From f1f59d721d9027ab54ff22a1788ac07d03a2fe7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Mon, 2 Jun 2025 15:45:36 -0700 Subject: [PATCH] bpf/progs/offload.c: add comment about pmtu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: 263884894 Flag: EXEMPT mainline Test: TreeHugger Signed-off-by: Maciej Żenczykowski Change-Id: I34c8d033ee0da34fc6db4d6093ed6a10c57c0dc1 --- bpf/progs/offload.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bpf/progs/offload.c b/bpf/progs/offload.c index b0dc324db7..ae6f9aea95 100644 --- a/bpf/progs/offload.c +++ b/bpf/progs/offload.c @@ -176,6 +176,8 @@ static inline __always_inline int do_forward6(struct __sk_buff* skb, // Handling of IPv6 overhead for incoming LRO/GRO packets uint64_t packets = 1; uint64_t L3_bytes = skb->len - l2_header_size; + // I don't trust v->pmtu to not be higher then it should be: it might just + // be device (instead of path/route/ipv6) mtu and that itself might be wrong... if (L3_bytes > v->pmtu) { if (gso_hdr_size == sizeof(struct ipv6hdr)) TC_PUNT(UNKNOWN_IPV6_GSO); const int mss = v->pmtu - gso_hdr_size; @@ -423,6 +425,8 @@ static inline __always_inline int do_forward4_bottom(struct __sk_buff* skb, // Handling of IPv4 overhead for incoming LRO/GRO packets uint64_t packets = 1; uint64_t L3_bytes = skb->len - l2_header_size; + // I don't trust v->pmtu to not be higher then it should be: it might just + // be device (instead of path/route) mtu and that itself might be wrong... if (L3_bytes > v->pmtu) { // we know it is IPv4 without IP options, and either TCP or UDP const int hdr_sz = sizeof(struct iphdr) + (is_tcp ? tcph->doff * 4 : sizeof(struct udphdr));