All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 00/14] devlink: Add support for control packet traps
@ 2020-05-29 18:36 Ido Schimmel
  2020-05-29 18:36 ` [PATCH net-next 01/14] devlink: Create dedicated trap group for layer 3 exceptions Ido Schimmel
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Ido Schimmel @ 2020-05-29 18:36 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, jiri, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@mellanox.com>

So far device drivers were only able to register drop and exception
packet traps with devlink. These traps are used for packets that were
either dropped by the underlying device or encountered an exception
(e.g., missing neighbour entry) during forwarding.

However, in the steady state, the majority of the packets being trapped
to the CPU are packets that are required for the correct functioning of
the control plane. For example, ARP request and IGMP query packets.

This patch set allows device drivers to register such control traps with
devlink and expose their default control plane policy to user space.
User space can then tune the packet trap policer settings according to
its needs, as with existing packet traps.

In a similar fashion to exception traps, the action associated with such
traps cannot be changed as it can easily break the control plane. Unlike
drop and exception traps, packets trapped via control traps are not
reported to the kernel's drop monitor as they are not indicative of any
problem.

Patch set overview:

Patches #1-#3 break out layer 3 exceptions to a different group to
provide better granularity. A future patch set will make this completely
configurable.

Patch #4 adds a new trap action ('mirror') that is used for packets that
are forwarded by the device and sent to the CPU. Such packets are marked
by device drivers with 'skb->offload_fwd_mark = 1' in order to prevent
the kernel from forwarding them again.

Patch #5 adds the new trap type, 'control'.

Patches #6-#8 gradually add various control traps to devlink with proper
documentation.

Patch #9 adds a few control traps to netdevsim, which are automatically
exercised by existing devlink-trap selftest.

Patches #10 performs small refactoring in mlxsw.

Patches #11-#13 change mlxsw to register its existing control traps with
devlink.

Patch #14 adds a selftest over mlxsw that exercises all the registered
control traps.

Ido Schimmel (14):
  devlink: Create dedicated trap group for layer 3 exceptions
  mlxsw: spectrum_trap: Move layer 3 exceptions to exceptions trap group
  netdevsim: Move layer 3 exceptions to exceptions trap group
  devlink: Add 'mirror' trap action
  devlink: Add 'control' trap type
  devlink: Add layer 2 control packet traps
  devlink: Add layer 3 control packet traps
  devlink: Add ACL control packet traps
  netdevsim: Register control traps
  mlxsw: spectrum_trap: Factor out common Rx listener function
  mlxsw: spectrum_trap: Register layer 2 control traps
  mlxsw: spectrum_trap: Register layer 3 control traps
  mlxsw: spectrum_trap: Register ACL control traps
  selftests: mlxsw: Add test for control packets

 .../networking/devlink/devlink-trap.rst       | 219 +++++-
 drivers/net/ethernet/mellanox/mlxsw/reg.h     |   2 +-
 .../net/ethernet/mellanox/mlxsw/spectrum.c    | 149 +---
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |   4 +
 .../ethernet/mellanox/mlxsw/spectrum_trap.c   | 583 ++++++++++++++-
 drivers/net/netdevsim/dev.c                   |  10 +-
 include/net/devlink.h                         | 189 +++++
 include/uapi/linux/devlink.h                  |   9 +
 net/core/devlink.c                            |  73 +-
 .../drivers/net/mlxsw/devlink_trap_control.sh | 688 ++++++++++++++++++
 .../selftests/net/forwarding/devlink_lib.sh   |  23 +
 11 files changed, 1781 insertions(+), 168 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/mlxsw/devlink_trap_control.sh

-- 
2.26.2


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-06-01 18:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 18:36 [PATCH net-next 00/14] devlink: Add support for control packet traps Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 01/14] devlink: Create dedicated trap group for layer 3 exceptions Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 02/14] mlxsw: spectrum_trap: Move layer 3 exceptions to exceptions trap group Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 03/14] netdevsim: " Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 04/14] devlink: Add 'mirror' trap action Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 05/14] devlink: Add 'control' trap type Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 06/14] devlink: Add layer 2 control packet traps Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 07/14] devlink: Add layer 3 " Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 08/14] devlink: Add ACL " Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 09/14] netdevsim: Register control traps Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 10/14] mlxsw: spectrum_trap: Factor out common Rx listener function Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 11/14] mlxsw: spectrum_trap: Register layer 2 control traps Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 12/14] mlxsw: spectrum_trap: Register layer 3 " Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 13/14] mlxsw: spectrum_trap: Register ACL " Ido Schimmel
2020-05-29 18:36 ` [PATCH net-next 14/14] selftests: mlxsw: Add test for control packets Ido Schimmel
2020-06-01 18:49 ` [PATCH net-next 00/14] devlink: Add support for control packet traps David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.