You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
134 lines
5.2 KiB
134 lines
5.2 KiB
From 8b0e108114e05a669dfea6bfdb928a52779e204b Mon Sep 17 00:00:00 2001
|
|
From: Igor Russkikh <irusskik@redhat.com>
|
|
Date: Fri, 6 Nov 2020 18:38:25 -0500
|
|
Subject: [PATCH 128/139] [netdrv] net: atlantic: additional per-queue stats
|
|
|
|
Message-id: <1604687916-15087-129-git-send-email-irusskik@redhat.com>
|
|
Patchwork-id: 338553
|
|
Patchwork-instance: patchwork
|
|
O-Subject: [RHEL8.4 BZ 1857861 128/139] net: atlantic: additional per-queue stats
|
|
Bugzilla: 1857861
|
|
RH-Acked-by: David Arcari <darcari@redhat.com>
|
|
RH-Acked-by: John Linville <linville@redhat.com>
|
|
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
|
|
|
|
Bugzilla: http://bugzilla.redhat.com/1857861
|
|
|
|
commit aa7e17a3e35a6e3fbf4ab2055a64097efcd09310
|
|
Author: Dmitry Bogdanov <dbogdanov@marvell.com>
|
|
Date: Mon Jul 20 21:32:37 2020 +0300
|
|
|
|
net: atlantic: additional per-queue stats
|
|
|
|
This patch adds additional per-queue stats, these could
|
|
be useful for debugging and diagnostics.
|
|
|
|
Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com>
|
|
Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
|
|
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
|
|
Signed-off-by: Igor Russkikh <irusskik@redhat.com>
|
|
|
|
Cc: David Arcari <darcari@redhat.com>
|
|
Cc: Igor Russkikh <irusskik@redhat.com>
|
|
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
---
|
|
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c | 3 +++
|
|
drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 14 ++++++++++++++
|
|
drivers/net/ethernet/aquantia/atlantic/aq_ring.h | 3 +++
|
|
drivers/net/ethernet/aquantia/atlantic/aq_vec.c | 3 +++
|
|
4 files changed, 23 insertions(+)
|
|
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
|
|
index 458491ef24b9..4f7a2ff4da85 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
|
|
@@ -93,6 +93,9 @@ static const char * const aq_ethtool_queue_rx_stat_names[] = {
|
|
"%sQueue[%d] InJumboPackets",
|
|
"%sQueue[%d] InLroPackets",
|
|
"%sQueue[%d] InErrors",
|
|
+ "%sQueue[%d] AllocFails",
|
|
+ "%sQueue[%d] SkbAllocFails",
|
|
+ "%sQueue[%d] Polls",
|
|
};
|
|
|
|
static const char * const aq_ethtool_queue_tx_stat_names[] = {
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
|
|
index b51ab2dbf6fe..4f913658eea4 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
|
|
@@ -94,6 +94,11 @@ static int aq_get_rxpages(struct aq_ring_s *self, struct aq_ring_buff_s *rxbuf,
|
|
if (!rxbuf->rxdata.page) {
|
|
ret = aq_get_rxpage(&rxbuf->rxdata, order,
|
|
aq_nic_get_dev(self->aq_nic));
|
|
+ if (ret) {
|
|
+ u64_stats_update_begin(&self->stats.rx.syncp);
|
|
+ self->stats.rx.alloc_fails++;
|
|
+ u64_stats_update_end(&self->stats.rx.syncp);
|
|
+ }
|
|
return ret;
|
|
}
|
|
|
|
@@ -414,6 +419,9 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
|
|
skb = build_skb(aq_buf_vaddr(&buff->rxdata),
|
|
AQ_CFG_RX_FRAME_MAX);
|
|
if (unlikely(!skb)) {
|
|
+ u64_stats_update_begin(&self->stats.rx.syncp);
|
|
+ self->stats.rx.skb_alloc_fails++;
|
|
+ u64_stats_update_end(&self->stats.rx.syncp);
|
|
err = -ENOMEM;
|
|
goto err_exit;
|
|
}
|
|
@@ -427,6 +435,9 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
|
|
} else {
|
|
skb = napi_alloc_skb(napi, AQ_CFG_RX_HDR_SIZE);
|
|
if (unlikely(!skb)) {
|
|
+ u64_stats_update_begin(&self->stats.rx.syncp);
|
|
+ self->stats.rx.skb_alloc_fails++;
|
|
+ u64_stats_update_end(&self->stats.rx.syncp);
|
|
err = -ENOMEM;
|
|
goto err_exit;
|
|
}
|
|
@@ -599,6 +610,9 @@ unsigned int aq_ring_fill_stats_data(struct aq_ring_s *self, u64 *data)
|
|
data[++count] = self->stats.rx.jumbo_packets;
|
|
data[++count] = self->stats.rx.lro_packets;
|
|
data[++count] = self->stats.rx.errors;
|
|
+ data[++count] = self->stats.rx.alloc_fails;
|
|
+ data[++count] = self->stats.rx.skb_alloc_fails;
|
|
+ data[++count] = self->stats.rx.polls;
|
|
} while (u64_stats_fetch_retry_irq(&self->stats.rx.syncp, start));
|
|
} else {
|
|
/* This data should mimic aq_ethtool_queue_tx_stat_names structure */
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h
|
|
index c92c3a0651a9..93659e58f1ce 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h
|
|
@@ -95,6 +95,9 @@ struct aq_ring_stats_rx_s {
|
|
u64 bytes;
|
|
u64 lro_packets;
|
|
u64 jumbo_packets;
|
|
+ u64 alloc_fails;
|
|
+ u64 skb_alloc_fails;
|
|
+ u64 polls;
|
|
u64 pg_losts;
|
|
u64 pg_flips;
|
|
u64 pg_reuses;
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c
|
|
index b008d12e923a..d281322d7dd2 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c
|
|
@@ -45,6 +45,9 @@ static int aq_vec_poll(struct napi_struct *napi, int budget)
|
|
} else {
|
|
for (i = 0U, ring = self->ring[0];
|
|
self->tx_rings > i; ++i, ring = self->ring[i]) {
|
|
+ u64_stats_update_begin(&ring[AQ_VEC_RX_ID].stats.rx.syncp);
|
|
+ ring[AQ_VEC_RX_ID].stats.rx.polls++;
|
|
+ u64_stats_update_end(&ring[AQ_VEC_RX_ID].stats.rx.syncp);
|
|
if (self->aq_hw_ops->hw_ring_tx_head_update) {
|
|
err = self->aq_hw_ops->hw_ring_tx_head_update(
|
|
self->aq_hw,
|
|
--
|
|
2.13.6
|
|
|