stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6.12.y] net: libwx: fix Tx L4 checksum
@ 2025-06-24  6:44 jetlan9
  2025-06-25 14:07 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: jetlan9 @ 2025-06-24  6:44 UTC (permalink / raw)
  To: gregkh, stable; +Cc: Jiawen Wu, Jakub Kicinski, Wenshan Lan

From: Jiawen Wu <jiawenwu@trustnetic.com>

[ Upstream commit c7d82913d5f9e97860772ee4051eaa66b56a6273 ]

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: 3403960cdf86 ("net: wangxun: libwx add tx offload functions")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Link: https://patch.msgid.link/20250324103235.823096-2-jiawenwu@trustnetic.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Wenshan Lan <jetlan9@163.com>
---
 drivers/net/ethernet/wangxun/libwx/wx_lib.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
index 71c891d14fb6..0896742b3f30 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
@@ -1336,6 +1336,7 @@ static void wx_tx_csum(struct wx_ring *tx_ring, struct wx_tx_buffer *first,
 	u8 tun_prot = 0;
 
 	if (skb->ip_summed != CHECKSUM_PARTIAL) {
+csum_failed:
 		if (!(first->tx_flags & WX_TX_FLAGS_HW_VLAN) &&
 		    !(first->tx_flags & WX_TX_FLAGS_CC))
 			return;
@@ -1429,7 +1430,8 @@ static void wx_tx_csum(struct wx_ring *tx_ring, struct wx_tx_buffer *first,
 					WX_TXD_L4LEN_SHIFT;
 			break;
 		default:
-			break;
+			skb_checksum_help(skb);
+			goto csum_failed;
 		}
 
 		/* update TX checksum flag */
-- 
2.39.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 6.12.y] net: libwx: fix Tx L4 checksum
  2025-06-24  6:44 [PATCH 6.12.y] net: libwx: fix Tx L4 checksum jetlan9
@ 2025-06-25 14:07 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2025-06-25 14:07 UTC (permalink / raw)
  To: stable; +Cc: jetlan9, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

The upstream commit SHA1 provided is correct: c7d82913d5f9e97860772ee4051eaa66b56a6273

WARNING: Author mismatch between patch and upstream commit:
Backport author: jetlan9@163.com
Commit author: Jiawen Wu<jiawenwu@trustnetic.com>

Status in newer kernel trees:
6.15.y | Present (exact SHA1)

Note: The patch differs from the upstream commit:
---
1:  c7d82913d5f9e ! 1:  378a713847ffc net: libwx: fix Tx L4 checksum
    @@ Metadata
      ## Commit message ##
         net: libwx: fix Tx L4 checksum
     
    +    [ Upstream commit c7d82913d5f9e97860772ee4051eaa66b56a6273 ]
    +
         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.
    @@ Commit message
         Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
         Link: https://patch.msgid.link/20250324103235.823096-2-jiawenwu@trustnetic.com
         Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    +    Signed-off-by: Wenshan Lan <jetlan9@163.com>
     
      ## drivers/net/ethernet/wangxun/libwx/wx_lib.c ##
     @@ drivers/net/ethernet/wangxun/libwx/wx_lib.c: static void wx_tx_csum(struct wx_ring *tx_ring, struct wx_tx_buffer *first,
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.12.y       |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-25 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24  6:44 [PATCH 6.12.y] net: libwx: fix Tx L4 checksum jetlan9
2025-06-25 14:07 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).