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: ef4f3c19f9 ("net: wangxun: libwx add rx offload functions")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Link: https://patch.msgid.link/20250407103322.273241-1-jiawenwu@trustnetic.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user