Commit 13e7d724 authored by Jiawen Wu's avatar Jiawen Wu Committed by Paolo Abeni
Browse files

net: libwx: Fix the wrong Rx descriptor field



WX_RXD_IPV6EX was incorrectly defined in Rx ring descriptor. In fact, this
field stores the 802.1ad ID from which the packet was received. The wrong
definition caused the statistics rx_csum_offload_errors to fail to grow
when receiving the 802.1ad packet with incorrect checksum.

Fixes: ef4f3c19 ("net: wangxun: libwx add rx offload functions")
Signed-off-by: default avatarJiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: default avatarMichal Kubiak <michal.kubiak@intel.com>
Link: https://patch.msgid.link/20250407103322.273241-1-jiawenwu@trustnetic.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent b7db9473
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -546,7 +546,8 @@ static void wx_rx_checksum(struct wx_ring *ring,
		return;

	/* Hardware can't guarantee csum if IPv6 Dest Header found */
	if (dptype.prot != WX_DEC_PTYPE_PROT_SCTP && WX_RXD_IPV6EX(rx_desc))
	if (dptype.prot != WX_DEC_PTYPE_PROT_SCTP &&
	    wx_test_staterr(rx_desc, WX_RXD_STAT_IPV6EX))
		return;

	/* if L4 checksum error */
+1 −2
Original line number Diff line number Diff line
@@ -513,6 +513,7 @@ enum WX_MSCA_CMD_value {
#define WX_RXD_STAT_L4CS             BIT(7) /* L4 xsum calculated */
#define WX_RXD_STAT_IPCS             BIT(8) /* IP xsum calculated */
#define WX_RXD_STAT_OUTERIPCS        BIT(10) /* Cloud IP xsum calculated*/
#define WX_RXD_STAT_IPV6EX           BIT(12) /* IPv6 Dest Header */
#define WX_RXD_STAT_TS               BIT(14) /* IEEE1588 Time Stamp */

#define WX_RXD_ERR_OUTERIPER         BIT(26) /* CRC IP Header error */
@@ -589,8 +590,6 @@ enum wx_l2_ptypes {

#define WX_RXD_PKTTYPE(_rxd) \
	((le32_to_cpu((_rxd)->wb.lower.lo_dword.data) >> 9) & 0xFF)
#define WX_RXD_IPV6EX(_rxd) \
	((le32_to_cpu((_rxd)->wb.lower.lo_dword.data) >> 6) & 0x1)
/*********************** Transmit Descriptor Config Masks ****************/
#define WX_TXD_STAT_DD               BIT(0)  /* Descriptor Done */
#define WX_TXD_DTYP_DATA             0       /* Adv Data Descriptor */