From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A871594817; Wed, 9 Sep 2026 14:40:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788964842; cv=none; b=ixdeHRNjz6weS8bgjtPd9hp8zJ8l5N9Rq14i1yiaaM4oJQ7nQTrG2/MMimUvJT87aTc4S49nkHXD4/iKLyNBOd2FfX6DQOX4fktEEki2eDJIZWuoqQDocccVMVsKqISYsPiShg6BFRT9Uy4sBt0Z8KBoYvAIAr7TR0HdBJj1irE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788964842; c=relaxed/simple; bh=A9xoaq6asyB3K4wIvuFtCeyjkGfEAjTlAbNSBDZuN7I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Hyo/5dQbZVva81LCuskQ6AFAIXLVXOx4wSOaIPOU/nmRJl3CivTCbLlZGCHLwQThRI6Dk1bD1b03fMQjHb28A0/uNm8tSLpfXjxcoAFROinmOma/okW4f3JZ5KHX6gjJqyvFO6Xob2QSEHBAf5ikj6EiwU2DLklPlcV7qnklX8A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1gO+eWQs; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1gO+eWQs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C62B71F00A3A; Wed, 9 Sep 2026 14:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788964841; bh=m6xIOa6LaYubb0bRcAfCHCSvGtFXR42z+++WFkjvBgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1gO+eWQsA9+UWv4Ve8L3N7bzpXK0xDj0yN1XsM3S6c3k6YTDkgmmlukbCuqPs2Ikk WfMisdMth6Jsva64huT7HICOCVg5I1N2xcT0Ou58h+a1jZOvVF7tYbxJPEZOqMdjvI /9/GxhaoNhvnqWAuzl+8X+wtdrUI3epQxBybQscc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , Kuniyuki Iwashima , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 523/583] inet: add dst4_mtu() and dst6_mtu() helpers Date: Wed, 9 Sep 2026 15:43:28 +0200 Message-ID: <20260909134255.822323570@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260909134237.773280130@linuxfoundation.org> References: <20260909134237.773280130@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit 8776c4ef3ab22b95f55713f00a7a576e6402507d ] With CONFIG_MITIGATION_RETPOLINE=y dst_mtu() is a bit fat, because it is generic. Indeed, clang does not always inline it. Add dst4_mtu() and dst6_mtu() helpers for callers that expect either ipv4_mtu() or ip6_mtu() to be called. These helpers are always inlined. Signed-off-by: Eric Dumazet Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20260130210303.3888261-6-edumazet@google.com Signed-off-by: Jakub Kicinski Stable-dep-of: 870a9e42ecc6 ("tcp: clamp route advmss to TCP_MIN_MSS") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- include/net/dst.h | 6 ++++++ include/net/ip6_route.h | 6 ++++++ 2 files changed, 12 insertions(+) --- a/include/net/dst.h +++ b/include/net/dst.h @@ -219,6 +219,12 @@ static inline u32 dst_mtu(const struct d return INDIRECT_CALL_INET(dst->ops->mtu, ip6_mtu, ipv4_mtu, dst); } +/* Variant of dst_mtu() for IPv4 users. */ +static inline u32 dst4_mtu(const struct dst_entry *dst) +{ + return INDIRECT_CALL_1(dst->ops->mtu, ipv4_mtu, dst); +} + /* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */ static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metric) { --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h @@ -266,6 +266,12 @@ static inline bool ipv6_anycast_destinat int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, int (*output)(struct net *, struct sock *, struct sk_buff *)); +/* Variant of dst_mtu() for IPv6 users */ +static inline u32 dst6_mtu(const struct dst_entry *dst) +{ + return INDIRECT_CALL_1(dst->ops->mtu, ip6_mtu, dst); +} + static inline unsigned int ip6_skb_dst_mtu(const struct sk_buff *skb) { const struct ipv6_pinfo *np = skb->sk && !dev_recursion_level() ?