[ovs-dev] [PATCH] datapath-windows: Enable failure after restarting extension

Nithin Raju nithin at vmware.com
Mon Aug 3 17:22:07 UTC 2015


> On Jul 15, 2015, at 7:50 AM, Sorin Vinturis <svinturis at cloudbasesolutions.com> wrote:
> 
> If the extension was previously enabled and running, after issuing a
> restart, stop+start, the extension fails to be enabled. This happens
> because the extension's DeviceObject is not yet initialized before the
> FilterAttach routine is called.
> 
> This patch addresses this issue.
> 
> 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_openvswitch_ovs-2Dissues_issues_96&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=pNHQcdr7B40b4h6Yb7FIedI1dnBsxdDuTLBYD3JqV80&m=-ocq5Ewu5A3PmYqKlMAHiQh2W82fu3WhPBCdk1S4PMI&s=XWbGE6dPBCtV-3-HfUG8yPDlUW6mlSorNqP6k27Z4Gk&e= 
> ---
> This patch is for both master and 2.4 branch.
> ---
> datapath-windows/ovsext/TunnelFilter.c | 28 ++++++++++++++++------------
> 1 file changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/datapath-windows/ovsext/TunnelFilter.c b/datapath-windows/ovsext/TunnelFilter.c
> index 231750e..5466fe4 100644
> --- a/datapath-windows/ovsext/TunnelFilter.c
> +++ b/datapath-windows/ovsext/TunnelFilter.c
> @@ -825,20 +825,24 @@ OvsInitTunnelFilter(PDRIVER_OBJECT driverObject, PVOID deviceObject)
> {
>     NTSTATUS status = STATUS_SUCCESS;
> 
> -    status = OvsSubscribeTunnelInitBfeStateChanges(driverObject, deviceObject);
> -    if (NT_SUCCESS(status)) {
> -        if (FWPM_SERVICE_RUNNING == FwpmBfeStateGet()) {
> -            status = OvsTunnelFilterInitialize(driverObject);
> -            if (!NT_SUCCESS(status)) {
> -                /* XXX: We need to decide what actions to take in case of
> -                 * failure to initialize tunnel filter. */
> -                ASSERT(status == NDIS_STATUS_SUCCESS);
> -                OVS_LOG_ERROR(
> -                    "Failed to initialize tunnel filter, status: %x.",
> -                    status);
> +    if (deviceObject) {
> +        status = OvsSubscribeTunnelInitBfeStateChanges(driverObject, deviceObject);
> +        if (NT_SUCCESS(status)) {
> +            if (FWPM_SERVICE_RUNNING == FwpmBfeStateGet()) {
> +                status = OvsTunnelFilterInitialize(driverObject);
> +                if (!NT_SUCCESS(status)) {
> +                    /* XXX: We need to decide what actions to take in case of
> +                     * failure to initialize tunnel filter. */
> +                    ASSERT(status == NDIS_STATUS_SUCCESS);
> +                    OVS_LOG_ERROR(
> +                        "Failed to initialize tunnel filter, status: %x.",
> +                        status);
> +                }
> +                OvsUnsubscribeTunnelInitBfeStateChanges();
>             }
> -            OvsUnsubscribeTunnelInitBfeStateChanges();
>         }
> +    } else {
> +        status = OvsTunnelFilterInitialize(driverObject);
>     }
> 

Why can’t we use the code from the ‘else’ case all the time? Why should there be any dependency on ‘gOvsDeviceObject’?

Also, in what conditions would OvsInitTunnelFilter() get called before ‘gOvsDeviceObject’ is initialized? As long as the driver is loaded, ‘gOvsDeviceObject’ should not be NULL at all.

thanks,
-- Nithin


More information about the dev mailing list