netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: wenxu <wenxu@ucloud.cn>
To: Pablo Neira Ayuso <pablo@netfilter.org>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: flowtable: clean up entries for FLOW_BLOCK_UNBIND
Date: Fri, 20 Dec 2019 15:03:54 +0800	[thread overview]
Message-ID: <d38552f8-8d61-e683-97d1-ecf6b41d205e@ucloud.cn> (raw)
In-Reply-To: <20191219135620.350881-1-pablo@netfilter.org>


On 12/19/2019 9:56 PM, Pablo Neira Ayuso wrote:
> Call nf_flow_table_iterate_cleanup() to remove flowtable entries.
> This patch is implicitly handling the NETDEV_UNREGISTER and the
> flowtable removal cases (while there are still entries in place).

Hi Pablo,

I  test the flowtable meeting the same problem with flowtable delete.


For NETDEV_UNREGISTER case there is no necessary to do this.

The flow_offload_netdev_event in the nft_flow_offload with NETDEV_DOWN(

previous to UNREGISTER) will do nf_flow_table_cleanup(dev);


For flowtable delete case, it will  do cleanup things in nf_flow_table_free, but this is

later than UNBIND. First it make UNBIND call after the free operation.

But only UNBIND setup before flows cleanup can't guarantee the flows
delete in the hardware. The real delete in nf_flow_offload_work handler.


I fix it through adding a refcont for the flow_block to make sure the hardware
flows clean before UNBIND setup. I test my patch with mellaonx card.

This patch is http://patchwork.ozlabs.org/patch/1213936/

welcome some commends and other solution idea. Thx!


BR

wenxu



 

      reply	other threads:[~2019-12-20  7:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 13:56 [PATCH nf] netfilter: flowtable: clean up entries for FLOW_BLOCK_UNBIND Pablo Neira Ayuso
2019-12-20  7:03 ` wenxu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d38552f8-8d61-e683-97d1-ecf6b41d205e@ucloud.cn \
    --to=wenxu@ucloud.cn \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).