Sorin,
I do understand the issue but the use of the signature to solve it is not 
clean. The signature field in the context structure is used for validation 
during debug. It could be removed and the code should still work.
We should not use the signature to identify self-allocated NBLs. 
Please consider to use the pool handle (ovsPool.ndisHandle) instaed.
Thanks,
Eitan

-----Original Message-----
From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] 
Sent: Wednesday, July 01, 2015 8:50 AM
To: Eitan Eliahu; dev@openvswitch.org
Subject: RE: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS 
ports

Eitan,

Consider the scenario below.

We receive a packet (NBL), that has multiple NBs, in OvsStartNBLIngress(). The 
NBL is not allocated by OVS and the NBL context is allocated and initialized in 
OvsInitExternalNBLContext(). After this the OvsCreateNewNBLsFromMultipleNBs() 
function is called and the NBL with multiple NBs is splitted into multiple NBLs 
with single NB, the latter NBLs being allocated by OVS. The execution continues 
with the first newly allocated NBL with single NB and all goes well until the 
loop goes to the next NBL with single NB. For this second newly created NBL 
with single NB the OvsInitExternalNBLContext() is called. Now we need to 
identify the NBL as being allocated by OVS, so we look at the NBL context 
signature.

I think this is a clean way to identify OVS NBLs, when calling 
OvsInitExternalNBLContext().

Thanks,
Sorin

-----Original Message-----
From: Eitan Eliahu [mailto:elia...@vmware.com] 
Sent: Wednesday, 1 July, 2015 18:12
To: Sorin Vinturis; dev@openvswitch.org
Subject: RE: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS 
ports

Hi Sorin,
Thank you for debugging this issue.
I think that the NBL context signature is used for code validation only (think 
about a signature we put in an object for the purpose of validating this object 
when executing in a different context).
Can you think about another way to fix this issue (e.g. a status/flag)?
Thanks,
Eitan

-----Original Message-----
From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis
Sent: Wednesday, July 01, 2015 7:02 AM
To: dev@openvswitch.org
Subject: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS ports

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://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_82&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCY&m=yx7HeX13135X7eeWKg3s73H3l711NpzfUes52_NsBqQ&s=3pshLMQB4SoTOb8sZncux7Bi6G5ADQwH7I0TlH9Is2U&e=
---
 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
https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_dev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCY&m=yx7HeX13135X7eeWKg3s73H3l711NpzfUes52_NsBqQ&s=M6NSK31Vva4-yAxaCNBMGVI5d9vESZHrNxsIVtrjJEE&e=
 
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to