[PATCH] net/mana: fix stats for txq bytes sent

longli at linuxonhyperv.com longli at linuxonhyperv.com
Fri Jul 21 00:42:41 CEST 2023


From: Long Li <longli at microsoft.com>

Bytes should be calculated using the packet length, not the mbuf segment
data length.

Fixes: 517ed6e2d590 ("net/mana: add basic driver with build environment")
Cc: stable at dpdk.org
Signed-off-by: Long Li <longli at microsoft.com>
---
 drivers/net/mana/tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mana/tx.c b/drivers/net/mana/tx.c
index 5947efbe8d..11ba2ee1ac 100644
--- a/drivers/net/mana/tx.c
+++ b/drivers/net/mana/tx.c
@@ -201,7 +201,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		if (!desc->pkt) {
 			DP_LOG(ERR, "mana_txq_desc has a NULL pkt");
 		} else {
-			txq->stats.bytes += desc->pkt->data_len;
+			txq->stats.bytes += desc->pkt->pkt_len;
 			rte_pktmbuf_free(desc->pkt);
 		}
 
-- 
2.34.1



More information about the stable mailing list