1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich 2023-06-25 18:51:12 -07:00
commit 6ca5fbfd82
4 changed files with 10 additions and 0 deletions

1
lib/mqnic/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
libmqnic.a

View File

@ -354,35 +354,42 @@ void mqnic_update_stats(struct net_device *ndev)
struct radix_tree_iter iter;
void **slot;
unsigned long packets, bytes;
unsigned long dropped;
if (unlikely(!priv->port_up))
return;
packets = 0;
bytes = 0;
dropped = 0;
down_read(&priv->rxq_table_sem);
radix_tree_for_each_slot(slot, &priv->rxq_table, &iter, 0) {
const struct mqnic_ring *q = (struct mqnic_ring *)*slot;
packets += READ_ONCE(q->packets);
bytes += READ_ONCE(q->bytes);
dropped += READ_ONCE(q->dropped_packets);
}
up_read(&priv->rxq_table_sem);
ndev->stats.rx_packets = packets;
ndev->stats.rx_bytes = bytes;
ndev->stats.rx_dropped = dropped;
packets = 0;
bytes = 0;
dropped = 0;
down_read(&priv->txq_table_sem);
radix_tree_for_each_slot(slot, &priv->txq_table, &iter, 0) {
const struct mqnic_ring *q = (struct mqnic_ring *)*slot;
packets += READ_ONCE(q->packets);
bytes += READ_ONCE(q->bytes);
dropped += READ_ONCE(q->dropped_packets);
}
up_read(&priv->txq_table_sem);
ndev->stats.tx_packets = packets;
ndev->stats.tx_bytes = bytes;
ndev->stats.tx_dropped = dropped;
}
static void mqnic_get_stats64(struct net_device *ndev,

1
utils/.gitignore vendored
View File

@ -2,4 +2,5 @@ mqnic-config
mqnic-bmc
mqnic-dump
mqnic-fw
mqnic-xcvr
perout

View File

@ -59,6 +59,7 @@ clean:
rm -f $(BIN)
rm -f *.o
rm -f .*.d
$(MAKE) -C $(dir $(LIBMQNIC))/ $@
-include $(wildcard .*.d)