cxgb4: Fix pause frame count in t4_get_port_stats
authorGanesh Goudar <ganeshgr@chelsio.com>
Mon, 4 Sep 2017 05:47:36 +0000 (11:17 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Sep 2017 21:27:50 +0000 (14:27 -0700)
MPS_STAT_CTL[CountPauseStatTx] and MPS_STAT_CTL[CountPauseStatRx]
only control whether or not Pause Frames will be counted as part
of the 64-Byte Tx/Rx Frame counters.  These bits do not control
whether Pause Frames are counted in the Total Tx/Rx Frames/Bytes
counters.

Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

index 08624db8a6e9b4f0b19f8977cd7fbec4f9cf3a10..42df1d8c7674302873be7af64efb6d3aa2888a0e 100644 (file)
@@ -5987,10 +5987,8 @@ void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p)
        p->tx_ppp7             = GET_STAT(TX_PORT_PPP7);
 
        if (CHELSIO_CHIP_VERSION(adap->params.chip) >= CHELSIO_T5) {
-               if (stat_ctl & COUNTPAUSESTATTX_F) {
-                       p->tx_frames -= p->tx_pause;
-                       p->tx_octets -= p->tx_pause * 64;
-               }
+               if (stat_ctl & COUNTPAUSESTATTX_F)
+                       p->tx_frames_64 -= p->tx_pause;
                if (stat_ctl & COUNTPAUSEMCTX_F)
                        p->tx_mcast_frames -= p->tx_pause;
        }
@@ -6023,10 +6021,8 @@ void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p)
        p->rx_ppp7             = GET_STAT(RX_PORT_PPP7);
 
        if (CHELSIO_CHIP_VERSION(adap->params.chip) >= CHELSIO_T5) {
-               if (stat_ctl & COUNTPAUSESTATRX_F) {
-                       p->rx_frames -= p->rx_pause;
-                       p->rx_octets -= p->rx_pause * 64;
-               }
+               if (stat_ctl & COUNTPAUSESTATRX_F)
+                       p->rx_frames_64 -= p->rx_pause;
                if (stat_ctl & COUNTPAUSEMCRX_F)
                        p->rx_mcast_frames -= p->rx_pause;
        }