]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Mirror loopbacked packets instead of trapping them
authorIdo Schimmel <idosch@mellanox.com>
Tue, 4 Dec 2018 08:15:12 +0000 (08:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Dec 2018 16:36:36 +0000 (08:36 -0800)
commit5ee60dfc93c168c26bf7963a97743efc911749ad
tree07c00148d4ade5ddd79a68c315eb608313276b85
parent4289957cd792d6a180f6f7ddb55db69a5bea1606
mlxsw: spectrum: Mirror loopbacked packets instead of trapping them

When the ASIC detects that a unicast packet is routed through the same
router interface (RIF) from which it ingressed (iRIF == eRIF), it raises
a trap called loopback error (LBERROR).

Thus far, this trap was configured to send a sole copy of the packet to
the CPU so that ICMP redirect packets could be potentially generated by
the kernel.

This is problematic as the CPU cannot forward packets at 3.2Tb/s and
there are scenarios (e.g., "one-armed router") where iRIF == eRIF is not
an exception.

Solve this by changing the trap to send a copy of the packet to the CPU.
To prevent the kernel from forwarding the packet again, it is marked
with 'offload_l3_fwd_mark'.

The trap is configured in a trap group of its own with a dedicated
policer in order not to prevent packets trapped by other traps from
reaching the CPU.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/reg.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c