From c3d165fec68897a817dcb0cbdbb945933d3afb93 Mon Sep 17 00:00:00 2001 From: lilinmao Date: Tue, 19 May 2026 10:20:22 +0800 Subject: [PATCH] ice: kcompat: only backport netdev_xmit_more() when kernel lacks it kcompat.h redefines netdev_xmit_more() as a macro on every kernel older than v5.2, reading the legacy skb->xmit_more bit-field or a constant zero. Downstream 4.19 trees exist that already backported the v5.2 helper along with the move of the xmit_more hint to softnet_data; there the macro shadows the kernel's inline and the driver reads a stale skb bit the kernel no longer maintains. If that stale bit happens to be set, ice_tx_map() skips ringing the TX tail doorbell and transmission stalls for several seconds until unrelated traffic flushes the ring. Observed with small-packet TCP flows on a 4.19.90-based tree. Probe for the helper in kcompat-generator.sh and emit the backport only under the new NEED_NETDEV_XMIT_MORE flag, matching the existing NEED_NETDEV_TX_SENT_QUEUE pattern. Kernels that genuinely lack netdev_xmit_more() keep the current fallback; affected trees now use the kernel's inline, which makes the stall go away. Signed-off-by: lilinmao --- src/kcompat-generator.sh | 1 + src/kcompat.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/kcompat-generator.sh b/src/kcompat-generator.sh index de7b5d5..62d283b 100644 --- a/src/kcompat-generator.sh +++ b/src/kcompat-generator.sh @@ -363,6 +363,7 @@ function gen-netdevice() { gen HAVE_RHEL7_NETDEV_OPS_EXT_NDO_SETUP_TC if method ndo_setup_tc_rh of net_device_ops_extended in "$ndh" gen HAVE_SET_NETDEV_DEVLINK_PORT if macro SET_NETDEV_DEVLINK_PORT in "$ndh" gen NEED_NETDEV_TX_SENT_QUEUE if fun __netdev_tx_sent_queue absent in "$ndh" + gen NEED_NETDEV_XMIT_MORE if fun netdev_xmit_more absent in "$ndh" gen NEED_NETIF_NAPI_ADD_NO_WEIGHT if fun netif_napi_add matches 'int weight' in "$ndh" gen NEED_NET_PREFETCH if fun net_prefetch absent in "$ndh" gen NEED_XDP_FEATURES if enum netdev_xdp_act absent in include/uapi/linux/netdev.h diff --git a/src/kcompat.h b/src/kcompat.h index 60bb5b3..bdee023 100644 --- a/src/kcompat.h +++ b/src/kcompat.h @@ -2979,12 +2979,14 @@ _kc_dev_change_flags(struct net_device *netdev, unsigned int flags, /*****************************************************************************/ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)) +#ifdef NEED_NETDEV_XMIT_MORE #if (defined HAVE_SKB_XMIT_MORE) && \ (!(RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8,2)))) #define netdev_xmit_more() (skb->xmit_more) #else #define netdev_xmit_more() (0) #endif +#endif /* NEED_NETDEV_XMIT_MORE */ #ifndef mmiowb #ifdef CONFIG_IA64