Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11095fdb authored by Netanel Belgazal's avatar Netanel Belgazal Committed by David S. Miller
Browse files

net: ena: add statistics for missed tx packets



Add a new statistic to ethtool stats that show the number of packets
without transmit acknowledgement from ENA device.

Signed-off-by: default avatarNetanel Belgazal <netanel@amazon.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8c5c7abd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ static const struct ena_stats ena_stats_tx_strings[] = {
	ENA_STAT_TX_ENTRY(doorbells),
	ENA_STAT_TX_ENTRY(prepare_ctx_err),
	ENA_STAT_TX_ENTRY(bad_req_id),
	ENA_STAT_TX_ENTRY(missed_tx),
};

static const struct ena_stats ena_stats_rx_strings[] = {
+17 −13
Original line number Diff line number Diff line
@@ -2648,7 +2648,7 @@ static int check_missing_comp_in_queue(struct ena_adapter *adapter,
	struct ena_tx_buffer *tx_buf;
	unsigned long last_jiffies;
	u32 missed_tx = 0;
	int i;
	int i, rc = 0;

	for (i = 0; i < tx_ring->ring_size; i++) {
		tx_buf = &tx_ring->tx_buffer_info[i];
@@ -2662,6 +2662,8 @@ static int check_missing_comp_in_queue(struct ena_adapter *adapter,

			tx_buf->print_once = 1;
			missed_tx++;
		}
	}

	if (unlikely(missed_tx > adapter->missing_tx_completion_threshold)) {
		netif_err(adapter, tx_err, adapter->netdev,
@@ -2671,12 +2673,14 @@ static int check_missing_comp_in_queue(struct ena_adapter *adapter,
		adapter->reset_reason =
			ENA_REGS_RESET_MISS_TX_CMPL;
		set_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags);
				return -EIO;
			}
		}
		rc = -EIO;
	}

	return 0;
	u64_stats_update_begin(&tx_ring->syncp);
	tx_ring->tx_stats.missed_tx = missed_tx;
	u64_stats_update_end(&tx_ring->syncp);

	return rc;
}

static void check_for_missing_tx_completions(struct ena_adapter *adapter)
+1 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ struct ena_stats_tx {
	u64 tx_poll;
	u64 doorbells;
	u64 bad_req_id;
	u64 missed_tx;
};

struct ena_stats_rx {