[ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS ports

Sorin Vinturis svinturis at cloudbasesolutions.com
Mon Aug 3 04:33:15 UTC 2015


Hi Nithin,

Yes, the second check, from the 564 line, is caught by the case when the OvsInitExternalNBLContext() function is called with the NBL created by OvsPartialCopyNBL().

--Sorin

-----Original Message-----
From: Nithin Raju [mailto:nithin at vmware.com] 
Sent: Saturday, 1 August, 2015 03:27
To: Eitan Eliahu
Cc: Sorin Vinturis; dev at openvswitch.org
Subject: Re: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS ports

hi Sorin,

In OvsInitExternalNBLContext(), there’s the following check:

563     if (poolHandle == context->ovsPool.ndisHandle ||                        
564         nbl->SourceHandle == context->ovsPool.ndisHandle) {                 
565         return (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl);

When you call OvsPartialCopyToMultipleNBLs(), we end up calling OvsPartialCopyNBL() -> OvsAllocateNBLContext() for each of the NBLs, which nbl->SourceHandle is set to context->ovsPool.ndisHandle.

So, this check should have caught your case. No?

thanks,
-- Nithin


> On Jul 1, 2015, at 8:12 AM, Eitan Eliahu <eliahue at vmware.com> wrote:
> 
> 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-bounces at openvswitch.org] On Behalf Of Sorin 
> Vinturis
> Sent: Wednesday, July 01, 2015 7:02 AM
> To: dev at 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 <svinturis at cloudbasesolutions.com>
> Reported-by: Sorin Vinturis <svinturis at cloudbasesolutions.com>
> Reported-at: 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvs
> witch_ovs-2Dissues_issues_82&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-
> YihVMNtXt-uEs&r=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCY&m=yx7HeX13
> 135X7eeWKg3s73H3l711NpzfUes52_NsBqQ&s=3pshLMQB4SoTOb8sZncux7Bi6G5ADQwH
> 7I0TlH9Is2U&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 at openvswitch.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_ma
> ilman_listinfo_dev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-
> uEs&r=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCY&m=yx7HeX13135X7eeWKg
> 3s73H3l711NpzfUes52_NsBqQ&s=M6NSK31Vva4-yAxaCNBMGVI5d9vESZHrNxsIVtrjJE
> E&e= _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_ma
> ilman_listinfo_dev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-
> uEs&r=pNHQcdr7B40b4h6Yb7FIedI1dnBsxdDuTLBYD3JqV80&m=CfEqHqD5AnXmgd1_rq
> tkOlUi5hqSD_ea5ybq21lxcQA&s=TiOSVk4d09Xaoq_FwyrQqOq7q2HF-RkfhTUQxsmVYi
> E&e=



More information about the dev mailing list