summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-02-07 07:48:35 +0300
committerJakub Kicinski <kuba@kernel.org>2026-02-07 07:50:13 +0300
commit1fdad81d880349756414b1a7d4e2a8bdf52664e6 (patch)
tree1da4ea8ca4da35cc6af3e08a573dc725ec5109b3 /include/linux
parent5826eec8710c214f02f253c165d66a230f5a86c3 (diff)
parent35f66ce900370ed0eab6553977adc0a2fb9cccfb (diff)
downloadlinux-1fdad81d880349756414b1a7d4e2a8bdf52664e6.tar.xz
Merge branch 'big-tcp-without-hbh-in-ipv6'
Alice Mikityanska says: ==================== BIG TCP without HBH in IPv6 Resubmitting after the grace period. This series is part 1 of "BIG TCP for UDP tunnels". Due to the number of patches, I'm splitting it into two logical parts: * Remove hop-by-hop header for BIG TCP IPv6 to align with BIG TCP IPv4. * Fix up things that prevent BIG TCP from working with UDP tunnels. The current BIG TCP IPv6 code inserts a hop-by-hop extension header with 32-bit length of the packet. When the packet is encapsulated, and either the outer or the inner protocol is IPv6, or both are IPv6, there will be 1 or 2 HBH headers that need to be dealt with. The issues that arise: 1. The drivers don't strip it, and they'd all need to know the structure of each tunnel protocol in order to strip it correctly, also taking into account all combinations of IPv4/IPv6 inner/outer protocols. 2. Even if (1) is implemented, it would be an additional performance penalty per aggregated packet. 3. The skb_gso_validate_network_len check is skipped in ip6_finish_output_gso when IP6SKB_FAKEJUMBO is set, but it seems that it would make sense to do the actual validation, just taking into account the length of the HBH header. When the support for tunnels is added, it becomes trickier, because there may be one or two HBH headers, depending on whether it's IPv6 in IPv6 or not. At the same time, having an HBH header to store the 32-bit length is not strictly necessary, as BIG TCP IPv4 doesn't do anything like this and just restores the length from skb->len. The same thing can be done for BIG TCP IPv6. Removing HBH from BIG TCP would allow to simplify the implementation significantly, and align it with BIG TCP IPv4, which has been a long-standing goal. ==================== Link: https://patch.msgid.link/20260205133925.526371-1-alice.kernel@fastmail.im Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ipv6.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 20aae8357dd1..bdbd63f9a85e 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -126,6 +126,28 @@ static inline unsigned int ipv6_transport_len(const struct sk_buff *skb)
skb_network_header_len(skb);
}
+static inline unsigned int
+ipv6_payload_len(const struct sk_buff *skb, const struct ipv6hdr *ip6)
+{
+ u32 len = ntohs(ip6->payload_len);
+
+ return (len || !skb_is_gso(skb) || !skb_is_gso_tcp(skb)) ?
+ len :
+ skb->len - skb_network_offset(skb) - sizeof(struct ipv6hdr);
+}
+
+static inline unsigned int skb_ipv6_payload_len(const struct sk_buff *skb)
+{
+ return ipv6_payload_len(skb, ipv6_hdr(skb));
+}
+
+#define IPV6_MAXPLEN 65535
+
+static inline void ipv6_set_payload_len(struct ipv6hdr *ip6, unsigned int len)
+{
+ ip6->payload_len = len <= IPV6_MAXPLEN ? htons(len) : 0;
+}
+
/*
This structure contains results of exthdrs parsing
as offsets from skb->nh.
@@ -155,7 +177,6 @@ struct inet6_skb_parm {
#define IP6SKB_L3SLAVE 64
#define IP6SKB_JUMBOGRAM 128
#define IP6SKB_SEG6 256
-#define IP6SKB_FAKEJUMBO 512
#define IP6SKB_MULTIPATH 1024
#define IP6SKB_MCROUTE 2048
};