Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci/ixgbe Make mailbox statistic counters evcnt(9).
details: https://anonhg.NetBSD.org/src/rev/3472fe5beeb7
branches: trunk
changeset: 356570:3472fe5beeb7
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Tue Oct 03 02:55:37 2017 +0000
description:
Make mailbox statistic counters evcnt(9).
Example:
> ixv0 message TXs 23 0 misc
> ixv0 message RXs 2911 0 misc
> ixv0 ACKs 23 0 misc
> ixv0 REQs 22 0 misc
> ixv0 RSTs 0 0 misc
diffstat:
sys/dev/pci/ixgbe/ixgbe_mbx.c | 42 +++++++++++++++++++++---------------------
sys/dev/pci/ixgbe/ixgbe_type.h | 14 +++++++-------
sys/dev/pci/ixgbe/ixv.c | 24 +++++++++++++++++++++++-
3 files changed, 51 insertions(+), 29 deletions(-)
diffs (218 lines):
diff -r bd38b5d41c2b -r 3472fe5beeb7 sys/dev/pci/ixgbe/ixgbe_mbx.c
--- a/sys/dev/pci/ixgbe/ixgbe_mbx.c Tue Oct 03 01:43:03 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_mbx.c Tue Oct 03 02:55:37 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_mbx.c,v 1.7 2017/08/30 08:49:18 msaitoh Exp $ */
+/* $NetBSD: ixgbe_mbx.c,v 1.8 2017/10/03 02:55:37 msaitoh Exp $ */
/******************************************************************************
@@ -231,7 +231,7 @@
if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) {
ret_val = IXGBE_SUCCESS;
- hw->mbx.stats.reqs++;
+ hw->mbx.stats.reqs.ev_count++;
}
return ret_val;
@@ -253,7 +253,7 @@
if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFACK)) {
ret_val = IXGBE_SUCCESS;
- hw->mbx.stats.acks++;
+ hw->mbx.stats.acks.ev_count++;
}
return ret_val;
@@ -276,7 +276,7 @@
if (!ixgbe_check_for_bit_vf(hw, (IXGBE_VFMAILBOX_RSTD |
IXGBE_VFMAILBOX_RSTI))) {
ret_val = IXGBE_SUCCESS;
- hw->mbx.stats.rsts++;
+ hw->mbx.stats.rsts.ev_count++;
}
return ret_val;
@@ -337,7 +337,7 @@
IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]);
/* update stats */
- hw->mbx.stats.msgs_tx++;
+ hw->mbx.stats.msgs_tx.ev_count++;
/* Drop VFU and interrupt the PF to tell it a message has been sent */
IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ);
@@ -377,7 +377,7 @@
IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_ACK);
/* update stats */
- hw->mbx.stats.msgs_rx++;
+ hw->mbx.stats.msgs_rx.ev_count++;
out_no_read:
return ret_val;
@@ -408,11 +408,11 @@
mbx->ops.check_for_ack = ixgbe_check_for_ack_vf;
mbx->ops.check_for_rst = ixgbe_check_for_rst_vf;
- mbx->stats.msgs_tx = 0;
- mbx->stats.msgs_rx = 0;
- mbx->stats.reqs = 0;
- mbx->stats.acks = 0;
- mbx->stats.rsts = 0;
+ mbx->stats.msgs_tx.ev_count = 0;
+ mbx->stats.msgs_rx.ev_count = 0;
+ mbx->stats.reqs.ev_count = 0;
+ mbx->stats.acks.ev_count = 0;
+ mbx->stats.rsts.ev_count = 0;
}
static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index)
@@ -446,7 +446,7 @@
if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFREQ_VF1 << vf_bit,
index)) {
ret_val = IXGBE_SUCCESS;
- hw->mbx.stats.reqs++;
+ hw->mbx.stats.reqs.ev_count++;
}
return ret_val;
@@ -470,7 +470,7 @@
if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFACK_VF1 << vf_bit,
index)) {
ret_val = IXGBE_SUCCESS;
- hw->mbx.stats.acks++;
+ hw->mbx.stats.acks.ev_count++;
}
return ret_val;
@@ -509,7 +509,7 @@
if (vflre & (1 << vf_shift)) {
ret_val = IXGBE_SUCCESS;
IXGBE_WRITE_REG(hw, IXGBE_VFLREC(reg_offset), (1 << vf_shift));
- hw->mbx.stats.rsts++;
+ hw->mbx.stats.rsts.ev_count++;
}
return ret_val;
@@ -578,7 +578,7 @@
IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_STS);
/* update stats */
- hw->mbx.stats.msgs_tx++;
+ hw->mbx.stats.msgs_tx.ev_count++;
out_no_write:
return ret_val;
@@ -617,7 +617,7 @@
IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_ACK);
/* update stats */
- hw->mbx.stats.msgs_rx++;
+ hw->mbx.stats.msgs_rx.ev_count++;
out_no_read:
return ret_val;
@@ -653,9 +653,9 @@
mbx->ops.check_for_ack = ixgbe_check_for_ack_pf;
mbx->ops.check_for_rst = ixgbe_check_for_rst_pf;
- mbx->stats.msgs_tx = 0;
- mbx->stats.msgs_rx = 0;
- mbx->stats.reqs = 0;
- mbx->stats.acks = 0;
- mbx->stats.rsts = 0;
+ mbx->stats.msgs_tx.ev_count = 0;
+ mbx->stats.msgs_rx.ev_count = 0;
+ mbx->stats.reqs.ev_count = 0;
+ mbx->stats.acks.ev_count = 0;
+ mbx->stats.rsts.ev_count = 0;
}
diff -r bd38b5d41c2b -r 3472fe5beeb7 sys/dev/pci/ixgbe/ixgbe_type.h
--- a/sys/dev/pci/ixgbe/ixgbe_type.h Tue Oct 03 01:43:03 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_type.h Tue Oct 03 02:55:37 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_type.h,v 1.27 2017/09/14 09:25:58 msaitoh Exp $ */
+/* $NetBSD: ixgbe_type.h,v 1.28 2017/10/03 02:55:37 msaitoh Exp $ */
/******************************************************************************
@@ -4137,12 +4137,12 @@
};
struct ixgbe_mbx_stats {
- u32 msgs_tx;
- u32 msgs_rx;
-
- u32 acks;
- u32 reqs;
- u32 rsts;
+ struct evcnt msgs_tx;
+ struct evcnt msgs_rx;
+
+ struct evcnt acks;
+ struct evcnt reqs;
+ struct evcnt rsts;
};
struct ixgbe_mbx_info {
diff -r bd38b5d41c2b -r 3472fe5beeb7 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c Tue Oct 03 01:43:03 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c Tue Oct 03 02:55:37 2017 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.66 2017/09/27 10:31:29 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.67 2017/10/03 02:55:37 msaitoh Exp $*/
/******************************************************************************
@@ -547,6 +547,7 @@
ixv_detach(device_t dev, int flags)
{
struct adapter *adapter = device_private(dev);
+ struct ixgbe_hw *hw = &adapter->hw;
struct ix_queue *que = adapter->queues;
struct tx_ring *txr = adapter->tx_rings;
struct rx_ring *rxr = adapter->rx_rings;
@@ -649,6 +650,13 @@
evcnt_detach(&stats->vfgotc);
evcnt_detach(&stats->vfgptc);
+ /* Mailbox Stats */
+ evcnt_detach(&hw->mbx.stats.msgs_tx);
+ evcnt_detach(&hw->mbx.stats.msgs_rx);
+ evcnt_detach(&hw->mbx.stats.acks);
+ evcnt_detach(&hw->mbx.stats.reqs);
+ evcnt_detach(&hw->mbx.stats.rsts);
+
ixgbe_free_transmit_structures(adapter);
ixgbe_free_receive_structures(adapter);
free(adapter->queues, M_DEVBUF);
@@ -2083,6 +2091,7 @@
struct tx_ring *txr = adapter->tx_rings;
struct rx_ring *rxr = adapter->rx_rings;
struct ixgbevf_hw_stats *stats = &adapter->stats.vf;
+ struct ixgbe_hw *hw = &adapter->hw;
const struct sysctlnode *rnode;
struct sysctllog **log = &adapter->sysctllog;
const char *xname = device_xname(dev);
@@ -2243,6 +2252,19 @@
xname, "Good Packets Transmitted");
evcnt_attach_dynamic(&stats->vfgotc, EVCNT_TYPE_MISC, NULL,
xname, "Good Octets Transmitted");
+
+ /* Mailbox Stats */
+ evcnt_attach_dynamic(&hw->mbx.stats.msgs_tx, EVCNT_TYPE_MISC, NULL,
+ xname, "message TXs");
+ evcnt_attach_dynamic(&hw->mbx.stats.msgs_rx, EVCNT_TYPE_MISC, NULL,
+ xname, "message RXs");
+ evcnt_attach_dynamic(&hw->mbx.stats.acks, EVCNT_TYPE_MISC, NULL,
+ xname, "ACKs");
+ evcnt_attach_dynamic(&hw->mbx.stats.reqs, EVCNT_TYPE_MISC, NULL,
+ xname, "REQs");
+ evcnt_attach_dynamic(&hw->mbx.stats.rsts, EVCNT_TYPE_MISC, NULL,
+ xname, "RSTs");
+
} /* ixv_add_stats_sysctls */
/************************************************************************
Home |
Main Index |
Thread Index |
Old Index