All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Vladimir Vdovin <deliran@verdict.gg>
Cc: 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>,
	Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next v4 1/3] ipv4: Check a Fragmentation Needed against each path of a multipath route
Date: Mon, 23 Nov 2026 14:11:02 +0200	[thread overview]
Message-ID: <20261123121102.GA3286403@shredder> (raw)
In-Reply-To: <20261117193141.27004-2-deliran@verdict.gg>

On Tue, Nov 17, 2026 at 10:31:39PM +0300, Vladimir Vdovin wrote:
> Since commit 7d3f3b4367f3 ("net: ipv4: Cache pmtu for all packet paths
> if multipath enabled") the mtu of a Fragmentation Needed is cached on
> every path of a multipath route, as the lookup for it may land on
> another path than the one the flow is on. But the mtu is still checked
> against that one path only, by the early returns on the looked-up dst:
> 
> - a path whose mtu or pmtu is lower gets a pmtu above what it can
>   carry, its flows blackhole until the exception expires
> - a mtu locked for being below ip_rt_min_pmtu is written as is, over a
>   lower device mtu or locked pmtu
> - a looked-up path narrower than the mtu, or already at it, ends the
>   update before the path of the flow has learned anything
> 
> Check the mtu against each path instead, what it uses now as ipv4_mtu()
> reports it: cache the mtu only where it is lower, cap a locked mtu to
> it, leave a locked pmtu alone. The checks on the dst stay for the other
> callers, sockets and tunnels, whose dst is the path of their flow. A
> Fragmentation Needed that changes nothing costs the ICMP callers a fib
> lookup and a look at the exception of each path.
> 
> Fixes: 7d3f3b4367f3 ("net: ipv4: Cache pmtu for all packet paths if multipath enabled")
> Signed-off-by: Vladimir Vdovin <deliran@verdict.gg>
> ---
>  net/ipv4/route.c | 90 +++++++++++++++++++++++++++++++++---------------
>  1 file changed, 63 insertions(+), 27 deletions(-)

This seems too complicated for something that should only happen with an
unusual configuration (nexthop devices with different MTU).

Let's say that we have a nexthop group with two nexthops:

A - device MTU 900
B - device MTU 1500

And that the PMTU to destination D is 1000. AFAIU, there are two cases:

1. We get a PTB and look up a dst entry on A. We see that the current
path MTU (900) is lower and return early without creating an exception
for destination D on B.

This can only happen if the PTB lookup hashes differently than the flow
(e.g., non-default hash policy), it never worked (even before
7d3f3b4367f3) and it also requires the PMTU to be between the MTUs of
both nexthops.

2. We get a PTB and look up a dst entry on B. We resolve the nexthop
group and create an exception for D with PMTU of 1000 on both A and B,
despite the fact that A's device MTU is lower (900 < 1000). Packets
destined to D that resolve to path A are therefore dropped.

Like the first case, this case also requires the PMTU to be between the
MTUs of both nexthops.

The second case can be fixed with something like [1]. The new IPv4
selftest passes with it and fails without it.

Can you send [1] instead of the current patch and mention in the commit
message that the first case is ignored since it requires a complicated
fix, never worked and requires a very unusual setup?

I think that patch can be targeted at net-next without a Fixes tag, as
even the second case requires a very specific configuration and nobody
has reported it.

[1]
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d0a5f6d77094..205921567634 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1085,6 +1085,8 @@ static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
 				nhc = fib_info_nhc(res.fi, nhsel);
 				if (!nhc)
 					break;
+				if (mtu > READ_ONCE(nhc->nhc_dev->mtu))
+					continue;
 				update_or_create_fnhe(nhc, fl4->daddr, 0, mtu, lock,
 						      jiffies + net->ipv4.ip_rt_mtu_expires);
 			}


  parent reply	other threads:[~2026-11-23 12:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 19:31 [PATCH net-next v4 0/3] ipv4/ipv6: Cache pmtu on all paths of a multipath route Vladimir Vdovin
2026-11-17 19:31 ` [PATCH net-next v4 1/3] ipv4: Check a Fragmentation Needed against each path " Vladimir Vdovin
2026-11-20 10:32   ` netdev-bot+sashiko
2026-11-23 12:11   ` Ido Schimmel [this message]
2026-11-17 19:31 ` [PATCH net-next v4 2/3] ipv6: Cache pmtu for all paths " Vladimir Vdovin
2026-11-20 10:32   ` netdev-bot+sashiko
2026-11-23 15:40   ` Ido Schimmel
2026-11-17 19:31 ` [PATCH net-next v4 3/3] selftests: net: pmtu: Add IPv6 and asymmetric multipath tests Vladimir Vdovin
2026-11-17 19:37 ` [PATCH net-next v4 0/3] ipv4/ipv6: Cache pmtu on all paths of a multipath route netdev-bot+sinfo
2026-11-19 13:32   ` Vladimir Vdovin
2026-11-22 16:51 ` Ido Schimmel

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=20261123121102.GA3286403@shredder \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=deliran@verdict.gg \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.