RFC bnxt: implement queue api
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 RFC Latest9 patches 14 repliesIn review
- v1 RFC3 patches 11 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | queue_api: define queue apiinclude/ include/ | +30 | 2 replies | |
| 2/9 | bnxt: implement queue apidrivers/ | +62 | 2 replies | |
| 3/9 | netdev: add netdev_rx_queue_restart()include/ net/ net/ | +62 | 6 replies | |
| 4/9 | bnxt: refactor bnxt_{alloc,free}_one_rx_ring()drivers/ | +10 | 0 replies | |
| 5/9 | bnxt: refactor bnxt_{alloc,free}_one_tpa_info()drivers/ | +62 | 2 replies | |
| 6/9 | bnxt: add __bnxt_init_rx_ring_struct() helperdrivers/ | +26 | 0 replies | |
| 7/9 | bnxt: add helpers for allocating rx ring memdrivers/ | +87 | 2 replies | |
| 8/9 | bnxt: alloc rx ring mem first before resetdrivers/ drivers/ | +79 | 0 replies | |
| 9/9 | bnxt: swap rx ring mem during queue_stop()drivers/ | +41 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [RFC PATCH net-next v2 0/9] bnxt: implement queue api
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
Signature · 1 line
2.43.0