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 | name: irq | 230 | name: irq |
| 231 | doc: The associated interrupt vector number for the napi | 231 | doc: The associated interrupt vector number for the napi |
| 232 | type: u32 | 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 | name: queue | 240 | name: queue |
| 235 | attributes: | 241 | attributes: |
| @@ -389,6 +395,7 @@ operations: · 153 unmodified lines | |||
| 389 | - id | 395 | - id |
| 390 | - ifindex | 396 | - ifindex |
| 391 | - irq | 397 | - irq |
| 398 | - pid | ||
| 392 | dump: | 399 | dump: |
| 393 | request: | 400 | request: |
| 394 | attributes: | 401 | attributes: |
| @@ -113,6 +113,7 @@ enum { · 112 unmodified lines | |||
| 113 | NETDEV_A_NAPI_IFINDEX = 1, | 113 | NETDEV_A_NAPI_IFINDEX = 1, |
| 114 | NETDEV_A_NAPI_ID, | 114 | NETDEV_A_NAPI_ID, |
| 115 | NETDEV_A_NAPI_IRQ, | 115 | NETDEV_A_NAPI_IRQ, |
| 116 | NETDEV_A_NAPI_PID, | ||
| 116 | 117 | ||
| 117 | __NETDEV_A_NAPI_MAX, | 118 | __NETDEV_A_NAPI_MAX, |
| 118 | NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1) | 119 | NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1) |
| @@ -113,6 +113,7 @@ enum { · 112 unmodified lines | |||
| 113 | NETDEV_A_NAPI_IFINDEX = 1, | 113 | NETDEV_A_NAPI_IFINDEX = 1, |
| 114 | NETDEV_A_NAPI_ID, | 114 | NETDEV_A_NAPI_ID, |
| 115 | NETDEV_A_NAPI_IRQ, | 115 | NETDEV_A_NAPI_IRQ, |
| 116 | NETDEV_A_NAPI_PID, | ||
| 116 | 117 | ||
| 117 | __NETDEV_A_NAPI_MAX, | 118 | __NETDEV_A_NAPI_MAX, |
| 118 | NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1) | 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 | [NETDEV_A_NAPI_IFINDEX] = { .name = "ifindex", .type = YNL_PT_U32, }, | 165 | [NETDEV_A_NAPI_IFINDEX] = { .name = "ifindex", .type = YNL_PT_U32, }, |
| 166 | [NETDEV_A_NAPI_ID] = { .name = "id", .type = YNL_PT_U32, }, | 166 | [NETDEV_A_NAPI_ID] = { .name = "id", .type = YNL_PT_U32, }, |
| 167 | [NETDEV_A_NAPI_IRQ] = { .name = "irq", .type = YNL_PT_U32, }, | 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 | struct ynl_policy_nest netdev_napi_nest = { | 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 | return MNL_CB_ERROR; | 217 | return MNL_CB_ERROR; |
| 217 | dst->_present.irq = 1; | 218 | dst->_present.irq = 1; |
| 218 | dst->irq = mnl_attr_get_u32(attr); | 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 | __u32 id:1; | 388 | __u32 id:1; |
| 389 | __u32 ifindex:1; | 389 | __u32 ifindex:1; |
| 390 | __u32 irq:1; | 390 | __u32 irq:1; |
| 391 | __u32 pid:1; | ||
| 391 | } _present; | 392 | } _present; |
| 392 | 393 | ||
| 393 | __u32 id; | 394 | __u32 id; |
| 394 | __u32 ifindex; | 395 | __u32 ifindex; |
| 395 | __u32 irq; | 396 | __u32 irq; |
| 397 | __u32 pid; | ||
| 396 | }; | 398 | }; |
| 397 | 399 | ||
| 398 | void netdev_napi_get_rsp_free(struct netdev_napi_get_rsp *rsp); | 400 | void netdev_napi_get_rsp_free(struct netdev_napi_get_rsp *rsp); |