Skip to content

Commit 6d627a2

Browse files
Amit Cohenkuba-moo
authored andcommitted
mlxsw: Trap ARP packets at layer 2 instead of layer 3
Next patch will set the same hardware domain for all bridge ports, including VXLAN, to prevent packets from being forwarded by software when they were already forwarded by hardware. ARP packets are not flooded by hardware to VXLAN, so software should handle such flooding. When hardware domain of VXLAN device will be changed, ARP packets which are trapped and marked with offload_fwd_mark will not be flooded to VXLAN also in software, which will break VXLAN traffic. To prevent such breaking, trap ARP packets at layer 2 and don't mark them as L2-forwarded in hardware, then flooding ARP packets will be done only in software, and VXLAN will send ARP packets. Remove NVE_ENCAP_ARP which is no longer needed, as now ARP packets are trapped when they enter the device. Signed-off-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/b2a2cc607a1f4cb96c10bd3b0b0244ba3117fd2e.1742224300.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent c353e89 commit 6d627a2

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,8 +2409,6 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
24092409
/* Multicast Router Traps */
24102410
MLXSW_SP_RXL_MARK(ACL1, TRAP_TO_CPU, MULTICAST, false),
24112411
MLXSW_SP_RXL_L3_MARK(ACL2, TRAP_TO_CPU, MULTICAST, false),
2412-
/* NVE traps */
2413-
MLXSW_SP_RXL_MARK(NVE_ENCAP_ARP, TRAP_TO_CPU, NEIGH_DISCOVERY, false),
24142412
};
24152413

24162414
static const struct mlxsw_listener mlxsw_sp1_listener[] = {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -959,18 +959,18 @@ static const struct mlxsw_sp_trap_item mlxsw_sp_trap_items_arr[] = {
959959
},
960960
{
961961
.trap = MLXSW_SP_TRAP_CONTROL(ARP_REQUEST, NEIGH_DISCOVERY,
962-
MIRROR),
962+
TRAP),
963963
.listeners_arr = {
964-
MLXSW_SP_RXL_MARK(ROUTER_ARPBC, NEIGH_DISCOVERY,
965-
TRAP_TO_CPU, false),
964+
MLXSW_SP_RXL_NO_MARK(ARPBC, NEIGH_DISCOVERY,
965+
TRAP_TO_CPU, false),
966966
},
967967
},
968968
{
969969
.trap = MLXSW_SP_TRAP_CONTROL(ARP_RESPONSE, NEIGH_DISCOVERY,
970-
MIRROR),
970+
TRAP),
971971
.listeners_arr = {
972-
MLXSW_SP_RXL_MARK(ROUTER_ARPUC, NEIGH_DISCOVERY,
973-
TRAP_TO_CPU, false),
972+
MLXSW_SP_RXL_NO_MARK(ARPUC, NEIGH_DISCOVERY,
973+
TRAP_TO_CPU, false),
974974
},
975975
},
976976
{

drivers/net/ethernet/mellanox/mlxsw/trap.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ enum {
2929
MLXSW_TRAP_ID_FDB_MISMATCH = 0x3B,
3030
MLXSW_TRAP_ID_FID_MISS = 0x3D,
3131
MLXSW_TRAP_ID_DECAP_ECN0 = 0x40,
32+
MLXSW_TRAP_ID_ARPBC = 0x50,
33+
MLXSW_TRAP_ID_ARPUC = 0x51,
3234
MLXSW_TRAP_ID_MTUERROR = 0x52,
3335
MLXSW_TRAP_ID_TTLERROR = 0x53,
3436
MLXSW_TRAP_ID_LBERROR = 0x54,
@@ -66,13 +68,10 @@ enum {
6668
MLXSW_TRAP_ID_HOST_MISS_IPV6 = 0x92,
6769
MLXSW_TRAP_ID_IPIP_DECAP_ERROR = 0xB1,
6870
MLXSW_TRAP_ID_NVE_DECAP_ARP = 0xB8,
69-
MLXSW_TRAP_ID_NVE_ENCAP_ARP = 0xBD,
7071
MLXSW_TRAP_ID_IPV4_BFD = 0xD0,
7172
MLXSW_TRAP_ID_IPV6_BFD = 0xD1,
7273
MLXSW_TRAP_ID_ROUTER_ALERT_IPV4 = 0xD6,
7374
MLXSW_TRAP_ID_ROUTER_ALERT_IPV6 = 0xD7,
74-
MLXSW_TRAP_ID_ROUTER_ARPBC = 0xE0,
75-
MLXSW_TRAP_ID_ROUTER_ARPUC = 0xE1,
7675
MLXSW_TRAP_ID_DISCARD_NON_ROUTABLE = 0x11A,
7776
MLXSW_TRAP_ID_DISCARD_ROUTER2 = 0x130,
7877
MLXSW_TRAP_ID_DISCARD_ROUTER3 = 0x131,

0 commit comments

Comments
 (0)