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.

This patch should be applied both on master and branch 2.4.

Signed-off-by: Sorin Vinturis <svintu...@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svintu...@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/82
---
 datapath-windows/ovsext/BufferMgmt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/datapath-windows/ovsext/BufferMgmt.c 
b/datapath-windows/ovsext/BufferMgmt.c
index 83d6cde..d36dfa2 100644
--- a/datapath-windows/ovsext/BufferMgmt.c
+++ b/datapath-windows/ovsext/BufferMgmt.c
@@ -558,6 +558,12 @@ OvsInitExternalNBLContext(PVOID ovsContext,
     NDIS_STATUS status;
     UINT16 flags;
 
+    ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl);
+    if (ctx && ctx->magic == OVS_CTX_MAGIC) {
+        OVS_LOG_INFO("nbl context already initialized/allocated by OVS.");
+        return ctx;
+    }
+
     poolHandle = NdisGetPoolFromNetBufferList(nbl);
 
     if (poolHandle == context->ovsPool.ndisHandle) {
@@ -801,6 +807,7 @@ OvsPartialCopyNBL(PVOID ovsContext,
                       OVS_DEFAULT_PORT_NO);
 
     InterlockedIncrement((LONG volatile *)&srcCtx->refCount);
+
 #ifdef DBG
     OvsDumpNetBufferList(nbl);
     OvsDumpForwardingDetails(nbl);
@@ -808,6 +815,7 @@ OvsPartialCopyNBL(PVOID ovsContext,
     OvsDumpNetBufferList(newNbl);
     OvsDumpForwardingDetails(newNbl);
 #endif
+
     OVS_LOG_LOUD("Partial Copy new NBL: %p", newNbl);
     return newNbl;
 
-- 
1.9.0.msysgit.0
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to