Fab Tillier
2013-02-21 05:12:41 UTC
MLX4ND: Support connection request timeout properly.
Signed-off-by: Fab Tillier <***@microsoft.com>
diff -dwup3 -X excl.txt -I ^ \*$ -I ^ \* \$ -r \dev\openib\Mellanox\11011\hw\mlx4\user\nd\connector.cpp .\hw\mlx4\user\nd\connector.cpp
--- \dev\openib\Mellanox\11011\hw\mlx4\user\nd\connector.cpp Thu Sep 20 17:51:16 2012
+++ .\hw\mlx4\user\nd\connector.cpp Tue Sep 18 09:43:06 2012
@@ -176,6 +176,19 @@ void* Connector::GetInterface(REFIID rii
}
+HRESULT Connector::PostProcessOverlapped(__in OVERLAPPED* pOverlapped)
+{
+ if( static_cast<NTSTATUS>(pOverlapped->Internal) == STATUS_IO_TIMEOUT
+ && m_pQp != NULL )
+ {
+ m_pQp->Release();
+ m_pQp = NULL;
+ }
+
+ return _Base::PostProcessOverlapped(pOverlapped);
+}
+
+
STDMETHODIMP Connector::Bind(
__in_bcount(cbAddress) const struct sockaddr* pAddress,
ULONG cbAddress
diff -dwup3 -X excl.txt -I ^ \*$ -I ^ \* \$ -r \dev\openib\Mellanox\11011\hw\mlx4\user\nd\connector.h .\hw\mlx4\user\nd\connector.h
--- \dev\openib\Mellanox\11011\hw\mlx4\user\nd\connector.h Thu Sep 20 17:51:16 2012
+++ .\hw\mlx4\user\nd\connector.h Tue Sep 18 09:30:34 2012
@@ -72,6 +72,8 @@ public:
void* GetInterface(REFIID riid);
+ HRESULT PostProcessOverlapped(__in OVERLAPPED* pOverlapped);
+
UINT64 GetHandle() const { return m_hConnector; }
static ULONG GetCancelIoctlCode() { return IOCTL_ND_CONNECTOR_CANCEL_IO; }
diff -dwup3 -X excl.txt -I ^ \*$ -I ^ \* \$ -r \dev\openib\Mellanox\11011\hw\mlx4\user\nd\overlapped.h .\hw\mlx4\user\nd\overlapped.h
--- \dev\openib\Mellanox\11011\hw\mlx4\user\nd\overlapped.h Thu Sep 20 17:51:16 2012
+++ .\hw\mlx4\user\nd\overlapped.h Tue Sep 18 09:26:44 2012
@@ -109,6 +109,11 @@ public:
{
ULONG cbOut;
::GetOverlappedResult(m_hFile, pOverlapped, &cbOut, wait);
+ return static_cast<ThisT*>(this)->PostProcessOverlapped( pOverlapped );
+ }
+
+ HRESULT PostProcessOverlapped(__in OVERLAPPED* pOverlapped)
+ {
return static_cast<HRESULT>(pOverlapped->Internal);
}
};
Signed-off-by: Fab Tillier <***@microsoft.com>
diff -dwup3 -X excl.txt -I ^ \*$ -I ^ \* \$ -r \dev\openib\Mellanox\11011\hw\mlx4\user\nd\connector.cpp .\hw\mlx4\user\nd\connector.cpp
--- \dev\openib\Mellanox\11011\hw\mlx4\user\nd\connector.cpp Thu Sep 20 17:51:16 2012
+++ .\hw\mlx4\user\nd\connector.cpp Tue Sep 18 09:43:06 2012
@@ -176,6 +176,19 @@ void* Connector::GetInterface(REFIID rii
}
+HRESULT Connector::PostProcessOverlapped(__in OVERLAPPED* pOverlapped)
+{
+ if( static_cast<NTSTATUS>(pOverlapped->Internal) == STATUS_IO_TIMEOUT
+ && m_pQp != NULL )
+ {
+ m_pQp->Release();
+ m_pQp = NULL;
+ }
+
+ return _Base::PostProcessOverlapped(pOverlapped);
+}
+
+
STDMETHODIMP Connector::Bind(
__in_bcount(cbAddress) const struct sockaddr* pAddress,
ULONG cbAddress
diff -dwup3 -X excl.txt -I ^ \*$ -I ^ \* \$ -r \dev\openib\Mellanox\11011\hw\mlx4\user\nd\connector.h .\hw\mlx4\user\nd\connector.h
--- \dev\openib\Mellanox\11011\hw\mlx4\user\nd\connector.h Thu Sep 20 17:51:16 2012
+++ .\hw\mlx4\user\nd\connector.h Tue Sep 18 09:30:34 2012
@@ -72,6 +72,8 @@ public:
void* GetInterface(REFIID riid);
+ HRESULT PostProcessOverlapped(__in OVERLAPPED* pOverlapped);
+
UINT64 GetHandle() const { return m_hConnector; }
static ULONG GetCancelIoctlCode() { return IOCTL_ND_CONNECTOR_CANCEL_IO; }
diff -dwup3 -X excl.txt -I ^ \*$ -I ^ \* \$ -r \dev\openib\Mellanox\11011\hw\mlx4\user\nd\overlapped.h .\hw\mlx4\user\nd\overlapped.h
--- \dev\openib\Mellanox\11011\hw\mlx4\user\nd\overlapped.h Thu Sep 20 17:51:16 2012
+++ .\hw\mlx4\user\nd\overlapped.h Tue Sep 18 09:26:44 2012
@@ -109,6 +109,11 @@ public:
{
ULONG cbOut;
::GetOverlappedResult(m_hFile, pOverlapped, &cbOut, wait);
+ return static_cast<ThisT*>(this)->PostProcessOverlapped( pOverlapped );
+ }
+
+ HRESULT PostProcessOverlapped(__in OVERLAPPED* pOverlapped)
+ {
return static_cast<HRESULT>(pOverlapped->Internal);
}
};