From bf09d80999c2c82dcf10c40cf9408a106d37ad97 Mon Sep 17 00:00:00 2001 From: Joachim Foerster Date: Wed, 17 Aug 2022 13:13:43 +0200 Subject: [PATCH 1/4] utils/Makefile: clean: Fix, also call target clean on libmqnic directory Signed-off-by: Joachim Foerster --- utils/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/Makefile b/utils/Makefile index ba95285a8..0fe8f4469 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -59,6 +59,7 @@ clean: rm -f $(BIN) rm -f *.o rm -f .*.d + $(MAKE) -C $(dir $(LIBMQNIC))/ $@ -include $(wildcard .*.d) From af22f5a43cbcf545db8853b506e2b9297e502a21 Mon Sep 17 00:00:00 2001 From: Joachim Foerster Date: Tue, 6 Sep 2022 09:49:37 +0200 Subject: [PATCH 2/4] utils/.gitignore: Minor, add mqnic-xcvr Signed-off-by: Joachim Foerster --- utils/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/.gitignore b/utils/.gitignore index 5554eb4e9..dde5a2302 100644 --- a/utils/.gitignore +++ b/utils/.gitignore @@ -2,4 +2,5 @@ mqnic-config mqnic-bmc mqnic-dump mqnic-fw +mqnic-xcvr perout From 3a9401d02b17055027b77e0c9c3a047f3b6dadd5 Mon Sep 17 00:00:00 2001 From: Joachim Foerster Date: Tue, 6 Sep 2022 09:49:57 +0200 Subject: [PATCH 3/4] lib/mqnic/.gitignore: Minor, add libmqnic.a Signed-off-by: Joachim Foerster --- lib/mqnic/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/mqnic/.gitignore diff --git a/lib/mqnic/.gitignore b/lib/mqnic/.gitignore new file mode 100644 index 000000000..36f087857 --- /dev/null +++ b/lib/mqnic/.gitignore @@ -0,0 +1 @@ +libmqnic.a From 12a90c6b71384e2b4cded43b8e4e4e6e687c716b Mon Sep 17 00:00:00 2001 From: Joachim Foerster Date: Fri, 14 Oct 2022 15:36:36 +0200 Subject: [PATCH 4/4] modules/mqnic: Export existing dropped_packets counter per TX ring to netdev statistics Signed-off-by: Joachim Foerster --- modules/mqnic/mqnic_netdev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/mqnic/mqnic_netdev.c b/modules/mqnic/mqnic_netdev.c index 0bea67b69..3d6cccbbd 100644 --- a/modules/mqnic/mqnic_netdev.c +++ b/modules/mqnic/mqnic_netdev.c @@ -230,6 +230,7 @@ void mqnic_update_stats(struct net_device *ndev) { struct mqnic_priv *priv = netdev_priv(ndev); unsigned long packets, bytes; + unsigned long dropped; int k; if (unlikely(!priv->port_up)) @@ -237,25 +238,31 @@ void mqnic_update_stats(struct net_device *ndev) packets = 0; bytes = 0; + dropped = 0; for (k = 0; k < priv->rx_queue_count; k++) { const struct mqnic_ring *ring = priv->rx_ring[k]; packets += READ_ONCE(ring->packets); bytes += READ_ONCE(ring->bytes); + dropped += READ_ONCE(ring->dropped_packets); } ndev->stats.rx_packets = packets; ndev->stats.rx_bytes = bytes; + ndev->stats.rx_dropped = dropped; packets = 0; bytes = 0; + dropped = 0; for (k = 0; k < priv->tx_queue_count; k++) { const struct mqnic_ring *ring = priv->tx_ring[k]; packets += READ_ONCE(ring->packets); bytes += READ_ONCE(ring->bytes); + dropped += READ_ONCE(ring->dropped_packets); } ndev->stats.tx_packets = packets; ndev->stats.tx_bytes = bytes; + ndev->stats.tx_dropped = dropped; } static void mqnic_get_stats64(struct net_device *ndev,