diff --git a/home/nipa/nipa_out/956196/ynl/old-code/devlink-user.c b/home/nipa/nipa_out/956196/ynl/new-code/devlink-user.c index 1b1a19449133..3ad57bc8d244 100644 --- a/home/nipa/nipa_out/956196/ynl/old-code/devlink-user.c +++ b/home/nipa/nipa_out/956196/ynl/new-code/devlink-user.c @@ -494,6 +494,7 @@ const struct ynl_policy_attr devlink_dl_port_function_policy[DEVLINK_PORT_FUNCTI [DEVLINK_PORT_FN_ATTR_STATE] = { .name = "state", .type = YNL_PT_U8, }, [DEVLINK_PORT_FN_ATTR_OPSTATE] = { .name = "opstate", .type = YNL_PT_U8, }, [DEVLINK_PORT_FN_ATTR_CAPS] = { .name = "caps", .type = YNL_PT_BITFIELD32, }, + [DEVLINK_PORT_FN_ATTR_UID] = { .name = "uid", .type = YNL_PT_NUL_STR, }, }; const struct ynl_policy_nest devlink_dl_port_function_nest = { @@ -1372,6 +1373,7 @@ void devlink_dl_trap_metadata_free(struct devlink_dl_trap_metadata *obj) void devlink_dl_port_function_free(struct devlink_dl_port_function *obj) { free(obj->hw_addr); + free(obj->uid); } int devlink_dl_port_function_put(struct nlmsghdr *nlh, unsigned int attr_type, @@ -1388,6 +1390,8 @@ int devlink_dl_port_function_put(struct nlmsghdr *nlh, unsigned int attr_type, ynl_attr_put_u8(nlh, DEVLINK_PORT_FN_ATTR_OPSTATE, obj->opstate); if (obj->_present.caps) ynl_attr_put(nlh, DEVLINK_PORT_FN_ATTR_CAPS, &obj->caps, sizeof(struct nla_bitfield32)); + if (obj->_present.uid_len) + ynl_attr_put_str(nlh, DEVLINK_PORT_FN_ATTR_UID, obj->uid); ynl_attr_nest_end(nlh, nest); return 0; diff --git a/home/nipa/nipa_out/956196/ynl/old-code/devlink-user.h b/home/nipa/nipa_out/956196/ynl/new-code/devlink-user.h index de00d71329c6..a75a02012bd3 100644 --- a/home/nipa/nipa_out/956196/ynl/old-code/devlink-user.h +++ b/home/nipa/nipa_out/956196/ynl/new-code/devlink-user.h @@ -246,12 +246,14 @@ struct devlink_dl_port_function { __u32 state:1; __u32 opstate:1; __u32 caps:1; + __u32 uid_len; } _present; void *hw_addr; enum devlink_port_fn_state state; enum devlink_port_fn_opstate opstate; struct nla_bitfield32 caps; + char *uid; }; struct devlink_dl_reload_stats_entry { @@ -708,6 +710,17 @@ devlink_port_set_req_set_port_function_caps(struct devlink_port_set_req *req, req->port_function._present.caps = 1; memcpy(&req->port_function.caps, caps, sizeof(struct nla_bitfield32)); } +static inline void +devlink_port_set_req_set_port_function_uid(struct devlink_port_set_req *req, + const char *uid) +{ + req->_present.port_function = 1; + free(req->port_function.uid); + req->port_function._present.uid_len = strlen(uid); + req->port_function.uid = malloc(req->port_function._present.uid_len + 1); + memcpy(req->port_function.uid, uid, req->port_function._present.uid_len); + req->port_function.uid[req->port_function._present.uid_len] = 0; +} /* * Set devlink port instances.