Skip to content

Commit 94e7e5d

Browse files
committed
Merge branch 'mlxsw-Various-fixes'
Ido Schimmel says: ==================== mlxsw: Various fixes This patchset includes two small fixes for the mlxsw driver and one patch which clarifies recently introduced devlink-trap documentation. Patch #1 clears the port's VLAN filters during port initialization. This ensures that the drop reason reported to the user is consistent. The problem is explained in detail in the commit message. Patch #2 clarifies the description of one of the traps exposed via devlink-trap. Patch #3 from Danielle forbids the installation of a tc filter with multiple mirror actions since this is not supported by the device. The failure is communicated to the user via extack. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 4208966 + 52feb8b commit 94e7e5d

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

Documentation/networking/devlink-trap.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ be added to the following table:
143143
* - ``port_list_is_empty``
144144
- ``drop``
145145
- Traps packets that the device decided to drop in case they need to be
146-
flooded and the flood list is empty
146+
flooded (e.g., unknown unicast, unregistered multicast) and there are
147+
no ports the packets should be flooded to
147148
* - ``port_loopback_filter``
148149
- ``drop``
149150
- Traps packets that the device decided to drop in case after layer 2

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

+9
Original file line numberDiff line numberDiff line change
@@ -3771,6 +3771,14 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
37713771
goto err_port_qdiscs_init;
37723772
}
37733773

3774+
err = mlxsw_sp_port_vlan_set(mlxsw_sp_port, 0, VLAN_N_VID - 1, false,
3775+
false);
3776+
if (err) {
3777+
dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to clear VLAN filter\n",
3778+
mlxsw_sp_port->local_port);
3779+
goto err_port_vlan_clear;
3780+
}
3781+
37743782
err = mlxsw_sp_port_nve_init(mlxsw_sp_port);
37753783
if (err) {
37763784
dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize NVE\n",
@@ -3818,6 +3826,7 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
38183826
err_port_pvid_set:
38193827
mlxsw_sp_port_nve_fini(mlxsw_sp_port);
38203828
err_port_nve_init:
3829+
err_port_vlan_clear:
38213830
mlxsw_sp_tc_qdisc_fini(mlxsw_sp_port);
38223831
err_port_qdiscs_init:
38233832
mlxsw_sp_port_fids_fini(mlxsw_sp_port);

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

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
2121
struct netlink_ext_ack *extack)
2222
{
2323
const struct flow_action_entry *act;
24+
int mirror_act_count = 0;
2425
int err, i;
2526

2627
if (!flow_action_has_entries(flow_action))
@@ -105,6 +106,11 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
105106
case FLOW_ACTION_MIRRED: {
106107
struct net_device *out_dev = act->dev;
107108

109+
if (mirror_act_count++) {
110+
NL_SET_ERR_MSG_MOD(extack, "Multiple mirror actions per rule are not supported");
111+
return -EOPNOTSUPP;
112+
}
113+
108114
err = mlxsw_sp_acl_rulei_act_mirror(mlxsw_sp, rulei,
109115
block, out_dev,
110116
extack);

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

-7
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,6 @@ ingress_vlan_filter_test()
224224
local vid=10
225225

226226
bridge vlan add vid $vid dev $swp2 master
227-
# During initialization the firmware enables all the VLAN filters and
228-
# the driver does not turn them off since the traffic will be discarded
229-
# by the STP filter whose default is DISCARD state. Add the VID on the
230-
# ingress bridge port and then remove it to make sure it is not member
231-
# in the VLAN.
232-
bridge vlan add vid $vid dev $swp1 master
233-
bridge vlan del vid $vid dev $swp1 master
234227

235228
RET=0
236229

0 commit comments

Comments
 (0)