Re: [RFC PATCH net-next 04/10] ethtool: Add link extended state

2020-06-09 Thread Amit Cohen
On 07-Jun-20 21:17, Florian Fainelli wrote: > > > On 6/7/2020 7:59 AM, Amit Cohen wrote: >> Currently, drivers can only tell whether the link is up/down using >> LINKSTATE_GET, but no additional information is given. >> >> Add attributes to LINKSTATE_GET comman

Re: [RFC PATCH net-next 07/10] mlxsw: spectrum_ethtool: Add link extended state

2020-06-08 Thread Amit Cohen
On 07-Jun-20 21:25, Florian Fainelli wrote: > > > On 6/7/2020 7:59 AM, Amit Cohen wrote: >> Implement .get_down_ext_state() as part of ethtool_ops. >> Query link down reason from PDDR register and convert it to ethtool >> ext_state. >> >> In case that mo

Re: [RFC PATCH net-next 05/10] Documentation: networking: ethtool-netlink: Add link extended state

2020-06-08 Thread Amit Cohen
On 07-Jun-20 22:11, Florian Fainelli wrote: > > > On 6/7/2020 7:59 AM, Amit Cohen wrote: >> Add link extended state attributes. >> >> Signed-off-by: Amit Cohen >> Reviewed-by: Petr Machata >> Reviewed-by: Jiri Pirko > > If you need to resubmit

RE: [RFC PATCH net-next 04/10] ethtool: Add link extended state

2020-06-08 Thread Amit Cohen
Andrew Lunn writes: >> +/** >> + * enum ethtool_ext_substate_cable_issue - more information in >> + * addition to ETHTOOL_EXT_STATE_CABLE_ISSUE. >> + */ >> +enum ethtool_ext_substate_cable_issue { >> +ETHTOOL_EXT_SUBSTATE_UNSUPPORTED_CABLE = 1, >> +ETHTOOL_EXT_SUBSTATE_SHORTED_CABLE, >> +

RE: [RFC PATCH net-next 05/10] Documentation: networking: ethtool-netlink: Add link extended state

2020-06-08 Thread Amit Cohen
Andrew Lunn writes: >> +Link extended states: >> + >> + >> = >> + ``Autoneg failure`` Failure during auto negotiation mechanism > >I think you need to define 'failure' here. > >Linux PHYs don't have this st

[RFC PATCH net-next 06/10] mlxsw: reg: Port Diagnostics Database Register

2020-06-07 Thread Amit Cohen
The PDDR register enables to read the Phy debug database. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/reg.h | 51 +++ 1 file changed, 51 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw

[RFC PATCH net-next 10/10] selftests: forwarding: Add tests for ethtool extended state

2020-06-07 Thread Amit Cohen
Add tests to check ethtool report about extended state. The tests configure several states and verify that the correct extended state is reported by ethtool. Check extended state with substate (Autoneg) and extended state without substate (No cable). Signed-off-by: Amit Cohen Reviewed-by: Petr

[RFC PATCH net-next 03/10] mlxsw: spectrum_ethtool: Move mlxsw_sp_port_type_speed_ops structs

2020-06-07 Thread Amit Cohen
Move mlxsw_sp1_port_type_speed_ops and mlxsw_sp2_port_type_speed_ops with the relevant code from spectrum.c to spectrum_ethtool.c. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Jiri Pirko --- .../net/ethernet/mellanox/mlxsw/spectrum.c| 660 -- .../net

[RFC PATCH net-next 04/10] ethtool: Add link extended state

2020-06-07 Thread Amit Cohen
nd omit the substate attribute. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Jiri Pirko --- include/linux/ethtool.h | 22 + include/uapi/linux/ethtool.h | 70 include/uapi/linux/ethtool_netlink.h | 2 + net/ethtool

[RFC PATCH net-next 05/10] Documentation: networking: ethtool-netlink: Add link extended state

2020-06-07 Thread Amit Cohen
Add link extended state attributes. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Jiri Pirko --- Documentation/networking/ethtool-netlink.rst | 56 ++-- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/Documentation/networking/ethtool

[RFC PATCH net-next 09/10] selftests: forwarding: forwarding.config.sample: Add port with no cable connected

2020-06-07 Thread Amit Cohen
Add NETIF_NO_CABLE port to tests topology. The port can also be declared as an environment variable and tests can be run like that: NETIF_NO_CABLE=eth9 ./test.sh eth{1..8} The NETIF_NO_CABLE port will be used by ethtool_extended_state test. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata

[RFC PATCH net-next 07/10] mlxsw: spectrum_ethtool: Add link extended state

2020-06-07 Thread Amit Cohen
Implement .get_down_ext_state() as part of ethtool_ops. Query link down reason from PDDR register and convert it to ethtool ext_state. In case that more information than common ext_state is provided, fill ext_substate also with the appropriate value. Signed-off-by: Amit Cohen Reviewed-by: Petr

[RFC PATCH net-next 08/10] selftests: forwarding: ethtool: Move different_speeds_get() to ethtool_lib

2020-06-07 Thread Amit Cohen
Currently different_speeds_get() is used only by ethtool.sh tests. The function can be useful for another tests that check ethtool configurations. Move the function to ethtool_lib in order to allow other tests to use it. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata --- .../testing

[RFC PATCH net-next 00/10] Add extended state

2020-06-07 Thread Amit Cohen
curred, something like: $ ethtool ethX ... Link detected: yes (downshifted) Patches #1-#3 Move mlxsw ethtool code to separate file Patches #4-#5 Add infrastructure in ethtool Patches #6-#7 Add support of extended state in mlxsw driver Patches #8-#10 Add tests cases Amit Cohen (10): mlxsw: spectrum_dcb:

[RFC PATCH net-next 01/10] mlxsw: spectrum_dcb: Rename mlxsw_sp_port_headroom_set()

2020-06-07 Thread Amit Cohen
, and not only as static function in spectrum.c. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw

[RFC PATCH net-next 02/10] mlxsw: Move ethtool_ops to spectrum_ethtool.c

2020-06-07 Thread Amit Cohen
Add spectrum_ethtool.c file for ethtool code. Move ethtool_ops and the relevant code from spectrum.c to spectrum_ethtool.c. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/Makefile | 3 +- .../net/ethernet/mellanox/mlxsw