From: Stan Smith Date: Wed, 13 Jan 2010 22:12:21 +0000 (+0000) Subject: [ND/WINVERBS] winverbs/nd: map completion status to ND value convert flushed completi... X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=6bca3c5042d07eacd1e27a49f57a6b8dafa29e2b;p=~shefty%2Frdma-win.git [ND/WINVERBS] winverbs/nd: map completion status to ND value convert flushed completion status values Signed-off-by: Sean Hefty git-svn-id: svn://openib.tc.cornell.edu/gen1@2666 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/branches/WOF2-2/inc/user/rdma/winverbs.h b/branches/WOF2-2/inc/user/rdma/winverbs.h index eb73b1bb..12542a56 100644 --- a/branches/WOF2-2/inc/user/rdma/winverbs.h +++ b/branches/WOF2-2/inc/user/rdma/winverbs.h @@ -194,6 +194,25 @@ typedef enum _WV_OPCODE } WV_OPCODE; +typedef enum _WV_WC_STATUS +{ + WvWcSuccess, + WvWcLocalLengthError, + WvWcLocalOpError, + WvWcLocalProtectionError, + WvWcFlushed, + WvWcMwBindError, + WvWcRemoteAccessError, + WvWcRemoteOpError, + WvWcRnrRetryError, + WvWcTimeoutRetryError, + WvWcRemoteInvalidRequest, + WvWcBadResponse, + WvWcLocalAccessError, + WvWcError + +} WV_WC_STATUS; + // Completion flags #define WV_WC_IMMEDIATE 0x00000001 // reserved 0x00000002 @@ -207,7 +226,7 @@ typedef struct _WV_COMPLETION WV_OPCODE Opcode; UINT32 Length; UINT64 VendorCode; - HRESULT Status; + WV_WC_STATUS Status; // Receive completion data DWORD Flags; diff --git a/branches/WOF2-2/ulp/libibverbs/include/infiniband/verbs.h b/branches/WOF2-2/ulp/libibverbs/include/infiniband/verbs.h index b1e44890..780f938e 100644 --- a/branches/WOF2-2/ulp/libibverbs/include/infiniband/verbs.h +++ b/branches/WOF2-2/ulp/libibverbs/include/infiniband/verbs.h @@ -242,28 +242,29 @@ struct ibv_async_event enum ibv_wc_status { - IBV_WC_SUCCESS, - IBV_WC_LOC_LEN_ERR, - IBV_WC_LOC_QP_OP_ERR, - IBV_WC_LOC_PROT_ERR, - IBV_WC_WR_FLUSH_ERR, - IBV_WC_MW_BIND_ERR, - IBV_WC_REM_ACCESS_ERR, - IBV_WC_REM_OP_ERR, - IBV_WC_RNR_RETRY_EXC_ERR, - IBV_WC_RESP_TIMEOUT_ERR, - IBV_WC_REM_INV_REQ_ERR, - IBV_WC_BAD_RESP_ERR, - IBV_WC_LOC_ACCESS_ERR, - IBV_WC_GENERAL_ERR, - IBV_WC_FATAL_ERR, - IBV_WC_RETRY_EXC_ERR, - IBV_WC_REM_ABORT_ERR, - IBV_WC_LOC_EEC_OP_ERR, - IBV_WC_LOC_RDD_VIOL_ERR, - IBV_WC_REM_INV_RD_REQ_ERR, - IBV_WC_INV_EECN_ERR, - IBV_WC_INV_EEC_STATE_ERR + IBV_WC_SUCCESS = WvWcSuccess, + IBV_WC_LOC_LEN_ERR = WvWcLocalLengthError, + IBV_WC_LOC_QP_OP_ERR = WvWcLocalOpError, + IBV_WC_LOC_PROT_ERR = WvWcLocalProtectionError, + IBV_WC_WR_FLUSH_ERR = WvWcFlushed, + IBV_WC_MW_BIND_ERR = WvWcMwBindError, + IBV_WC_REM_ACCESS_ERR = WvWcRemoteAccessError, + IBV_WC_REM_OP_ERR = WvWcRemoteOpError, + IBV_WC_RNR_RETRY_EXC_ERR = WvWcRnrRetryError, + IBV_WC_RESP_TIMEOUT_ERR = WvWcTimeoutRetryError, + IBV_WC_REM_INV_REQ_ERR = WvWcRemoteInvalidRequest, + IBV_WC_BAD_RESP_ERR = WvWcBadResponse, + IBV_WC_LOC_ACCESS_ERR = WvWcLocalAccessError, + IBV_WC_GENERAL_ERR = WvWcError, + IBV_WC_FATAL_ERR = WvWcError, + IBV_WC_RETRY_EXC_ERR = WvWcError, + IBV_WC_REM_ABORT_ERR = WvWcError, + IBV_WC_LOC_EEC_OP_ERR = WvWcError, + IBV_WC_LOC_RDD_VIOL_ERR = WvWcError, + IBV_WC_REM_INV_RD_REQ_ERR = WvWcError, + IBV_WC_INV_EECN_ERR = WvWcError, + IBV_WC_INV_EEC_STATE_ERR = WvWcError + }; __declspec(dllexport) diff --git a/branches/WOF2-2/ulp/netdirect/user/nd_cq.cpp b/branches/WOF2-2/ulp/netdirect/user/nd_cq.cpp index 28aabe55..07dabc23 100644 --- a/branches/WOF2-2/ulp/netdirect/user/nd_cq.cpp +++ b/branches/WOF2-2/ulp/netdirect/user/nd_cq.cpp @@ -116,6 +116,34 @@ Notify(DWORD Type, OVERLAPPED* pOverlapped) return NDConvertWVStatus(hr); } +STDMETHODIMP_(HRESULT) CNDCompletionQueue:: +ConvertStatus(WV_WC_STATUS Status) +{ + switch (Status) { + case WvWcSuccess: + return ND_SUCCESS; + case WvWcFlushed: + return ND_CANCELED; + case WvWcLocalLengthError: + return ND_LOCAL_LENGTH; + case WvWcRnrRetryError: + case WvWcTimeoutRetryError: + return ND_TIMEOUT; + case WvWcLocalAccessError: + case WvWcLocalOpError: + case WvWcLocalProtectionError: + case WvWcMwBindError: + return ND_ACCESS_VIOLATION; + case WvWcRemoteAccessError: + case WvWcRemoteOpError: + case WvWcRemoteInvalidRequest: + case WvWcBadResponse: + return ND_REMOTE_ERROR; + default: + return ND_INTERNAL_ERROR; + } +} + STDMETHODIMP_(SIZE_T) CNDCompletionQueue:: GetResults(ND_RESULT* pResults[], SIZE_T nResults) { @@ -134,7 +162,7 @@ GetResults(ND_RESULT* pResults[], SIZE_T nResults) if (comp[i].Opcode & WvReceive) { pResults[total]->BytesTransferred = comp[i].Length; } - pResults[total++]->Status = comp[i].Status; + pResults[total++]->Status = ConvertStatus(comp[i].Status); } } return total; diff --git a/branches/WOF2-2/ulp/netdirect/user/nd_cq.h b/branches/WOF2-2/ulp/netdirect/user/nd_cq.h index ba1c91a4..06c4d6c4 100644 --- a/branches/WOF2-2/ulp/netdirect/user/nd_cq.h +++ b/branches/WOF2-2/ulp/netdirect/user/nd_cq.h @@ -90,6 +90,7 @@ public: protected: CNDAdapter *m_pAdapter; STDMETHODIMP Init(SIZE_T nEntries); + STDMETHODIMP_(HRESULT) ConvertStatus(WV_WC_STATUS Status); }; #endif // _ND_CQ_H_