igc: Clean RX descriptor error flags
authorAndre Guedes <andre.guedes@intel.com>
Mon, 10 Aug 2020 21:08:30 +0000 (14:08 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 28 Sep 2020 21:42:45 +0000 (14:42 -0700)
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 <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igc/igc_defines.h
drivers/net/ethernet/intel/igc/igc_main.c

index 3f5a201..32f5fd6 100644 (file)
 /* Advanced Receive Descriptor bit definitions */
 #define IGC_RXDADV_STAT_TSIP   0x08000 /* timestamp in packet */
 
-#define IGC_RXDEXT_STATERR_CE          0x01000000
-#define IGC_RXDEXT_STATERR_SE          0x02000000
-#define IGC_RXDEXT_STATERR_SEQ         0x04000000
-#define IGC_RXDEXT_STATERR_CXE         0x10000000
-#define IGC_RXDEXT_STATERR_TCPE                0x20000000
+#define IGC_RXDEXT_STATERR_L4E         0x20000000
 #define IGC_RXDEXT_STATERR_IPE         0x40000000
 #define IGC_RXDEXT_STATERR_RXE         0x80000000
 
-/* Same mask, but for extended and packet split descriptors */
-#define IGC_RXDEXT_ERR_FRAME_ERR_MASK ( \
-       IGC_RXDEXT_STATERR_CE  |        \
-       IGC_RXDEXT_STATERR_SE  |        \
-       IGC_RXDEXT_STATERR_SEQ |        \
-       IGC_RXDEXT_STATERR_CXE |        \
-       IGC_RXDEXT_STATERR_RXE)
-
 #define IGC_MRQC_RSS_FIELD_IPV4_TCP    0x00010000
 #define IGC_MRQC_RSS_FIELD_IPV4                0x00020000
 #define IGC_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000
index b46bc8d..7a46b22 100644 (file)
@@ -1433,7 +1433,7 @@ static void igc_rx_checksum(struct igc_ring *ring,
 
        /* TCP/UDP checksum error bit is set */
        if (igc_test_staterr(rx_desc,
-                            IGC_RXDEXT_STATERR_TCPE |
+                            IGC_RXDEXT_STATERR_L4E |
                             IGC_RXDEXT_STATERR_IPE)) {
                /* work around errata with sctp packets where the TCPE aka
                 * 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,
                                union igc_adv_rx_desc *rx_desc,
                                struct sk_buff *skb)
 {
-       if (unlikely((igc_test_staterr(rx_desc,
-                                      IGC_RXDEXT_ERR_FRAME_ERR_MASK)))) {
+       if (unlikely(igc_test_staterr(rx_desc, IGC_RXDEXT_STATERR_RXE))) {
                struct net_device *netdev = rx_ring->netdev;
 
                if (!(netdev->features & NETIF_F_RXALL)) {