Commit 026de64d authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Jakub Kicinski

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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 25becba6
...@@ -1661,11 +1661,15 @@ static int taprio_init(struct Qdisc *sch, struct nlattr *opt, ...@@ -1661,11 +1661,15 @@ static int taprio_init(struct Qdisc *sch, struct nlattr *opt,
list_add(&q->taprio_list, &taprio_list); list_add(&q->taprio_list, &taprio_list);
spin_unlock(&taprio_list_lock); 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; 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; return -EOPNOTSUPP;
}
/* pre-allocate qdisc, attachment can't fail */ /* pre-allocate qdisc, attachment can't fail */
q->qdiscs = kcalloc(dev->num_tx_queues, q->qdiscs = kcalloc(dev->num_tx_queues,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment