Skip to content

Commit 976c44a

Browse files
idoschkuba-moo
authored andcommitted
mlxsw: core: Unregister EMAD trap using FORWARD action
The device's manual (PRM - Programmer's Reference Manual) classifies the trap that is used to deliver EMAD responses as an "event trap". Among other things, it means that the only actions that can be associated with the trap are TRAP and FORWARD (NOP). Currently, during driver de-initialization the driver unregisters the trap by setting its action to DISCARD, which violates the above guideline. Future firmware versions will prevent such misuses by returning an error. This does not prevent the driver from working, but an error will be printed to the kernel log during module removal / devlink reload: mlxsw_spectrum 0000:03:00.0: Reg cmd access status failed (status=7(bad parameter)) mlxsw_spectrum 0000:03:00.0: Reg cmd access failed (reg_id=7003(hpkt),type=write) Suppress the error message by aligning the driver to the manual and use a FORWARD (NOP) action when unregistering the trap. Fixes: 4ec14b7 ("mlxsw: Add interface to access registers and process events") Cc: Jiri Pirko <[email protected]> Cc: Amit Cohen <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Petr Machata <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Petr Machata <[email protected]> Link: https://lore.kernel.org/r/753a89e14008fde08cb4a2c1e5f537b81d8eb2d6.1713446092.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9f898fc commit 976c44a

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlxsw/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ static void mlxsw_emad_rx_listener_func(struct sk_buff *skb, u16 local_port,
849849

850850
static const struct mlxsw_listener mlxsw_emad_rx_listener =
851851
MLXSW_RXL(mlxsw_emad_rx_listener_func, ETHEMAD, TRAP_TO_CPU, false,
852-
EMAD, DISCARD);
852+
EMAD, FORWARD);
853853

854854
static int mlxsw_emad_tlv_enable(struct mlxsw_core *mlxsw_core)
855855
{

0 commit comments

Comments
 (0)