diff options
author | jhb <jhb@FreeBSD.org> | 2016-12-05 23:55:53 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2016-12-05 23:55:53 +0000 |
commit | d712063b88e782be19e367065bc5289da436795b (patch) | |
tree | 42237541b6bb74f5ec9b37230fbfc7999ac43e09 | |
parent | 27a52ba66be52e63c6e45e7c166148773b53f87d (diff) | |
download | FreeBSD-src-d712063b88e782be19e367065bc5289da436795b.zip FreeBSD-src-d712063b88e782be19e367065bc5289da436795b.tar.gz |
MFC 308066: cxgbe(4): Accurate statistics for all chip settings.
There are 4 independent knobs in T5+ chips to include or exclude PAUSE
frames from the "total frames" and "multicast frames" counters in either
direction. This change lets the driver deal with any combination of
these settings.
-rw-r--r-- | sys/dev/cxgbe/common/t4_hw.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index e0160e6..27d0227 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -5876,10 +5876,13 @@ void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) p->tx_ppp6 = GET_STAT(TX_PORT_PPP6); p->tx_ppp7 = GET_STAT(TX_PORT_PPP7); - if (stat_ctl & F_COUNTPAUSESTATTX) { - p->tx_frames -= p->tx_pause; - p->tx_octets -= p->tx_pause * 64; - p->tx_mcast_frames -= p->tx_pause; + if (chip_id(adap) >= CHELSIO_T5) { + if (stat_ctl & F_COUNTPAUSESTATTX) { + p->tx_frames -= p->tx_pause; + p->tx_octets -= p->tx_pause * 64; + } + if (stat_ctl & F_COUNTPAUSEMCTX) + p->tx_mcast_frames -= p->tx_pause; } p->rx_pause = GET_STAT(RX_PORT_PAUSE); @@ -5910,10 +5913,13 @@ void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) p->rx_ppp6 = GET_STAT(RX_PORT_PPP6); p->rx_ppp7 = GET_STAT(RX_PORT_PPP7); - if (stat_ctl & F_COUNTPAUSESTATRX) { - p->rx_frames -= p->rx_pause; - p->rx_octets -= p->rx_pause * 64; - p->rx_mcast_frames -= p->rx_pause; + if (chip_id(adap) >= CHELSIO_T5) { + if (stat_ctl & F_COUNTPAUSESTATRX) { + p->rx_frames -= p->rx_pause; + p->rx_octets -= p->rx_pause * 64; + } + if (stat_ctl & F_COUNTPAUSEMCRX) + p->rx_mcast_frames -= p->rx_pause; } p->rx_ovflow0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_MAC_DROP_FRAME) : 0; |