netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@nvidia.com>
To: Ido Schimmel <idosch@idosch.org>,
	Nikolay Aleksandrov <razor@blackwall.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	dsahern@gmail.com
Subject: Re: [PATCH net 0/3] net: nexthop: fix refcount issues when replacing groups
Date: Sun, 21 Nov 2021 20:17:49 +0200	[thread overview]
Message-ID: <d902fd06-00c2-fbff-1df2-4db3e890724a@nvidia.com> (raw)
In-Reply-To: <YZqIBVcFwIzj6VZG@shredder>

On 21/11/2021 19:55, Ido Schimmel wrote:
> On Sun, Nov 21, 2021 at 05:24:50PM +0200, Nikolay Aleksandrov wrote:
>> From: Nikolay Aleksandrov <nikolay@nvidia.com>
>>
>> Hi,
>> This set fixes a refcount bug when replacing nexthop groups and
>> modifying routes. It is complex because the objects look valid when
>> debugging memory dumps, but we end up having refcount dependency between
>> unlinked objects which can never be released, so in turn they cannot
>> free their resources and refcounts. The problem happens because we can
>> have stale IPv6 per-cpu dsts in nexthops which were removed from a
>> group. Even though the IPv6 gen is bumped, the dsts won't be released
>> until traffic passes through them or the nexthop is freed, that can take
>> arbitrarily long time, and even worse we can create a scenario[1] where it
>> can never be released. The fix is to release the IPv6 per-cpu dsts of
>> replaced nexthops after an RCU grace period so no new ones can be
>> created. To do that we add a new IPv6 stub - fib6_nh_release_dsts, which
>> is used by the nexthop code only when necessary. We can further optimize
>> group replacement, but that is more suited for net-next as these patches
>> would have to be backported to stable releases.
> 
> Will run regression with these patches tonight and report tomorrow
> 

Thank you, I've prepared v2 with the selftest mausezahn check and will hold
it off to see how the tests would go. Also if any comments show up in the
meantime. :)

By the way I've been running a torture test all day for multiple IPv6 route
forwarding + local traffic through different CPUs while also replacing multiple
nh groups referencing multiple nexthops, so far it looks good.


  reply	other threads:[~2021-11-21 18:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-21 15:24 [PATCH net 0/3] net: nexthop: fix refcount issues when replacing groups Nikolay Aleksandrov
2021-11-21 15:24 ` [PATCH net 1/3] net: ipv6: add fib6_nh_release_dsts stub Nikolay Aleksandrov
2021-11-21 15:24 ` [PATCH net 2/3] net: nexthop: release IPv6 per-cpu dsts when replacing a nexthop group Nikolay Aleksandrov
2021-11-21 17:17   ` Ido Schimmel
2021-11-21 17:35     ` Ido Schimmel
2021-11-21 18:02       ` Nikolay Aleksandrov
2021-11-21 15:24 ` [PATCH net 3/3] selftests: net: fib_nexthops: add test for group refcount imbalance bug Nikolay Aleksandrov
2021-11-21 17:53   ` Ido Schimmel
2021-11-21 17:59     ` Nikolay Aleksandrov
2021-11-21 17:55 ` [PATCH net 0/3] net: nexthop: fix refcount issues when replacing groups Ido Schimmel
2021-11-21 18:17   ` Nikolay Aleksandrov [this message]
2021-11-22  9:48     ` Ido Schimmel
2021-11-22  9:53       ` Nikolay Aleksandrov

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=d902fd06-00c2-fbff-1df2-4db3e890724a@nvidia.com \
    --to=nikolay@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=idosch@idosch.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=razor@blackwall.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).