lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c60720e1a6a9768b063ba709ec536f0d89a31ff9.camel@ericsson.com>
Date:   Fri, 17 Feb 2023 07:24:07 +0000
From:   Ferenc Fejes <ferenc.fejes@...csson.com>
To:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "vladimir.oltean@....com" <vladimir.oltean@....com>
CC:     "andrew@...n.ch" <andrew@...n.ch>,
        "amritha.nambiar@...el.com" <amritha.nambiar@...el.com>,
        "vinicius.gomes@...el.com" <vinicius.gomes@...el.com>,
        "jhs@...atatu.com" <jhs@...atatu.com>,
        "claudiu.manoil@....com" <claudiu.manoil@....com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "xiaoliang.yang_1@....com" <xiaoliang.yang_1@....com>,
        "alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "jiri@...nulli.us" <jiri@...nulli.us>,
        "UNGLinuxDriver@...rochip.com" <UNGLinuxDriver@...rochip.com>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "gerhard@...leder-embedded.com" <gerhard@...leder-embedded.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "xiyou.wangcong@...il.com" <xiyou.wangcong@...il.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "kurt@...utronix.de" <kurt@...utronix.de>,
        "f.fainelli@...il.com" <f.fainelli@...il.com>
Subject: Re: [PATCH net-next 08/12] net/sched: mqprio: add an extack message
 to mqprio_parse_opt()

Hi Vladimir!

On Fri, 2023-02-17 at 01:21 +0200, Vladimir Oltean 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.

Much better, great improvement!

> 
> This was rejected because iproute2 defaults to "hw 1" if the option
> is
> not specified.
> 
> Link:
> https://patchwork.kernel.org/project/netdevbpf/patch/20230204135307.1036988-3-vladimir.oltean@nxp.com/#25215636
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> ---
>  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 18eda5fade81..52cfc0ec2e23 100644
> --- a/net/sched/sch_mqprio.c
> +++ b/net/sched/sch_mqprio.c
> @@ -134,8 +134,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;
>  }

Thanks for doing this!

Best,
Ferenc

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ