DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/bnxt: fix memset size mismatch in Tx queue start
@ 2026-04-16  9:02 Denis Lyulin
  2026-04-17 16:33 ` Kishore Padmanabha
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Lyulin @ 2026-04-16  9:02 UTC (permalink / raw)
  To: Kishore Padmanabha, Ajit Khaparde, Manish Kurup, Shuanglin Wang,
	Randy Schacher
  Cc: dev, stable, Denis Lyulin

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.

Fixes: dd0191d5e70d ("net/bnxt/tf_ulp: support Thor2 ULP layer")
Cc: shuanglin.wang@broadcom.com
Cc: stable@dpdk.org

Signed-off-by: Denis Lyulin <lyulin.2003@mail.ru>
---
 drivers/net/bnxt/bnxt_txr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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));
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/bnxt: fix memset size mismatch in Tx queue start
  2026-04-16  9:02 [PATCH] net/bnxt: fix memset size mismatch in Tx queue start Denis Lyulin
@ 2026-04-17 16:33 ` Kishore Padmanabha
  0 siblings, 0 replies; 2+ messages in thread
From: Kishore Padmanabha @ 2026-04-17 16:33 UTC (permalink / raw)
  To: Denis Lyulin
  Cc: Ajit Khaparde, Manish Kurup, Shuanglin Wang, Randy Schacher, dev,
	stable


[-- Attachment #1.1: Type: text/plain, Size: 1440 bytes --]

On Thu, Apr 16, 2026 at 5:03 AM Denis Lyulin <lyulin.2003@mail.ru> wrote:

> 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.
>
> Fixes: dd0191d5e70d ("net/bnxt/tf_ulp: support Thor2 ULP layer")
> Cc: shuanglin.wang@broadcom.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Denis Lyulin <lyulin.2003@mail.ru>
>
Acked-by:  Kishore Padmanabha <kishore.padmanabha@broadcom.com>

> ---
>  drivers/net/bnxt/bnxt_txr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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));
> --
> 2.34.1
>
>

[-- Attachment #1.2: Type: text/html, Size: 2687 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5493 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-24  7:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16  9:02 [PATCH] net/bnxt: fix memset size mismatch in Tx queue start Denis Lyulin
2026-04-17 16:33 ` Kishore Padmanabha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox