[PATCH net-next RFC v1 0/4] Add devlink traps in devlink port context
From: Aya Levin
Date: Wed Sep 02 2020 - 11:32:49 EST
Implement support for devlink traps on per-port basis.
Dropped packets in the RX flow are related to the Ethernet port and
thus should be in port context. Traps per device should trap global
configuration which can cause drops. On top of that, enabling a trap
on a device level should trigger this trap on its siblings ports.
In addition, when devlink traps is enabled, it may cause a degradation
in performance. Hence devlink traps should be regard as a debug mode.
Considering that, it is preferred to encapsulate the debug mode as
much as possible and not to effect all the device.
Patchset:
Patch 1: Refactors devlink trap for easier code re-use in the coming
patches
Patch 2: Adds devlink traps under devlink port context
Patch 3: Adds a relation between traps in device context and traps in
ports context. In a nutshell it allows enable/disable of a trap on
all related ports which registered this trap.
Patch 4: Display a use in devlink traps in port context in mlx5
ethernet driver.
Aya Levin (4):
devlink: Wrap trap related lists and ops in trap_mngr
devlink: Add devlink traps under devlink_ports context
devlink: Add hiererchy between traps in device level and port level
net/mlx5e: Add devlink trap to catch oversize packets
drivers/net/ethernet/mellanox/mlx5/core/Makefile | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +
drivers/net/ethernet/mellanox/mlx5/core/en/traps.c | 32 ++
drivers/net/ethernet/mellanox/mlx5/core/en/traps.h | 13 +
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 41 ++
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 11 +-
drivers/net/ethernet/mellanox/mlxsw/core.c | 5 +
include/net/devlink.h | 84 ++-
net/core/devlink.c | 616 +++++++++++++++++----
9 files changed, 665 insertions(+), 141 deletions(-)
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/traps.c
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/traps.h
--
2.14.1