Re: [PATCH v4 net-next 6/9] net/sched: mqprio: allow per-TC user input of FP adminStatus

From: Jakub Kicinski
Date: Tue Apr 11 2023 - 14:18:20 EST


On Tue, 11 Apr 2023 20:01:51 +0300 Vladimir Oltean wrote:
> > > + int err, tc;
> > > +
> > > + err = nla_parse_nested(tb, TCA_MQPRIO_TC_ENTRY_MAX, opt,
> > > + mqprio_tc_entry_policy, extack);
> > > + if (err < 0)
> > > + return err;
> > > +
> > > + if (!tb[TCA_MQPRIO_TC_ENTRY_INDEX]) {
> > > + NL_SET_ERR_MSG(extack, "TC entry index missing");
> >
> > Are you not using NL_REQ_ATTR_CHECK() because iproute can't actually
> > parse the result? :(
>
> I could use it though.. let's assume that iproute2 is "reference code"
> and gets the nlattr structure right. Thus, the NLMSGERR_ATTR_MISS_NEST
> would be of more interest for custom user programs.
>
> Speaking of which, is there any reference example of how to use
> NLMSGERR_ATTR_MISS_NEST? My search came up empty handed:
> https://github.com/search?p=1&q=NLMSGERR_ATTR_MISS_NEST&type=Code

Only YNL to my knowledge, basic support in the in-tree Python:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/tools/net/ynl/lib/ynl.py#n198
And fuller support in the user space hacks which never made it out
of my GitHub:
https://github.com/kuba-moo/linux/blob/ynl-user-c-wip/tools/net/ynl/lib/ynl.c#L163

> I usually steal from hostap's error_handler(), but it looks like it
> hasn't gotten that advanced yet as to re-parse the netlink message to
> understand the reason why it got rejected.