mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yuya Kusakabe <yuya.kusakabe@gmail.com>
To: Andrea Mayer <andrea.mayer@uniroma2.it>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Gabriel Goller <g.goller@proxmox.com>
Subject: Re: [PATCH net-next v3 1/2] seg6: skip the route refcount in seg6local IPv6 lookups
Date: Wed, 21 Oct 2026 20:56:40 +0900	[thread overview]
Message-ID: <20261020031413.seg6-lookup-noref-v3-reply-5f2735b7@gmail.com> (raw)
In-Reply-To: <20261020010429.eeffd6f140ec6157609c310a@uniroma2.it>

On Tue, 20 Oct 2026 01:04:29 +0200
Andrea Mayer <andrea.mayer@uniroma2.it> wrote:

> After a noref lookup, the "out:" branch still takes a reference on
> ip6_blk_hole_entry and then clears RT6_LOOKUP_F_DST_NOREF.
>
> This branch can be taken at steady state.

Agreed.  With a local next segment, every End packet goes through the
"out:" branch and takes a reference on a shared entry, which is what
the series removes for ip6_null_entry.  On v3, 20000 such packets made
20000 more dst_release() calls than with your suggestion applied.

> For a blackhole rule, __fib6_rule_action() picks ip6_blk_hole_entry and
> takes no reference on it when the lookup has RT6_LOOKUP_F_DST_NOREF. The
> "out:" branch could do the same, for example:
>
> 	if (!dst) {
> 		dst = &net->ipv6.ip6_blk_hole_entry->dst;
> 		if (!(flags & RT6_LOOKUP_F_DST_NOREF))
> 			dst_hold(dst);
> 	}

v4 will do that, and will set RT6_LOOKUP_F_DST_NOREF before
fib6_get_table() in the table branch, so that a missing table takes no
reference either.  The oif branch will keep the flag clear.

> Nit: seg6_lookup_any_nexthop_noref() and seg6_lookup_nexthop_noref() can
> attach the dst without a reference. They rely on being called under RCU. A
> one line comment about this, like the one ip6_route_input() has, could help
> the next reader.

v4 will add one to both helpers.

  reply	other threads:[~2026-10-21 11:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 14:39 [PATCH net-next v3 0/2] seg6: skip route refcounts in seg6local lookups Yuya Kusakabe
2026-10-15 14:39 ` [PATCH net-next v3 1/2] seg6: skip the route refcount in seg6local IPv6 lookups Yuya Kusakabe
2026-10-19 23:04   ` Andrea Mayer
2026-10-21 11:56     ` Yuya Kusakabe [this message]
2026-10-15 14:39 ` [PATCH net-next v3 2/2] seg6: skip the route refcount in seg6local IPv4 lookups Yuya Kusakabe

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=20261020031413.seg6-lookup-noref-v3-reply-5f2735b7@gmail.com \
    --to=yuya.kusakabe@gmail.com \
    --cc=andrea.mayer@uniroma2.it \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=g.goller@proxmox.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®