|SUCCESS| net/bnxt: fix memset size mismatch in Tx queue start
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Fri Apr 24 23:48:26 CEST 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/163279
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-04-24
Reviewing the patch for correctness, coding style, and API requirements.
git sha: dd0191d5e70d
Author: Denis Lyulin <lyulin.2003 at mail.ru>
Subject: [PATCH] net/bnxt: fix memset size mismatch in Tx queue start
Summary: When the tx_queue is started, previous stats are reset. For
tpa_v2 and P7, extended stats structure is used: `struct
bnxt_ring_stats_ext`, so passing wrong size to memset makes not all stats
to be reset. This commit sets correct size of the structure passed to
memset when zeroing-out previous stats.
> diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
> index 27758898b0..b6ad37f872 100644
> --- a/drivers/net/bnxt/bnxt_txr.c
> +++ b/drivers/net/bnxt/bnxt_txr.c
> @@ -729,7 +729,7 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
> */
> if (BNXT_TPA_V2_P7(bp))
> memset(&bp->prev_tx_ring_stats_ext[tx_queue_id], 0,
> - sizeof(struct bnxt_ring_stats));
> + sizeof(struct bnxt_ring_stats_ext));
> else
> memset(&bp->prev_tx_ring_stats[tx_queue_id], 0,
> sizeof(struct bnxt_ring_stats));
The fix looks correct. The code is resetting extended stats but was using
the base structure size. This would result in partial zeroing of the
extended stats structure when BNXT_TPA_V2_P7() is true.
However, I need to verify the indexing safety. The code uses
bp->prev_tx_ring_stats_ext[tx_queue_id] without bounds checking in this
function. Can bnxt_tx_queue_start() be called with a tx_queue_id that
exceeds the allocated size of bp->prev_tx_ring_stats_ext[]?
Earlier in the function there should be validation of tx_queue_id against
the configured queue count. Can you confirm that tx_queue_id is validated
before this memset call?
Also, for consistency with DPDK coding style, the indentation of the
sizeof argument should be verified. The existing code and the fix both
appear to align the sizeof properly with the opening parenthesis, which
looks correct.
More information about the test-report
mailing list