mbox series

[nf-next,v3,0/4] netfilter: nf_tables_offload: clean offload things when the device unregister

Message ID 1567656019-6881-1-git-send-email-wenxu@ucloud.cn
Headers show
Series netfilter: nf_tables_offload: clean offload things when the device unregister | expand

Message

wenxu Sept. 5, 2019, 4 a.m. UTC
From: wenxu <wenxu@ucloud.cn>

This series clean the offload things for both chain and rules when the
related device unregister

This version add a nft_offload_netdev_iterate common function

wenxu (4):
  netfilter: nf_tables_offload: refactor the nft_flow_offload_chain
    function
  netfilter: nf_tables_offload: refactor the nft_flow_offload_rule
    function
  netfilter: nf_tables_offload: add nft_offload_netdev_iterate function
  netfilter: nf_tables_offload: clean offload things when the device
    unregister

 include/net/netfilter/nf_tables_offload.h |   2 +-
 net/netfilter/nf_tables_api.c             |   9 ++-
 net/netfilter/nf_tables_offload.c         | 122 ++++++++++++++++++++++++------
 3 files changed, 105 insertions(+), 28 deletions(-)

Comments

Pablo Neira Ayuso Sept. 6, 2019, 12:27 a.m. UTC | #1
On Thu, Sep 05, 2019 at 12:00:15PM +0800, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>
> 
> This series clean the offload things for both chain and rules when the
> related device unregister
> 
> This version add a nft_offload_netdev_iterate common function
> 
> wenxu (4):
>   netfilter: nf_tables_offload: refactor the nft_flow_offload_chain
>     function
>   netfilter: nf_tables_offload: refactor the nft_flow_offload_rule
>     function

1/4 and 2/4 are not required anymore after adding the registration
logic to nf_tables_offload.

>   netfilter: nf_tables_offload: add nft_offload_netdev_iterate function
>   netfilter: nf_tables_offload: clean offload things when the device
>     unregister
> 
>  include/net/netfilter/nf_tables_offload.h |   2 +-
>  net/netfilter/nf_tables_api.c             |   9 ++-
>  net/netfilter/nf_tables_offload.c         | 122 ++++++++++++++++++++++++------
>  3 files changed, 105 insertions(+), 28 deletions(-)
> 
> -- 
> 1.8.3.1
>
wenxu Sept. 6, 2019, 3:09 a.m. UTC | #2
On 9/6/2019 8:27 AM, Pablo Neira Ayuso wrote:
> On Thu, Sep 05, 2019 at 12:00:15PM +0800, wenxu@ucloud.cn wrote:
>> From: wenxu <wenxu@ucloud.cn>
>>
>> This series clean the offload things for both chain and rules when the
>> related device unregister
>>
>> This version add a nft_offload_netdev_iterate common function
>>
>> wenxu (4):
>>   netfilter: nf_tables_offload: refactor the nft_flow_offload_chain
>>     function
>>   netfilter: nf_tables_offload: refactor the nft_flow_offload_rule
>>     function
> 1/4 and 2/4 are not required anymore after adding the registration
> logic to nf_tables_offload.

Maybe it also need the 1/4 and 2/4 patches.  The nft_flow_offload_chain/rule need

get some inform from the nft_trans. There is no this struct in the netdev notify event,.

So it better to refactor it more common?


>