datapath-windows: Solved BSOD when adding OVS ports
authorSorin Vinturis <svinturis@cloudbasesolutions.com>
Thu, 2 Jul 2015 11:39:14 +0000 (11:39 +0000)
committerBen Pfaff <blp@nicira.com>
Mon, 6 Jul 2015 15:25:42 +0000 (08:25 -0700)
This BSOD occurred in the context of a packet (NBL) with multiple
NET_BUFFER(s) (NBs). The reason for the BSOD is due to the marking
of NBLs created by OVS as being external and wrongly completing them.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/82
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows/ovsext/BufferMgmt.c

index 83d6cde..3550e20 100644 (file)
@@ -560,7 +560,8 @@ OvsInitExternalNBLContext(PVOID ovsContext,
 
     poolHandle = NdisGetPoolFromNetBufferList(nbl);
 
-    if (poolHandle == context->ovsPool.ndisHandle) {
+    if (poolHandle == context->ovsPool.ndisHandle ||
+        nbl->SourceHandle == context->ovsPool.ndisHandle) {
         return (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl);
     }
     status = NdisAllocateNetBufferListContext(nbl, sizeof (OVS_BUFFER_CONTEXT),
@@ -801,6 +802,7 @@ OvsPartialCopyNBL(PVOID ovsContext,
                       OVS_DEFAULT_PORT_NO);
 
     InterlockedIncrement((LONG volatile *)&srcCtx->refCount);
+
 #ifdef DBG
     OvsDumpNetBufferList(nbl);
     OvsDumpForwardingDetails(nbl);
@@ -808,6 +810,7 @@ OvsPartialCopyNBL(PVOID ovsContext,
     OvsDumpNetBufferList(newNbl);
     OvsDumpForwardingDetails(newNbl);
 #endif
+
     OVS_LOG_LOUD("Partial Copy new NBL: %p", newNbl);
     return newNbl;