netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amritha Nambiar <amritha.nambiar@intel.com>
To: netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com
Cc: edumazet@google.com, ast@kernel.org, sdf@google.com,
	lorenzo@kernel.org, tariqt@nvidia.com, daniel@iogearbox.net,
	anthony.l.nguyen@intel.com, lucien.xin@gmail.com,
	michael.chan@broadcom.com, hawk@kernel.org,
	sridhar.samudrala@intel.com, amritha.nambiar@intel.com
Subject: [net-next PATCH v11 00/11] Introduce queue and NAPI support in netdev-genl (Was: Introduce NAPI queues support)
Date: Fri, 01 Dec 2023 15:28:24 -0800	[thread overview]
Message-ID: <170147307026.5260.9300080745237900261.stgit@anambiarhost.jf.intel.com> (raw)

Add the capability to export the following via netdev-genl interface:
- queue information supported by the device
- NAPI information supported by the device

Introduce support for associating queue and NAPI instance.
Extend the netdev_genl generic netlink family for netdev
with queue and NAPI data. 

The queue parameters exposed are:
- queue index
- queue type
- ifindex
- NAPI id associated with the queue

Additional rx and tx queue parameters can be exposed in follow up
patches by stashing them in netdev queue structures. XDP queue type
can also be supported in future.

The NAPI fields exposed are:
- NAPI id
- NAPI device ifindex
- Interrupt number associated with the NAPI instance
- PID for the NAPI thread

This series only supports 'get' ability for retrieving
certain queue and NAPI attributes. The 'set' ability for
configuring queue and associated NAPI instance via netdev-genl
will be submitted as a separate patch series.

Previous discussion at:
https://lore.kernel.org/netdev/c8476530638a5f4381d64db0e024ed49c2db3b02.camel@gmail.com/T/#m00999652a8b4731fbdb7bf698d2e3666c65a60e7

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

$ ./cli.py --spec netdev.yaml  --do queue-get --json='{"ifindex": 12, "id": 0, "type": 1}'
{'id': 0, 'ifindex': 12, 'napi-id': 593, 'type': 'tx'}

$ ./cli.py --spec netdev.yaml  --dump queue-get --json='{"ifindex": 12}'
[{'id': 0, 'ifindex': 12, 'napi-id': 593, 'type': 'rx'},
 {'id': 1, 'ifindex': 12, 'napi-id': 594, 'type': 'rx'},
 {'id': 2, 'ifindex': 12, 'napi-id': 595, 'type': 'rx'},
 {'id': 3, 'ifindex': 12, 'napi-id': 596, 'type': 'rx'},
 {'id': 0, 'ifindex': 12, 'napi-id': 593, 'type': 'tx'},
 {'id': 1, 'ifindex': 12, 'napi-id': 594, 'type': 'tx'},
 {'id': 2, 'ifindex': 12, 'napi-id': 595, 'type': 'tx'},
 {'id': 3, 'ifindex': 12, 'napi-id': 596, 'type': 'tx'}]

$ ./cli.py --spec netdev.yaml --do napi-get --json='{"id": 593}'
{'id': 593, 'ifindex': 12, 'irq': 291, 'pid': 3727}

$ ./cli.py --spec netdev.yaml --dump napi-get --json='{"ifindex": 12}'
[{'id': 596, 'ifindex': 12, 'irq': 294, 'pid': 3724},
 {'id': 595, 'ifindex': 12, 'irq': 293, 'pid': 3725},
 {'id': 594, 'ifindex': 12, 'irq': 292, 'pid': 3726},
 {'id': 593, 'ifindex': 12, 'irq': 291, 'pid': 3727}]

v10 -> v11
* Update bnxt patch to exclude XDP Tx rings

v9 -> v10
* Re-spin to resolve merge issues as page pool changes were accepted.

v8 -> v9
* Removed locked version __netif_queue_set_napi(), the function
netif_queue_set_napi() assumes lock is taken. Made changes to ice
driver to take the lock locally.
* Detach NAPI from queues by passing NULL to netif_queue_set_napi()
* Support to avoid listing queue and NAPI info of devices which are DOWN
* Includes support for bnxt driver.

v7 -> v8
* Removed $obj prefix from attribute names in yaml spec

v6 -> v7
* Added more documentation in spec file
* Addressed other review comments related to lock

v5 -> v6
* Fixed build warning in prototype for ice_queue_set_napi()

v4 -> v5
* Removed tx_maxrate in queue atrributes
* Added lock protection for queue->napi
* Addressed other review comments

v3 -> v4
Minor nits, changed function name, used list_for_each_entry in place
of _rcu

v2 -> v3
* Implemented queue as separate netlink object
with support for exposing per-queue paramters
* Removed queue-list associations with NAPI
* Addressed other review feedback WRT tracking list
iterations

v1 -> v2
* Removed multi-attr nest for NAPI object
* Added support for flat/individual NAPI objects
* Changed 'do' command to take napi-id as argument
* Supported filtered 'dump' (dump with ifindex for a netdev and dump for
  all netdevs)

RFC -> v1
* Changed to separate 'napi_get' command
* Added support to expose interrupt and PID for the NAPI
* Used list of netdev queue structs
* Split patches further and fixed code style and errors

---

Amritha Nambiar (10):
      netdev-genl: spec: Extend netdev netlink spec in YAML for queue
      net: Add queue and napi association
      ice: Add support in the driver for associating queue with napi
      netdev-genl: Add netlink framework functions for queue
      netdev-genl: spec: Extend netdev netlink spec in YAML for NAPI
      netdev-genl: Add netlink framework functions for napi
      netdev-genl: spec: Add irq in netdev netlink YAML spec
      net: Add NAPI IRQ support
      netdev-genl: spec: Add PID in netdev netlink YAML spec
      netdev-genl: Add PID for the NAPI thread

Jakub Kicinski (1):
      eth: bnxt: link NAPI instances to queues and IRQs


 Documentation/netlink/specs/netdev.yaml   |   94 ++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt.c |   14 +
 drivers/net/ethernet/intel/ice/ice_base.c |   12 +
 drivers/net/ethernet/intel/ice/ice_lib.c  |   69 ++++++
 drivers/net/ethernet/intel/ice/ice_lib.h  |    4 
 drivers/net/ethernet/intel/ice/ice_main.c |    4 
 include/linux/netdevice.h                 |   14 +
 include/net/netdev_rx_queue.h             |    4 
 include/uapi/linux/netdev.h               |   27 ++
 net/core/dev.c                            |   41 +++-
 net/core/dev.h                            |    2 
 net/core/netdev-genl-gen.c                |   50 ++++
 net/core/netdev-genl-gen.h                |    5 
 net/core/netdev-genl.c                    |  331 +++++++++++++++++++++++++++++
 tools/include/uapi/linux/netdev.h         |   27 ++
 tools/net/ynl/generated/netdev-user.c     |  289 +++++++++++++++++++++++++
 tools/net/ynl/generated/netdev-user.h     |  178 ++++++++++++++++
 17 files changed, 1159 insertions(+), 6 deletions(-)

--

             reply	other threads:[~2023-12-01 23:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 23:28 Amritha Nambiar [this message]
2023-12-01 23:28 ` [net-next PATCH v11 01/11] netdev-genl: spec: Extend netdev netlink spec in YAML for queue Amritha Nambiar
2023-12-01 23:28 ` [net-next PATCH v11 02/11] net: Add queue and napi association Amritha Nambiar
2023-12-01 23:28 ` [net-next PATCH v11 03/11] ice: Add support in the driver for associating queue with napi Amritha Nambiar
2023-12-01 23:28 ` [net-next PATCH v11 04/11] netdev-genl: Add netlink framework functions for queue Amritha Nambiar
2023-12-01 23:28 ` [net-next PATCH v11 05/11] netdev-genl: spec: Extend netdev netlink spec in YAML for NAPI Amritha Nambiar
2023-12-01 23:28 ` [net-next PATCH v11 06/11] netdev-genl: Add netlink framework functions for napi Amritha Nambiar
2023-12-01 23:29 ` [net-next PATCH v11 07/11] netdev-genl: spec: Add irq in netdev netlink YAML spec Amritha Nambiar
2023-12-01 23:29 ` [net-next PATCH v11 08/11] net: Add NAPI IRQ support Amritha Nambiar
2023-12-01 23:29 ` [net-next PATCH v11 09/11] netdev-genl: spec: Add PID in netdev netlink YAML spec Amritha Nambiar
2023-12-01 23:29 ` [net-next PATCH v11 10/11] netdev-genl: Add PID for the NAPI thread Amritha Nambiar
2023-12-01 23:29 ` [net-next PATCH v11 11/11] eth: bnxt: link NAPI instances to queues and IRQs Amritha Nambiar
2023-12-01 23:56   ` Michael Chan
2023-12-05  2:30 ` [net-next PATCH v11 00/11] Introduce queue and NAPI support in netdev-genl (Was: Introduce NAPI queues support) patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=170147307026.5260.9300080745237900261.stgit@anambiarhost.jf.intel.com \
    --to=amritha.nambiar@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@google.com \
    --cc=sridhar.samudrala@intel.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).