[ovs-dev] [PATCH v2 5/6] datapath-windows: Refactor CreateQueue function to handle vport pid.

Nithin Raju nithin at vmware.com
Thu Oct 23 00:21:16 UTC 2014


On Oct 21, 2014, at 5:24 PM, Ankur Sharma <ankursharma at vmware.com> wrote:

> Refactored CreateQueue function so that packets are enqueued to correct corresponding queue.
> 
> Signed-off-by: Ankur Sharma <ankursharma at vmware.com>

Looks good mostly. One comment I had was if it was the right thing to use gOvsControlLock. This can lead to a deadlock.

Consider the following sequence:
Context #1 executing OvsDeviceControl() code to do vport add:
1. Acquires gOvsControlLock
2. Acquires dispatch lock

Context #2 executing packet processing code:
1. Acquires dispatch lock
2. Acquires gOvsControlLock for enqueueing packets

We should add a separate lock for PID, and not use the gOvsControlLock.

> @@ -932,6 +943,10 @@ OvsGetPid(POVS_VPORT_ENTRY vport, PNET_BUFFER nb, UINT32 *pid)
> {
>     UNREFERENCED_PARAMETER(nb);
> 
> +    if (!vport) {
> +        return STATUS_INVALID_PARAMETER;
> +    }

The existing code already checks for vport == NULL before calling OvsGetPid(). We can just ASSERT() here.

thanks,
-- Nithin


More information about the dev mailing list