[PATCH v1 04/25] net/ntnic: remove extra memset

Oleksandr Kolomeiets okl-plv at napatech.com
Wed Apr 30 15:48:16 CEST 2025


The function rte_eth_stats_get fills the structure stats with zeroes
before it eventually calls dpdk_stats_collect.
That makes the call to memset inside dpdk_stats_collect redundant.

Signed-off-by: Oleksandr Kolomeiets <okl-plv at napatech.com>
---
 drivers/net/ntnic/ntnic_ethdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c
index 9a6667b3be..f9644b5826 100644
--- a/drivers/net/ntnic/ntnic_ethdev.c
+++ b/drivers/net/ntnic/ntnic_ethdev.c
@@ -200,8 +200,6 @@ static int dpdk_stats_collect(struct pmd_internals *internals, struct rte_eth_st
 	 */
 	ntnic_filter_ops->poll_statistics(internals);
 
-	memset(stats, 0, sizeof(*stats));
-
 	for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS && i < internals->nb_rx_queues; i++) {
 		stats->q_ipackets[i] = internals->rxq_scg[i].rx_pkts;
 		stats->q_ibytes[i] = internals->rxq_scg[i].rx_bytes;
-- 
2.47.1



More information about the dev mailing list