mbox series

[RFC,net-next,v1,0/3] bnxt: implement queue api

Message ID 20240430010732.666512-1-dw@davidwei.uk (mailing list archive)
Headers show
Series bnxt: implement queue api | expand

Message

David Wei April 30, 2024, 1:07 a.m. UTC
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 is minimal for now, with
ndo_queue_mem_alloc()/free() doing nothing. Therefore queue mem is
allocated after the queue has been stopped, instead of before.
Implementing this properly for bnxt is more complex so before spending
that time I would like to get some feedback first on the viability of
this patchset.

The ndo_queue_stop()/start() steps are basically the same as
bnxt_rx_ring_reset(). It is done outside of sp_task, since the caller
netdev_rx_queue_restart() is in the task context already, with rtnl_lock
taken.

[1]: https://lore.kernel.org/netdev/20240419202535.5c5097fe@kernel.org/

David Wei (2):
  bnxt: implement queue api
  netdev: add netdev_rx_queue_restart()

Mina Almasry (1):
  queue_api: define queue api

 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 62 +++++++++++++++++++++++
 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 +++++++++++++++++++++
 6 files changed, 154 insertions(+)
 create mode 100644 net/core/netdev_rx_queue.c