diff --git a/home/nipa/nipa_out/879531/ynl/old-code/devlink-user.c b/home/nipa/nipa_out/879531/ynl/new-code/devlink-user.c index 47c8c4cdca1b..4dcf294ed835 100644 --- a/home/nipa/nipa_out/879531/ynl/old-code/devlink-user.c +++ b/home/nipa/nipa_out/879531/ynl/new-code/devlink-user.c @@ -134,6 +134,7 @@ const char *devlink_port_fn_attr_cap_str(enum devlink_port_fn_attr_cap value) static const char * const devlink_rate_type_strmap[] = { [0] = "leaf", [1] = "node", + [2] = "traffic-class", }; const char *devlink_rate_type_str(enum devlink_rate_type value) @@ -869,6 +870,7 @@ const struct ynl_policy_attr devlink_policy[DEVLINK_ATTR_MAX + 1] = { [DEVLINK_ATTR_RATE_TYPE] = { .name = "rate-type", .type = YNL_PT_U16, }, [DEVLINK_ATTR_RATE_TX_SHARE] = { .name = "rate-tx-share", .type = YNL_PT_U64, }, [DEVLINK_ATTR_RATE_TX_MAX] = { .name = "rate-tx-max", .type = YNL_PT_U64, }, + [DEVLINK_ATTR_RATE_TRAFFIC_CLASS_INDEX] = { .name = "rate-traffic-class-index", .type = YNL_PT_U16, }, [DEVLINK_ATTR_RATE_NODE_NAME] = { .name = "rate-node-name", .type = YNL_PT_NUL_STR, }, [DEVLINK_ATTR_RATE_PARENT_NODE_NAME] = { .name = "rate-parent-node-name", .type = YNL_PT_NUL_STR, }, [DEVLINK_ATTR_REGION_MAX_SNAPSHOTS] = { .name = "region-max-snapshots", .type = YNL_PT_U32, }, @@ -6628,6 +6630,11 @@ int devlink_rate_get_rsp_parse(const struct nlmsghdr *nlh, return YNL_PARSE_CB_ERROR; dst->_present.port_index = 1; dst->port_index = ynl_attr_get_u32(attr); + } else if (type == DEVLINK_ATTR_RATE_TRAFFIC_CLASS_INDEX) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.rate_traffic_class_index = 1; + dst->rate_traffic_class_index = ynl_attr_get_u16(attr); } else if (type == DEVLINK_ATTR_RATE_NODE_NAME) { unsigned int len; @@ -6663,6 +6670,8 @@ devlink_rate_get(struct ynl_sock *ys, struct devlink_rate_get_req *req) ynl_attr_put_str(nlh, DEVLINK_ATTR_DEV_NAME, req->dev_name); if (req->_present.port_index) ynl_attr_put_u32(nlh, DEVLINK_ATTR_PORT_INDEX, req->port_index); + if (req->_present.rate_traffic_class_index) + ynl_attr_put_u16(nlh, DEVLINK_ATTR_RATE_TRAFFIC_CLASS_INDEX, req->rate_traffic_class_index); if (req->_present.rate_node_name_len) ynl_attr_put_str(nlh, DEVLINK_ATTR_RATE_NODE_NAME, req->rate_node_name); @@ -6763,6 +6772,8 @@ int devlink_rate_set(struct ynl_sock *ys, struct devlink_rate_set_req *req) ynl_attr_put_str(nlh, DEVLINK_ATTR_BUS_NAME, req->bus_name); if (req->_present.dev_name_len) ynl_attr_put_str(nlh, DEVLINK_ATTR_DEV_NAME, req->dev_name); + if (req->_present.rate_traffic_class_index) + ynl_attr_put_u16(nlh, DEVLINK_ATTR_RATE_TRAFFIC_CLASS_INDEX, req->rate_traffic_class_index); if (req->_present.rate_node_name_len) ynl_attr_put_str(nlh, DEVLINK_ATTR_RATE_NODE_NAME, req->rate_node_name); if (req->_present.rate_tx_share) @@ -6807,6 +6818,8 @@ int devlink_rate_new(struct ynl_sock *ys, struct devlink_rate_new_req *req) ynl_attr_put_str(nlh, DEVLINK_ATTR_BUS_NAME, req->bus_name); if (req->_present.dev_name_len) ynl_attr_put_str(nlh, DEVLINK_ATTR_DEV_NAME, req->dev_name); + if (req->_present.rate_traffic_class_index) + ynl_attr_put_u16(nlh, DEVLINK_ATTR_RATE_TRAFFIC_CLASS_INDEX, req->rate_traffic_class_index); if (req->_present.rate_node_name_len) ynl_attr_put_str(nlh, DEVLINK_ATTR_RATE_NODE_NAME, req->rate_node_name); if (req->_present.rate_tx_share) diff --git a/home/nipa/nipa_out/879531/ynl/old-code/devlink-user.h b/home/nipa/nipa_out/879531/ynl/new-code/devlink-user.h index e08ff699a3c0..9e5eae3a9073 100644 --- a/home/nipa/nipa_out/879531/ynl/old-code/devlink-user.h +++ b/home/nipa/nipa_out/879531/ynl/new-code/devlink-user.h @@ -4652,12 +4652,14 @@ struct devlink_rate_get_req { __u32 bus_name_len; __u32 dev_name_len; __u32 port_index:1; + __u32 rate_traffic_class_index:1; __u32 rate_node_name_len; } _present; char *bus_name; char *dev_name; __u32 port_index; + __u16 rate_traffic_class_index; char *rate_node_name; }; @@ -4695,6 +4697,13 @@ devlink_rate_get_req_set_port_index(struct devlink_rate_get_req *req, req->port_index = port_index; } static inline void +devlink_rate_get_req_set_rate_traffic_class_index(struct devlink_rate_get_req *req, + __u16 rate_traffic_class_index) +{ + req->_present.rate_traffic_class_index = 1; + req->rate_traffic_class_index = rate_traffic_class_index; +} +static inline void devlink_rate_get_req_set_rate_node_name(struct devlink_rate_get_req *req, const char *rate_node_name) { @@ -4710,12 +4719,14 @@ struct devlink_rate_get_rsp { __u32 bus_name_len; __u32 dev_name_len; __u32 port_index:1; + __u32 rate_traffic_class_index:1; __u32 rate_node_name_len; } _present; char *bus_name; char *dev_name; __u32 port_index; + __u16 rate_traffic_class_index; char *rate_node_name; }; @@ -4783,6 +4794,7 @@ struct devlink_rate_set_req { struct { __u32 bus_name_len; __u32 dev_name_len; + __u32 rate_traffic_class_index:1; __u32 rate_node_name_len; __u32 rate_tx_share:1; __u32 rate_tx_max:1; @@ -4793,6 +4805,7 @@ struct devlink_rate_set_req { char *bus_name; char *dev_name; + __u16 rate_traffic_class_index; char *rate_node_name; __u64 rate_tx_share; __u64 rate_tx_max; @@ -4828,6 +4841,13 @@ devlink_rate_set_req_set_dev_name(struct devlink_rate_set_req *req, req->dev_name[req->_present.dev_name_len] = 0; } static inline void +devlink_rate_set_req_set_rate_traffic_class_index(struct devlink_rate_set_req *req, + __u16 rate_traffic_class_index) +{ + req->_present.rate_traffic_class_index = 1; + req->rate_traffic_class_index = rate_traffic_class_index; +} +static inline void devlink_rate_set_req_set_rate_node_name(struct devlink_rate_set_req *req, const char *rate_node_name) { @@ -4887,6 +4907,7 @@ struct devlink_rate_new_req { struct { __u32 bus_name_len; __u32 dev_name_len; + __u32 rate_traffic_class_index:1; __u32 rate_node_name_len; __u32 rate_tx_share:1; __u32 rate_tx_max:1; @@ -4897,6 +4918,7 @@ struct devlink_rate_new_req { char *bus_name; char *dev_name; + __u16 rate_traffic_class_index; char *rate_node_name; __u64 rate_tx_share; __u64 rate_tx_max; @@ -4932,6 +4954,13 @@ devlink_rate_new_req_set_dev_name(struct devlink_rate_new_req *req, req->dev_name[req->_present.dev_name_len] = 0; } static inline void +devlink_rate_new_req_set_rate_traffic_class_index(struct devlink_rate_new_req *req, + __u16 rate_traffic_class_index) +{ + req->_present.rate_traffic_class_index = 1; + req->rate_traffic_class_index = rate_traffic_class_index; +} +static inline void devlink_rate_new_req_set_rate_node_name(struct devlink_rate_new_req *req, const char *rate_node_name) {