netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Erez Shitrit <erezsh@nvidia.com>,
	Moshe Shemesh <moshe@nvidia.com>, Vlad Buslov <vladbu@nvidia.com>
Subject: [net-next 11/15] net/mlx5: Bridge, Enable mcast in smfs steering mode
Date: Tue, 19 Sep 2023 23:35:48 -0700	[thread overview]
Message-ID: <20230920063552.296978-12-saeed@kernel.org> (raw)
In-Reply-To: <20230920063552.296978-1-saeed@kernel.org>

From: Erez Shitrit <erezsh@nvidia.com>

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>
---
 .../ethernet/mellanox/mlx5/core/esw/bridge_mcast.c    | 11 ++---------
 include/linux/mlx5/fs.h                               |  1 +
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c
index 7a01714b3780..a7ed87e9d842 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c
@@ -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;
diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h
index 1e00c2436377..6f7725238abc 100644
--- a/include/linux/mlx5/fs.h
+++ b/include/linux/mlx5/fs.h
@@ -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
-- 
2.41.0


  parent reply	other threads:[~2023-09-20  6:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20  6:35 [pull request][net-next 00/15] mlx5 updates 2023-09-19 Saeed Mahameed
2023-09-20  6:35 ` [net-next 01/15] net/mlx5: Call mlx5_sf_id_erase() once in mlx5_sf_dealloc() Saeed Mahameed
2023-09-28 13:50   ` patchwork-bot+netdevbpf
2023-09-20  6:35 ` [net-next 02/15] net/mlx5: Use devlink port pointer to get the pointer of container SF struct Saeed Mahameed
2023-09-20  6:35 ` [net-next 03/15] net/mlx5: Convert SF port_indices xarray to function_ids xarray Saeed Mahameed
2023-09-20  6:35 ` [net-next 04/15] net/mlx5: Move state lock taking into mlx5_sf_dealloc() Saeed Mahameed
2023-09-20  6:35 ` [net-next 05/15] net/mlx5: Rename mlx5_sf_deactivate_all() to mlx5_sf_del_all() Saeed Mahameed
2023-09-20  6:35 ` [net-next 06/15] net/mlx5: Push common deletion code into mlx5_sf_del() Saeed Mahameed
2023-09-20  6:35 ` [net-next 07/15] net/mlx5: Remove SF table reference counting Saeed Mahameed
2023-09-20  6:35 ` [net-next 08/15] net/mlx5: Remove redundant max_sfs check and field from struct mlx5_sf_dev_table Saeed Mahameed
2023-09-20  6:35 ` [net-next 09/15] net/mlx5e: Consider aggregated port speed during rate configuration Saeed Mahameed
2023-09-20  6:35 ` [net-next 10/15] net/mlx5e: Check police action rate for matchall filter Saeed Mahameed
2023-09-20  6:35 ` Saeed Mahameed [this message]
2023-09-20  6:35 ` [net-next 12/15] net/mlx5: DR, Add check for multi destination FTE Saeed Mahameed
2023-09-20  6:35 ` [net-next 13/15] net/mlx5: DR, Handle multi destination action in the right order Saeed Mahameed
2023-09-20  6:35 ` [net-next 14/15] net/mlx5: Add a health error syndrome for pci data poisoned Saeed Mahameed
2023-09-20  6:35 ` [net-next 15/15] net/mlx5: Enable 4 ports multiport E-switch Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230920063552.296978-12-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=erezsh@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=vladbu@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).