From: Vladimir Oltean Date: Thu, 15 Sep 2022 10:50:45 +0000 (+0300) Subject: net/sched: taprio: add extack messages in taprio_init X-Git-Tag: v6.1-rc5~319^2~161^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=026de64d7bc39cc77f2084c4454a562720e9c8ff;p=platform%2Fkernel%2Flinux-starfive.git net/sched: taprio: add extack messages in taprio_init Stop contributing to the proverbial user unfriendliness of tc, and tell the user what is wrong wherever possible. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski --- diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 2f45dfb..2552f62 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -1661,11 +1661,15 @@ static int taprio_init(struct Qdisc *sch, struct nlattr *opt, list_add(&q->taprio_list, &taprio_list); spin_unlock(&taprio_list_lock); - if (sch->parent != TC_H_ROOT) + if (sch->parent != TC_H_ROOT) { + NL_SET_ERR_MSG_MOD(extack, "Can only be attached as root qdisc"); return -EOPNOTSUPP; + } - if (!netif_is_multiqueue(dev)) + if (!netif_is_multiqueue(dev)) { + NL_SET_ERR_MSG_MOD(extack, "Multi-queue device is required"); return -EOPNOTSUPP; + } /* pre-allocate qdisc, attachment can't fail */ q->qdiscs = kcalloc(dev->num_tx_queues,