Commit ab277d20 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Jakub Kicinski

net/sched: mqprio: add an extack message to mqprio_parse_opt()

Ferenc reports that a combination of poor iproute2 defaults and obscure
cases where the kernel returns -EINVAL make it difficult to understand
what is wrong with this command:

$ ip link add veth0 numtxqueues 8 numrxqueues 8 type veth peer name veth1
$ tc qdisc add dev veth0 root mqprio num_tc 8 map 0 1 2 3 4 5 6 7 \
        queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7
RTNETLINK answers: Invalid argument

Hopefully with this patch, the cause is clearer:

Error: Device does not support hardware offload.

The kernel was (and still is) rejecting this because iproute2 defaults
to "hw 1" if this command line option is not specified.

Link: https://lore.kernel.org/netdev/ede5e9a2f27bf83bfb86d3e8c4ca7b34093b99e2.camel@inf.elte.hu/Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: default avatarFerenc Fejes <fejes@inf.elte.hu>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 57f21bf8
...@@ -133,8 +133,11 @@ static int mqprio_parse_opt(struct net_device *dev, struct tc_mqprio_qopt *qopt, ...@@ -133,8 +133,11 @@ static int mqprio_parse_opt(struct net_device *dev, struct tc_mqprio_qopt *qopt,
/* If ndo_setup_tc is not present then hardware doesn't support offload /* If ndo_setup_tc is not present then hardware doesn't support offload
* and we should return an error. * and we should return an error.
*/ */
if (qopt->hw && !dev->netdev_ops->ndo_setup_tc) if (qopt->hw && !dev->netdev_ops->ndo_setup_tc) {
NL_SET_ERR_MSG(extack,
"Device does not support hardware offload");
return -EINVAL; return -EINVAL;
}
return 0; return 0;
} }
......
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