net/ena: fix counting of per-queue number of Tx pkts

Message ID 1557832286-15487-1-git-send-email-rk@semihalf.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/ena: fix counting of per-queue number of Tx pkts |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Rafal Kozik May 14, 2019, 11:11 a.m. UTC
  Instead of counting number of used NIC Tx bufs just count number
of Tx packets.

Fixes: 45b6d86184fc ("net/ena: add per-queue software counters stats")
Cc: stable@dpdk.org

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
---
 drivers/net/ena/ena_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit June 6, 2019, 2:33 p.m. UTC | #1
On 5/14/2019 12:11 PM, Rafal Kozik wrote:
> Instead of counting number of used NIC Tx bufs just count number
> of Tx packets.
> 
> Fixes: 45b6d86184fc ("net/ena: add per-queue software counters stats")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Rafal Kozik <rk@semihalf.com>
> Acked-by: Michal Krawczyk <mk@semihalf.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 3eb3816..178c230 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2391,7 +2391,7 @@  static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		tx_info->tx_descs = nb_hw_desc;
 
 		next_to_use++;
-		tx_ring->tx_stats.cnt += tx_info->num_of_bufs;
+		tx_ring->tx_stats.cnt++;
 		tx_ring->tx_stats.bytes += total_length;
 	}
 	tx_ring->tx_stats.available_desc =