[PATCH net-next 2/2] netdev-genl: spec: Add ifname to netdev nl YAML spec

From: Joe Damato
Date: Wed Feb 21 2024 - 11:00:25 EST


Add support to netdev netlink spec (netdev.yaml) for the ifname of the net
device.

Signed-off-by: Joe Damato <jdamato@xxxxxxxxxx>
---
Documentation/netlink/specs/netdev.yaml | 10 ++++++++++
tools/include/uapi/linux/netdev.h | 2 ++
2 files changed, 12 insertions(+)

diff --git a/Documentation/netlink/specs/netdev.yaml b/Documentation/netlink/specs/netdev.yaml
index 3addac9..9a92d04 100644
--- a/Documentation/netlink/specs/netdev.yaml
+++ b/Documentation/netlink/specs/netdev.yaml
@@ -240,6 +240,10 @@ attribute-sets:
threaded mode. If NAPI is not in threaded mode (i.e. uses normal
softirq context), the attribute will be absent.
type: u32
+ -
+ name: ifname
+ doc: name of the netdevice to which NAPI instance belongs.
+ type: string
-
name: queue
attributes:
@@ -264,6 +268,10 @@ attribute-sets:
name: napi-id
doc: ID of the NAPI instance which services this queue.
type: u32
+ -
+ name: ifname
+ doc: name of the netdevice to which the queue belongs.
+ type: string

operations:
list:
@@ -381,6 +389,7 @@ operations:
- type
- napi-id
- ifindex
+ - ifname
dump:
request:
attributes:
@@ -400,6 +409,7 @@ operations:
- ifindex
- irq
- pid
+ - ifname
dump:
request:
attributes:
diff --git a/tools/include/uapi/linux/netdev.h b/tools/include/uapi/linux/netdev.h
index 93cb411..80762bc 100644
--- a/tools/include/uapi/linux/netdev.h
+++ b/tools/include/uapi/linux/netdev.h
@@ -117,6 +117,7 @@ enum {
NETDEV_A_NAPI_ID,
NETDEV_A_NAPI_IRQ,
NETDEV_A_NAPI_PID,
+ NETDEV_A_NAPI_IFNAME,

__NETDEV_A_NAPI_MAX,
NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1)
@@ -127,6 +128,7 @@ enum {
NETDEV_A_QUEUE_IFINDEX,
NETDEV_A_QUEUE_TYPE,
NETDEV_A_QUEUE_NAPI_ID,
+ NETDEV_A_QUEUE_IFNAME,

__NETDEV_A_QUEUE_MAX,
NETDEV_A_QUEUE_MAX = (__NETDEV_A_QUEUE_MAX - 1)
--
2.7.4