Skip to content

Commit f8d49be

Browse files
committed
Merge branch 'mlxsw-Various-fixes'
Ido Schimmel says: ==================== mlxsw: Various fixes This patchset contains various small fixes for mlxsw. Patch #1 fixes a warning generated by switchdev core when the driver fails to insert an MDB entry in the commit phase. Patches #2-#4 fix a warning in check_flush_dependency() that can be triggered when a work item in a WQ_MEM_RECLAIM workqueue tries to flush a non-WQ_MEM_RECLAIM workqueue. It seems that the semantics of the WQ_MEM_RECLAIM flag are not very clear [1] and that various patches have been sent to remove it from various workqueues throughout the kernel [2][3][4] in order to silence the warning. These patches do the same for the workqueues created by mlxsw that probably should not have been created with this flag in the first place. Patch #5 fixes a regression where an IP address cannot be assigned to a VRF upper due to erroneous MAC validation check. Patch #6 adds a test case. Patch #7 adjusts Spectrum-2 shared buffer configuration to be compatible with Spectrum-1. The problem and fix are described in detail in the commit message. Please consider patches #1-#5 for 5.0.y. I verified they apply cleanly. [1] https://patchwork.kernel.org/patch/10791315/ [2] Commit ce162bf ("mac80211_hwsim: don't use WQ_MEM_RECLAIM") [3] Commit 39baf10 ("IB/core: Fix use workqueue without WQ_MEM_RECLAIM") [4] Commit 75215e5 ("iwcm: Don't allocate iwcm workqueue with WQ_MEM_RECLAIM") ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents c03fd01 + d5949d9 commit f8d49be

File tree

5 files changed

+36
-13
lines changed

5 files changed

+36
-13
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core)
568568
if (!(mlxsw_core->bus->features & MLXSW_BUS_F_TXRX))
569569
return 0;
570570

571-
emad_wq = alloc_workqueue("mlxsw_core_emad", WQ_MEM_RECLAIM, 0);
571+
emad_wq = alloc_workqueue("mlxsw_core_emad", 0, 0);
572572
if (!emad_wq)
573573
return -ENOMEM;
574574
mlxsw_core->emad_wq = emad_wq;
@@ -1958,10 +1958,10 @@ static int __init mlxsw_core_module_init(void)
19581958
{
19591959
int err;
19601960

1961-
mlxsw_wq = alloc_workqueue(mlxsw_core_driver_name, WQ_MEM_RECLAIM, 0);
1961+
mlxsw_wq = alloc_workqueue(mlxsw_core_driver_name, 0, 0);
19621962
if (!mlxsw_wq)
19631963
return -ENOMEM;
1964-
mlxsw_owq = alloc_ordered_workqueue("%s_ordered", WQ_MEM_RECLAIM,
1964+
mlxsw_owq = alloc_ordered_workqueue("%s_ordered", 0,
19651965
mlxsw_core_driver_name);
19661966
if (!mlxsw_owq) {
19671967
err = -ENOMEM;

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

+11-8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static const struct mlxsw_sp_sb_pool_des mlxsw_sp2_sb_pool_dess[] = {
7070
{MLXSW_REG_SBXX_DIR_EGRESS, 1},
7171
{MLXSW_REG_SBXX_DIR_EGRESS, 2},
7272
{MLXSW_REG_SBXX_DIR_EGRESS, 3},
73+
{MLXSW_REG_SBXX_DIR_EGRESS, 15},
7374
};
7475

7576
#define MLXSW_SP_SB_ING_TC_COUNT 8
@@ -428,6 +429,7 @@ static const struct mlxsw_sp_sb_pr mlxsw_sp2_sb_prs[] = {
428429
MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_STATIC, 0),
429430
MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_STATIC, 0),
430431
MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_STATIC, 0),
432+
MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_STATIC, MLXSW_SP_SB_INFI),
431433
};
432434

433435
static int mlxsw_sp_sb_prs_init(struct mlxsw_sp *mlxsw_sp,
@@ -517,14 +519,14 @@ static const struct mlxsw_sp_sb_cm mlxsw_sp2_sb_cms_egress[] = {
517519
MLXSW_SP_SB_CM(0, 7, 4),
518520
MLXSW_SP_SB_CM(0, 7, 4),
519521
MLXSW_SP_SB_CM(0, 7, 4),
520-
MLXSW_SP_SB_CM(0, 7, 4),
521-
MLXSW_SP_SB_CM(0, 7, 4),
522-
MLXSW_SP_SB_CM(0, 7, 4),
523-
MLXSW_SP_SB_CM(0, 7, 4),
524-
MLXSW_SP_SB_CM(0, 7, 4),
525-
MLXSW_SP_SB_CM(0, 7, 4),
526-
MLXSW_SP_SB_CM(0, 7, 4),
527-
MLXSW_SP_SB_CM(0, 7, 4),
522+
MLXSW_SP_SB_CM(0, MLXSW_SP_SB_INFI, 8),
523+
MLXSW_SP_SB_CM(0, MLXSW_SP_SB_INFI, 8),
524+
MLXSW_SP_SB_CM(0, MLXSW_SP_SB_INFI, 8),
525+
MLXSW_SP_SB_CM(0, MLXSW_SP_SB_INFI, 8),
526+
MLXSW_SP_SB_CM(0, MLXSW_SP_SB_INFI, 8),
527+
MLXSW_SP_SB_CM(0, MLXSW_SP_SB_INFI, 8),
528+
MLXSW_SP_SB_CM(0, MLXSW_SP_SB_INFI, 8),
529+
MLXSW_SP_SB_CM(0, MLXSW_SP_SB_INFI, 8),
528530
MLXSW_SP_SB_CM(1, 0xff, 4),
529531
};
530532

@@ -671,6 +673,7 @@ static const struct mlxsw_sp_sb_pm mlxsw_sp2_sb_pms[] = {
671673
MLXSW_SP_SB_PM(0, 0),
672674
MLXSW_SP_SB_PM(0, 0),
673675
MLXSW_SP_SB_PM(0, 0),
676+
MLXSW_SP_SB_PM(10000, 90000),
674677
};
675678

676679
static int mlxsw_sp_port_sb_pms_init(struct mlxsw_sp_port *mlxsw_sp_port)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6781,7 +6781,7 @@ static int mlxsw_sp_router_port_check_rif_addr(struct mlxsw_sp *mlxsw_sp,
67816781
/* A RIF is not created for macvlan netdevs. Their MAC is used to
67826782
* populate the FDB
67836783
*/
6784-
if (netif_is_macvlan(dev))
6784+
if (netif_is_macvlan(dev) || netif_is_l3_master(dev))
67856785
return 0;
67866786

67876787
for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ static int mlxsw_sp_port_mdb_add(struct mlxsw_sp_port *mlxsw_sp_port,
16301630
u16 fid_index;
16311631
int err = 0;
16321632

1633-
if (switchdev_trans_ph_prepare(trans))
1633+
if (switchdev_trans_ph_commit(trans))
16341634
return 0;
16351635

16361636
bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp->bridge, orig_dev);

tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh

+20
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ lib_dir=$(dirname $0)/../../../net/forwarding
1111

1212
ALL_TESTS="
1313
rif_set_addr_test
14+
rif_vrf_set_addr_test
1415
rif_inherit_bridge_addr_test
1516
rif_non_inherit_bridge_addr_test
1617
vlan_interface_deletion_test
@@ -98,6 +99,25 @@ rif_set_addr_test()
9899
ip link set dev $swp1 addr $swp1_mac
99100
}
100101

102+
rif_vrf_set_addr_test()
103+
{
104+
# Test that it is possible to set an IP address on a VRF upper despite
105+
# its random MAC address.
106+
RET=0
107+
108+
ip link add name vrf-test type vrf table 10
109+
ip link set dev $swp1 master vrf-test
110+
111+
ip -4 address add 192.0.2.1/24 dev vrf-test
112+
check_err $? "failed to set IPv4 address on VRF"
113+
ip -6 address add 2001:db8:1::1/64 dev vrf-test
114+
check_err $? "failed to set IPv6 address on VRF"
115+
116+
log_test "RIF - setting IP address on VRF"
117+
118+
ip link del dev vrf-test
119+
}
120+
101121
rif_inherit_bridge_addr_test()
102122
{
103123
RET=0

0 commit comments

Comments
 (0)