Expose netdev name in netdev netlink APIs
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | netdev-genl: Add ifname for queue and NAPI APIsinclude/ net/ | +19 | 5 replies | |
| 2/2 | netdev-genl: spec: Add ifname to netdev nl YAML specDocumentation/ tools/ | +12 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH net-next 0/2] Expose netdev name in netdev netlink APIs
Greetings:
The netdev netlink APIs currently provide the ifindex of a device associated with the NIC queue or NAPI when the netlink API is used. In order for user applications to map this back to a human readable device name, user applications must issue a subsequent ioctl (SIOCGIFNAME) in order to map an ifindex back to a device name.
This patch set adds ifname to the API so that when queue or NAPI information is retrieved, the human readable string is included. The netdev netlink YAML spec has been updated to include this field, as well.
This saves the subsequent call to ioctl and makes the netlink information more user friendly. Applications might use this information in conjunction with SO_INCOMING_NAPI_ID to map NAPI IDs to specific NICs with application specific configuration (e.g. NUMA zone and CPU layout information).
An example using the netlink cli tool before this change:
$ ./cli.py --spec netdev.yaml --dump queue-get --json='{"ifindex": 7}'
[{'id': 0, 'ifindex': 7, 'type': 'rx'},
{'id': 1, 'ifindex': 7, 'type': 'rx'},
{'id': 2, 'ifindex': 7, 'type': 'rx'},
...$ ./cli.py --spec netdev.yaml --dump napi-get --json='{"ifindex": 7}'
[{'id': 448, 'ifindex': 7},
{'id': 447, 'ifindex': 7},
{'id': 446, 'ifindex': 7},
...An example after this change:
$ ./cli.py --spec netdev.yaml --dump queue-get --json='{"ifindex": 7}'
[{'id': 0, 'ifindex': 7, 'ifname': 'eth1', 'type': 'rx'},
{'id': 1, 'ifindex': 7, 'ifname': 'eth1', 'type': 'rx'},
{'id': 2, 'ifindex': 7, 'ifname': 'eth1', 'type': 'rx'},
...$ ./cli.py --spec netdev.yaml --dump napi-get --json='{"ifindex": 7}'
[{'id': 448, 'ifindex': 7, 'ifname': 'eth1'},
{'id': 447, 'ifindex': 7, 'ifname': 'eth1'},
{'id': 446, 'ifindex': 7, 'ifname': 'eth1'},
...Thanks,
Joe
Joe Damato (2):
netdev-genl: Add ifname for queue and NAPI APIs
netdev-genl: spec: Add ifname to netdev nl YAML spec
Documentation/netlink/specs/netdev.yaml | 10 ++++++++++ include/uapi/linux/netdev.h | 2 ++ net/core/netdev-genl.c | 22 +++++++++++++++++----- tools/include/uapi/linux/netdev.h | 2 ++ 4 files changed, 31 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4