ice: Fix missing 1's complement negation in GCS raw checksum
Subsystems (3)
PATCH 1/1 ice: Fix missing 1's complement negation in GCS raw checksum
From: Matt Fleming <[email protected]>
Commit 905d1a220e8d ("ice: Add E830 checksum offload support") added Generic Checksum (GCS) support for E830 NICs but omitted the 1's complement negation (~) when converting the hardware raw_csum to skb->csum for CHECKSUM_COMPLETE.
Without the negation, every CHECKSUM_COMPLETE packet fails the fast-path validation in nf_ip_checksum() and falls through to software checksumming via __skb_checksum_complete(), which triggers the rate-limited "hw csum failure" warning. Packets are still accepted (the software recheck passes) but hardware checksum offload is effectively disabled and the warning floods dmesg on systems running nf_conntrack on VLAN sub-interfaces.
Multiple other drivers (idpf, ehea, iwlwifi, cassini, sunhme, enetc) also apply ~ for CHECKSUM_COMPLETE. The ice driver was the only in-tree user of csum_unfold() for CHECKSUM_COMPLETE that omitted it.
--- drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_txrx_lib.c +1 -1
@@ -92,7 +92,7 @@ static void ice_rx_gcs(struct sk_buff *skb, desc = (struct ice_32b_rx_flex_desc_nic *)rx_desc; skb->ip_summed =CHECKSUM_COMPLETE ; csum = (__force u16 )desc->raw_csum; - skb->csum =csum_unfold ((__force __sum16 )swab16 (csum)); + skb->csum =csum_unfold ((__force __sum16 )~swab16 (csum)); }/**
Signature · 1 line
2.43.0
Quoted 57 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Matt Fleming
Sent: Wednesday, April 8, 2026 9:02 PM
To: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>
Cc: Andrew Lunn <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; intel- [email protected]; [email protected]; linux- [email protected]; [email protected]; Matt Fleming <[email protected]>
Subject: [Intel-wired-lan] [PATCH net] ice: Fix missing 1's complement negation in GCS raw checksumFrom: Matt Fleming <[email protected]>
Commit
905d1a220e8d("ice: Add E830 checksum offload support") added Generic Checksum (GCS) support for E830 NICs but omitted the 1's complement negation (~) when converting the hardwareraw_csumtoskb->csumforCHECKSUM_COMPLETE.Without the negation, every
CHECKSUM_COMPLETEpacket fails the fast- path validation innf_ip_checksum()and falls through to software checksumming via__skb_checksum_complete(), which triggers the rate- limited "hw csum failure" warning. Packets are still accepted (the software recheck passes) but hardware checksum offload is effectively disabled and the warning floods dmesg on systems runningnf_conntrackon VLAN sub-interfaces.Multiple other drivers (idpf, ehea, iwlwifi, cassini, sunhme, enetc) also apply ~ for
CHECKSUM_COMPLETE. The ice driver was the only in- tree user ofcsum_unfold()forCHECKSUM_COMPLETEthat omitted it.Fixes 905d1a220e8d ("ice: Add E830 checksum offload support")Signed-off-by Matt Fleming <[email protected]>--- drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/ice/ice_txrx_lib.c +1
-2@@ -92,7 +92,7 @@ static void ice_rx_gcs(struct sk_buff *skb, desc = (struct ice_32b_rx_flex_desc_nic *)rx_desc; skb->ip_summed =CHECKSUM_COMPLETE ; csum = (__force u16 )desc->raw_csum; - skb->csum =csum_unfold ((__force __sum16 )swab16 (csum)); + skb->csum =csum_unfold ((__force __sum16 )~swab16 (csum)); }/** --
Quoted 1 line
2.43.0
I'd recommend adding Cc: [email protected]
Quoted 15 lines · Matt Fleming
From: Matt Fleming <[email protected]>
Commit
905d1a220e8d("ice: Add E830 checksum offload support") added Generic Checksum (GCS) support for E830 NICs but omitted the 1's complement negation (~) when converting the hardwareraw_csumtoskb->csumforCHECKSUM_COMPLETE.Without the negation, every
CHECKSUM_COMPLETEpacket fails the fast-path validation innf_ip_checksum()and falls through to software checksumming via__skb_checksum_complete(), which triggers the rate-limited "hw csum failure" warning. Packets are still accepted (the software recheck passes) but hardware checksum offload is effectively disabled and the warning floods dmesg on systems runningnf_conntrackon VLAN sub-interfaces.
Quoted 6 lines
Multiple other drivers (idpf, ehea, iwlwifi, cassini, sunhme, enetc) also apply ~ for
CHECKSUM_COMPLETE. The ice driver was the only in-tree user ofcsum_unfold()forCHECKSUM_COMPLETEthat omitted it.Fixes 905d1a220e8d ("ice: Add E830 checksum offload support")Signed-off-by Matt Fleming <[email protected]>