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: <171234737780.5075.5717254021446469741.stgit@anambiarhost.jf.intel.com>
Date: Fri, 05 Apr 2024 13:09:28 -0700
From: Amritha Nambiar <amritha.nambiar@...el.com>
To: netdev@...r.kernel.org, kuba@...nel.org, davem@...emloft.net
Cc: edumazet@...gle.com, pabeni@...hat.com, ast@...nel.org, sdf@...gle.com,
 lorenzo@...nel.org, tariqt@...dia.com, daniel@...earbox.net,
 anthony.l.nguyen@...el.com, lucien.xin@...il.com, hawk@...nel.org,
 sridhar.samudrala@...el.com, amritha.nambiar@...el.com
Subject: [net-next,RFC PATCH 0/5] Configuring NAPI instance for a queue

Support user configurability of queue<->NAPI association. The netdev-genl
interface is extended with 'queue-set' command. Currently, the set
command enables associating a NAPI ID for a queue, but can also be extended
to support configuring other attributes. To set the NAPI attribute, the
command requires the queue identifiers and the ID of the NAPI instance that
the queue has to be associated with.

Previous discussion:
https://lore.kernel.org/netdev/32e32635-ca75-99b8-2285-1d87a29b6d89@intel.com/

Example:
$ ./cli.py --spec netdev.yaml --do queue-set  --json='{"ifindex": 12, "id": 0, "type": 0, "napi-id": 595}'
{'id': 0, 'ifindex': 12, 'napi-id': 595, 'type': 'rx'}

The queue<->NAPI association is achieved by mapping the queue to the
corresponding interrupt vector. This interface, thereby, exposes
configurability of the queue<->vector mapping.

The interface is generic such that any Tx or Rx queue[s] can be associated
with a NAPI instance. So, it is possible to have multiple queues (Tx queues
only, Rx queues only or both Tx and Rx queues) on a NAPI/vector. This is a
step away from the usual 1:1 queue<->vector model, although the queue-pair
association can still be retained by configuring the Tx[n]-Rx[n] queue-pair
to the same NAPI instance.

The usecase for configuring NAPI pollers to queues this way from the userspace
is to limit the number of pollers (by sharing multiple queues on a vector).
This allows to have more cores for application threads by reducing the cores
needed for poller threads.

Patch 1-2 introduces the kernel interface hooks to set the NAPI ID attribute
for a queue.
Patch 3-4 prepares the ice driver for device configuration. The queue<->vector
mapping configured from userspace would not be reflected in the HW unless the
queue is reset. Currently, the driver supports only reset of the entire VSI or
a queue-pair. Resetting the VSI for each queue configuration is an overkill.
So, add the ice driver support to reset a vector. Also, add support to handle
vectors that gets unused due to the dynamic nature of configurability.
Patch 5 implements the support for queue<->NAPI configuration in the ice driver.

Testing Hints:
1. Move a Rx queue from its current NAPI to a different NAPI during traffic
2. Move a Rx queue back to its initial NAPI during traffic
3. Move all Rx queues of NAPI-A to NAPI-B during traffic
4. Repeat the tests above for Tx queue
5. Move all Tx and Rx queues of a NAPI to a new NAPI during traffic
6. Move a queue to an unused NAPI during traffic

---

Amritha Nambiar (5):
      netdev-genl: spec: Extend netdev netlink spec in YAML for queue-set
      netdev-genl: Add netlink framework functions for queue-set NAPI
      ice: Add support to enable/disable a vector
      ice: Handle unused vectors dynamically
      ice: Add driver support for ndo_queue_set_napi


 Documentation/netlink/specs/netdev.yaml   |   20 +
 drivers/net/ethernet/intel/ice/ice.h      |   13 +
 drivers/net/ethernet/intel/ice/ice_lib.c  |  667 +++++++++++++++++++++++++++++
 drivers/net/ethernet/intel/ice/ice_lib.h  |   12 +
 drivers/net/ethernet/intel/ice/ice_main.c |   15 -
 drivers/net/ethernet/intel/ice/ice_xsk.c  |   34 -
 include/linux/netdevice.h                 |    7 
 include/uapi/linux/netdev.h               |    1 
 net/core/netdev-genl-gen.c                |   15 +
 net/core/netdev-genl-gen.h                |    1 
 net/core/netdev-genl.c                    |  120 +++++
 tools/include/uapi/linux/netdev.h         |    1 
 12 files changed, 845 insertions(+), 61 deletions(-)

--

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ