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] [day] [month] [year] [list]
Message-ID: <CAMy_GT89khdMOCeSxqGx_hh+samb0BabbrQrY6nd9uA3xNS4Cg@mail.gmail.com>
Date:   Tue, 7 Mar 2023 10:24:25 +0800
From:   Po-Hsu Lin <po-hsu.lin@...onical.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        netdev@...r.kernel.org, idosch@...lanox.com,
        danieller@...lanox.com, petrm@...lanox.com, shuah@...nel.org,
        pabeni@...hat.com, edumazet@...gle.com, davem@...emloft.net
Subject: Re: [PATCH] selftests: net: devlink_port_split.py: skip test if no
 suitable device available

On Tue, Mar 7, 2023 at 2:33 AM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Mon,  6 Mar 2023 19:19:59 +0800 Po-Hsu Lin wrote:
> > The `devlink -j dev show` command output may not contain the "flavour"
> > key, for example:
> >   $ devlink -j dev show
> >   {"dev":{"pci/0001:00:00.0":{},"pci/0002:00:00.0":{}}}
>
> It's not dev that's supposed to have the flavor, it's port.
>
>   devlink -j port show
Ah yes, it's using output from this command, thanks for catching this.

>
> Are you running with old kernel or old user space?
> Flavor is not an optional attribute.
This was from a s390x LPAR instance with Ubuntu 22.10 (5.19.0-37-generic)
iproute2-5.15.0

$ devlink -j port show
{"port":{"pci/0001:00:00.0/1":{"type":"eth","netdev":"ens301"},"pci/0001:00:00.0/2":{"type":"eth","netdev":"ens301d1"},"pci/0002:00:00.0/1":{"type":"eth","netdev":"ens317"},"pci/0002:00:00.0/2":{"type":"eth","netdev":"ens317d1"}}}

>
> > This will cause a KeyError exception. Fix this by checking the key
> > existence first.
> >
> > Also, if max lanes is 0 the port splitting won't be tested at all.
> > but the script will end normally and thus causing a false-negative
> > test result.
> >
> > Use a test_ran flag to determine if these tests were skipped and
> > return KSFT_SKIP accordingly.
> >
> > Link: https://bugs.launchpad.net/bugs/1937133
> > Fixes: f3348a82e727 ("selftests: net: Add port split test")
> > Signed-off-by: Po-Hsu Lin <po-hsu.lin@...onical.com>
>
> Could you factor out the existing skipping logic from main()
> (the code under "if not dev:") and add the test for flavors
> to the same function? It'll be a bit more code but cleaner
> result IMHO.
Sure, will do with V2.
Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ