diff --git a/home/nipa/nipa_out/873686/ynl/old-code/ethtool-user.c b/home/nipa/nipa_out/873686/ynl/new-code/ethtool-user.c index 4821a0061627..5941f2285e65 100644 --- a/home/nipa/nipa_out/873686/ynl/old-code/ethtool-user.c +++ b/home/nipa/nipa_out/873686/ynl/new-code/ethtool-user.c @@ -6084,6 +6084,8 @@ ethtool_rss_get(struct ynl_sock *ys, struct ethtool_rss_get_req *req) if (req->_present.header) ethtool_header_put(nlh, ETHTOOL_A_RSS_HEADER, &req->header); + if (req->_present.context) + ynl_attr_put_u32(nlh, ETHTOOL_A_RSS_CONTEXT, req->context); rsp = calloc(1, sizeof(*rsp)); yrs.yarg.data = rsp; @@ -6101,59 +6103,6 @@ ethtool_rss_get(struct ynl_sock *ys, struct ethtool_rss_get_req *req) return NULL; } -/* ETHTOOL_MSG_RSS_GET - dump */ -void ethtool_rss_get_req_dump_free(struct ethtool_rss_get_req_dump *req) -{ - ethtool_header_free(&req->header); - free(req); -} - -void ethtool_rss_get_list_free(struct ethtool_rss_get_list *rsp) -{ - struct ethtool_rss_get_list *next = rsp; - - while ((void *)next != YNL_LIST_END) { - rsp = next; - next = rsp->next; - - ethtool_header_free(&rsp->obj.header); - free(rsp->obj.indir); - free(rsp->obj.hkey); - free(rsp); - } -} - -struct ethtool_rss_get_list * -ethtool_rss_get_dump(struct ynl_sock *ys, struct ethtool_rss_get_req_dump *req) -{ - struct ynl_dump_state yds = {}; - struct nlmsghdr *nlh; - int err; - - yds.yarg.ys = ys; - yds.yarg.rsp_policy = ðtool_rss_nest; - yds.yarg.data = NULL; - yds.alloc_sz = sizeof(struct ethtool_rss_get_list); - yds.cb = ethtool_rss_get_rsp_parse; - yds.rsp_cmd = ETHTOOL_MSG_RSS_GET; - - nlh = ynl_gemsg_start_dump(ys, ys->family_id, ETHTOOL_MSG_RSS_GET, 1); - ys->req_policy = ðtool_rss_nest; - - if (req->_present.header) - ethtool_header_put(nlh, ETHTOOL_A_RSS_HEADER, &req->header); - - err = ynl_exec_dump(ys, nlh, &yds); - if (err < 0) - goto free_list; - - return yds.first; - -free_list: - ethtool_rss_get_list_free(yds.first); - return NULL; -} - /* ============== ETHTOOL_MSG_PLCA_GET_CFG ============== */ /* ETHTOOL_MSG_PLCA_GET_CFG - do */ void ethtool_plca_get_cfg_req_free(struct ethtool_plca_get_cfg_req *req) diff --git a/home/nipa/nipa_out/873686/ynl/old-code/ethtool-user.h b/home/nipa/nipa_out/873686/ynl/new-code/ethtool-user.h index 06dc95e10464..1a3b15c36cb4 100644 --- a/home/nipa/nipa_out/873686/ynl/old-code/ethtool-user.h +++ b/home/nipa/nipa_out/873686/ynl/new-code/ethtool-user.h @@ -4918,9 +4918,11 @@ int ethtool_pse_set(struct ynl_sock *ys, struct ethtool_pse_set_req *req); struct ethtool_rss_get_req { struct { __u32 header:1; + __u32 context:1; } _present; struct ethtool_header header; + __u32 context; }; static inline struct ethtool_rss_get_req *ethtool_rss_get_req_alloc(void) @@ -4956,6 +4958,12 @@ ethtool_rss_get_req_set_header_flags(struct ethtool_rss_get_req *req, req->header._present.flags = 1; req->header.flags = flags; } +static inline void +ethtool_rss_get_req_set_context(struct ethtool_rss_get_req *req, __u32 context) +{ + req->_present.context = 1; + req->context = context; +} struct ethtool_rss_get_rsp { struct { @@ -4983,60 +4991,6 @@ void ethtool_rss_get_rsp_free(struct ethtool_rss_get_rsp *rsp); struct ethtool_rss_get_rsp * ethtool_rss_get(struct ynl_sock *ys, struct ethtool_rss_get_req *req); -/* ETHTOOL_MSG_RSS_GET - dump */ -struct ethtool_rss_get_req_dump { - struct { - __u32 header:1; - } _present; - - struct ethtool_header header; -}; - -static inline struct ethtool_rss_get_req_dump * -ethtool_rss_get_req_dump_alloc(void) -{ - return calloc(1, sizeof(struct ethtool_rss_get_req_dump)); -} -void ethtool_rss_get_req_dump_free(struct ethtool_rss_get_req_dump *req); - -static inline void -ethtool_rss_get_req_dump_set_header_dev_index(struct ethtool_rss_get_req_dump *req, - __u32 dev_index) -{ - req->_present.header = 1; - req->header._present.dev_index = 1; - req->header.dev_index = dev_index; -} -static inline void -ethtool_rss_get_req_dump_set_header_dev_name(struct ethtool_rss_get_req_dump *req, - const char *dev_name) -{ - req->_present.header = 1; - free(req->header.dev_name); - req->header._present.dev_name_len = strlen(dev_name); - req->header.dev_name = malloc(req->header._present.dev_name_len + 1); - memcpy(req->header.dev_name, dev_name, req->header._present.dev_name_len); - req->header.dev_name[req->header._present.dev_name_len] = 0; -} -static inline void -ethtool_rss_get_req_dump_set_header_flags(struct ethtool_rss_get_req_dump *req, - __u32 flags) -{ - req->_present.header = 1; - req->header._present.flags = 1; - req->header.flags = flags; -} - -struct ethtool_rss_get_list { - struct ethtool_rss_get_list *next; - struct ethtool_rss_get_rsp obj __attribute__((aligned(8))); -}; - -void ethtool_rss_get_list_free(struct ethtool_rss_get_list *rsp); - -struct ethtool_rss_get_list * -ethtool_rss_get_dump(struct ynl_sock *ys, struct ethtool_rss_get_req_dump *req); - /* ============== ETHTOOL_MSG_PLCA_GET_CFG ============== */ /* ETHTOOL_MSG_PLCA_GET_CFG - do */ struct ethtool_plca_get_cfg_req {