diff --git a/home/nipa/nipa_out/910418/ynl/old-code/devlink-user.c b/home/nipa/nipa_out/910418/ynl/new-code/devlink-user.c index 47c8c4cdca1b..f795a0020a56 100644 --- a/home/nipa/nipa_out/910418/ynl/old-code/devlink-user.c +++ b/home/nipa/nipa_out/910418/ynl/new-code/devlink-user.c @@ -538,6 +538,15 @@ const struct ynl_policy_nest devlink_dl_selftest_id_nest = { .table = devlink_dl_selftest_id_policy, }; +const struct ynl_policy_attr devlink_dl_rate_tc_bw_values_policy[DEVLINK_ATTR_MAX + 1] = { + [DEVLINK_ATTR_RATE_TC_BW] = { .name = "rate-tc-bw", .type = YNL_PT_U32, }, +}; + +const struct ynl_policy_nest devlink_dl_rate_tc_bw_values_nest = { + .max_attr = DEVLINK_ATTR_MAX, + .table = devlink_dl_rate_tc_bw_values_policy, +}; + const struct ynl_policy_attr devlink_dl_dpipe_table_matches_policy[DEVLINK_ATTR_MAX + 1] = { [DEVLINK_ATTR_DPIPE_MATCH] = { .name = "dpipe-match", .type = YNL_PT_NEST, .nest = &devlink_dl_dpipe_match_nest, }, }; @@ -880,6 +889,8 @@ const struct ynl_policy_attr devlink_policy[DEVLINK_ATTR_MAX + 1] = { [DEVLINK_ATTR_RATE_TX_PRIORITY] = { .name = "rate-tx-priority", .type = YNL_PT_U32, }, [DEVLINK_ATTR_RATE_TX_WEIGHT] = { .name = "rate-tx-weight", .type = YNL_PT_U32, }, [DEVLINK_ATTR_REGION_DIRECT] = { .name = "region-direct", .type = YNL_PT_FLAG, }, + [DEVLINK_ATTR_RATE_TC_BW] = { .name = "rate-tc-bw", .type = YNL_PT_U32, }, + [DEVLINK_ATTR_RATE_TC_BW_VALUES] = { .name = "rate-tc-bw-values", .type = YNL_PT_NEST, .nest = &devlink_dl_rate_tc_bw_values_nest, }, }; const struct ynl_policy_nest devlink_nest = { @@ -1495,6 +1506,25 @@ int devlink_dl_selftest_id_put(struct nlmsghdr *nlh, unsigned int attr_type, return 0; } +void +devlink_dl_rate_tc_bw_values_free(struct devlink_dl_rate_tc_bw_values *obj) +{ +} + +int devlink_dl_rate_tc_bw_values_put(struct nlmsghdr *nlh, + unsigned int attr_type, + struct devlink_dl_rate_tc_bw_values *obj) +{ + struct nlattr *nest; + + nest = ynl_attr_nest_start(nlh, attr_type); + if (obj->_present.rate_tc_bw) + ynl_attr_put_u32(nlh, DEVLINK_ATTR_RATE_TC_BW, obj->rate_tc_bw); + ynl_attr_nest_end(nlh, nest); + + return 0; +} + void devlink_dl_dpipe_table_matches_free(struct devlink_dl_dpipe_table_matches *obj) { @@ -6747,6 +6777,7 @@ void devlink_rate_set_req_free(struct devlink_rate_set_req *req) free(req->dev_name); free(req->rate_node_name); free(req->rate_parent_node_name); + devlink_dl_rate_tc_bw_values_free(&req->rate_tc_bw_values); free(req); } @@ -6775,6 +6806,8 @@ int devlink_rate_set(struct ynl_sock *ys, struct devlink_rate_set_req *req) ynl_attr_put_u32(nlh, DEVLINK_ATTR_RATE_TX_WEIGHT, req->rate_tx_weight); if (req->_present.rate_parent_node_name_len) ynl_attr_put_str(nlh, DEVLINK_ATTR_RATE_PARENT_NODE_NAME, req->rate_parent_node_name); + if (req->_present.rate_tc_bw_values) + devlink_dl_rate_tc_bw_values_put(nlh, DEVLINK_ATTR_RATE_TC_BW_VALUES, &req->rate_tc_bw_values); err = ynl_exec(ys, nlh, &yrs); if (err < 0) @@ -6791,6 +6824,7 @@ void devlink_rate_new_req_free(struct devlink_rate_new_req *req) free(req->dev_name); free(req->rate_node_name); free(req->rate_parent_node_name); + devlink_dl_rate_tc_bw_values_free(&req->rate_tc_bw_values); free(req); } @@ -6819,6 +6853,8 @@ int devlink_rate_new(struct ynl_sock *ys, struct devlink_rate_new_req *req) ynl_attr_put_u32(nlh, DEVLINK_ATTR_RATE_TX_WEIGHT, req->rate_tx_weight); if (req->_present.rate_parent_node_name_len) ynl_attr_put_str(nlh, DEVLINK_ATTR_RATE_PARENT_NODE_NAME, req->rate_parent_node_name); + if (req->_present.rate_tc_bw_values) + devlink_dl_rate_tc_bw_values_put(nlh, DEVLINK_ATTR_RATE_TC_BW_VALUES, &req->rate_tc_bw_values); err = ynl_exec(ys, nlh, &yrs); if (err < 0) diff --git a/home/nipa/nipa_out/910418/ynl/old-code/devlink-user.h b/home/nipa/nipa_out/910418/ynl/new-code/devlink-user.h index e08ff699a3c0..6dfc1a16fca1 100644 --- a/home/nipa/nipa_out/910418/ynl/old-code/devlink-user.h +++ b/home/nipa/nipa_out/910418/ynl/new-code/devlink-user.h @@ -283,6 +283,14 @@ struct devlink_dl_selftest_id { } _present; }; +struct devlink_dl_rate_tc_bw_values { + struct { + __u32 rate_tc_bw:1; + } _present; + + __u32 rate_tc_bw; +}; + struct devlink_dl_dpipe_table_matches { unsigned int n_dpipe_match; struct devlink_dl_dpipe_match *dpipe_match; @@ -4789,6 +4797,7 @@ struct devlink_rate_set_req { __u32 rate_tx_priority:1; __u32 rate_tx_weight:1; __u32 rate_parent_node_name_len; + __u32 rate_tc_bw_values:1; } _present; char *bus_name; @@ -4799,6 +4808,7 @@ struct devlink_rate_set_req { __u32 rate_tx_priority; __u32 rate_tx_weight; char *rate_parent_node_name; + struct devlink_dl_rate_tc_bw_values rate_tc_bw_values; }; static inline struct devlink_rate_set_req *devlink_rate_set_req_alloc(void) @@ -4875,6 +4885,14 @@ devlink_rate_set_req_set_rate_parent_node_name(struct devlink_rate_set_req *req, memcpy(req->rate_parent_node_name, rate_parent_node_name, req->_present.rate_parent_node_name_len); req->rate_parent_node_name[req->_present.rate_parent_node_name_len] = 0; } +static inline void +devlink_rate_set_req_set_rate_tc_bw_values_rate_tc_bw(struct devlink_rate_set_req *req, + __u32 rate_tc_bw) +{ + req->_present.rate_tc_bw_values = 1; + req->rate_tc_bw_values._present.rate_tc_bw = 1; + req->rate_tc_bw_values.rate_tc_bw = rate_tc_bw; +} /* * Set rate instances. @@ -4893,6 +4911,7 @@ struct devlink_rate_new_req { __u32 rate_tx_priority:1; __u32 rate_tx_weight:1; __u32 rate_parent_node_name_len; + __u32 rate_tc_bw_values:1; } _present; char *bus_name; @@ -4903,6 +4922,7 @@ struct devlink_rate_new_req { __u32 rate_tx_priority; __u32 rate_tx_weight; char *rate_parent_node_name; + struct devlink_dl_rate_tc_bw_values rate_tc_bw_values; }; static inline struct devlink_rate_new_req *devlink_rate_new_req_alloc(void) @@ -4979,6 +4999,14 @@ devlink_rate_new_req_set_rate_parent_node_name(struct devlink_rate_new_req *req, memcpy(req->rate_parent_node_name, rate_parent_node_name, req->_present.rate_parent_node_name_len); req->rate_parent_node_name[req->_present.rate_parent_node_name_len] = 0; } +static inline void +devlink_rate_new_req_set_rate_tc_bw_values_rate_tc_bw(struct devlink_rate_new_req *req, + __u32 rate_tc_bw) +{ + req->_present.rate_tc_bw_values = 1; + req->rate_tc_bw_values._present.rate_tc_bw = 1; + req->rate_tc_bw_values.rate_tc_bw = rate_tc_bw; +} /* * Create rate instances.