Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Yifei Sun <yifei.sun@inria.fr>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net 1/2] ipv4: keep scanning the leaf when a nexthop object is unusable
Date: Tue, 24 Nov 2026 17:37:19 +0200	[thread overview]
Message-ID: <20261124153719.GA3946712@shredder> (raw)
In-Reply-To: <20261121182031.36626-1-yifei.sun@inria.fr>

Diff itself looks correct. A few comments on the commit message below.
Please wait for the AI review (tomorrow) before posting v2.

On Sat, Nov 21, 2026 at 07:20:16PM +0100, Yifei Sun wrote:
> With veth1 on 172.16.1.0/24 and veth3 on 172.16.2.0/24:
> 
> ```console
> $ ip nexthop add id 12 via 172.16.1.2 dev veth1
> $ ip route add 10.0.0.0/24 nhid 12
> $ ip route add 10.0.0.0/16 via 172.16.2.2 dev veth3
> $ ip route get fibmatch 10.0.0.1 oif veth3
> RTNETLINK answers: No route to host
> ```

Strip the markdown formatting:

 # ip nexthop add ..
 # ip route add ...

> 
> When the /24's nexthop object has no path on veth3, fib_table_lookup()
> backtracks past the /16 in the same leaf. A socket bound to veth3 then
> ARPs for the destination instead of the gateway. Try the next alias,
> as for inline nexthops.

s/Try the next/Fix by trying the next/

> 
> Encountered this while work on a unrelated IPv4 SADR patch (not sure if
> this is even needed...)
> 
> In QEMU with lockdep on 5e2976e52671, the selftest and device-bound
> ping and UDP failed before the fix and passed after it.

The last two paragraphs belong under the '---'.

> 
> Fixes: af7888ad9edb ("ipv4: Refactor nhc evaluation in fib_table_lookup")
> Signed-off-by: Yifei Sun <yifei.sun@inria.fr>
> ---
>  net/ipv4/fib_trie.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
> index 394df1de1281..2a670e9b0417 100644
> --- a/net/ipv4/fib_trie.c
> +++ b/net/ipv4/fib_trie.c
> @@ -1591,7 +1591,7 @@ out_reject:
>  						     &nhsel);
>  			if (nhc)
>  				goto set_result;
> -			goto miss;
> +			continue;
>  		}
>  
>  		for (nhsel = 0; nhsel < fib_info_num_path(fi); nhsel++) {
> @@ -1622,7 +1622,6 @@ set_result:
>  			return err;
>  		}
>  	}
> -miss:
>  #ifdef CONFIG_IP_FIB_TRIE_STATS
>  	this_cpu_inc(stats->semantic_match_miss);
>  #endif
> 
> base-commit: d5b89d55a322b632e2b465b392a4c1d9d338db9c

      parent reply	other threads:[~2026-11-24 15:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 18:20 [PATCH net 1/2] ipv4: keep scanning the leaf when a nexthop object is unusable Yifei Sun
2026-11-21 18:20 ` [PATCH net 2/2] selftests: net: test IPv4 nexthop fallback in the same trie leaf Yifei Sun
2026-11-24 15:37   ` Ido Schimmel
2026-11-24 15:37 ` Ido Schimmel [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=20261124153719.GA3946712@shredder \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=shuah@kernel.org \
    --cc=willemb@google.com \
    --cc=yifei.sun@inria.fr \
    /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