Re: [PATCH net-next v2 1/3] selftests: nic_basic_tests: Add selftest file for basic tests of NIC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 19, 2024 at 10:44:11AM +0000, Mohan.Prasad@xxxxxxxxxxxxx wrote:
> Hello Andrew,
> 
> Thank you for the suggestion.
> 
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> > content is safe
> > 
> > > > Since you have batteries included python:
> > > >
> > > > ethtool --json enp2s0
> > > > [sudo] password for andrew:
> > > > [ {
> > > >         "ifname": "enp2s0",
> > > >         "supported-ports": [ "TP","MII" ],
> > > >         "supported-link-modes": [
> > > > "10baseT/Half","10baseT/Full","100baseT/Half","100baseT/Full","1000b
> > > > aseT/
> > > > Full" ],
> > > >         "supported-pause-frame-use": "Symmetric Receive-only",
> > > >         "supports-auto-negotiation": true,
> > > >         "supported-fec-modes": [ ],
> > > >         "advertised-link-modes": [
> > > > "10baseT/Half","10baseT/Full","100baseT/Half","100baseT/Full","1000b
> > > > aseT/
> > > > Full" ],
> > > >         "advertised-pause-frame-use": "Symmetric Receive-only",
> > > >         "advertised-auto-negotiation": true,
> > > >         "advertised-fec-modes": [ ],
> > > >         "auto-negotiation": false,
> > > >         "master-slave-cfg": "preferred slave",
> > > >         "master-slave-status": "unknown",
> > > >         "port": "Twisted Pair",
> > > >         "phyad": 0,
> > > >         "transceiver": "external",
> > > >         "supports-wake-on": "pumbg",
> > > >         "wake-on": "d",
> > > >         "link-detected": false
> > > >     } ]
> > > >
> > > > You can use a json library to do all the parsing for you.
> > >
> > > I tried running the --json option with the ethtool ("ethtool --json enp9s0"),
> > however I am not getting the above output.
> > > Instead it always throws "ethtool: bad command line argument(s)"
> > > I am figuring out what might be missing (or any suggestions would be
> > helpful).
> > 
> > Are you using real ethtool, or busybox? What version of ethtool? I'm using
> > 6.10, but it looks like JSON support was added somewhere around 5.10.
> 
> I have been using ethtool 6.7, updating to ethtool 6.10 solved the problem.

It would be good to gracefully handle this. Have the test fail with a
human readable error indicating ethtool is too old, rather than just
throwing an exception etc.

Digging through the git history, it seems like 6.10 was actually the
first version that supported this:

commit bd1341cd2146bfb89e1239546299102339acbf4d
Author: Fabian Pfitzner <f.pfitzner@xxxxxxxxxxxxxx>
Date:   Fri Jul 19 10:55:44 2024 +0200

    add json support for base command
    
    Most subcommands already implement json support for their output. The
    base command (without supplying any subcommand) still lacks this
    option. This patch implments the needed changes to get json output,
    which is printed via "ethtool --json [iface]"
    
    The following design decision were made during implementation:
    - json values like Yes/No are printed as true/false
    - values that are "Unknown" are not printed at all
    - all other json values are not changed
    - keys are printed in lowercase with dashes in between
    
    Signed-off-by: Fabian Pfitzner <f.pfitzner@xxxxxxxxxxxxxx>

	Andrew




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux