netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH v3 00/10] Introduce queue and NAPI support in netdev-genl (Was: Introduce NAPI queues support)
@ 2023-09-19 22:27 Amritha Nambiar
  2023-09-19 22:27 ` [net-next PATCH v3 01/10] netdev-genl: spec: Extend netdev netlink spec in YAML for queue Amritha Nambiar
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Amritha Nambiar @ 2023-09-19 22:27 UTC (permalink / raw)
  To: netdev, kuba; +Cc: sridhar.samudrala, amritha.nambiar

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
- tx maxrate
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, "q-id": 0, "q-type": 0}'
{'ifindex': 12, 'napi-id': 593, 'q-id': 0, 'q-type': 'rx'}

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

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

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

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

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


 Documentation/netlink/specs/netdev.yaml   |   92 ++++++++
 drivers/net/ethernet/intel/ice/ice_lib.c  |   60 +++++
 drivers/net/ethernet/intel/ice/ice_lib.h  |    4 
 drivers/net/ethernet/intel/ice/ice_main.c |    4 
 include/linux/netdevice.h                 |   13 +
 include/net/netdev_rx_queue.h             |    2 
 include/uapi/linux/netdev.h               |   28 ++
 net/core/dev.c                            |   39 +++
 net/core/netdev-genl-gen.c                |   50 ++++
 net/core/netdev-genl-gen.h                |    5 
 net/core/netdev-genl.c                    |  347 +++++++++++++++++++++++++++++
 tools/include/uapi/linux/netdev.h         |   28 ++
 tools/net/ynl/generated/netdev-user.c     |  295 +++++++++++++++++++++++++
 tools/net/ynl/generated/netdev-user.h     |  180 +++++++++++++++
 14 files changed, 1143 insertions(+), 4 deletions(-)

--

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

end of thread, other threads:[~2023-10-10 19:58 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-19 22:27 [net-next PATCH v3 00/10] Introduce queue and NAPI support in netdev-genl (Was: Introduce NAPI queues support) Amritha Nambiar
2023-09-19 22:27 ` [net-next PATCH v3 01/10] netdev-genl: spec: Extend netdev netlink spec in YAML for queue Amritha Nambiar
2023-09-28 10:33   ` Paolo Abeni
2023-09-28 23:06     ` Nambiar, Amritha
2023-09-19 22:27 ` [net-next PATCH v3 02/10] net: Add queue and napi association Amritha Nambiar
2023-09-28 10:47   ` Paolo Abeni
2023-09-28 23:12     ` Nambiar, Amritha
2023-09-19 22:27 ` [net-next PATCH v3 03/10] ice: Add support in the driver for associating queue with napi Amritha Nambiar
2023-09-19 22:27 ` [net-next PATCH v3 04/10] netdev-genl: Add netlink framework functions for queue Amritha Nambiar
2023-10-10  9:08   ` Paolo Abeni
2023-10-10 19:57     ` Nambiar, Amritha
2023-09-19 22:27 ` [net-next PATCH v3 05/10] netdev-genl: spec: Extend netdev netlink spec in YAML for NAPI Amritha Nambiar
2023-09-19 22:27 ` [net-next PATCH v3 06/10] netdev-genl: Add netlink framework functions for napi Amritha Nambiar
2023-09-28 11:19   ` Paolo Abeni
2023-09-28 23:34     ` Nambiar, Amritha
2023-09-19 22:27 ` [net-next PATCH v3 07/10] netdev-genl: spec: Add irq in netdev netlink YAML spec Amritha Nambiar
2023-09-19 22:27 ` [net-next PATCH v3 08/10] net: Add NAPI IRQ support Amritha Nambiar
2023-09-19 22:28 ` [net-next PATCH v3 09/10] netdev-genl: spec: Add PID in netdev netlink YAML spec Amritha Nambiar
2023-09-19 22:28 ` [net-next PATCH v3 10/10] netdev-genl: Add PID for the NAPI thread Amritha Nambiar

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).