diff options
author | David S. Miller <davem@davemloft.net> | 2022-05-06 12:07:56 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-05-06 12:07:56 +0100 |
commit | 95730d65708397828f75ca7dbca838edf6727bfd (patch) | |
tree | 37f896eb09e44bcaaa344a03a96052843a4dbd90 /net/core/dev.h | |
parent | beb21e3e8e261fc9f11050af17efe6de183b33d3 (diff) | |
parent | 744d49daf8bd3b17b345c836f2e6f97d49fa6ae8 (diff) |
Merge branch 'tso-gso-limit-split'
Jakub Kicinski says:
====================
net: disambiguate the TSO and GSO limits
This series separates the device-reported TSO limitations
from the user space-controlled GSO limits. It used to be that
we only had the former (HW limits) but they were named GSO.
This probably lead to confusion and letting user override them.
The problem came up in the BIG TCP discussion between Eric and
Alex, and seems like something we should address.
Targeting net-next because (a) nobody is reporting problems;
and (b) there is a tiny but non-zero chance that some actually
wants to lift the HW limitations.
====================
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.h')
-rw-r--r-- | net/core/dev.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/core/dev.h b/net/core/dev.h index 27923df00637..328b37af90ba 100644 --- a/net/core/dev.h +++ b/net/core/dev.h @@ -88,4 +88,25 @@ int dev_change_carrier(struct net_device *dev, bool new_carrier); void __dev_set_rx_mode(struct net_device *dev); +static inline void netif_set_gso_max_size(struct net_device *dev, + unsigned int size) +{ + /* dev->gso_max_size is read locklessly from sk_setup_caps() */ + WRITE_ONCE(dev->gso_max_size, size); +} + +static inline void netif_set_gso_max_segs(struct net_device *dev, + unsigned int segs) +{ + /* dev->gso_max_segs is read locklessly from sk_setup_caps() */ + WRITE_ONCE(dev->gso_max_segs, segs); +} + +static inline void netif_set_gro_max_size(struct net_device *dev, + unsigned int size) +{ + /* This pairs with the READ_ONCE() in skb_gro_receive() */ + WRITE_ONCE(dev->gro_max_size, size); +} + #endif |