lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240502045410.3524155-1-dw@davidwei.uk>
Date: Wed,  1 May 2024 21:54:01 -0700
From: David Wei <dw@...idwei.uk>
To: netdev@...r.kernel.org,
	Michael Chan <michael.chan@...adcom.com>,
	Pavan Chebbi <pavan.chebbi@...adcom.com>,
	Andy Gospodarek <andrew.gospodarek@...adcom.com>,
	Adrian Alvarado <adrian.alvarado@...adcom.com>,
	Mina Almasry <almasrymina@...gle.com>,
	Shailend Chand <shailend@...gle.com>
Cc: Jakub Kicinski <kuba@...nel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Paolo Abeni <pabeni@...hat.com>
Subject: [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

-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ