[ovs-dev] [PATCH v1 01/23] netdev: Add flow API de-init function

Gaëtan Rivet grive at u256.net
Wed Mar 3 12:41:46 UTC 2021


On Wed, Mar 3, 2021, at 12:02, Maxime Coquelin wrote:
> Hi Gaetan,
> 
> On 2/10/21 3:57 PM, Gaetan Rivet wrote:
> > Add a new operation for flow API providers to
> > deinitializes when the API is disassociated from a netdev.
> > 
> > Signed-off-by: Gaetan Rivet <grive at u256.net>
> > Reviewed-by: Eli Britstein <elibr at nvidia.com>
> > ---
> >  lib/netdev-offload-provider.h | 3 +++
> >  lib/netdev-offload.c          | 4 ++++
> >  2 files changed, 7 insertions(+)
> > 
> > diff --git a/lib/netdev-offload-provider.h b/lib/netdev-offload-provider.h
> > index cf859d1b4..4815a1bd2 100644
> > --- a/lib/netdev-offload-provider.h
> > +++ b/lib/netdev-offload-provider.h
> > @@ -90,6 +90,9 @@ struct netdev_flow_api {
> >      /* Initializies the netdev flow api.
> >       * Return 0 if successful, otherwise returns a positive errno value. */
> >      int (*init_flow_api)(struct netdev *);
> > +
> > +    /* Deinitializes the netdev flow api. */
> > +    void (*deinit_flow_api)(struct netdev *);
> >  };
> >  
> >  int netdev_register_flow_api_provider(const struct netdev_flow_api *);
> > diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c
> > index 6237667c3..3092f8d55 100644
> > --- a/lib/netdev-offload.c
> > +++ b/lib/netdev-offload.c
> > @@ -320,6 +320,10 @@ netdev_uninit_flow_api(struct netdev *netdev)
> >          return;
> >      }
> >  
> > +    if (flow_api->deinit_flow_api) {
> > +        flow_api->deinit_flow_api(netdev);
> 
> For consistency, couldn't it be changed to .uninit_flow_api()?
> 

Hey Maxime,

Actually yes, it should probably be uninit instead.
I don't remember where I got deinit from, I thought it was used elsewhere.
Grepping the code I don't see it. I will update this patch, thanks.

> > +    }
> > +
> >      ovsrcu_set(&netdev->flow_api, NULL);
> >      rfa = netdev_lookup_flow_api(flow_api->type);
> >      ovs_refcount_unref(&rfa->refcnt);
> > 
> 
> Maxime
> 
>

-- 
Gaetan


More information about the dev mailing list