netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] eth: bnxt: fix several bugs in the bnxt module
@ 2025-02-26  6:18 Taehee Yoo
  2025-02-26  6:18 ` [PATCH net 1/3] eth: bnxt: fix truesize for mb-xdp-pass case Taehee Yoo
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Taehee Yoo @ 2025-02-26  6:18 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, michael.chan, pavan.chebbi,
	andrew+netdev, netdev
  Cc: gospo, somnath.kotur, dw, horms, ap420073

The first fixes setting incorrect skb->truesize.
When xdp-mb prog returns XDP_PASS, skb is allocated and initialized.
Currently, The truesize is calculated as BNXT_RX_PAGE_SIZE *
sinfo->nr_frags, but sinfo->nr_frags is not correct at this moment.
So, it should use num_frags instead of sinfo->nr_frags.

The second fixes kernel panic in the bnxt_queue_mem_alloc().
The bnxt_queue_mem_alloc() accesses rx ring descriptor.
rx ring descriptors are allocated when the interface is up and it's
freed when the interface is down.
So, if bnxt_queue_mem_alloc() is called when the interface is down,
kernel panic occurs.
This patch makes the bnxt_queue_mem_alloc() return -ENETDOWN if rx ring
descriptors are not allocated.

The third patch fix kernel panic in the bnxt_queue_{start | stop}().
When a queue is restarted bnxt_queue_{start | stop}() are called.
These functions set MRU to 0 to stop packet flow and then to set up the
remaining things.
MRU variable is a member of vnic_info[] the first vnic_info is for
default and the second is for ntuple.
The first vnic_info is always allocated when interface is up, but the
second is allocated only when ntuple is enabled.
(ethtool -K eth0 ntuple <on | off>).
Currently, the bnxt_queue_{start | stop}() access
vnic_info[BNXT_VNIC_NTUPLE] regardless of whether ntuple is enabled or
not.
So kernel panic occurs.
This patch make the bnxt_queue_{start | stop}() use bp->nr_vnics instead
of BNXT_VNIC_NTUPLE.

Taehee Yoo (3):
  eth: bnxt: fix truesize for mb-xdp-pass case
  eth: bnxt: return fail if interface is down in bnxt_queue_mem_alloc()
  eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue
    restart logic

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 7 +++++--
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-02-27  5:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-26  6:18 [PATCH net 0/3] eth: bnxt: fix several bugs in the bnxt module Taehee Yoo
2025-02-26  6:18 ` [PATCH net 1/3] eth: bnxt: fix truesize for mb-xdp-pass case Taehee Yoo
2025-02-26  8:20   ` Somnath Kotur
2025-02-27  2:07   ` Jakub Kicinski
2025-02-27  5:00     ` Taehee Yoo
2025-02-26  6:18 ` [PATCH net 2/3] eth: bnxt: return fail if interface is down in bnxt_queue_mem_alloc() Taehee Yoo
2025-02-26  6:42   ` Somnath Kotur
2025-02-27  2:08   ` Jakub Kicinski
2025-02-26  6:18 ` [PATCH net 3/3] eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue restart logic Taehee Yoo
2025-02-26  6:46   ` Somnath Kotur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).