From: Rahul Lakkireddy Date: Fri, 29 Jun 2018 19:23:55 +0000 (+0530) Subject: net/cxgbevf: add missing Tx byte counters X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d67692bacff307ef0748b1fcd0b155ee6c82f469;p=dpdk.git net/cxgbevf: add missing Tx byte counters Fixes: a0a344a8f728 ("net/cxgbe: add VF port statistics") Cc: stable@dpdk.org Signed-off-by: Rahul Lakkireddy --- diff --git a/drivers/net/cxgbe/base/t4_regs.h b/drivers/net/cxgbe/base/t4_regs.h index cbaf415fab..6f872edc25 100644 --- a/drivers/net/cxgbe/base/t4_regs.h +++ b/drivers/net/cxgbe/base/t4_regs.h @@ -799,8 +799,11 @@ #define A_MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_L 0x96b8 #define A_MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_H 0x96bc +#define A_MPS_VF_STAT_TX_VF_BCAST_BYTES_L 0x80 #define A_MPS_VF_STAT_TX_VF_BCAST_FRAMES_L 0x88 +#define A_MPS_VF_STAT_TX_VF_MCAST_BYTES_L 0x90 #define A_MPS_VF_STAT_TX_VF_MCAST_FRAMES_L 0x98 +#define A_MPS_VF_STAT_TX_VF_UCAST_BYTES_L 0xa0 #define A_MPS_VF_STAT_TX_VF_UCAST_FRAMES_L 0xa8 #define A_MPS_VF_STAT_TX_VF_DROP_FRAMES_L 0xb0 #define A_MPS_VF_STAT_RX_VF_BCAST_FRAMES_L 0xd0 diff --git a/drivers/net/cxgbe/base/t4vf_hw.c b/drivers/net/cxgbe/base/t4vf_hw.c index 9fd0b87917..d96456bbe4 100644 --- a/drivers/net/cxgbe/base/t4vf_hw.c +++ b/drivers/net/cxgbe/base/t4vf_hw.c @@ -683,6 +683,9 @@ static int t4vf_get_port_stats_fw(struct adapter *adapter, int pidx, /* * Translate firmware statistics into host native statistics. */ + p->tx_octets = be64_to_cpu(fwstats.tx_bcast_bytes) + + be64_to_cpu(fwstats.tx_mcast_bytes) + + be64_to_cpu(fwstats.tx_ucast_bytes); p->tx_bcast_frames = be64_to_cpu(fwstats.tx_bcast_frames); p->tx_mcast_frames = be64_to_cpu(fwstats.tx_mcast_frames); p->tx_ucast_frames = be64_to_cpu(fwstats.tx_ucast_frames); @@ -722,6 +725,9 @@ void t4vf_get_port_stats(struct adapter *adapter, int pidx, #define GET_STAT(name) \ t4_read_reg64(adapter, \ T4VF_MPS_BASE_ADDR + A_MPS_VF_STAT_##name##_L) + p->tx_octets = GET_STAT(TX_VF_BCAST_BYTES) + + GET_STAT(TX_VF_MCAST_BYTES) + + GET_STAT(TX_VF_UCAST_BYTES); p->tx_bcast_frames = GET_STAT(TX_VF_BCAST_FRAMES); p->tx_mcast_frames = GET_STAT(TX_VF_MCAST_FRAMES); p->tx_ucast_frames = GET_STAT(TX_VF_UCAST_FRAMES); diff --git a/drivers/net/cxgbe/cxgbevf_ethdev.c b/drivers/net/cxgbe/cxgbevf_ethdev.c index b4770e0c59..3b32ca9d44 100644 --- a/drivers/net/cxgbe/cxgbevf_ethdev.c +++ b/drivers/net/cxgbe/cxgbevf_ethdev.c @@ -50,6 +50,7 @@ static int cxgbevf_dev_stats_get(struct rte_eth_dev *eth_dev, /* TX Stats */ eth_stats->opackets = ps.tx_bcast_frames + ps.tx_mcast_frames + ps.tx_ucast_frames; + eth_stats->obytes = ps.tx_octets; eth_stats->oerrors = ps.tx_drop; for (i = 0; i < pi->n_rx_qsets; i++) {