netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next v2 0/9] bnxt: implement queue api
@ 2024-05-02  4:54 David Wei
  2024-05-02  4:54 ` [RFC PATCH net-next v2 1/9] queue_api: define " David Wei
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: David Wei @ 2024-05-02  4:54 UTC (permalink / raw)
  To: netdev, Michael Chan, Pavan Chebbi, Andy Gospodarek,
	Adrian Alvarado, Mina Almasry, Shailend Chand
  Cc: Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni

Both TCP devmem and io_uring ZC Rx need a way to change the page pool
for an Rx queue and reset it. As discussed in [1], until netdev core
takes a greater role in owning queue mem and ndo_open()/stop() calls
the queue API to alloc/free queue mem, we will have the driver
allocate queue mem in netdev_queue_mgmt_ops.

Rather than keeping the queue restart function in netmem, move it to
netdev core in netdev_rx_queue.h, since io_uring will also need to call
this as well. In the future, we'll have another API function that
changes the page pool memory provider for a given queue, then restarts
it.

The bnxt implementation allocates new queue mem and descriptors for an
rx queue before stopping the queue. Then, before starting the queue, the
queue mem and descriptors are swapped. Finally, the old queue mem and
descriptors are freed.

Individual patches go into more detail about how this is done for bnxt.
But from a high level:

1. Clone the bnxt_rx_ring_info for the specified rx queue
2. Allocate queue mem and descriptors into this clone
3. Stop the queue
4. Swap the queue mem and descriptors around, such that the clone how
   has the old queue mem and descriptors
5. Start the queue
6. Free the clone, which frees the old queue mem and descriptors

This patches compiled but is so far untested as I don't have access to
FW that supports individual rx queue reset. I'm sending it as an RFC to
hopefully get some early feedback while I get a test environment set up.

David Wei (8):
  bnxt: implement queue api
  netdev: add netdev_rx_queue_restart()
  bnxt: refactor bnxt_{alloc,free}_one_rx_ring()
  bnxt: refactor bnxt_{alloc,free}_one_tpa_info()
  bnxt: add __bnxt_init_rx_ring_struct() helper
  bnxt: add helpers for allocating rx ring mem
  bnxt: alloc rx ring mem first before reset
  bnxt: swap rx ring mem during queue_stop()

Mina Almasry (1):
  queue_api: define queue api

 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 410 ++++++++++++++++++----
 drivers/net/ethernet/broadcom/bnxt/bnxt.h |   2 +
 include/linux/netdevice.h                 |   3 +
 include/net/netdev_queues.h               |  27 ++
 include/net/netdev_rx_queue.h             |   3 +
 net/core/Makefile                         |   1 +
 net/core/netdev_rx_queue.c                |  58 +++
 7 files changed, 443 insertions(+), 61 deletions(-)
 create mode 100644 net/core/netdev_rx_queue.c

-- 
2.43.0


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

end of thread, other threads:[~2024-05-08 17:13 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-02  4:54 [RFC PATCH net-next v2 0/9] bnxt: implement queue api David Wei
2024-05-02  4:54 ` [RFC PATCH net-next v2 1/9] queue_api: define " David Wei
2024-05-04 12:11   ` Simon Horman
2024-05-06  0:34     ` David Wei
2024-05-02  4:54 ` [RFC PATCH net-next v2 2/9] bnxt: implement " David Wei
2024-05-02 17:23   ` Mina Almasry
2024-05-06  0:36     ` David Wei
2024-05-02  4:54 ` [RFC PATCH net-next v2 3/9] netdev: add netdev_rx_queue_restart() David Wei
2024-05-02 17:27   ` Mina Almasry
2024-05-06  0:38     ` David Wei
2024-05-04 12:20   ` Simon Horman
2024-05-06  0:41     ` David Wei
2024-05-07 16:46       ` Simon Horman
2024-05-08 17:13         ` Mina Almasry
2024-05-02  4:54 ` [RFC PATCH net-next v2 4/9] bnxt: refactor bnxt_{alloc,free}_one_rx_ring() David Wei
2024-05-02  4:54 ` [RFC PATCH net-next v2 5/9] bnxt: refactor bnxt_{alloc,free}_one_tpa_info() David Wei
2024-05-04 12:30   ` Simon Horman
2024-05-06  0:43     ` David Wei
2024-05-02  4:54 ` [RFC PATCH net-next v2 6/9] bnxt: add __bnxt_init_rx_ring_struct() helper David Wei
2024-05-02  4:54 ` [RFC PATCH net-next v2 7/9] bnxt: add helpers for allocating rx ring mem David Wei
2024-05-04 12:34   ` Simon Horman
2024-05-06  0:42     ` David Wei
2024-05-02  4:54 ` [RFC PATCH net-next v2 8/9] bnxt: alloc rx ring mem first before reset David Wei
2024-05-02  4:54 ` [RFC PATCH net-next v2 9/9] bnxt: swap rx ring mem during queue_stop() David Wei

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).