rtl_quirk_packet_padto() returns the minimum packet length required by the padding quirks. For RTL8168evl and RTL8125-family chips this is at least ETH_ZLEN, even when the skb is already longer. rtl8169_features_check() treats that nonzero target as a boolean and therefore disables checksum offload for ordinary non-GSO CHECKSUM_PARTIAL packets on these chips. Packets that need no padding are unnecessarily checksummed in software. Compare the skb length with the padding target instead. Packets that actually need padding continue to use software checksumming; the existing short-frame and transport-offset checks are unchanged. Fixes: 8d520b4de3ed ("r8169: work around RTL8125 UDP hw bug") Assisted-by: LLM Signed-off-by: iugfdin --- Tested with W=1 driver-target builds on net under x86-64 allmodconfig and allyesconfig, and source-executing ASan/UBSan checks with modeled kernel/DMA/MMIO boundaries. No physical Realtek NIC was available; this is not an on-device test claim. diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index ee1bc9bd..045fcd4d 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -4677,7 +4677,7 @@ static netdev_features_t rtl8169_features_check(struct sk_buff *skb, if (skb->len < ETH_ZLEN) features &= ~NETIF_F_CSUM_MASK; - if (rtl_quirk_packet_padto(tp, skb)) + if (skb->len < rtl_quirk_packet_padto(tp, skb)) features &= ~NETIF_F_CSUM_MASK; if (skb_transport_offset(skb) > TCPHO_MAX &&