[ofw] [Patch 48/62] Reference implementation of NDv2

Fab Tillier ftillier at microsoft.com
Wed Feb 20 20:52:04 PST 2013


Fix some win8 build environment build errors, tweak IBAT and MW emulation.

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\ibat\kernel\ibat.cpp .\core\ibat\kernel\ibat.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\ibat\kernel\ibat.cpp	Wed Aug 15 20:15:54 2012
+++ .\core\ibat\kernel\ibat.cpp	Wed Aug 29 12:05:01 2012
@@ -787,10 +787,16 @@ IbatpResolvePhysicalAddressUnsafe(
 
     status = IbatpResolveRemoteAddressUnsafe( luid, pLocalAddress, pRemoteAddress, pMac );
 
-    if( (status == STATUS_NOT_FOUND) && 
-        (IbatUtil::IsEqual(*pLocalAddress, *pRemoteAddress) == true) )
+    if( (status == STATUS_NOT_FOUND) )
     {
-        status = IbatpResolveLoopbackAddressUnsafe( luid, pMac );
+        if( (IbatUtil::IsEqual(*pLocalAddress, *pRemoteAddress) == true) )
+        {
+            status = IbatpResolveLoopbackAddressUnsafe( luid, pMac );
+        }
+        else
+        {
+            status = STATUS_BAD_NETWORK_NAME;
+        }
     }
 
     return status;
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\ibat\kernel\route.cpp .\core\ibat\kernel\route.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\ibat\kernel\route.cpp	Wed Aug 15 20:15:54 2012
+++ .\core\ibat\kernel\route.cpp	Wed Aug 29 12:05:01 2012
@@ -69,7 +69,7 @@ IbatRoute::Create(
 
     KeInitializeSpinLock( &pRoute->m_requestLock );
     pRoute->m_requestList = NULL;
-        pRoute->m_state = NlnsUnreachable;
+    pRoute->m_state = NlnsUnreachable;
     pRoute->m_hQuery = NULL;
     pRoute->m_nRef = 1;
 
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\ibat\kernel\router.cpp .\core\ibat\kernel\router.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\ibat\kernel\router.cpp	Wed Aug 15 20:15:54 2012
+++ .\core\ibat\kernel\router.cpp	Wed Aug 29 12:05:01 2012
@@ -140,17 +140,20 @@ IbatRouter* IbatRouter::Create( UINT64 p
             0,
             0
             );
-        ib_path_rec_set_hop_flow_raw( &pRouter->m_path, 1, 0, FALSE );
+        //
+        // IBTA RoCE Annex, A16.4.4, states that hop limit should be set to 0xFF.
+        //
+        ib_path_rec_set_hop_flow_raw( &pRouter->m_path, 0xFF, 0, FALSE );
     }
     else
     {
-    RtlInitializeGenericTableAvl(
-        &pRouter->m_table,
-        &IbatRouter::RouteCompare,
-        &IbatRouter::RouteAlloc,
-        &IbatRouter::RouteFree,
-        pRouter
-        );
+        RtlInitializeGenericTableAvl(
+            &pRouter->m_table,
+            &IbatRouter::RouteCompare,
+            &IbatRouter::RouteAlloc,
+            &IbatRouter::RouteFree,
+            pRouter
+            );
     }
 
     return pRouter;
@@ -260,20 +263,20 @@ IbatRouter::Resolve(
 {
     if( m_isRoCE == TRUE )
     {
-        RtlCopyMemory( pPath, &m_path, sizeof(m_path) );
         //
-        // Copy OUI to first 3 bytes of interface ID.  OUI is the first 3 bytes of the MAC.
+        // The GID for RoCE is generated following the IPv6 stateless address
+        // autoconfiguration rules.  The subnet prefix was already set when the
+        // path was setup upon router creation, so only the EUI-64 portion of the
+        // address must be generated.  The EUI-64 value is generated from the
+        // 48-bit MAC by adding 0xFFFE as the middle two bytes and setting the
+        // Universal/Local (U/L) bit (bit 2 of the first byte).
         //
+        RtlCopyMemory( pPath, &m_path, sizeof(m_path) );
+
         RtlCopyMemory( &pPath->dgid.raw[8], &mac, 3 );
-        pPath->dgid.raw[8] ^= 2;
-        //
-        // Fill in the middle two bytes.
-        //
+        pPath->dgid.raw[8] |= 2;
         pPath->dgid.raw[11] = 0xFF;
         pPath->dgid.raw[12] = 0xFE;
-        //
-        // Copy the lower 3 bytes of the MAC to the last 3 bytes of the interface ID.
-        //
         RtlCopyMemory( &pPath->dgid.raw[13], reinterpret_cast<UINT8*>(&mac) + 3, 3);
         return STATUS_SUCCESS;
     }
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\ibat\user\ibat.cpp .\core\ibat\user\ibat.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\ibat\user\ibat.cpp	Tue Aug 07 16:41:02 2012
+++ .\core\ibat\user\ibat.cpp	Wed May 23 17:27:42 2012
@@ -81,7 +81,7 @@ IoControl(
   __out_opt    LPVOID lpOutBuffer,
   __in         DWORD nOutBufferSize,
   __out_opt    LPDWORD lpBytesReturned
-    )
+  )
 {
     HRESULT hr = S_OK;
     HANDLE hIbat;
@@ -98,7 +98,7 @@ IoControl(
     if( hIbat == INVALID_HANDLE_VALUE )
     {
         return HRESULT_FROM_WIN32( GetLastError() );
-        }
+    }
 
     fSuccess  = ::DeviceIoControl(
         hIbat,
@@ -111,7 +111,7 @@ IoControl(
         NULL
         );
     if( FALSE == fSuccess )
-            {
+    {
         hr = HRESULT_FROM_WIN32( ::GetLastError() );
     }
     ::CloseHandle(hIbat);
@@ -130,28 +130,28 @@ QueryPath(
     queryIn.Version = IBAT_IOCTL_VERSION;
 
     if( AF_INET == pSrcAddr->sa_family )
-        {
+    {
         queryIn.LocalAddress.Ipv4 = *reinterpret_cast<const sockaddr_in*>(pSrcAddr);
     }
     else
-        {
+    {
         queryIn.LocalAddress.Ipv6 = *reinterpret_cast<const sockaddr_in6*>(pSrcAddr);
-        }
+    }
 
     if( AF_INET == pDestAddr->sa_family )
-        {
+    {
         queryIn.RemoteAddress.Ipv4 = *reinterpret_cast<const sockaddr_in*>(pDestAddr);
-        }
+    }
     else
-        {
+    {
         queryIn.RemoteAddress.Ipv6 = *reinterpret_cast<const sockaddr_in6*>(pDestAddr);
-}
+    }
 
     return IBAT::IoControl(
                     IOCTL_IBAT_QUERY_PATH,
                     queryIn,
                     pPath
-                );
+                    );
 }
 
 
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\ndfltr\kernel\nd_partition.cpp .\core\ndfltr\kernel\nd_partition.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\ndfltr\kernel\nd_partition.cpp	Wed Aug 29 14:26:45 2012
+++ .\core\ndfltr\kernel\nd_partition.cpp	Wed Aug 29 15:18:58 2012
@@ -29,8 +29,6 @@
  */
 
 #include "precomp.h"
-#include <InitGuid.h>
-#include <coguid.h>
 
 
 inline
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\hca\cq.c .\hw\mlx4\user\hca\cq.c
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\hca\cq.c	Thu Aug 23 13:03:04 2012
+++ .\hw\mlx4\user\hca\cq.c	Wed Aug 29 12:05:01 2012
@@ -276,6 +276,7 @@ static int mlx4_poll_one(struct mlx4_cq 
 		switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) {
 		case MLX4_OPCODE_RDMA_WRITE_IMM:
 			wc->recv.ud.recv_opt |= IB_RECV_OPT_IMMEDIATE;
+            __fallthrough;
 		case MLX4_OPCODE_RDMA_WRITE:
 			wc->wc_type   = IB_WC_RDMA_WRITE;
 			break;
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\adapter.cpp .\hw\mlx4\user\nd\adapter.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\adapter.cpp	Mon Aug 20 10:45:24 2012
+++ .\hw\mlx4\user\nd\adapter.cpp	Wed Aug 29 15:20:33 2012
@@ -29,8 +29,11 @@
 
 #include "precomp.h"
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
+
 // {22681265-CE87-401F-83B7-EE8DF85C270A}
 const GUID Adapter::_Guid = 
     { 0x22681265, 0xce87, 0x401f, { 0x83, 0xb7, 0xee, 0x8d, 0xf8, 0x5c, 0x27, 0xa } };
@@ -668,9 +671,9 @@ void Adapter::DeallocPd(void)
     m_hPd = 0;
 }
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -680,7 +683,7 @@ namespace NDv1
 ///////////////////////////////////////////////////////////////////////////////
 
 
-Adapter::Adapter(Provider& provider, NDv2::Adapter& adapter)
+Adapter::Adapter(Provider& provider, v2::Adapter& adapter)
     : m_Provider(provider),
     m_Adapter(adapter)
 {
@@ -729,7 +732,7 @@ HRESULT Adapter::Initialize(
 
 HRESULT Adapter::Create(
     __in Provider& provider,
-    __in NDv2::Adapter& adapter,
+    __in v2::Adapter& adapter,
     __in_bcount(addressLength) const struct sockaddr* pAddress,
     __in SIZE_T addressLength,
     __out INDAdapter** ppAdapter
@@ -1026,4 +1029,5 @@ HRESULT Adapter::Listen(
     return hr;
 }
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\adapter.h .\hw\mlx4\user\nd\adapter.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\adapter.h	Tue Apr 24 22:07:37 2012
+++ .\hw\mlx4\user\nd\adapter.h	Wed Aug 29 15:20:09 2012
@@ -30,7 +30,9 @@
 #pragma once
 
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 class Adapter
@@ -53,7 +55,7 @@ private:
     ib_pd_handle_t m_uPd;
 
 private:
-    operator =(Adapter&){}
+    Adapter& operator =(Adapter& rhs);
 
 public:
     Adapter(Provider& provider);
@@ -182,10 +184,10 @@ private:
 
 };
 
-} // namespace NDv2
+} // namespace ND::v2
 
 
-namespace NDv1
+namespace v1
 {
 
 class Adapter
@@ -194,7 +196,7 @@ class Adapter
     typedef Unknown<Adapter, INDAdapter> _Base;
 
     Provider& m_Provider;
-    NDv2::Adapter& m_Adapter;
+    v2::Adapter& m_Adapter;
 
     HANDLE m_hAsync;
 
@@ -204,13 +206,13 @@ class Adapter
     ListEntry m_MrList;
 
 public:
-    static const _MaxSge = 4;
+    static const SIZE_T _MaxSge = 4;
 
 private:
-    operator =(Adapter&){}
+    Adapter& operator =(Adapter& rhs);
 
 private:
-    Adapter(Provider& provider, NDv2::Adapter& adapter);
+    Adapter(Provider& provider, v2::Adapter& adapter);
 
     HRESULT Initialize(
         __in_bcount(addressLength) const struct sockaddr* pAddress,
@@ -220,7 +222,7 @@ private:
 public:
     static HRESULT Create(
         __in Provider& provider,
-        __in NDv2::Adapter& adapter,
+        __in v2::Adapter& adapter,
         __in_bcount(addressLength) const struct sockaddr* pAddress,
         __in SIZE_T addressLength,
         __out INDAdapter** ppAdapter
@@ -300,4 +302,5 @@ public:
         );
 };
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\connector.cpp .\hw\mlx4\user\nd\connector.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\connector.cpp	Thu Aug 09 16:30:50 2012
+++ .\hw\mlx4\user\nd\connector.cpp	Wed Aug 29 15:16:19 2012
@@ -29,8 +29,11 @@
 
 #include "precomp.h"
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
+
 // {4DF1A76E-2A27-428A-8482-AA66C4DADFAE}
 const GUID Connector::_Guid = 
 { 0x4df1a76e, 0x2a27, 0x428a, { 0x84, 0x82, 0xaa, 0x66, 0xc4, 0xda, 0xdf, 0xae } };
@@ -555,9 +558,9 @@ STDMETHODIMP Connector::Disconnect(
         );
 }
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 Connector::Connector(Adapter& adapter, IND2Connector& connector)
@@ -805,4 +808,5 @@ HRESULT Connector::Disconnect(
     return m_Connector.Disconnect(pOverlapped);
 }
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\connector.h .\hw\mlx4\user\nd\connector.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\connector.h	Thu May 03 22:13:45 2012
+++ .\hw\mlx4\user\nd\connector.h	Wed Aug 29 15:16:33 2012
@@ -29,7 +29,9 @@
 
 #pragma once
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 bool CopyAddress(
@@ -60,7 +62,7 @@ public:
     static const GUID _Guid;
 
 private:
-    operator =(Connector&) {}
+    Connector& operator =(Connector& rhs);
 
 public:
     Connector(Adapter& adapter);
@@ -138,9 +140,9 @@ public:
         );
 };
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 class Connector
@@ -155,7 +157,7 @@ class Connector
     ULONG m_OutboundReadLimit;
 
 private:
-    operator =(Connector&) {}
+    Connector& operator =(Connector& rhs);
 
 public:
     Connector(Adapter& adapter, IND2Connector& connector);
@@ -256,4 +258,5 @@ public:
         );
 };
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\cq.cpp .\hw\mlx4\user\nd\cq.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\cq.cpp	Thu Aug 23 12:05:30 2012
+++ .\hw\mlx4\user\nd\cq.cpp	Wed Aug 29 15:16:19 2012
@@ -29,7 +29,9 @@
 
 #include "precomp.h"
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 // {3186027E-65EB-4EA4-B469-D6B50D7F5AE6}
 const GUID Cq::_Guid = 
@@ -288,10 +290,7 @@ STDMETHODIMP_(ULONG) Cq::GetResults(
             MwOpContext* opContext = reinterpret_cast<MwOpContext*>(wc.wr_id);
             results[i].RequestType = opContext->GetRequestType();
             results[i].RequestContext = opContext->GetRequestContext();
-            if( SUCCEEDED(results[i].Status) )
-            {
-                results[i].Status = opContext->Complete();
-            }
+            results[i].Status = opContext->Complete( results[i].Status );
             delete opContext;
         }
         else
@@ -313,9 +312,9 @@ void Cq::FreeCq(ib_api_status_t ibStatus
     m_hCq = 0;
 }
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 Cq::Cq(IND2CompletionQueue& cq)
@@ -381,4 +380,5 @@ SIZE_T Cq::GetResults(
     return i;
 }
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\cq.h .\hw\mlx4\user\nd\cq.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\cq.h	Thu May 03 22:12:57 2012
+++ .\hw\mlx4\user\nd\cq.h	Wed Aug 29 15:16:33 2012
@@ -29,7 +29,9 @@
 
 #pragma once
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 class Cq
@@ -47,7 +49,7 @@ private:
     ib_cq_handle_t m_uCq;
 
 private:
-    operator =(Cq&){}
+    Cq& operator =(Cq& rhs);
 
 public:
     Cq(Adapter& adapter);
@@ -158,9 +160,9 @@ private:
     }
 };
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 class Cq
     : public Unknown<Cq, INDCompletionQueue>
@@ -170,7 +172,7 @@ class Cq
     IND2CompletionQueue& m_Cq;
 
 private:
-    operator =(Cq&){}
+    Cq& operator =(Cq& rhs);
 
 public:
     Cq(IND2CompletionQueue& cq);
@@ -230,4 +232,5 @@ public:
         );
 };
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\factory.cpp .\hw\mlx4\user\nd\factory.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\factory.cpp	Fri Aug 10 12:51:25 2012
+++ .\hw\mlx4\user\nd\factory.cpp	Wed Aug 29 15:21:28 2012
@@ -29,6 +29,8 @@
 
 #include "precomp.h"
 
+namespace ND
+{
 
 ClassFactory::ClassFactory(void)
     : _Base()
@@ -68,14 +70,16 @@ HRESULT ClassFactory::CreateInstance(
     void** ppObject )
 {
     if( pUnkOuter != NULL )
+    {
         return CLASS_E_NOAGGREGATION;
+    }
 
     if( IsEqualIID( riid, IID_INDProvider ) )
     {
-        return NDv1::Provider::Create(ppObject);
+        return v1::Provider::Create(ppObject);
     }
 
-    return NDv2::Provider::Create(riid, ppObject);
+    return v2::Provider::Create(riid, ppObject);
 }
 
 
@@ -83,3 +87,5 @@ HRESULT ClassFactory::LockServer( BOOL )
 {
     return S_OK;
 }
+
+} // namespace ND
\ No newline at end of file
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\factory.h .\hw\mlx4\user\nd\factory.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\factory.h	Fri Apr 13 09:15:59 2012
+++ .\hw\mlx4\user\nd\factory.h	Wed Aug 29 14:56:59 2012
@@ -29,11 +29,16 @@
 
 #pragma once
 
+namespace ND
+{
 
 class ClassFactory : public Unknown<ClassFactory, IClassFactory>
 {
     typedef Unknown<ClassFactory, IClassFactory> _Base;
 
+private:
+    ClassFactory& operator = (ClassFactory& rhs);
+
 public:
     ClassFactory(void);
     ~ClassFactory(void);
@@ -45,3 +50,5 @@ public:
 public:
     void* GetInterface(REFIID riid);
 };
+
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\listener.cpp .\hw\mlx4\user\nd\listener.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\listener.cpp	Thu Aug 09 16:30:49 2012
+++ .\hw\mlx4\user\nd\listener.cpp	Wed Aug 29 15:16:19 2012
@@ -29,7 +29,9 @@
 
 #include "precomp.h"
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 Listener::Listener(Adapter& adapter)
@@ -184,10 +186,9 @@ STDMETHODIMP Listener::GetConnectionRequ
         );
 }
 
-} // namespace NDv2
-
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 Listener::Listener(IND2Listener& listener)
@@ -294,4 +295,5 @@ HRESULT Listener::GetConnectionRequest(
         );
 }
 
-} // namespace
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\listener.h .\hw\mlx4\user\nd\listener.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\listener.h	Mon Jun 04 10:08:40 2012
+++ .\hw\mlx4\user\nd\listener.h	Wed Aug 29 15:16:33 2012
@@ -29,7 +29,9 @@
 
 #pragma once
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 class Listener
@@ -42,7 +44,7 @@ class Listener
     UINT64 m_hListener;
 
 private:
-    operator =(Listener&) {}
+    Listener& operator =(Listener& rhs);
 
 public:
     Listener(Adapter& adapter);
@@ -77,9 +79,9 @@ public:
         );
 };
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 class Listener
@@ -99,7 +101,7 @@ private:
         __out_opt USHORT* pAssignedPort
         );
 
-    operator =(Listener&){}
+    Listener& operator =(Listener& rhs);
 
 public:
     ~Listener(void);
@@ -144,4 +146,5 @@ public:
         );
 };
 
-} // namespace
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\main.cpp .\hw\mlx4\user\nd\main.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\main.cpp	Mon Aug 20 10:31:02 2012
+++ .\hw\mlx4\user\nd\main.cpp	Wed Aug 29 15:20:46 2012
@@ -27,11 +27,11 @@
  * SOFTWARE.
  */
 
+#include "precomp.h"
+
 #include <initguid.h>
 #include "ndspi.h"
 
-#include "precomp.h"
-
 
 HANDLE g_hHeap;
 #if DBG
@@ -208,7 +208,7 @@ STDAPI DllGetClassObject(
 
     if( IsEqualIID( riid, IID_IClassFactory ) )
     {
-        IClassFactory* pFactory = static_cast<IClassFactory*>( new ClassFactory() );
+        IClassFactory* pFactory = static_cast<IClassFactory*>( new ND::ClassFactory() );
         if( pFactory == NULL )
             return E_OUTOFMEMORY;
 
@@ -216,7 +216,7 @@ STDAPI DllGetClassObject(
         return S_OK;
     }
 
-    return NDv2::Provider::Create( riid, ppv );
+    return ND::v2::Provider::Create( riid, ppv );
 }
 
 
@@ -387,7 +387,7 @@ void CALLBACK RegisterProviderW(HWND, HI
     provider.iSecurityScheme = SECURITY_PROTOCOL_NONE;
     provider.dwMessageSize = 0xFFFFFFFF; /* IB supports 32-bit lengths for data transfers on RC */
     provider.dwProviderReserved = 0;
-    wcscpy( provider.szProtocol, L"OpenFabrics Network Direct Provider for Mellanox ConnectX" );
+    wcscpy_s( provider.szProtocol, sizeof(provider.szProtocol), L"OpenFabrics Network Direct Provider for Mellanox ConnectX" );
 
     WSCInstallProvider64_32(
         &providerId, L"%SYSTEMROOT%\\system32\\mlx4nd.dll", &provider, 1, &err_no );
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\mr.cpp .\hw\mlx4\user\nd\mr.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\mr.cpp	Thu Aug 09 16:30:50 2012
+++ .\hw\mlx4\user\nd\mr.cpp	Wed Aug 29 15:16:19 2012
@@ -29,7 +29,9 @@
 
 #include "precomp.h"
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 // {CD4D60B4-CEBC-49F5-A78E-C234659EC7EF}
 const GUID Mr::_Guid = 
@@ -260,9 +262,9 @@ STDMETHODIMP Mr::Deregister(
     return hr;
 }
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 Mr::Mr(INDAdapter& adapter, IND2MemoryRegion& mr)
@@ -303,4 +305,5 @@ void Mr::CancelOverlappedRequests()
     m_Mr.CancelOverlappedRequests();
 }
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\mr.h .\hw\mlx4\user\nd\mr.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\mr.h	Thu May 03 22:14:55 2012
+++ .\hw\mlx4\user\nd\mr.h	Wed Aug 29 15:16:19 2012
@@ -29,7 +29,9 @@
 
 #pragma once
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 class Mr
@@ -52,7 +54,7 @@ private:
     LONG m_nBoundWindows;
 
 private:
-    operator =(Mr&) {};
+    Mr& operator =(Mr& rhs);
 
 public:
     Mr(Adapter& adapter);
@@ -95,9 +97,9 @@ public:
     STDMETHODIMP_(UINT32) GetRemoteToken() { return m_Keys.RKey; }
 };
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 class Mr : public ListEntry
@@ -106,7 +108,7 @@ class Mr : public ListEntry
     IND2MemoryRegion& m_Mr;
 
 private:
-    operator =(Mr&){}
+    Mr& operator =(Mr& rhs);
 
 public:
     Mr(INDAdapter& adapter, IND2MemoryRegion& mr);
@@ -119,4 +121,5 @@ public:
     IND2MemoryRegion* GetMr() const { return &m_Mr; }
 };
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\mw.cpp .\hw\mlx4\user\nd\mw.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\mw.cpp	Mon Aug 20 10:45:27 2012
+++ .\hw\mlx4\user\nd\mw.cpp	Wed Aug 29 15:16:19 2012
@@ -29,8 +29,11 @@
 
 #include "precomp.h"
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
+
 // {6A148B1D-A8F8-4935-863D-F9F85D40399C}
 const GUID Mw::_Guid = 
 { 0x6a148b1d, 0xa8f8, 0x4935, { 0x86, 0x3d, 0xf9, 0xf8, 0x5d, 0x40, 0x39, 0x9c } };
@@ -156,9 +159,9 @@ HRESULT Mw::Invalidate()
     return hr;
 }
 
-}
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 Mw::Mw(INDAdapter& adapter, IND2MemoryWindow& mw, ND_RESULT* pInvalidateResult)
@@ -188,4 +191,5 @@ void* Mw::GetInterface(REFIID riid)
     return _Base::GetInterface(riid);
 }
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\mw.h .\hw\mlx4\user\nd\mw.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\mw.h	Tue Apr 24 09:34:41 2012
+++ .\hw\mlx4\user\nd\mw.h	Wed Aug 29 15:16:33 2012
@@ -29,7 +29,9 @@
 
 #pragma once
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 class Mw
@@ -53,7 +55,7 @@ private:
     Mr* m_pBoundMr;
 
 private:
-    operator =(Mw&){}
+    Mw& operator =(Mw& rhs);
 
 public:
     Mw(Adapter& adapter, Mr& mr);
@@ -71,9 +73,9 @@ public:
     STDMETHODIMP_(UINT32) GetRemoteToken(){ return m_Mr.GetRemoteToken(); }
 };
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 class Mw
@@ -87,7 +89,7 @@ class Mw
     ND_RESULT* m_pInvalidateResult;
 
 private:
-    operator =(Mw&){}
+    Mw& operator =(Mw& rhs);
 
 public:
     Mw(INDAdapter& adapter, IND2MemoryWindow& mw, ND_RESULT* pInvalidateResult);
@@ -98,4 +100,5 @@ public:
     IND2MemoryWindow* GetMw() const { return &m_Mw; }
 };
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\overlapped.h .\hw\mlx4\user\nd\overlapped.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\overlapped.h	Thu May 03 22:12:22 2012
+++ .\hw\mlx4\user\nd\overlapped.h	Wed Aug 29 15:16:33 2012
@@ -29,7 +29,9 @@
 
 #pragma once
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 template<
@@ -111,4 +113,5 @@ public:
     }
 };
 
-} // namespace NDv2
+} // namespace ND::v2
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\precomp.h .\hw\mlx4\user\nd\precomp.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\precomp.h	Tue Apr 24 11:37:41 2012
+++ .\hw\mlx4\user\nd\precomp.h	Wed Aug 29 14:48:21 2012
@@ -42,6 +42,7 @@
 #include <InitGuid.h>
 #include <ndspi.h>
 #include <ndstatus.h>
+#include <string.h>
 
 #include "ndfltr.h"
 
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\provider.cpp .\hw\mlx4\user\nd\provider.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\provider.cpp	Thu Aug 09 15:12:27 2012
+++ .\hw\mlx4\user\nd\provider.cpp	Wed Aug 29 15:20:33 2012
@@ -30,7 +30,9 @@
 #include "precomp.h"
 
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 Provider::Provider()
@@ -258,9 +260,9 @@ HRESULT Provider::OpenAdapter(
 }
 
 
-}   // namespace NDv2
+}   // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 Provider::Provider()
@@ -289,7 +291,7 @@ HRESULT Provider::Create(__out void** pp
         return E_OUTOFMEMORY;
     }
 
-    HRESULT hr = NDv2::Provider::Create(
+    HRESULT hr = v2::Provider::Create(
         IID_IND2Provider,
         reinterpret_cast<void**>(&pProvider->m_pProvider)
         );
@@ -356,9 +358,9 @@ HRESULT Provider::OpenAdapter(
         return hr;
     }
 
-    NDv2::Adapter* pAdapter;
+    v2::Adapter* pAdapter;
     hr = m_pProvider->OpenAdapter(
-        NDv2::Adapter::_Guid,
+        v2::Adapter::_Guid,
         adapterId,
         reinterpret_cast<void**>(&pAdapter)
         );
@@ -371,4 +373,5 @@ HRESULT Provider::OpenAdapter(
     return hr;
 }
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\provider.h .\hw\mlx4\user\nd\provider.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\provider.h	Thu May 03 22:09:58 2012
+++ .\hw\mlx4\user\nd\provider.h	Wed Aug 29 15:16:33 2012
@@ -30,7 +30,9 @@
 #pragma once
 
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 class Provider
@@ -88,9 +90,9 @@ public:
     void FreeHandle( UINT64 handle, ULONG ctlCode );
 };
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 class Provider
@@ -124,4 +126,5 @@ public:
     void* GetInterface(REFIID iid);
 };
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\qp.cpp .\hw\mlx4\user\nd\qp.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\qp.cpp	Thu Aug 23 12:05:49 2012
+++ .\hw\mlx4\user\nd\qp.cpp	Wed Aug 29 15:16:19 2012
@@ -29,7 +29,9 @@
 
 #include "precomp.h"
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 MwOpContext::~MwOpContext()
@@ -38,13 +40,13 @@ MwOpContext::~MwOpContext()
 }
 
 
-HRESULT MwOpContext::Complete()
+HRESULT MwOpContext::Complete( HRESULT workRequestStatus )
 {
-    if( m_RequestType == Nd2RequestTypeInvalidate )
+    if( m_RequestType == Nd2RequestTypeInvalidate && SUCCEEDED(workRequestStatus) )
     {
         return m_pMw->Invalidate();
     }
-    return STATUS_SUCCESS;
+    return workRequestStatus;
 }
 
 
@@ -630,9 +632,9 @@ STDMETHODIMP Qp::Write(
     return PostSend(&wr);
 }
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -863,4 +865,5 @@ HRESULT Endpoint::Write(
         );
 }
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\qp.h .\hw\mlx4\user\nd\qp.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\qp.h	Thu Aug 23 12:04:51 2012
+++ .\hw\mlx4\user\nd\qp.h	Wed Aug 29 15:16:33 2012
@@ -29,7 +29,9 @@
 
 #pragma once
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 class MwOpContext
@@ -51,7 +53,7 @@ public:
 
     ~MwOpContext();
 
-    HRESULT Complete();
+    HRESULT Complete( HRESULT workRequestStatus );
     inline ND2_REQUEST_TYPE GetRequestType() const { return m_RequestType; }
     inline VOID* GetRequestContext() const { return m_RequestContext; }
 };
@@ -75,7 +77,7 @@ private:
     ib_qp_handle_t m_uQp;
 
 private:
-    operator =(Qp&){}
+    Qp& operator =(Qp& rhs);
 
 public:
     Qp(Adapter& adapter, Cq& receiveCq, Cq& initiatorCq, Srq* pSrq);
@@ -155,9 +157,9 @@ public:
 
 };
 
-} // namespace NDv2
+} // namespace ND::v2
 
-namespace NDv1
+namespace v1
 {
 
 
@@ -191,7 +193,7 @@ public:
     static const ULONG _MaxInline = 160;
 
 private:
-    operator =(Endpoint&) {};
+    Endpoint& operator =(Endpoint& rhs);
 
 public:
     Endpoint(IND2QueuePair& qp);
@@ -283,4 +285,5 @@ private:
 
 };
 
-} // namespace NDv1
+} // namespace ND::v1
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\srq.cpp .\hw\mlx4\user\nd\srq.cpp
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\srq.cpp	Mon Aug 20 10:45:24 2012
+++ .\hw\mlx4\user\nd\srq.cpp	Wed Aug 29 15:16:19 2012
@@ -29,7 +29,9 @@
 
 #include "precomp.h"
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 // {3186027E-65EB-4EA4-B469-D6B50D7F5AE6}
 const GUID Srq::_Guid = 
@@ -293,4 +295,5 @@ void Srq::FreeSrq(ib_api_status_t ibStat
     m_hSrq = 0;
 }
 
-} // namespace NDv2
+} // namespace ND::v2
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\srq.h .\hw\mlx4\user\nd\srq.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\srq.h	Thu May 03 22:15:55 2012
+++ .\hw\mlx4\user\nd\srq.h	Wed Aug 29 15:16:19 2012
@@ -29,7 +29,9 @@
 
 #pragma once
 
-namespace NDv2
+namespace ND
+{
+namespace v2
 {
 
 class Srq
@@ -46,7 +48,7 @@ public:
     static const GUID _Guid;
 
 private:
-    operator =(Srq&){}
+    Srq& operator =(Srq& rhs);
 
 public:
     Srq(Adapter& adapter);
@@ -94,4 +96,5 @@ private:
     void FreeSrq(ib_api_status_t ibStatus);
 };
 
-} // namespace NDv2
+} // namespace ND::v2
+} // namespace ND
diff -dup3 -X \dev\openib\endure3\private\openib\excl.txt -r \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\unknown.h .\hw\mlx4\user\nd\unknown.h
--- \dev\openib\ofw\gen1\branches\mlx4_30\trunk\hw\mlx4\user\nd\unknown.h	Fri Apr 13 09:15:59 2012
+++ .\hw\mlx4\user\nd\unknown.h	Wed Aug 29 14:56:44 2012
@@ -29,6 +29,9 @@
 
 #pragma once
 
+namespace ND
+{
+
 template<
     typename ThisT,
     typename InterfaceT
@@ -99,3 +102,5 @@ public:
         delete pThis;
     }
 };
+
+} // namespace ND
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ndv2.48.patch
Type: application/octet-stream
Size: 32306 bytes
Desc: ndv2.48.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20130221/4359324c/attachment.obj>


More information about the ofw mailing list