]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Trap loop-backed packets
authorIdo Schimmel <idosch@mellanox.com>
Wed, 17 Aug 2016 14:39:33 +0000 (16:39 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Aug 2016 23:18:27 +0000 (19:18 -0400)
commita326671cd2fca72355a1cede0ac013aaeb6461d6
tree4367bf7306d77db2956ff97e0e25fbba1dbba8cc
parent079b3f7a5b6abb724ba5ff2b61e4c297d2df1fef
mlxsw: spectrum: Trap loop-backed packets

One of the conditions to generate an ICMP Redirect Message is that "the
packet is being forwarded out the same physical interface that it was
received from" (RFC 1812).

Therefore, we need to be able to trap such packets and let the kernel
decide what to do with them.

For each RIF, enable the loop-back filter, which will raise the LBERROR
trap whenever the ingress RIF equals the egress RIF.

Fixes: 1cc503140fec ("mlxsw: spectrum: Introduce support for router interfaces")
Reported-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@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
drivers/net/ethernet/mellanox/mlxsw/trap.h