Re: [PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh

2019-06-10 Thread Ido Schimmel
On Mon, Jun 10, 2019 at 08:29:54AM -0700, Florian Fainelli wrote: > On 6/10/2019 6:56 AM, Ido Schimmel wrote: > > On Mon, Jun 10, 2019 at 03:35:38PM +0200, Andrew Lunn wrote: > >> On Mon, Jun 10, 2019 at 11:40:43AM +0300, Ido Schimmel wrote: > >>> From: Amit Cohen > >>> +declare -A speed_values >

Re: [PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh

2019-06-10 Thread Florian Fainelli
On 6/10/2019 6:56 AM, Ido Schimmel wrote: > On Mon, Jun 10, 2019 at 03:35:38PM +0200, Andrew Lunn wrote: >> On Mon, Jun 10, 2019 at 11:40:43AM +0300, Ido Schimmel wrote: >>> From: Amit Cohen >>> +declare -A speed_values >>> + >>> +speed_values=( [10baseT/Half]=0x001 >>> + [10baseT

Re: [PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh

2019-06-10 Thread Andrew Lunn
> Andrew, are you suggestion to split speeds_get() into > supported_speeds_get() and advertised_speeds_get() and use each where > appropriate? Note that not all the tests are testing with autoneg on. Hi Ido Yes. You should be able to force all speeds in supported speeds. But if you try to auto-n

Re: [PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh

2019-06-10 Thread Ido Schimmel
On Mon, Jun 10, 2019 at 03:59:14PM +0200, Andrew Lunn wrote: > > +speeds_get() > > +{ > > + local dev=$1; shift > > + local with_mode=$1; shift > > + > > + local speeds_str=$(ethtool "$dev" | \ > > + # Snip everything before the link modes section. > > + sed -n '/Supported

Re: [PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh

2019-06-10 Thread Andrew Lunn
> +speeds_get() > +{ > + local dev=$1; shift > + local with_mode=$1; shift > + > + local speeds_str=$(ethtool "$dev" | \ > + # Snip everything before the link modes section. > + sed -n '/Supported link modes:/,$p' | \ > + # Quit processing the rest at

Re: [PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh

2019-06-10 Thread Ido Schimmel
On Mon, Jun 10, 2019 at 03:35:38PM +0200, Andrew Lunn wrote: > On Mon, Jun 10, 2019 at 11:40:43AM +0300, Ido Schimmel wrote: > > From: Amit Cohen > > +declare -A speed_values > > + > > +speed_values=( [10baseT/Half]=0x001 > > + [10baseT/Full]=0x002 > > + [100baseT/Half]=0x0

Re: [PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh

2019-06-10 Thread Andrew Lunn
On Mon, Jun 10, 2019 at 11:40:43AM +0300, Ido Schimmel wrote: > From: Amit Cohen > +declare -A speed_values > + > +speed_values=( [10baseT/Half]=0x001 > + [10baseT/Full]=0x002 > + [100baseT/Half]=0x004 > + [100baseT/Full]=0x008 > + [1000baseT/H

[PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh

2019-06-10 Thread Ido Schimmel
From: Amit Cohen Functions: 1. ethtool_set: params: cmd The function runs ethtool by cmd (ethtool -s cmd) and checks if there was an error in configuration 2. speeds_get: params: dev, with_mode (0 or 1) return value: Array of supported link modes with/wit