bnxt_en: Improve RX buffer error handling.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 18 Nov 2019 08:56:36 +0000 (03:56 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Nov 2019 01:13:28 +0000 (17:13 -0800)
When hardware reports RX buffer errors, the latest 57500 chips do not
require reset.  The packet is discarded by the hardware and the
ring will continue to operate.

Also, add an rx_buf_errors counter for this type of error.  It can help
the user to identify if the aggregation ring is too small.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

index 81bb6ce0adbf3881270ebc93f9190351c679d790..0e5b5b853b2d88cb6aaee8f44c720bf1a200a39e 100644 (file)
@@ -1767,8 +1767,12 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
 
                rc = -EIO;
                if (rx_err & RX_CMPL_ERRORS_BUFFER_ERROR_MASK) {
-                       netdev_warn(bp->dev, "RX buffer error %x\n", rx_err);
-                       bnxt_sched_reset(bp, rxr);
+                       bnapi->cp_ring.rx_buf_errors++;
+                       if (!(bp->flags & BNXT_FLAG_CHIP_P5)) {
+                               netdev_warn(bp->dev, "RX buffer error %x\n",
+                                           rx_err);
+                               bnxt_sched_reset(bp, rxr);
+                       }
                }
                goto next_rx_no_len;
        }
index c260cbbffefa07d26109ea259143ee7105f86500..f2b5da7028737d969e46b32c679aa14c9a9f28ea 100644 (file)
@@ -932,6 +932,7 @@ struct bnxt_cp_ring_info {
        dma_addr_t              hw_stats_map;
        u32                     hw_stats_ctx_id;
        u64                     rx_l4_csum_errors;
+       u64                     rx_buf_errors;
        u64                     missed_irqs;
 
        struct bnxt_ring_struct cp_ring_struct;
index f2220b826d61890b6c42b7346ed50e70bbfd6e91..7a5f6bf1701c3cf164df477c1f9a5d12a76e16f4 100644 (file)
@@ -173,6 +173,7 @@ static const char * const bnxt_ring_tpa2_stats_str[] = {
 
 static const char * const bnxt_ring_sw_stats_str[] = {
        "rx_l4_csum_errors",
+       "rx_buf_errors",
        "missed_irqs",
 };
 
@@ -552,6 +553,7 @@ static void bnxt_get_ethtool_stats(struct net_device *dev,
                for (k = 0; k < stat_fields; j++, k++)
                        buf[j] = le64_to_cpu(hw_stats[k]);
                buf[j++] = cpr->rx_l4_csum_errors;
+               buf[j++] = cpr->rx_buf_errors;
                buf[j++] = cpr->missed_irqs;
 
                bnxt_sw_func_stats[RX_TOTAL_DISCARDS].counter +=