diff --git a/home/nipa/nipa_out/930589/ynl/old-code/netdev-user.c b/home/nipa/nipa_out/930589/ynl/new-code/netdev-user.c index 1d3877ce20bb..2001cb743efb 100644 --- a/home/nipa/nipa_out/930589/ynl/old-code/netdev-user.c +++ b/home/nipa/nipa_out/930589/ynl/new-code/netdev-user.c @@ -106,6 +106,14 @@ const char *netdev_qstats_scope_str(enum netdev_qstats_scope value) } /* Policies */ +const struct ynl_policy_attr netdev_io_uring_provider_info_policy[NETDEV_A_IO_URING_PROVIDER_INFO_MAX + 1] = { +}; + +const struct ynl_policy_nest netdev_io_uring_provider_info_nest = { + .max_attr = NETDEV_A_IO_URING_PROVIDER_INFO_MAX, + .table = netdev_io_uring_provider_info_policy, +}; + const struct ynl_policy_attr netdev_page_pool_info_policy[NETDEV_A_PAGE_POOL_MAX + 1] = { [NETDEV_A_PAGE_POOL_ID] = { .name = "id", .type = YNL_PT_UINT, }, [NETDEV_A_PAGE_POOL_IFINDEX] = { .name = "ifindex", .type = YNL_PT_U32, }, @@ -148,6 +156,7 @@ const struct ynl_policy_attr netdev_page_pool_policy[NETDEV_A_PAGE_POOL_MAX + 1] [NETDEV_A_PAGE_POOL_INFLIGHT_MEM] = { .name = "inflight-mem", .type = YNL_PT_UINT, }, [NETDEV_A_PAGE_POOL_DETACH_TIME] = { .name = "detach-time", .type = YNL_PT_UINT, }, [NETDEV_A_PAGE_POOL_DMABUF] = { .name = "dmabuf", .type = YNL_PT_U32, }, + [NETDEV_A_PAGE_POOL_IO_URING] = { .name = "io-uring", .type = YNL_PT_NEST, .nest = &netdev_io_uring_provider_info_nest, }, }; const struct ynl_policy_nest netdev_page_pool_nest = { @@ -181,6 +190,7 @@ const struct ynl_policy_attr netdev_queue_policy[NETDEV_A_QUEUE_MAX + 1] = { [NETDEV_A_QUEUE_TYPE] = { .name = "type", .type = YNL_PT_U32, }, [NETDEV_A_QUEUE_NAPI_ID] = { .name = "napi-id", .type = YNL_PT_U32, }, [NETDEV_A_QUEUE_DMABUF] = { .name = "dmabuf", .type = YNL_PT_U32, }, + [NETDEV_A_QUEUE_IO_URING] = { .name = "io-uring", .type = YNL_PT_NEST, .nest = &netdev_io_uring_provider_info_nest, }, }; const struct ynl_policy_nest netdev_queue_nest = { @@ -255,6 +265,17 @@ const struct ynl_policy_nest netdev_dmabuf_nest = { }; /* Common nested types */ +void +netdev_io_uring_provider_info_free(struct netdev_io_uring_provider_info *obj) +{ +} + +int netdev_io_uring_provider_info_parse(struct ynl_parse_arg *yarg, + const struct nlattr *nested) +{ + return 0; +} + void netdev_page_pool_info_free(struct netdev_page_pool_info *obj) { } @@ -457,6 +478,7 @@ void netdev_page_pool_get_req_free(struct netdev_page_pool_get_req *req) void netdev_page_pool_get_rsp_free(struct netdev_page_pool_get_rsp *rsp) { + netdev_io_uring_provider_info_free(&rsp->io_uring); free(rsp); } @@ -465,8 +487,10 @@ int netdev_page_pool_get_rsp_parse(const struct nlmsghdr *nlh, { struct netdev_page_pool_get_rsp *dst; const struct nlattr *attr; + struct ynl_parse_arg parg; dst = yarg->data; + parg.ys = yarg->ys; ynl_attr_for_each(attr, nlh, yarg->ys->family->hdr_len) { unsigned int type = ynl_attr_type(attr); @@ -506,6 +530,15 @@ int netdev_page_pool_get_rsp_parse(const struct nlmsghdr *nlh, return YNL_PARSE_CB_ERROR; dst->_present.dmabuf = 1; dst->dmabuf = ynl_attr_get_u32(attr); + } else if (type == NETDEV_A_PAGE_POOL_IO_URING) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.io_uring = 1; + + parg.rsp_policy = &netdev_io_uring_provider_info_nest; + parg.data = &dst->io_uring; + if (netdev_io_uring_provider_info_parse(&parg, attr)) + return YNL_PARSE_CB_ERROR; } } @@ -552,6 +585,7 @@ void netdev_page_pool_get_list_free(struct netdev_page_pool_get_list *rsp) rsp = next; next = rsp->next; + netdev_io_uring_provider_info_free(&rsp->obj.io_uring); free(rsp); } } @@ -586,6 +620,7 @@ netdev_page_pool_get_dump(struct ynl_sock *ys) /* NETDEV_CMD_PAGE_POOL_GET - notify */ void netdev_page_pool_get_ntf_free(struct netdev_page_pool_get_ntf *rsp) { + netdev_io_uring_provider_info_free(&rsp->obj.io_uring); free(rsp); } @@ -771,6 +806,7 @@ void netdev_queue_get_req_free(struct netdev_queue_get_req *req) void netdev_queue_get_rsp_free(struct netdev_queue_get_rsp *rsp) { + netdev_io_uring_provider_info_free(&rsp->io_uring); free(rsp); } @@ -779,8 +815,10 @@ int netdev_queue_get_rsp_parse(const struct nlmsghdr *nlh, { struct netdev_queue_get_rsp *dst; const struct nlattr *attr; + struct ynl_parse_arg parg; dst = yarg->data; + parg.ys = yarg->ys; ynl_attr_for_each(attr, nlh, yarg->ys->family->hdr_len) { unsigned int type = ynl_attr_type(attr); @@ -810,6 +848,15 @@ int netdev_queue_get_rsp_parse(const struct nlmsghdr *nlh, return YNL_PARSE_CB_ERROR; dst->_present.dmabuf = 1; dst->dmabuf = ynl_attr_get_u32(attr); + } else if (type == NETDEV_A_QUEUE_IO_URING) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.io_uring = 1; + + parg.rsp_policy = &netdev_io_uring_provider_info_nest; + parg.data = &dst->io_uring; + if (netdev_io_uring_provider_info_parse(&parg, attr)) + return YNL_PARSE_CB_ERROR; } } @@ -865,6 +912,7 @@ void netdev_queue_get_list_free(struct netdev_queue_get_list *rsp) rsp = next; next = rsp->next; + netdev_io_uring_provider_info_free(&rsp->obj.io_uring); free(rsp); } } diff --git a/home/nipa/nipa_out/930589/ynl/old-code/netdev-user.h b/home/nipa/nipa_out/930589/ynl/new-code/netdev-user.h index bc103e532cb3..4a9d4d0dd4e6 100644 --- a/home/nipa/nipa_out/930589/ynl/old-code/netdev-user.h +++ b/home/nipa/nipa_out/930589/ynl/new-code/netdev-user.h @@ -24,6 +24,9 @@ const char *netdev_queue_type_str(enum netdev_queue_type value); const char *netdev_qstats_scope_str(enum netdev_qstats_scope value); /* Common nested types */ +struct netdev_io_uring_provider_info { +}; + struct netdev_page_pool_info { struct { __u32 id:1; @@ -145,6 +148,7 @@ struct netdev_page_pool_get_rsp { __u32 inflight_mem:1; __u32 detach_time:1; __u32 dmabuf:1; + __u32 io_uring:1; } _present; __u64 id; @@ -154,6 +158,7 @@ struct netdev_page_pool_get_rsp { __u64 inflight_mem; __u64 detach_time; __u32 dmabuf; + struct netdev_io_uring_provider_info io_uring; }; void netdev_page_pool_get_rsp_free(struct netdev_page_pool_get_rsp *rsp); @@ -323,6 +328,7 @@ struct netdev_queue_get_rsp { __u32 napi_id:1; __u32 ifindex:1; __u32 dmabuf:1; + __u32 io_uring:1; } _present; __u32 id; @@ -330,6 +336,7 @@ struct netdev_queue_get_rsp { __u32 napi_id; __u32 ifindex; __u32 dmabuf; + struct netdev_io_uring_provider_info io_uring; }; void netdev_queue_get_rsp_free(struct netdev_queue_get_rsp *rsp);