Article View: linux.kernel.netdev
Article #15889[PATCH net-next v3 1/3] ipv4: Only lower the pmtu of the other paths of a multipath route
From: Vladimir Vdovin
Date: Fri, 13 Nov 2026 12:22
Date: Fri, 13 Nov 2026 12:22
81 lines
13623 bytes
13623 bytes
Since commit 7d3f3b4367f3 ("net: ipv4: Cache pmtu for all packet paths
if multipath enabled") __ip_rt_update_pmtu() caches the mtu of a
Fragmentation Needed on every path of a multipath route, as the lookup
there doesn't know the flow the message was sent for and may land on
another path than the one that flow is on. But only that path is
checked against the mtu, by the old_mtu early return, the others get it
as is. A path whose device or route mtu is below it, or that already
learned a lower pmtu, ends up with a pmtu above what it can carry: its
flows send packets of that size, which don't get through, and no
Fragmentation Needed comes back for them until the exception expires.
Skip a path when the mtu would not lower what that path uses now: the
pmtu of its live exception if it has one, else the mtu of the route or
the device, the way ipv4_mtu() would report them. A mtu locked because
it is below ip_rt_min_pmtu is still written everywhere, it clears DF
and has to reach the path the flow is on.
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 | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d0a5f6d77094..f0da009f4115 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -150,6 +150,8 @@ static struct neighbour *ipv4_dst_neigh_lookup(const struct dst_entry *dst,
struct sk_buff *skb,
const void *daddr);
static void ipv4_confirm_neigh(const struct dst_entry *dst, const void *daddr);
+static struct fib_nh_exception *find_exception(struct fib_nh_common *nhc,
+ __be32 daddr);
static struct dst_ops ipv4_dst_ops = {
.family = AF_INET,
@@ -1046,6 +1048,26 @@ out: kfree_skb_reason(skb, reason);
return 0;
}
+#ifdef CONFIG_IP_ROUTE_MULTIPATH
+/* The mtu a path currently uses for daddr, as ipv4_mtu() would report it. */
+static u32 fib_nhc_mtu(struct fib_nh_common *nhc, const struct fib_info *fi,
+ __be32 daddr)
+{
+ struct fib_nh_exception *fnhe = find_exception(nhc, daddr);
+ u32 mtu = 0;
+
+ if (fnhe && fnhe->fnhe_genid == fnhe_genid(dev_net(nhc->nhc_dev)))
+ mtu = fnhe->fnhe_pmtu;
+ if (!mtu)
+ mtu = fi->fib_mtu;
+ if (!mtu)
+ mtu = READ_ONCE(nhc->nhc_dev->mtu);
+ mtu = min(mtu, IP_MAX_MTU);
+
+ return mtu - lwtunnel_headroom(nhc->nhc_lwtstate, mtu);
+}
+#endif
+
static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
{
struct dst_entry *dst = &rt->dst;
@@ -1085,6 +1107,14 @@ static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
nhc = fib_info_nhc(res.fi, nhsel);
if (!nhc)
break;
+ /* old_mtu above is the mtu of the path dst
+ * is on, don't raise what another path
+ * uses. A locked mtu clears DF and goes
+ * to every path.
+ */
+ if (!lock &&
+ mtu > fib_nhc_mtu(nhc, res.fi, fl4->daddr))
+ continue;
update_or_create_fnhe(nhc, fl4->daddr, 0, mtu, lock,
jiffies + net->ipv4.ip_rt_mtu_expires);
}
--
2.56.0
Technical Details
Message-ID:
<20261113122237.88990-2-deliran@verdict.gg>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362627-linux-kernel-netdev=dewy.ruReferences:
<20261113122237.88990-1-deliran@verdict.gg>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362627-linux-kernel-netdev=dewy.ru From: deliran@verdict.gg (Vladimir Vdovin) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v3 1/3] ipv4: Only lower the pmtu of the other paths of a multipath route Date: Fri, 13 Nov 2026 15:22:35 +0300 Organization: Usenet Network Message-ID: <20261113122237.88990-2-deliran@verdict.gg> References: <20261113122237.88990-1-deliran@verdict.gg> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1406835"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:h7ARf+vZ3eqZVYmyclAzRqbAbE0= sha256:2IVQXodJiJKcp6G634bY6V+5nEUR3iBnWPj2EkUAfVY= sha1:jWjXkMK+07jEThFdGOxYKGJmiHQ= sha256:zAIuYCSM+yqdKF3RM7YljVpDu7u4MvxUqgdowG5iKe0= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id DB8871145F7; Fri, 13 Nov 2026 21:33:43 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=verdict.gg X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E0HmAKyH55Wb; Fri, 13 Nov 2026 21:33:36 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-362627-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=verdict.gg X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 34B5C1145EC; Fri, 13 Nov 2026 21:33:28 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 330EE2E071; Fri, 13 Nov 2026 12:24:19 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794572575; b=vNh6lzyhgVGDlc3+FsrgcIYPxQr/bBRdRitwTXCqpqYJ4N1iju2t0GV5l1ZmVNnVfQPB UU1a6yvDj4d9ST/Z5KejE0w54KlG2/l+dvkc9g6fsGBvUCqfK2iIhedHqF0A3RaYQtvbS Rs+Hb0Fnbfj6uVhuMVspaWubqFolIu+/LZpXwtzirnQjRpdOOzn3vXrVLhvT65SedaBTG c50P8IsY9fncjkoqzJSCuCe+rSWxJTLsI5M0UQ8FocWvXNX5GxpGMyUkN2emdEIkiGAFW 52ILH3VsNsPMcJjC7PalHyLshsY+S+2CE3mDqsokx461mkP91ijmc81UHInrs35wAAw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794572575; h=X-Original-To:Received:DMARC-Filter:Received:X-ICL-RepId: Dkim-Signature:mail-alias-created-date:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding: X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Details-Enc:X-Authority-Info-Out:X-JNJ; bh=CAPJTphDYYFKEENJOeATe0OoS3X41+ZOVJxvbKyL+Ow=; b=AgxnE7pig70uud+sk4NT7i9flssYVmAEB7SK25bShXdZ3OZrXsIgWI42AiFC7vkk2Qp5 kGwUJ+6p7a8MRoWlNcEw/uJ8fipRPxmN7Vl9JNLKMjhDdkkrAlDe1yIAEc4R3mZpNdh3P Ec7xObBQoFoToJl+wfnmKF9v4z3qp++Q0stC3nkSxrB2UlMD5/72alEflu/6pyz868AwB tTFUL7/7bNd0ylhXQ2lFlqkCSgtLiPXqe+Hnu32UZqtGWeJjifpMf+FOjvBZkEHPLKOO/ q0tF/X4QqOrncpktjKjPHa0+MqsJxXHyZvG4BdR/fK5olIhRme/WIfTILrCELrnLrqg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=verdict.gg header.i=@verdict.gg header.a=rsa-sha256 header.s=sig1 header.b=KUMlAOWr; dmarc=none header.from=verdict.gg; spf=pass smtp.mailfrom=verdict.gg; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A80460A260F; Fri, 13 Nov 2026 12:22:55 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=verdict.gg header.i=@verdict.gg header.a=rsa-sha256 header.s=sig1 header.b=KUMlAOWr X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=57.103.71.67 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794572574; b=cGK5z8qJDdF8by09dLEJHGDMlT7vc1tInZ53R5cfo4NUxt0wmfh6ht9QZ3wv5RFRa37l 3Yjq1MBgQV3P7O/Fv7HV3YcaDakl+mkzJG98u39A5aaMz2bCsSCQNDrC1HaM5Gz9vW03/ OsXx6hRd5q5Fwii4O1DyF7HrQEcRN9b/OvlXFhHsHifn4lo9cgyEpB+tkO4V4BCmVfgB4 CP8KM3IlTD19MrWC9BcHuNmLi7Fl+lwXOpEqNDb1AJ6rOY+1KH0mq0XM3p3VMS21sg868 7SHkvX0cX/LiFYlS5nwvQDUa3RgXX0IinxWIUXgNKBs4YA3GCBtbnHDpxsNSfRQrW7Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794572574; h=DMARC-Filter:Received:X-ICL-RepId:Dkim-Signature: mail-alias-created-date:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Details-Enc:X-Authority-Info-Out:X-JNJ; bh=CAPJTphDYYFKEENJOeATe0OoS3X41+ZOVJxvbKyL+Ow=; b=ZgQLFFXgN6KiIRKjL6N71RY1ux/RdvRwbt4YMzGDXi1THwbsVwwZmu7cbDkp3JpOvieg S+9HqauS+tbNmFMqQf1PUuH6N9h48X+OuoV+okN3t4sAGSZQUVdYMcycL5IW7T2xIo2dB 7NjasPk/LsqniMWPxkRI/Fe0KBWykKmfKHH2bxRl3IBzBUUsHZ5hUn1VuPy95toss1g8Q myLIXVsD6CYBbWNTHGqzkYs4BfneTRyvCg8n7pbq+pRxX5BA9cCDoiyLwk+Xzb58OD2J7 butbgyFC+dhDU/yBRsp3Qc4suDtnfDoOd3zKojcohzu5B3h0oooQYwZ429zwHh5cpLg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=verdict.gg; spf=pass smtp.mailfrom=verdict.gg; dkim=pass header.d=verdict.gg header.i=@verdict.gg header.a=rsa-sha256 header.s=sig1 header.b=KUMlAOWr; arc=none smtp.remote-ip=57.103.71.67 X-Received: from outbound.mr.icloud.com (mr-2005g-snip4-4.eps.apple.com [57.103.71.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C519060A3807 for <netdev@vger.kernel.org>; Fri, 13 Nov 2026 12:22:53 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C519060A3807 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=verdict.gg X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=verdict.gg X-Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-6 (Postfix) with ESMTPS id 2317A18002F0; Fri, 13 Nov 2026 12:22:49 +0000 (UTC) X-ICL-RepId: 01a1d4dc-4dd5-7c87-9bb1-eb56a6bfed53 X-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdict.gg; s=sig1; t=1794572573; x=1826108573; bh=CAPJTphDYYFKEENJOeATe0OoS3X41+ZOVJxvbKyL+Ow=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=KUMlAOWr6DV2m92RyUnR/G1u7oVsHeNmI9PIKh80FwQLG4n5/7rmmikoRcl/yda4wU0Y2cjAeeY+chb33t3yARRckwsmTY2T1NvDIstVXxh5rWzq0KcQSB+0NE9cb5izB16gyrva5QxNb2XhFIlry9W05YIJ32QlRhtcBVMJNMKL3QVdfHwY6GmgyTdbjVmltNNNDSUeXYj3shCnDiUGzPvr/4SgEqSwgfzBcZDAIwTMjMmwyY/IeSE6gaoOOEKTAbLevNPqv9epKYZht7kDlnQhqNF9ojo6rZjaSkWfFMBWH1xAGhvp+XW5fO42FR8HdmmNo7RPty4Zz3h+crsa7g== X-mail-alias-created-date: 1621344842221 X-Received: from DelNac.mail.msk (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-6 (Postfix) with ESMTPSA id F054A18002EE; Fri, 13 Nov 2026 12:22:46 +0000 (UTC) X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Vladimir Vdovin <deliran@verdict.gg> X-Mailer: git-send-email 2.56.0 X-In-Reply-To: <20261113122237.88990-1-deliran@verdict.gg> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Proofpoint-GUID: iYPjl1fPsKEE3JDTr09BaKW-U0xrB-pa X-Proofpoint-ORIG-GUID: iYPjl1fPsKEE3JDTr09BaKW-U0xrB-pa X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTEzMDA0OSBTYWx0ZWRfX3ZuI9pm4zDZg 3V56i7+rCEIIu1cyXBD1u3M7nF6LYS22bJYGXBiqUgVwawnPGZpu3/6p8KR8RfHYCTDaI4PI/bC hcO4Hs0wkDjZzTsGIIkkhmBuJX9rNacw8DA3u6+C5z5MIqvTh1dDSmZtZfVKV5hwWwimqllo4Yo 5YAD9a2VULrGvv4Hfe/Ldg0N67pExXGjSDpCl8cuTMI6IdfNcAGhJoxtaoXPLUF2eUq1PgPf3xc rLB99GJ64iaQX2sLUGL1oC5qNTDT3aRzihjVYfeHm+TuXnJq5H0xbEyI+d/62rGE5RBo2nOuEfs UKwLx3bD88cir2hIazGWmmZ5eOr8LP1ID3KAlsSjDThJM86VtvTk+24YjC1Ic4= X-Authority-Info-Out: v=2.4 cv=WrYm8Nfv c=1 sm=1 tr=0 ts=6af7011b cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=LRu4Mgyf0Pww-iI-pl8A:9 X-JNJ: AAAAAAAB4dz2jpGX6Y8hexPYNj6OFg2unHRmK+2Rvda4H/yTk1YfO3l4d9GDdMwTvTW0sk PMc87Ibp0SFXYpR3KdGLx3rBzb4qEWNTMyAFoMr+5HnD/9mSOIyUywHGk7drnJXEWKWFhY 81oB2c3A4uSg8wnRRo4VbiCVth0FBKpAayYFXh56otv31g8s1hrVUcMDBWfsoS5gyba2TT fPJPjPnO5EoWD8UlL5Ekkmaxdu3ljRRThxnjk36vRMhuyMJinoG0hL/kFUd1c3s5B/9H0l NGfoRdcTeJWBV94Pc8H+MJwfn93tMCOxomVV0GiCjCKlsvOKSAINFVRV1eE88hp/DODMpL hb6y2IA+kUPep9cryGAkJhKDIptwW6Rlk2zNpa7dl3FzVr/+tQW4Ls3/J6d/7VnEnBSB62 d7i2Uzw2Glc2NIZR1QvQJn4L0nl9zRtQIJlvEZsvx5N2FLOUhuVjQcafzy26ROTiaFy8Wl nNmyPmkmAxeLkifvS9e/l3rFQiVXVTzMdzWNUUsDKdg5t/X38zmVW4BSurFTz5rDn7/u2+ X3nuXCar7PFdWWXCKTS8lSn4Plds4BxwMl0+X/sHdrzG7PdQNYzl6F2QJY72jk7Aumi6Pb uNjJYYGRq/kT7Eo+5zR+AWuinFQi4Aj7NyFKmwntFh8K+ib+8ab0aqk78HDJoGMWwZYId7 ol+/56857PB/t8l3ayudTLJwerD/TV9kDH8Uoxqv4/8MZsrys3pWq266G6wvNgDrcP1Wz/ UJ2+bEVxKd5Nc540lrlG4jETnron2PXsyiiErEeHEQHAxUHmGUiXd60NRNLE7aU+ZTd9Bs EaLq6EsD9i9prqokjqUfVMGaLPOF9wi0nB+MLvi2Fi6pBQ==