Commit 19b3751f authored by Michael Chan's avatar Michael Chan Committed by David S. Miller
Browse files

bnxt_en: Improve RX buffer error handling.



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: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 41136ab3
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1767,9 +1767,13 @@ 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);
			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;
	}

+1 −0
Original line number Diff line number Diff line
@@ -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;
+2 −0
Original line number Diff line number Diff line
@@ -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 +=