mirror of
https://github.com/corundum/corundum.git
synced 2025-01-30 08:32:52 +08:00
commit
6ca5fbfd82
1
lib/mqnic/.gitignore
vendored
Normal file
1
lib/mqnic/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
libmqnic.a
|
@ -354,35 +354,42 @@ void mqnic_update_stats(struct net_device *ndev)
|
|||||||
struct radix_tree_iter iter;
|
struct radix_tree_iter iter;
|
||||||
void **slot;
|
void **slot;
|
||||||
unsigned long packets, bytes;
|
unsigned long packets, bytes;
|
||||||
|
unsigned long dropped;
|
||||||
|
|
||||||
if (unlikely(!priv->port_up))
|
if (unlikely(!priv->port_up))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
packets = 0;
|
packets = 0;
|
||||||
bytes = 0;
|
bytes = 0;
|
||||||
|
dropped = 0;
|
||||||
down_read(&priv->rxq_table_sem);
|
down_read(&priv->rxq_table_sem);
|
||||||
radix_tree_for_each_slot(slot, &priv->rxq_table, &iter, 0) {
|
radix_tree_for_each_slot(slot, &priv->rxq_table, &iter, 0) {
|
||||||
const struct mqnic_ring *q = (struct mqnic_ring *)*slot;
|
const struct mqnic_ring *q = (struct mqnic_ring *)*slot;
|
||||||
|
|
||||||
packets += READ_ONCE(q->packets);
|
packets += READ_ONCE(q->packets);
|
||||||
bytes += READ_ONCE(q->bytes);
|
bytes += READ_ONCE(q->bytes);
|
||||||
|
dropped += READ_ONCE(q->dropped_packets);
|
||||||
}
|
}
|
||||||
up_read(&priv->rxq_table_sem);
|
up_read(&priv->rxq_table_sem);
|
||||||
ndev->stats.rx_packets = packets;
|
ndev->stats.rx_packets = packets;
|
||||||
ndev->stats.rx_bytes = bytes;
|
ndev->stats.rx_bytes = bytes;
|
||||||
|
ndev->stats.rx_dropped = dropped;
|
||||||
|
|
||||||
packets = 0;
|
packets = 0;
|
||||||
bytes = 0;
|
bytes = 0;
|
||||||
|
dropped = 0;
|
||||||
down_read(&priv->txq_table_sem);
|
down_read(&priv->txq_table_sem);
|
||||||
radix_tree_for_each_slot(slot, &priv->txq_table, &iter, 0) {
|
radix_tree_for_each_slot(slot, &priv->txq_table, &iter, 0) {
|
||||||
const struct mqnic_ring *q = (struct mqnic_ring *)*slot;
|
const struct mqnic_ring *q = (struct mqnic_ring *)*slot;
|
||||||
|
|
||||||
packets += READ_ONCE(q->packets);
|
packets += READ_ONCE(q->packets);
|
||||||
bytes += READ_ONCE(q->bytes);
|
bytes += READ_ONCE(q->bytes);
|
||||||
|
dropped += READ_ONCE(q->dropped_packets);
|
||||||
}
|
}
|
||||||
up_read(&priv->txq_table_sem);
|
up_read(&priv->txq_table_sem);
|
||||||
ndev->stats.tx_packets = packets;
|
ndev->stats.tx_packets = packets;
|
||||||
ndev->stats.tx_bytes = bytes;
|
ndev->stats.tx_bytes = bytes;
|
||||||
|
ndev->stats.tx_dropped = dropped;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mqnic_get_stats64(struct net_device *ndev,
|
static void mqnic_get_stats64(struct net_device *ndev,
|
||||||
|
1
utils/.gitignore
vendored
1
utils/.gitignore
vendored
@ -2,4 +2,5 @@ mqnic-config
|
|||||||
mqnic-bmc
|
mqnic-bmc
|
||||||
mqnic-dump
|
mqnic-dump
|
||||||
mqnic-fw
|
mqnic-fw
|
||||||
|
mqnic-xcvr
|
||||||
perout
|
perout
|
||||||
|
@ -59,6 +59,7 @@ clean:
|
|||||||
rm -f $(BIN)
|
rm -f $(BIN)
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
rm -f .*.d
|
rm -f .*.d
|
||||||
|
$(MAKE) -C $(dir $(LIBMQNIC))/ $@
|
||||||
|
|
||||||
-include $(wildcard .*.d)
|
-include $(wildcard .*.d)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user