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

Maxime Coquelin maxime.coquelin at redhat.com
Wed Mar 3 13:05:42 UTC 2021



On 3/3/21 1:41 PM, Gaëtan Rivet wrote:
> 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.

Ok, thanks.
I'm going through your series this week, so no hurry in posting v2 :)

Maxime

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



More information about the dev mailing list