Merge branch 'mlxsw-Various-fixes'
authorDavid S. Miller <davem@davemloft.net>
Fri, 27 Sep 2019 18:33:19 +0000 (20:33 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Sep 2019 18:33:19 +0000 (20:33 +0200)
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>
Documentation/networking/devlink-trap.rst
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
tools/testing/selftests/drivers/net/mlxsw/devlink_trap_l2_drops.sh

index c20c7c4..8e90a85 100644 (file)
@@ -143,7 +143,8 @@ be added to the following table:
    * - ``port_list_is_empty``
      - ``drop``
      - Traps packets that the device decided to drop in case they need to be
-       flooded and the flood list is empty
+       flooded (e.g., unknown unicast, unregistered multicast) and there are
+       no ports the packets should be flooded to
    * - ``port_loopback_filter``
      - ``drop``
      - Traps packets that the device decided to drop in case after layer 2
index dd234cf..dcf9562 100644 (file)
@@ -3771,6 +3771,14 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
                goto err_port_qdiscs_init;
        }
 
+       err = mlxsw_sp_port_vlan_set(mlxsw_sp_port, 0, VLAN_N_VID - 1, false,
+                                    false);
+       if (err) {
+               dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to clear VLAN filter\n",
+                       mlxsw_sp_port->local_port);
+               goto err_port_vlan_clear;
+       }
+
        err = mlxsw_sp_port_nve_init(mlxsw_sp_port);
        if (err) {
                dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize NVE\n",
@@ -3818,6 +3826,7 @@ err_port_vlan_create:
 err_port_pvid_set:
        mlxsw_sp_port_nve_fini(mlxsw_sp_port);
 err_port_nve_init:
+err_port_vlan_clear:
        mlxsw_sp_tc_qdisc_fini(mlxsw_sp_port);
 err_port_qdiscs_init:
        mlxsw_sp_port_fids_fini(mlxsw_sp_port);
index 0ad1a24..b607919 100644 (file)
@@ -21,6 +21,7 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
                                         struct netlink_ext_ack *extack)
 {
        const struct flow_action_entry *act;
+       int mirror_act_count = 0;
        int err, i;
 
        if (!flow_action_has_entries(flow_action))
@@ -105,6 +106,11 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
                case FLOW_ACTION_MIRRED: {
                        struct net_device *out_dev = act->dev;
 
+                       if (mirror_act_count++) {
+                               NL_SET_ERR_MSG_MOD(extack, "Multiple mirror actions per rule are not supported");
+                               return -EOPNOTSUPP;
+                       }
+
                        err = mlxsw_sp_acl_rulei_act_mirror(mlxsw_sp, rulei,
                                                            block, out_dev,
                                                            extack);
index 5dcdfa2..126caf2 100755 (executable)
@@ -224,13 +224,6 @@ ingress_vlan_filter_test()
        local vid=10
 
        bridge vlan add vid $vid dev $swp2 master
-       # During initialization the firmware enables all the VLAN filters and
-       # the driver does not turn them off since the traffic will be discarded
-       # by the STP filter whose default is DISCARD state. Add the VID on the
-       # ingress bridge port and then remove it to make sure it is not member
-       # in the VLAN.
-       bridge vlan add vid $vid dev $swp1 master
-       bridge vlan del vid $vid dev $swp1 master
 
        RET=0