[PATCH iproute2-next] ip route: Print "rt_offload_failed" indication

2021-02-09 Thread Amit Cohen
The kernel signals when offload fails using the 'RTM_F_OFFLOAD_FAILED' flag. Print it to help users understand the offload state of the route. The "rt_" prefix is used in order to distinguish it from the offload state of nexthops, similar to "rt_offload" and "r

RE: [PATCH net-next 05/10] net: ipv4: Emit notification when fib hardware flags are changed

2021-01-27 Thread Amit Cohen
>-Original Message- >From: David Ahern >Sent: Wednesday, January 27, 2021 7:03 >To: Ido Schimmel ; netdev@vger.kernel.org >Cc: da...@davemloft.net; k...@kernel.org; Amit Cohen ; >Roopa Prabhu ; Donald >Sharp ; Benjamin Poirier ; mlxsw >; Ido Schimmel > >S

RE: [PATCH net-next 01/10] netdevsim: fib: Convert the current occupancy to an atomic variable

2021-01-27 Thread Amit Cohen
>-Original Message- >From: David Ahern >Sent: Wednesday, January 27, 2021 6:33 >To: Ido Schimmel ; netdev@vger.kernel.org >Cc: da...@davemloft.net; k...@kernel.org; Amit Cohen ; >Roopa Prabhu ; Donald >Sharp ; Benjamin Poirier ; mlxsw >; Ido Schimmel > >S

[PATCH iproute2] devlink: Add fflush() in cmd_mon_show_cb()

2020-08-20 Thread Amit Cohen
From: Amit Cohen Similar to other print functions we need to flush buffered data in order to work with pipes and output redirects. Without it, stdout output is buffered and not written to the disk. This is useful when writing scripts that rely on devlink-monitor output. Signed-off-by: Amit

[PATCH ethtool v2 0/3] Add extended link state

2020-07-02 Thread Amit Cohen
-next snapshot * Move helper functions from common.c to netlink/settings.c * Use string tables for enum strings * Report the numeric value in case of unknown value * Use banner once, change print concept Amit Cohen (3): uapi: linux: update kernel UAPI header files netlink: desc-ethtool.c

[PATCH ethtool v2 3/3] netlink: settings: expand linkstate_reply_cb() to support link extended state

2020-07-02 Thread Amit Cohen
Print extended state in addition to link state. In case that extended state is not provided, print state only. If extended substate is provided in addition to the extended state, print it also. Signed-off-by: Amit Cohen --- netlink/settings.c | 147

[PATCH ethtool v2 1/3] uapi: linux: update kernel UAPI header files

2020-07-02 Thread Amit Cohen
Add copies of kernel UAPI header files needed for link extended state: uapi/linux/ethtool.h uapi/linux/ethtool_netlink.h The copies are taken from net-next tree, commit ecc31c60240b ("ethtool: Add link extended state") Signed-off-by: Amit Cohen --- uapi/linux

[PATCH ethtool v2 2/3] netlink: desc-ethtool.c: Add descriptions of extended state attributes

2020-07-02 Thread Amit Cohen
Add ETHTOOL_A_LINKSTATE_EXT_STATE and ETHTOOL_A_LINKSTATE_EXT_SUBSTATE format descriptions. Signed-off-by: Amit Cohen --- netlink/desc-ethtool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c index 98b898e..bce22e2 100644 --- a/netlink/desc

[PATCH ethtool 1/3] netlink: expand ETHTOOL_LINKSTATE with extended state attributes

2020-06-30 Thread Amit Cohen
Add ETHTOOL_A_LINKSTATE_EXT_STATE to expose general extended state. Add ETHTOOL_A_LINKSTATE_EXT_SUBSTATE to expose more information in addition to the extended state. Signed-off-by: Amit Cohen --- netlink/desc-ethtool.c | 2 ++ uapi/linux/ethtool_netlink.h | 2 ++ 2 files changed, 4

[PATCH ethtool 0/3] Add extended link state

2020-06-30 Thread Amit Cohen
neral extended state, drivers can pass additional information about the link state using the sub-state field. For example: $ ethtool ethX ... Link detected: no (Autoneg, No partner detected) Amit Cohen (3): netlink: expand ETHTOOL_LINKSTATE with extended state attributes common: add infrastructu

[PATCH ethtool 2/3] common: add infrastructure to convert kernel values to userspace strings

2020-06-30 Thread Amit Cohen
Add enums and functions to covert extended state values sent from kernel to appropriate strings to expose in userspace. Signed-off-by: Amit Cohen --- common.c | 171 +++ common.h | 2 + 2 files changed, 173 insertions(+) diff --git a

[PATCH ethtool 3/3] netlink: settings: expand linkstate_reply_cb() to support link extended state

2020-06-30 Thread Amit Cohen
Print extended state in addition to link state. In case that extended state is not provided, print state only. If extended substate is provided in addition to the extended state, print it also. Signed-off-by: Amit Cohen --- netlink/settings.c | 59

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

2020-06-25 Thread Amit Cohen
On 24-Jun-20 22:07, Jacob Keller wrote: > > > On 6/24/2020 1:19 AM, Ido Schimmel wrote: >> From: Amit Cohen >> >> Add link extended state attributes. >> >> Signed-off-by: Amit Cohen >> Reviewed-by: Petr Machata >> Reviewed-by: Jiri Pirko

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 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 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 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 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 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 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 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

[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 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:

RE: Link down reasons

2020-05-27 Thread Amit Cohen
Andrew Lunn writes: >On Wed, May 27, 2020 at 03:41:22PM +0000, Amit Cohen wrote: >> Hi Andrew, >> >> We are planning to send a set that exposes link-down reason in ethtool. >> >> It seems that the ability of your set “Ethernet cable test support” >>