From: Andre Guedes <andre.gue...@intel.com>

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.gue...@intel.com>
Tested-by: Aaron Brown <aaron.f.br...@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.ngu...@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_defines.h | 14 +-------------
 drivers/net/ethernet/intel/igc/igc_main.c    |  5 ++---
 2 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h 
b/drivers/net/ethernet/intel/igc/igc_defines.h
index 3f5a201bda89..32f5fd684139 100644
--- a/drivers/net/ethernet/intel/igc/igc_defines.h
+++ b/drivers/net/ethernet/intel/igc/igc_defines.h
@@ -324,22 +324,10 @@
 /* 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
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c 
b/drivers/net/ethernet/intel/igc/igc_main.c
index b46bc8ded836..7a46b22413f2 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -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)) {
-- 
2.26.2

Reply via email to