Skip to content

Commit ef8a17a

Browse files
Andre Guedesanguy11
authored andcommitted
igc: Clean RX descriptor error flags
i225 advanced receive descriptor doesn't have the following extend error bits: CE, SE, SEQ, CXE. In addition to that, the bit TCPE is called L4E in the datasheet. Clean up the code accordingly, and get rid of the macro IGC_RXDEXT_ERR_FRAME_ERR_MASK since it doesn't make much sense anymore. Signed-off-by: Andre Guedes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 09cb2a3 commit ef8a17a

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

drivers/net/ethernet/intel/igc/igc_defines.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -324,22 +324,10 @@
324324
/* Advanced Receive Descriptor bit definitions */
325325
#define IGC_RXDADV_STAT_TSIP 0x08000 /* timestamp in packet */
326326

327-
#define IGC_RXDEXT_STATERR_CE 0x01000000
328-
#define IGC_RXDEXT_STATERR_SE 0x02000000
329-
#define IGC_RXDEXT_STATERR_SEQ 0x04000000
330-
#define IGC_RXDEXT_STATERR_CXE 0x10000000
331-
#define IGC_RXDEXT_STATERR_TCPE 0x20000000
327+
#define IGC_RXDEXT_STATERR_L4E 0x20000000
332328
#define IGC_RXDEXT_STATERR_IPE 0x40000000
333329
#define IGC_RXDEXT_STATERR_RXE 0x80000000
334330

335-
/* Same mask, but for extended and packet split descriptors */
336-
#define IGC_RXDEXT_ERR_FRAME_ERR_MASK ( \
337-
IGC_RXDEXT_STATERR_CE | \
338-
IGC_RXDEXT_STATERR_SE | \
339-
IGC_RXDEXT_STATERR_SEQ | \
340-
IGC_RXDEXT_STATERR_CXE | \
341-
IGC_RXDEXT_STATERR_RXE)
342-
343331
#define IGC_MRQC_RSS_FIELD_IPV4_TCP 0x00010000
344332
#define IGC_MRQC_RSS_FIELD_IPV4 0x00020000
345333
#define IGC_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ static void igc_rx_checksum(struct igc_ring *ring,
14331433

14341434
/* TCP/UDP checksum error bit is set */
14351435
if (igc_test_staterr(rx_desc,
1436-
IGC_RXDEXT_STATERR_TCPE |
1436+
IGC_RXDEXT_STATERR_L4E |
14371437
IGC_RXDEXT_STATERR_IPE)) {
14381438
/* work around errata with sctp packets where the TCPE aka
14391439
* L4E bit is set incorrectly on 64 byte (60 byte w/o crc)
@@ -1742,8 +1742,7 @@ static bool igc_cleanup_headers(struct igc_ring *rx_ring,
17421742
union igc_adv_rx_desc *rx_desc,
17431743
struct sk_buff *skb)
17441744
{
1745-
if (unlikely((igc_test_staterr(rx_desc,
1746-
IGC_RXDEXT_ERR_FRAME_ERR_MASK)))) {
1745+
if (unlikely(igc_test_staterr(rx_desc, IGC_RXDEXT_STATERR_RXE))) {
17471746
struct net_device *netdev = rx_ring->netdev;
17481747

17491748
if (!(netdev->features & NETIF_F_RXALL)) {

0 commit comments

Comments
 (0)