net/mlx5: Bridge, Enable mcast in smfs steering mode
authorErez Shitrit <erezsh@nvidia.com>
Mon, 28 Aug 2023 11:20:00 +0000 (14:20 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 20 Sep 2023 06:33:08 +0000 (23:33 -0700)
In order to have mcast offloads the driver needs the following:
It should know if that mcast comes from wire port, in addition the flow
should not be marked as any specific source, that way it will give the
flexibility for the driver not to be depended on the way iterator
implemented in the FW.

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c
include/linux/mlx5/fs.h

index 7a01714b3780038c0c1185e8ab8deecb88482a6a..a7ed87e9d8426befdbda753b52732400e003f1b8 100644 (file)
@@ -78,6 +78,8 @@ mlx5_esw_bridge_mdb_flow_create(u16 esw_owner_vhca_id, struct mlx5_esw_bridge_md
        xa_for_each(&entry->ports, idx, port) {
                dests[i].type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
                dests[i].ft = port->mcast.ft;
+               if (port->vport_num == MLX5_VPORT_UPLINK)
+                       dests[i].ft->flags |= MLX5_FLOW_TABLE_UPLINK_VPORT;
                i++;
        }
 
@@ -585,10 +587,6 @@ mlx5_esw_bridge_mcast_vlan_flow_create(u16 vlan_proto, struct mlx5_esw_bridge_po
        if (!rule_spec)
                return ERR_PTR(-ENOMEM);
 
-       if (MLX5_CAP_ESW_FLOWTABLE(bridge->br_offloads->esw->dev, flow_source) &&
-           port->vport_num == MLX5_VPORT_UPLINK)
-               rule_spec->flow_context.flow_source =
-                       MLX5_FLOW_CONTEXT_FLOW_SOURCE_LOCAL_VPORT;
        rule_spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS;
 
        flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT;
@@ -660,11 +658,6 @@ mlx5_esw_bridge_mcast_fwd_flow_create(struct mlx5_esw_bridge_port *port)
        if (!rule_spec)
                return ERR_PTR(-ENOMEM);
 
-       if (MLX5_CAP_ESW_FLOWTABLE(bridge->br_offloads->esw->dev, flow_source) &&
-           port->vport_num == MLX5_VPORT_UPLINK)
-               rule_spec->flow_context.flow_source =
-                       MLX5_FLOW_CONTEXT_FLOW_SOURCE_LOCAL_VPORT;
-
        if (MLX5_CAP_ESW(bridge->br_offloads->esw->dev, merged_eswitch)) {
                dest.vport.flags = MLX5_FLOW_DEST_VPORT_VHCA_ID;
                dest.vport.vhca_id = port->esw_owner_vhca_id;
index 1e00c2436377fc42195c8cdeb4057629cb6a5097..6f7725238abc2fcfeaf471e988b0035df25b9b87 100644 (file)
@@ -67,6 +67,7 @@ enum {
        MLX5_FLOW_TABLE_TERMINATION = BIT(2),
        MLX5_FLOW_TABLE_UNMANAGED = BIT(3),
        MLX5_FLOW_TABLE_OTHER_VPORT = BIT(4),
+       MLX5_FLOW_TABLE_UPLINK_VPORT = BIT(5),
 };
 
 #define LEFTOVERS_RULE_NUM      2