netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next v1 0/3] bnxt: implement queue api
@ 2024-04-30  1:07 David Wei
  2024-04-30  1:07 ` [RFC PATCH net-next v1 1/3] queue_api: define " David Wei
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: David Wei @ 2024-04-30  1:07 UTC (permalink / raw)
  To: netdev, Michael Chan, Pavan Chebbi, Andy Gospodarek, 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 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

-- 
2.43.0


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

end of thread, other threads:[~2024-05-03  1:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30  1:07 [RFC PATCH net-next v1 0/3] bnxt: implement queue api David Wei
2024-04-30  1:07 ` [RFC PATCH net-next v1 1/3] queue_api: define " David Wei
2024-04-30 18:00   ` Mina Almasry
2024-05-02  1:00     ` David Wei
2024-05-02 16:58       ` Mina Almasry
2024-05-02  2:44     ` David Wei
2024-05-02 17:15       ` Mina Almasry
2024-04-30  1:07 ` [RFC PATCH net-next v1 2/3] bnxt: implement " David Wei
2024-04-30  1:07 ` [RFC PATCH net-next v1 3/3] netdev: add netdev_rx_queue_restart() David Wei
2024-04-30 18:15   ` Mina Almasry
2024-05-02  1:04     ` David Wei
2024-05-02 16:46       ` Mina Almasry
2024-05-03  0:22         ` Jakub Kicinski
2024-05-03  0:49           ` Jakub Kicinski
2024-05-03  1:19             ` 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).