[v2,04/26] net/ntnic: remove extra memset

Message ID 20250505071309.586015-5-okl-plv@napatech.com (mailing list archive)
State Awaiting Upstream
Delegated to: Stephen Hemminger
Headers
Series net/ntnic: fixes and improvements |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Oleksandr Kolomeiets May 5, 2025, 7:12 a.m. UTC
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@napatech.com>
---
 drivers/net/ntnic/ntnic_ethdev.c | 2 --
 1 file changed, 2 deletions(-)
  

Patch

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;