Re: [net-next PATCH] taprio: don't reject same mqprio settings

From: David Miller
Date: Sat Nov 16 2019 - 15:42:37 EST


From: Ivan Khoronzhuk <ivan.khoronzhuk@xxxxxxxxxx>
Date: Fri, 15 Nov 2019 03:56:07 +0200

> @@ -1347,6 +1347,26 @@ static int taprio_parse_clockid(struct Qdisc *sch, struct nlattr **tb,
> return err;
> }
>
> +static int taprio_mqprio_cmp(struct net_device *dev,
> + struct tc_mqprio_qopt *mqprio)
> +{
...
> static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
> struct netlink_ext_ack *extack)
> {
> @@ -1398,6 +1418,10 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
> admin = rcu_dereference(q->admin_sched);
> rcu_read_unlock();
>
> + /* no changes - no new mqprio settings */
> + if (mqprio && !taprio_mqprio_cmp(dev, mqprio))
> + mqprio = NULL;
> +

I like Vinicius's feedback, please make the new helper function have
the signature:

static int taprio_mqprio_cmp(const struct net_device *dev,
const struct tc_mqprio_qopt *mqprio)

And make the NULL check in there instead of at the caller.

Please also remember to add the Fixes: tag.

Thanks.