Re: [PATCH v4 net-next 02/14] ipv6: add dev->gso_ipv6_max_size
From: Alexander H Duyck <hidden>
Date: 2022-03-11 16:22:04
On Wed, 2022-03-09 at 21:46 -0800, Eric Dumazet wrote:
quoted hunk ↗ jump to hunk
From: Coco Li <redacted> This enable TCP stack to build TSO packets bigger than 64KB if the driver is LSOv2 compatible. This patch introduces new variable gso_ipv6_max_size that is modifiable through ip link. ip link set dev eth0 gso_ipv6_max_size 185000 User input is capped by driver limit (tso_ipv6_max_size) added in previous patch. Signed-off-by: Coco Li <redacted> Signed-off-by: Eric Dumazet <edumazet@google.com> --- include/linux/netdevice.h | 12 ++++++++++++ include/uapi/linux/if_link.h | 1 + net/core/dev.c | 1 + net/core/rtnetlink.c | 15 +++++++++++++++ net/core/sock.c | 6 ++++++ tools/include/uapi/linux/if_link.h | 1 + 6 files changed, 36 insertions(+)diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 61db67222c47664c179b6a5d3b6f15fdf8a02bdd..9ed348d8b6f1195514c3b5f85fbe2c45b3fa997f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h@@ -1952,6 +1952,7 @@ enum netdev_ml_priv_type { * registered * @offload_xstats_l3: L3 HW stats for this netdevice. * @tso_ipv6_max_size: Maximum size of IPv6 TSO packets (driver/NIC limit) + * @gso_ipv6_max_size: Maximum size of IPv6 GSO packets (user/admin limit) * * FIXME: cleanup struct net_device such that network protocol info * moves out.@@ -2291,6 +2292,7 @@ struct net_device { netdevice_tracker dev_registered_tracker; struct rtnl_hw_stats64 *offload_xstats_l3; unsigned int tso_ipv6_max_size; + unsigned int gso_ipv6_max_size; }; #define to_net_dev(d) container_of(d, struct net_device, dev)
Rather than have this as a device specific value would it be advantageous to consider making this a namespace specific sysctl value instead? Something along the lines of: net.ipv6.conf.*.max_jumbogram_size It could also be applied generically to the GSO/GRO as the upper limit for any frame assembled by the socket or GRO. The general idea is that might be desirable for admins to be able to basically just set the maximum size they want to see for IPv6 frames and if we could combine the GRO/GSO logic into a single sysctl that could be set on a namespace basis instead of a device basis which would be more difficult to track down. We already have the per-device limits in the tso_ipv6_max_size for the outgoing frames so it seems like it might make sense to make this per network namespace and defaultable rather than per device and requiring an update for each device instance.