netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Blakey <paulb@mellanox.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Oz Shlomo <ozsh@mellanox.com>, Roi Dayan <roid@mellanox.com>,
	netdev@vger.kernel.org, Saeed Mahameed <saeedm@mellanox.com>,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH net] netfilter: flowtable: Fix expired flow not being deleted from software
Date: Mon, 11 May 2020 12:50:02 +0300	[thread overview]
Message-ID: <b3a54d5e-bb00-3306-c064-5c85806560e1@mellanox.com> (raw)
In-Reply-To: <20200511084243.GA18188@salvia>



On 5/11/2020 11:42 AM, Pablo Neira Ayuso wrote:
> On Mon, May 11, 2020 at 10:24:44AM +0300, Paul Blakey wrote:
>>
>> On 5/11/2020 1:26 AM, Pablo Neira Ayuso wrote:
>>> On Wed, May 06, 2020 at 02:27:29PM +0300, Paul Blakey wrote:
>>>> Once a flow is considered expired, it is marked as DYING, and
>>>> scheduled a delete from hardware. The flow will be deleted from
>>>> software, in the next gc_step after hardware deletes the flow
>>>> (and flow is marked DEAD). Till that happens, the flow's timeout
>>>> might be updated from a previous scheduled stats, or software packets
>>>> (refresh). This will cause the gc_step to no longer consider the flow
>>>> expired, and it will not be deleted from software.
>>>>
>>>> Fix that by looking at the DYING flag as in deciding
>>>> a flow should be deleted from software.
>>> Would this work for you?
>>>
>>> The idea is to skip the refresh if this has already expired.
>>>
>>> Thanks.
>> The idea is ok, but timeout check + update isn't atomic (need atomic_inc_unlesss
>> or something like that), and there is also
>> the hardware stats which if comes too late (after gc finds it expired) might
>> bring a flow back to life.
> Right. Once the entry has expired, there should not be a way turning
> back.
>
> I'm attaching a new sketch, it's basically using the teardown state to
> specify that the gc already made the decision to remove this entry.
>
> Thanks.

Looks fine to me, are you submitting that instead?


      reply	other threads:[~2020-05-11  9:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 11:27 [PATCH net] netfilter: flowtable: Fix expired flow not being deleted from software Paul Blakey
2020-05-10 22:26 ` Pablo Neira Ayuso
2020-05-11  7:24   ` Paul Blakey
2020-05-11  8:42     ` Pablo Neira Ayuso
2020-05-11  9:50       ` Paul Blakey [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=b3a54d5e-bb00-3306-c064-5c85806560e1@mellanox.com \
    --to=paulb@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=ozsh@mellanox.com \
    --cc=pablo@netfilter.org \
    --cc=roid@mellanox.com \
    --cc=saeedm@mellanox.com \
    /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).