Skip to content

Commit 82adc45

Browse files
committed
Merge branch 'mlxsw-various-fixes'
Ido Schimmel says: ==================== mlxsw: Various fixes This patchset contains various fixes for mlxsw. Patch #1 fixes a race condition in a selftest. The race and fix are explained in detail in the changelog. Patch #2 re-adds a link mode that was wrongly removed, resulting in a regression in some setups. Patch #3 fixes a race condition in route installation with nexthop objects. Please consider patches #2 and #3 for stable. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 2107d45 + dc860b8 commit 82adc45

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4430,6 +4430,7 @@ MLXSW_ITEM32(reg, ptys, ext_eth_proto_cap, 0x08, 0, 32);
44304430
#define MLXSW_REG_PTYS_ETH_SPEED_100GBASE_CR4 BIT(20)
44314431
#define MLXSW_REG_PTYS_ETH_SPEED_100GBASE_SR4 BIT(21)
44324432
#define MLXSW_REG_PTYS_ETH_SPEED_100GBASE_KR4 BIT(22)
4433+
#define MLXSW_REG_PTYS_ETH_SPEED_100GBASE_LR4_ER4 BIT(23)
44334434
#define MLXSW_REG_PTYS_ETH_SPEED_25GBASE_CR BIT(27)
44344435
#define MLXSW_REG_PTYS_ETH_SPEED_25GBASE_KR BIT(28)
44354436
#define MLXSW_REG_PTYS_ETH_SPEED_25GBASE_SR BIT(29)

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,11 @@ static const struct mlxsw_sp1_port_link_mode mlxsw_sp1_port_link_mode[] = {
11691169
.mask_ethtool = ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT,
11701170
.speed = SPEED_100000,
11711171
},
1172+
{
1173+
.mask = MLXSW_REG_PTYS_ETH_SPEED_100GBASE_LR4_ER4,
1174+
.mask_ethtool = ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT,
1175+
.speed = SPEED_100000,
1176+
},
11721177
};
11731178

11741179
#define MLXSW_SP1_PORT_LINK_MODE_LEN ARRAY_SIZE(mlxsw_sp1_port_link_mode)

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5951,6 +5951,10 @@ mlxsw_sp_router_fib4_replace(struct mlxsw_sp *mlxsw_sp,
59515951
if (mlxsw_sp->router->aborted)
59525952
return 0;
59535953

5954+
if (fen_info->fi->nh &&
5955+
!mlxsw_sp_nexthop_obj_group_lookup(mlxsw_sp, fen_info->fi->nh->id))
5956+
return 0;
5957+
59545958
fib_node = mlxsw_sp_fib_node_get(mlxsw_sp, fen_info->tb_id,
59555959
&fen_info->dst, sizeof(fen_info->dst),
59565960
fen_info->dst_len,
@@ -6601,6 +6605,9 @@ static int mlxsw_sp_router_fib6_replace(struct mlxsw_sp *mlxsw_sp,
66016605
if (mlxsw_sp_fib6_rt_should_ignore(rt))
66026606
return 0;
66036607

6608+
if (rt->nh && !mlxsw_sp_nexthop_obj_group_lookup(mlxsw_sp, rt->nh->id))
6609+
return 0;
6610+
66046611
fib_node = mlxsw_sp_fib_node_get(mlxsw_sp, rt->fib6_table->tb6_id,
66056612
&rt->fib6_dst.addr,
66066613
sizeof(rt->fib6_dst.addr),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ static const struct mlxsw_sx_port_link_mode mlxsw_sx_port_link_mode[] = {
613613
{
614614
.mask = MLXSW_REG_PTYS_ETH_SPEED_100GBASE_CR4 |
615615
MLXSW_REG_PTYS_ETH_SPEED_100GBASE_SR4 |
616-
MLXSW_REG_PTYS_ETH_SPEED_100GBASE_KR4,
616+
MLXSW_REG_PTYS_ETH_SPEED_100GBASE_KR4 |
617+
MLXSW_REG_PTYS_ETH_SPEED_100GBASE_LR4_ER4,
617618
.speed = 100000,
618619
},
619620
};

tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,20 @@ test_ip6gretap()
8686

8787
test_gretap_stp()
8888
{
89+
# Sometimes after mirror installation, the neighbor's state is not valid.
90+
# The reason is that there is no SW datapath activity related to the
91+
# neighbor for the remote GRE address. Therefore whether the corresponding
92+
# neighbor will be valid is a matter of luck, and the test is thus racy.
93+
# Set the neighbor's state to permanent, so it would be always valid.
94+
ip neigh replace 192.0.2.130 lladdr $(mac_get $h3) \
95+
nud permanent dev br2
8996
full_test_span_gre_stp gt4 $swp3.555 "mirror to gretap"
9097
}
9198

9299
test_ip6gretap_stp()
93100
{
101+
ip neigh replace 2001:db8:2::2 lladdr $(mac_get $h3) \
102+
nud permanent dev br2
94103
full_test_span_gre_stp gt6 $swp3.555 "mirror to ip6gretap"
95104
}
96105

0 commit comments

Comments
 (0)