summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexander Duyck <alexanderduyck@fb.com>2022-05-13 11:34:03 -0700
committerDavid S. Miller <davem@davemloft.net>2022-05-16 10:18:56 +0100
commit0fe79f28bfaf73b66b7b1562d2468f94aa03bd12 (patch)
tree0656d24d4e0cc9d8ae6e04106737b392b706271c /include
parent81fbc812132cbc72a0f933b19bfd3a829bd946e4 (diff)
downloadlinux-stable-0fe79f28bfaf73b66b7b1562d2468f94aa03bd12.tar.gz
linux-stable-0fe79f28bfaf73b66b7b1562d2468f94aa03bd12.tar.bz2
linux-stable-0fe79f28bfaf73b66b7b1562d2468f94aa03bd12.zip
net: allow gro_max_size to exceed 65536
Allow the gro_max_size to exceed a value larger than 65536. There weren't really any external limitations that prevented this other than the fact that IPv4 only supports a 16 bit length field. Since we have the option of adding a hop-by-hop header for IPv6 we can allow IPv6 to exceed this value and for IPv4 and non-TCP flows we can cap things at 65536 via a constant rather than relying on gro_max_size. [edumazet] limit GRO_MAX_SIZE to (8 * 65535) to avoid overflows. Signed-off-by: Alexander Duyck <alexanderduyck@fb.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h6
-rw-r--r--include/net/ipv6.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index fd38847d0dc7..d57ce248004c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2161,7 +2161,11 @@ struct net_device {
struct bpf_prog __rcu *xdp_prog;
unsigned long gro_flush_timeout;
int napi_defer_hard_irqs;
-#define GRO_MAX_SIZE 65536
+#define GRO_LEGACY_MAX_SIZE 65536u
+/* TCP minimal MSS is 8 (TCP_MIN_GSO_SIZE),
+ * and shinfo->gso_segs is a 16bit field.
+ */
+#define GRO_MAX_SIZE (8 * 65535u)
unsigned int gro_max_size;
rx_handler_func_t __rcu *rx_handler;
void __rcu *rx_handler_data;
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index b6df0314aa02..5b38bf1a586b 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -477,7 +477,7 @@ static inline int ipv6_has_hopopt_jumbo(const struct sk_buff *skb)
const struct hop_jumbo_hdr *jhdr;
const struct ipv6hdr *nhdr;
- if (likely(skb->len <= GRO_MAX_SIZE))
+ if (likely(skb->len <= GRO_LEGACY_MAX_SIZE))
return 0;
if (skb->protocol != htons(ETH_P_IPV6))