summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorWang Zhan <wang.zhan@smartx.com>2026-10-08 18:06:47 +0800
committerPaolo Abeni <pabeni@redhat.com>2026-10-13 15:32:47 +0200
commit0bba48256b0aa86e84a08d69b4410018bd8ffc67 (patch)
treefc89d92d89beece457df2995c1525483085f4faf /include/linux
parentcc9dcb0e7a428ca43259bbee3350d786681265a3 (diff)
net: core: factor out the GSO device limit check
gso_features_check() decides whether an egress device can offload a GSO skb as a single TSO frame by comparing the segment count and the frame length against the device limits. The resegmentation path added by a later patch caps the MSS segments per output skb and needs the same features computed without those limits, so put the two tests in a helper and gate them with one flag. __netif_skb_features() takes that flag and takes the place of netif_skb_features(), which becomes an inline wrapper in netdevice.h and passes the flag set. Existing callers keep their call, and the resegmentation path asks for the features without the limit checks. No functional changes. Reviewed-by: Willem de Bruijn <willemb@google.com> Assisted-by: LLM Signed-off-by: Wang Zhan <wang.zhan@smartx.com> Link: https://patch.msgid.link/20261008100651.2534957-3-wang.zhan@smartx.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/netdevice.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1743dcd02d5b..8fbe3a5d8169 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5500,7 +5500,14 @@ void netif_stacked_transfer_operstate(const struct net_device *rootdev,
netdev_features_t passthru_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features);
-netdev_features_t netif_skb_features(struct sk_buff *skb);
+netdev_features_t __netif_skb_features(struct sk_buff *skb,
+ bool check_gso_limits);
+
+static inline netdev_features_t netif_skb_features(struct sk_buff *skb)
+{
+ return __netif_skb_features(skb, true);
+}
+
void skb_warn_bad_offload(const struct sk_buff *skb);
static inline bool net_gso_ok(netdev_features_t features, int gso_type)