From: Saeed Mahameed <saeed@kernel.org>
To: Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leonro@nvidia.com>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org
Cc: Mark Bloch <mbloch@nvidia.com>
Subject: [PATCH mlx5-next 4/9] net/mlx5: E-Switch, Add match on vhca id to default send rules
Date: Wed, 10 Mar 2021 23:09:10 -0800 [thread overview]
Message-ID: <20210311070915.321814-5-saeed@kernel.org> (raw)
In-Reply-To: <20210311070915.321814-1-saeed@kernel.org>
From: Mark Bloch <mbloch@nvidia.com>
Match on the vhca id of the E-Switch owner when creating the send-to-vport
representor rules.
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 107b1f208b72..fd5f8b830584 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -1055,10 +1055,16 @@ mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw, u16 vport,
MLX5_SET(fte_match_set_misc, misc, source_sqn, sqn);
/* source vport is the esw manager */
MLX5_SET(fte_match_set_misc, misc, source_port, esw->manager_vport);
+ if (MLX5_CAP_ESW(esw->dev, merged_eswitch))
+ MLX5_SET(fte_match_set_misc, misc, source_eswitch_owner_vhca_id,
+ MLX5_CAP_GEN(esw->dev, vhca_id));
misc = MLX5_ADDR_OF(fte_match_param, spec->match_criteria, misc_parameters);
MLX5_SET_TO_ONES(fte_match_set_misc, misc, source_sqn);
MLX5_SET_TO_ONES(fte_match_set_misc, misc, source_port);
+ if (MLX5_CAP_ESW(esw->dev, merged_eswitch))
+ MLX5_SET_TO_ONES(fte_match_set_misc, misc,
+ source_eswitch_owner_vhca_id);
spec->match_criteria_enable = MLX5_MATCH_MISC_PARAMETERS;
dest.type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
@@ -1702,6 +1708,12 @@ static int esw_create_offloads_fdb_tables(struct mlx5_eswitch *esw)
MLX5_SET_TO_ONES(fte_match_param, match_criteria, misc_parameters.source_sqn);
MLX5_SET_TO_ONES(fte_match_param, match_criteria, misc_parameters.source_port);
+ if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) {
+ MLX5_SET_TO_ONES(fte_match_param, match_criteria,
+ misc_parameters.source_eswitch_owner_vhca_id);
+ MLX5_SET(create_flow_group_in, flow_group_in,
+ source_eswitch_owner_vhca_id_valid, 1);
+ }
ix = esw->total_vports * MAX_SQ_NVPORTS + MAX_PF_SQ;
MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, 0);
--
2.29.2
next prev parent reply other threads:[~2021-03-11 7:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 7:09 [PATCH mlx5-next 0/9] mlx5 next updates 2021-03-10 Saeed Mahameed
2021-03-11 7:09 ` [PATCH mlx5-next 1/9] net/mlx5: Cleanup prototype warning Saeed Mahameed
2021-03-11 7:09 ` [PATCH mlx5-next 2/9] net/mlx5: simplify the return expression of mlx5_esw_offloads_pair() Saeed Mahameed
2021-03-11 7:09 ` [PATCH mlx5-next 3/9] net/mlx5: Remove unused mlx5_core_health member recover_work Saeed Mahameed
2021-03-11 7:09 ` Saeed Mahameed [this message]
2021-03-11 7:09 ` [PATCH mlx5-next 5/9] net/mlx5: E-Switch, Add eswitch pointer to each representor Saeed Mahameed
2021-03-11 7:09 ` [PATCH mlx5-next 6/9] RDMA/mlx5: Use represntor E-Switch when getting netdev and metadata Saeed Mahameed
2021-03-11 17:33 ` Jason Gunthorpe
2021-03-11 20:43 ` Mark Bloch
2021-03-11 22:38 ` Saeed Mahameed
2021-03-11 7:09 ` [PATCH mlx5-next 7/9] net/mlx5: E-Switch, Refactor send to vport to be more generic Saeed Mahameed
2021-03-11 7:09 ` [PATCH mlx5-next 8/9] net/mlx5: Add IFC bits needed for single FDB mode Saeed Mahameed
2021-03-11 7:09 ` [PATCH mlx5-next 9/9] net/mlx5: Use order-0 allocations for EQs Saeed Mahameed
2021-03-12 21:10 ` [PATCH mlx5-next 0/9] mlx5 next updates 2021-03-10 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=20210311070915.321814-5-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=leonro@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@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).