diff --git a/home/nipa/nipa_out/909768/ynl/old-code/devlink-user.c b/home/nipa/nipa_out/909768/ynl/new-code/devlink-user.c index 47c8c4cdca1b..16d4e8127bce 100644 --- a/home/nipa/nipa_out/909768/ynl/old-code/devlink-user.c +++ b/home/nipa/nipa_out/909768/ynl/new-code/devlink-user.c @@ -538,6 +538,16 @@ 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_policy[DEVLINK_ATTR_MAX + 1] = { + [DEVLINK_ATTR_RATE_TC_INDEX] = { .name = "rate-tc-index", .type = YNL_PT_U8, }, + [DEVLINK_ATTR_RATE_BW] = { .name = "rate-bw", .type = YNL_PT_U32, }, +}; + +const struct ynl_policy_nest devlink_dl_rate_tc_bw_nest = { + .max_attr = DEVLINK_ATTR_MAX, + .table = devlink_dl_rate_tc_bw_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, }, }; @@ -879,6 +889,9 @@ const struct ynl_policy_attr devlink_policy[DEVLINK_ATTR_MAX + 1] = { [DEVLINK_ATTR_SELFTESTS] = { .name = "selftests", .type = YNL_PT_NEST, .nest = &devlink_dl_selftest_id_nest, }, [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_RATE_TC_INDEX] = { .name = "rate-tc-index", .type = YNL_PT_U8, }, + [DEVLINK_ATTR_RATE_BW] = { .name = "rate-bw", .type = YNL_PT_U32, }, + [DEVLINK_ATTR_RATE_TC_BW] = { .name = "rate-tc-bw", .type = YNL_PT_NEST, .nest = &devlink_dl_rate_tc_bw_nest, }, [DEVLINK_ATTR_REGION_DIRECT] = { .name = "region-direct", .type = YNL_PT_FLAG, }, }; @@ -1495,6 +1508,25 @@ int devlink_dl_selftest_id_put(struct nlmsghdr *nlh, unsigned int attr_type, return 0; } +void devlink_dl_rate_tc_bw_free(struct devlink_dl_rate_tc_bw *obj) +{ +} + +int devlink_dl_rate_tc_bw_put(struct nlmsghdr *nlh, unsigned int attr_type, + struct devlink_dl_rate_tc_bw *obj) +{ + struct nlattr *nest; + + nest = ynl_attr_nest_start(nlh, attr_type); + if (obj->_present.rate_tc_index) + ynl_attr_put_u8(nlh, DEVLINK_ATTR_RATE_TC_INDEX, obj->rate_tc_index); + if (obj->_present.rate_bw) + ynl_attr_put_u32(nlh, DEVLINK_ATTR_RATE_BW, obj->rate_bw); + ynl_attr_nest_end(nlh, nest); + + return 0; +} + void devlink_dl_dpipe_table_matches_free(struct devlink_dl_dpipe_table_matches *obj) { @@ -6746,6 +6778,7 @@ void devlink_rate_set_req_free(struct devlink_rate_set_req *req) free(req->bus_name); free(req->dev_name); free(req->rate_node_name); + devlink_dl_rate_tc_bw_free(&req->rate_tc_bw); free(req->rate_parent_node_name); free(req); } @@ -6773,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_PRIORITY, req->rate_tx_priority); if (req->_present.rate_tx_weight) ynl_attr_put_u32(nlh, DEVLINK_ATTR_RATE_TX_WEIGHT, req->rate_tx_weight); + if (req->_present.rate_tc_bw) + devlink_dl_rate_tc_bw_put(nlh, DEVLINK_ATTR_RATE_TC_BW, &req->rate_tc_bw); if (req->_present.rate_parent_node_name_len) ynl_attr_put_str(nlh, DEVLINK_ATTR_RATE_PARENT_NODE_NAME, req->rate_parent_node_name); @@ -6790,6 +6825,7 @@ void devlink_rate_new_req_free(struct devlink_rate_new_req *req) free(req->bus_name); free(req->dev_name); free(req->rate_node_name); + devlink_dl_rate_tc_bw_free(&req->rate_tc_bw); free(req->rate_parent_node_name); free(req); } @@ -6817,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_PRIORITY, req->rate_tx_priority); if (req->_present.rate_tx_weight) ynl_attr_put_u32(nlh, DEVLINK_ATTR_RATE_TX_WEIGHT, req->rate_tx_weight); + if (req->_present.rate_tc_bw) + devlink_dl_rate_tc_bw_put(nlh, DEVLINK_ATTR_RATE_TC_BW, &req->rate_tc_bw); if (req->_present.rate_parent_node_name_len) ynl_attr_put_str(nlh, DEVLINK_ATTR_RATE_PARENT_NODE_NAME, req->rate_parent_node_name); diff --git a/home/nipa/nipa_out/909768/ynl/old-code/devlink-user.h b/home/nipa/nipa_out/909768/ynl/new-code/devlink-user.h index e08ff699a3c0..16cd67e8ba2d 100644 --- a/home/nipa/nipa_out/909768/ynl/old-code/devlink-user.h +++ b/home/nipa/nipa_out/909768/ynl/new-code/devlink-user.h @@ -283,6 +283,16 @@ struct devlink_dl_selftest_id { } _present; }; +struct devlink_dl_rate_tc_bw { + struct { + __u32 rate_tc_index:1; + __u32 rate_bw:1; + } _present; + + __u8 rate_tc_index; + __u32 rate_bw; +}; + struct devlink_dl_dpipe_table_matches { unsigned int n_dpipe_match; struct devlink_dl_dpipe_match *dpipe_match; @@ -4788,6 +4798,7 @@ struct devlink_rate_set_req { __u32 rate_tx_max:1; __u32 rate_tx_priority:1; __u32 rate_tx_weight:1; + __u32 rate_tc_bw:1; __u32 rate_parent_node_name_len; } _present; @@ -4798,6 +4809,7 @@ struct devlink_rate_set_req { __u64 rate_tx_max; __u32 rate_tx_priority; __u32 rate_tx_weight; + struct devlink_dl_rate_tc_bw rate_tc_bw; char *rate_parent_node_name; }; @@ -4866,6 +4878,22 @@ devlink_rate_set_req_set_rate_tx_weight(struct devlink_rate_set_req *req, req->rate_tx_weight = rate_tx_weight; } static inline void +devlink_rate_set_req_set_rate_tc_bw_rate_tc_index(struct devlink_rate_set_req *req, + __u8 rate_tc_index) +{ + req->_present.rate_tc_bw = 1; + req->rate_tc_bw._present.rate_tc_index = 1; + req->rate_tc_bw.rate_tc_index = rate_tc_index; +} +static inline void +devlink_rate_set_req_set_rate_tc_bw_rate_bw(struct devlink_rate_set_req *req, + __u32 rate_bw) +{ + req->_present.rate_tc_bw = 1; + req->rate_tc_bw._present.rate_bw = 1; + req->rate_tc_bw.rate_bw = rate_bw; +} +static inline void devlink_rate_set_req_set_rate_parent_node_name(struct devlink_rate_set_req *req, const char *rate_parent_node_name) { @@ -4892,6 +4920,7 @@ struct devlink_rate_new_req { __u32 rate_tx_max:1; __u32 rate_tx_priority:1; __u32 rate_tx_weight:1; + __u32 rate_tc_bw:1; __u32 rate_parent_node_name_len; } _present; @@ -4902,6 +4931,7 @@ struct devlink_rate_new_req { __u64 rate_tx_max; __u32 rate_tx_priority; __u32 rate_tx_weight; + struct devlink_dl_rate_tc_bw rate_tc_bw; char *rate_parent_node_name; }; @@ -4970,6 +5000,22 @@ devlink_rate_new_req_set_rate_tx_weight(struct devlink_rate_new_req *req, req->rate_tx_weight = rate_tx_weight; } static inline void +devlink_rate_new_req_set_rate_tc_bw_rate_tc_index(struct devlink_rate_new_req *req, + __u8 rate_tc_index) +{ + req->_present.rate_tc_bw = 1; + req->rate_tc_bw._present.rate_tc_index = 1; + req->rate_tc_bw.rate_tc_index = rate_tc_index; +} +static inline void +devlink_rate_new_req_set_rate_tc_bw_rate_bw(struct devlink_rate_new_req *req, + __u32 rate_bw) +{ + req->_present.rate_tc_bw = 1; + req->rate_tc_bw._present.rate_bw = 1; + req->rate_tc_bw.rate_bw = rate_bw; +} +static inline void devlink_rate_new_req_set_rate_parent_node_name(struct devlink_rate_new_req *req, const char *rate_parent_node_name) {