[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM0EoMmwER5--nkF2r4=qTHsTnCODy5F8VAo0j6HQOgeLLXbrw@mail.gmail.com>
Date: Fri, 7 Apr 2023 12:08:18 -0400
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Jiri Pirko <jiri@...nulli.us>,
Vinicius Costa Gomes <vinicius.gomes@...el.com>,
Kurt Kanzenbach <kurt@...utronix.de>,
Gerhard Engleder <gerhard@...leder-embedded.com>,
Amritha Nambiar <amritha.nambiar@...el.com>,
Ferenc Fejes <ferenc.fejes@...csson.com>,
Xiaoliang Yang <xiaoliang.yang_1@....com>,
Roger Quadros <rogerq@...nel.org>,
Pranavi Somisetty <pranavi.somisetty@....com>,
Harini Katakam <harini.katakam@....com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Michael Sit Wei Hong <michael.wei.hong.sit@...el.com>,
Mohammad Athari Bin Ismail <mohammad.athari.ismail@...el.com>,
Oleksij Rempel <linux@...pel-privat.de>,
Jacob Keller <jacob.e.keller@...el.com>,
linux-kernel@...r.kernel.org, Ferenc Fejes <fejes@....elte.hu>,
Simon Horman <simon.horman@...igine.com>
Subject: Re: [PATCH v4 net-next 4/9] net/sched: mqprio: add an extack message
to mqprio_parse_opt()
On Mon, Apr 3, 2023 at 6:35 AM Vladimir Oltean <vladimir.oltean@....com> wrote:
>
> 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: Vladimir Oltean <vladimir.oltean@....com>
> Reviewed-by: Ferenc Fejes <fejes@....elte.hu>
> Reviewed-by: Simon Horman <simon.horman@...igine.com>
Acked-by: Jamal Hadi Salim <jhs@...atatu.com>
cheers,
jamal
> ---
> v3->v4: none
> v2->v3: change link from patchwork to lore
> v1->v2: slightly reword last paragraph of commit message
>
> net/sched/sch_mqprio.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
> index 5a9261c38b95..9ee5a9a9b9e9 100644
> --- a/net/sched/sch_mqprio.c
> +++ b/net/sched/sch_mqprio.c
> @@ -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
> * 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 0;
> }
> --
> 2.34.1
>
Powered by blists - more mailing lists