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.
This commit is contained in:
parent
aee4341421
commit
041e5aed63
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=308066
@ -5870,10 +5870,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);
|
||||
@ -5904,10 +5907,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;
|
||||
|
Loading…
Reference in New Issue
Block a user