History

netdev-genl: spec: Add PID in netdev netlink YAML spec

Add support in netlink spec(netdev.yaml) for PID of the NAPI thread. Add code generated from the spec.

Amritha Nambiar committed 2 years ago

Commit 8481a241 parent 26793bf5 files · +17 −0Browse files

Unified · Split

5 files
  1. Documentation/netlink/specs/netdev.yaml +7 −0
  2. include/uapi/linux/netdev.h +1 −0
  3. tools/include/uapi/linux/netdev.h +1 −0
  4. tools/net/ynl/generated/netdev-user.c +6 −0
  5. tools/net/ynl/generated/netdev-user.h +2 −0
Documentation/netlink/specs/netdev.yaml+7−0
@@ -230,6 +230,12 @@ attribute-sets: · 229 unmodified lines
230230 name: irq
231231 doc: The associated interrupt vector number for the napi
232232 type: u32
233+ -
234+ name: pid
235+ doc: PID of the napi thread, if NAPI is configured to operate in
236+ threaded mode. If NAPI is not in threaded mode (i.e. uses normal
237+ softirq context), the attribute will be absent.
238+ type: u32
233239 -
234240 name: queue
235241 attributes:
@@ -389,6 +395,7 @@ operations: · 153 unmodified lines
389395 - id
390396 - ifindex
391397 - irq
398+ - pid
392399 dump:
393400 request:
394401 attributes:
include/uapi/linux/netdev.h+1−0
@@ -113,6 +113,7 @@ enum { · 112 unmodified lines
113113 NETDEV_A_NAPI_IFINDEX = 1,
114114 NETDEV_A_NAPI_ID,
115115 NETDEV_A_NAPI_IRQ,
116+ NETDEV_A_NAPI_PID,
116117
117118 __NETDEV_A_NAPI_MAX,
118119 NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1)
tools/include/uapi/linux/netdev.h+1−0
@@ -113,6 +113,7 @@ enum { · 112 unmodified lines
113113 NETDEV_A_NAPI_IFINDEX = 1,
114114 NETDEV_A_NAPI_ID,
115115 NETDEV_A_NAPI_IRQ,
116+ NETDEV_A_NAPI_PID,
116117
117118 __NETDEV_A_NAPI_MAX,
118119 NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1)
tools/net/ynl/generated/netdev-user.c+6−0
@@ -165,6 +165,7 @@ struct ynl_policy_attr netdev_napi_policy[NETDEV_A_NAPI_MAX + 1] = { · 164 unmodified lines
165165 [NETDEV_A_NAPI_IFINDEX] = { .name = "ifindex", .type = YNL_PT_U32, },
166166 [NETDEV_A_NAPI_ID] = { .name = "id", .type = YNL_PT_U32, },
167167 [NETDEV_A_NAPI_IRQ] = { .name = "irq", .type = YNL_PT_U32, },
168+ [NETDEV_A_NAPI_PID] = { .name = "pid", .type = YNL_PT_U32, },
168169 };
169170
170171 struct ynl_policy_nest netdev_napi_nest = {
@@ -216,6 +217,11 @@ int netdev_page_pool_info_parse(struct ynl_parse_arg *yarg, · 45 unmodified lines
216217 return MNL_CB_ERROR;
217218 dst->_present.irq = 1;
218219 dst->irq = mnl_attr_get_u32(attr);
220+ } else if (type == NETDEV_A_NAPI_PID) {
221+ if (ynl_attr_validate(yarg, attr))
222+ return MNL_CB_ERROR;
223+ dst->_present.pid = 1;
224+ dst->pid = mnl_attr_get_u32(attr);
219225 }
220226 }
221227
tools/net/ynl/generated/netdev-user.h+2−0
@@ -388,11 +388,13 @@ struct netdev_napi_get_rsp { · 387 unmodified lines
388388 __u32 id:1;
389389 __u32 ifindex:1;
390390 __u32 irq:1;
391+ __u32 pid:1;
391392 } _present;
392393
393394 __u32 id;
394395 __u32 ifindex;
395396 __u32 irq;
397+ __u32 pid;
396398 };
397399
398400 void netdev_napi_get_rsp_free(struct netdev_napi_get_rsp *rsp);