Add support in netlink spec(netdev.yaml) for PID of the NAPI thread. Add code generated from the spec.
Unified · Split
| @@ -230,6 +230,12 @@ attribute-sets: · 229 unmodified lines | ||
| 230 | 230 | name: irq |
| 231 | 231 | doc: The associated interrupt vector number for the napi |
| 232 | 232 | 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 | |
| 233 | 239 | - |
| 234 | 240 | name: queue |
| 235 | 241 | attributes: |
| @@ -389,6 +395,7 @@ operations: · 153 unmodified lines | ||
| 389 | 395 | - id |
| 390 | 396 | - ifindex |
| 391 | 397 | - irq |
| 398 | + - pid | |
| 392 | 399 | dump: |
| 393 | 400 | request: |
| 394 | 401 | attributes: |
| @@ -113,6 +113,7 @@ enum { · 112 unmodified lines | ||
| 113 | 113 | NETDEV_A_NAPI_IFINDEX = 1, |
| 114 | 114 | NETDEV_A_NAPI_ID, |
| 115 | 115 | NETDEV_A_NAPI_IRQ, |
| 116 | + NETDEV_A_NAPI_PID, | |
| 116 | 117 | |
| 117 | 118 | __NETDEV_A_NAPI_MAX, |
| 118 | 119 | NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1) |
| @@ -113,6 +113,7 @@ enum { · 112 unmodified lines | ||
| 113 | 113 | NETDEV_A_NAPI_IFINDEX = 1, |
| 114 | 114 | NETDEV_A_NAPI_ID, |
| 115 | 115 | NETDEV_A_NAPI_IRQ, |
| 116 | + NETDEV_A_NAPI_PID, | |
| 116 | 117 | |
| 117 | 118 | __NETDEV_A_NAPI_MAX, |
| 118 | 119 | NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1) |
| @@ -165,6 +165,7 @@ struct ynl_policy_attr netdev_napi_policy[NETDEV_A_NAPI_MAX + 1] = { · 164 unmodified lines | ||
| 165 | 165 | [NETDEV_A_NAPI_IFINDEX] = { .name = "ifindex", .type = YNL_PT_U32, }, |
| 166 | 166 | [NETDEV_A_NAPI_ID] = { .name = "id", .type = YNL_PT_U32, }, |
| 167 | 167 | [NETDEV_A_NAPI_IRQ] = { .name = "irq", .type = YNL_PT_U32, }, |
| 168 | + [NETDEV_A_NAPI_PID] = { .name = "pid", .type = YNL_PT_U32, }, | |
| 168 | 169 | }; |
| 169 | 170 | |
| 170 | 171 | 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 | ||
| 216 | 217 | return MNL_CB_ERROR; |
| 217 | 218 | dst->_present.irq = 1; |
| 218 | 219 | 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); | |
| 219 | 225 | } |
| 220 | 226 | } |
| 221 | 227 | |
| @@ -388,11 +388,13 @@ struct netdev_napi_get_rsp { · 387 unmodified lines | ||
| 388 | 388 | __u32 id:1; |
| 389 | 389 | __u32 ifindex:1; |
| 390 | 390 | __u32 irq:1; |
| 391 | + __u32 pid:1; | |
| 391 | 392 | } _present; |
| 392 | 393 | |
| 393 | 394 | __u32 id; |
| 394 | 395 | __u32 ifindex; |
| 395 | 396 | __u32 irq; |
| 397 | + __u32 pid; | |
| 396 | 398 | }; |
| 397 | 399 | |
| 398 | 400 | void netdev_napi_get_rsp_free(struct netdev_napi_get_rsp *rsp); |