[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250711165813.02e3cd80@kernel.org>
Date: Fri, 11 Jul 2025 16:58:13 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, thomas.petazzoni@...tlin.com, Andrew Lunn
<andrew@...n.ch>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, Russell King <linux@...linux.org.uk>, Florian Fainelli
<f.fainelli@...il.com>, Heiner Kallweit <hkallweit1@...il.com>, Vladimir
Oltean <vladimir.oltean@....com>, Köry Maincent
<kory.maincent@...tlin.com>, Oleksij Rempel <o.rempel@...gutronix.de>,
Simon Horman <horms@...nel.org>, Shuah Khan <shuah@...nel.org>,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net-next v3 3/3] selftests: ethtool: Introduce ethernet
PHY selftests on netdevsim
On Thu, 10 Jul 2025 08:22:47 +0200 Maxime Chevallier wrote:
> +set -o pipefail
> +
> +# Check simple PHY addition and listing
> +
> +# Parent == 0 means that the PHY's parent is the netdev
> +PHY_DFS=$(make_phydev_on_netdev "$NSIM_ID" 0)
> +
> +# First PHY gets index 1
> +index=$(ethtool --show-phys "$NSIM_NETDEV" | grep "PHY index" | cut -d ' ' -f 3)
> +check $? "$index" "1"
> +
> +# Insert a second PHY, same parent. It gets index 2.
> +PHY2_DFS=$(make_phydev_on_netdev "$NSIM_ID" 0)
> +
> +# Create another netdev
> +NSIM_ID2=$((RANDOM % 1024))
> +NSIM_NETDEV_2=$(make_netdev_from_id "$NSIM_ID2")
> +
> +PHY3_DFS=$(make_phydev_on_netdev "$NSIM_ID2" 0);
> +
> +# Check unfiltered PHY Dump
> +n_phy=$(ethtool --show-phys '*' | grep -c "PHY index")
> +check $? "$n_phy" "3"
> +
> +# Check filtered Dump
> +n_phy=$(ethtool --show-phys "$NSIM_NETDEV" | grep -c "PHY index")
> +check $? "$n_phy" "2"
Not a very strong preference, but I wonder if we should wire up the
paths to the Python lib for drivers/net/netdevsim and switch to Python?
It does the setup and cleanup and it gives us direct YNL access.
More convenient for testing new stuff than jugging ethtool builds..
But I guess you could argue that testing the CLI is good in itself.
Powered by blists - more mailing lists