Skip to content

Commit c7d8291

Browse files
Jiawen Wukuba-moo
authored andcommitted
net: libwx: fix Tx L4 checksum
The hardware only supports L4 checksum offload for TCP/UDP/SCTP protocol. There was a bug to set Tx checksum flag for the other protocol that results in Tx ring hang. Fix to compute software checksum for these packets. Fixes: 3403960 ("net: wangxun: libwx add tx offload functions") Signed-off-by: Jiawen Wu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a44940d commit c7d8291

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/ethernet/wangxun/libwx

1 file changed

+3
-1
lines changed

drivers/net/ethernet/wangxun/libwx/wx_lib.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,7 @@ static void wx_tx_csum(struct wx_ring *tx_ring, struct wx_tx_buffer *first,
13371337
u8 tun_prot = 0;
13381338

13391339
if (skb->ip_summed != CHECKSUM_PARTIAL) {
1340+
csum_failed:
13401341
if (!(first->tx_flags & WX_TX_FLAGS_HW_VLAN) &&
13411342
!(first->tx_flags & WX_TX_FLAGS_CC))
13421343
return;
@@ -1441,7 +1442,8 @@ static void wx_tx_csum(struct wx_ring *tx_ring, struct wx_tx_buffer *first,
14411442
WX_TXD_L4LEN_SHIFT;
14421443
break;
14431444
default:
1444-
break;
1445+
skb_checksum_help(skb);
1446+
goto csum_failed;
14451447
}
14461448

14471449
/* update TX checksum flag */

0 commit comments

Comments
 (0)