|
|
f95c89 |
From ecb8a317044a5892e9f0d5a3ebe27689dcb264b4 Mon Sep 17 00:00:00 2001
|
|
|
f95c89 |
From: Jonathan Toppins <jtoppins@redhat.com>
|
|
|
f95c89 |
Date: Wed, 2 Oct 2019 18:23:07 -0400
|
|
|
f95c89 |
Subject: [PATCH 52/96] [netdrv] bnxt_en: Support TPA counters on 57500 chips
|
|
|
f95c89 |
|
|
|
f95c89 |
Message-id: <af5cd8f6d840cf1d1352c7bfd76e0c1044e9871b.1570027456.git.jtoppins@redhat.com>
|
|
|
f95c89 |
Patchwork-id: 276468
|
|
|
f95c89 |
O-Subject: [RHEL-8.2 PATCH 45/78] bnxt_en: Support TPA counters on 57500 chips.
|
|
|
f95c89 |
Bugzilla: 1724766
|
|
|
f95c89 |
RH-Acked-by: John Linville <linville@redhat.com>
|
|
|
f95c89 |
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
|
|
|
f95c89 |
|
|
|
f95c89 |
Support the new expanded TPA v2 counters on 57500 B0 chips for
|
|
|
f95c89 |
ethtool -S.
|
|
|
f95c89 |
|
|
|
f95c89 |
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
|
|
|
f95c89 |
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
|
f95c89 |
(cherry picked from commit 78e7b86605b460e8b40622d16d840f9276d58627)
|
|
|
f95c89 |
Bugzilla: 1724766
|
|
|
f95c89 |
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=23809532
|
|
|
f95c89 |
Tested: build, boot, basic ping
|
|
|
f95c89 |
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
|
|
|
f95c89 |
Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
|
|
|
f95c89 |
---
|
|
|
f95c89 |
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 41 +++++++++++++++++------
|
|
|
f95c89 |
1 file changed, 31 insertions(+), 10 deletions(-)
|
|
|
f95c89 |
|
|
|
f95c89 |
Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
|
|
|
f95c89 |
===================================================================
|
|
|
f95c89 |
--- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c 2020-02-06 16:23:17.017501155 +0100
|
|
|
f95c89 |
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c 2020-02-06 16:23:17.286498686 +0100
|
|
|
f95c89 |
@@ -163,6 +163,14 @@
|
|
|
f95c89 |
"tpa_aborts",
|
|
|
f95c89 |
};
|
|
|
f95c89 |
|
|
|
f95c89 |
+static const char * const bnxt_ring_tpa2_stats_str[] = {
|
|
|
f95c89 |
+ "rx_tpa_eligible_pkt",
|
|
|
f95c89 |
+ "rx_tpa_eligible_bytes",
|
|
|
f95c89 |
+ "rx_tpa_pkt",
|
|
|
f95c89 |
+ "rx_tpa_bytes",
|
|
|
f95c89 |
+ "rx_tpa_errors",
|
|
|
f95c89 |
+};
|
|
|
f95c89 |
+
|
|
|
f95c89 |
static const char * const bnxt_ring_sw_stats_str[] = {
|
|
|
f95c89 |
"rx_l4_csum_errors",
|
|
|
f95c89 |
"missed_irqs",
|
|
|
f95c89 |
@@ -461,14 +469,23 @@
|
|
|
f95c89 |
ARRAY_SIZE(bnxt_tx_pkts_pri_arr))
|
|
|
f95c89 |
#define BNXT_NUM_PCIE_STATS ARRAY_SIZE(bnxt_pcie_stats_arr)
|
|
|
f95c89 |
|
|
|
f95c89 |
+static int bnxt_get_num_tpa_ring_stats(struct bnxt *bp)
|
|
|
f95c89 |
+{
|
|
|
f95c89 |
+ if (BNXT_SUPPORTS_TPA(bp)) {
|
|
|
f95c89 |
+ if (bp->max_tpa_v2)
|
|
|
f95c89 |
+ return ARRAY_SIZE(bnxt_ring_tpa2_stats_str);
|
|
|
f95c89 |
+ return ARRAY_SIZE(bnxt_ring_tpa_stats_str);
|
|
|
f95c89 |
+ }
|
|
|
f95c89 |
+ return 0;
|
|
|
f95c89 |
+}
|
|
|
f95c89 |
+
|
|
|
f95c89 |
static int bnxt_get_num_ring_stats(struct bnxt *bp)
|
|
|
f95c89 |
{
|
|
|
f95c89 |
int num_stats;
|
|
|
f95c89 |
|
|
|
f95c89 |
num_stats = ARRAY_SIZE(bnxt_ring_stats_str) +
|
|
|
f95c89 |
- ARRAY_SIZE(bnxt_ring_sw_stats_str);
|
|
|
f95c89 |
- if (BNXT_SUPPORTS_TPA(bp))
|
|
|
f95c89 |
- num_stats += ARRAY_SIZE(bnxt_ring_tpa_stats_str);
|
|
|
f95c89 |
+ ARRAY_SIZE(bnxt_ring_sw_stats_str) +
|
|
|
f95c89 |
+ bnxt_get_num_tpa_ring_stats(bp);
|
|
|
f95c89 |
return num_stats * bp->cp_nr_rings;
|
|
|
f95c89 |
}
|
|
|
f95c89 |
|
|
|
f95c89 |
@@ -515,10 +532,8 @@
|
|
|
f95c89 |
{
|
|
|
f95c89 |
u32 i, j = 0;
|
|
|
f95c89 |
struct bnxt *bp = netdev_priv(dev);
|
|
|
f95c89 |
- u32 stat_fields = ARRAY_SIZE(bnxt_ring_stats_str);
|
|
|
f95c89 |
-
|
|
|
f95c89 |
- if (BNXT_SUPPORTS_TPA(bp))
|
|
|
f95c89 |
- stat_fields += ARRAY_SIZE(bnxt_ring_tpa_stats_str);
|
|
|
f95c89 |
+ u32 stat_fields = ARRAY_SIZE(bnxt_ring_stats_str) +
|
|
|
f95c89 |
+ bnxt_get_num_tpa_ring_stats(bp);
|
|
|
f95c89 |
|
|
|
f95c89 |
if (!bp->bnapi) {
|
|
|
f95c89 |
j += bnxt_get_num_ring_stats(bp) + BNXT_NUM_SW_FUNC_STATS;
|
|
|
f95c89 |
@@ -609,6 +624,7 @@
|
|
|
f95c89 |
static void bnxt_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
|
|
|
f95c89 |
{
|
|
|
f95c89 |
struct bnxt *bp = netdev_priv(dev);
|
|
|
f95c89 |
+ static const char * const *str;
|
|
|
f95c89 |
u32 i, j, num_str;
|
|
|
f95c89 |
|
|
|
f95c89 |
switch (stringset) {
|
|
|
f95c89 |
@@ -623,10 +639,15 @@
|
|
|
f95c89 |
if (!BNXT_SUPPORTS_TPA(bp))
|
|
|
f95c89 |
goto skip_tpa_stats;
|
|
|
f95c89 |
|
|
|
f95c89 |
- num_str = ARRAY_SIZE(bnxt_ring_tpa_stats_str);
|
|
|
f95c89 |
+ if (bp->max_tpa_v2) {
|
|
|
f95c89 |
+ num_str = ARRAY_SIZE(bnxt_ring_tpa2_stats_str);
|
|
|
f95c89 |
+ str = bnxt_ring_tpa2_stats_str;
|
|
|
f95c89 |
+ } else {
|
|
|
f95c89 |
+ num_str = ARRAY_SIZE(bnxt_ring_tpa_stats_str);
|
|
|
f95c89 |
+ str = bnxt_ring_tpa_stats_str;
|
|
|
f95c89 |
+ }
|
|
|
f95c89 |
for (j = 0; j < num_str; j++) {
|
|
|
f95c89 |
- sprintf(buf, "[%d]: %s", i,
|
|
|
f95c89 |
- bnxt_ring_tpa_stats_str[j]);
|
|
|
f95c89 |
+ sprintf(buf, "[%d]: %s", i, str[j]);
|
|
|
f95c89 |
buf += ETH_GSTRING_LEN;
|
|
|
f95c89 |
}
|
|
|
f95c89 |
skip_tpa_stats:
|