Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Maor Dickman <maord@nvidia.com>, Roi Dayan <roid@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: [net 03/12] net/mlx5: E-Switch, Set destination vport vhca id only when merged eswitch is supported
Date: Tue, 27 Jul 2021 16:20:41 -0700	[thread overview]
Message-ID: <20210727232050.606896-4-saeed@kernel.org> (raw)
In-Reply-To: <20210727232050.606896-1-saeed@kernel.org>

From: Maor Dickman <maord@nvidia.com>

Destination vport vhca id is valid flag is set only merged eswitch isn't supported.
Change destination vport vhca id value to be set also only when merged eswitch
is supported.

Fixes: e4ad91f23f10 ("net/mlx5e: Split offloaded eswitch TC rules for port mirroring")
Signed-off-by: Maor Dickman <maord@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 7579f3402776..b0a2ca9037ac 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -382,10 +382,11 @@ esw_setup_vport_dest(struct mlx5_flow_destination *dest, struct mlx5_flow_act *f
 {
 	dest[dest_idx].type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
 	dest[dest_idx].vport.num = esw_attr->dests[attr_idx].rep->vport;
-	dest[dest_idx].vport.vhca_id =
-		MLX5_CAP_GEN(esw_attr->dests[attr_idx].mdev, vhca_id);
-	if (MLX5_CAP_ESW(esw->dev, merged_eswitch))
+	if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) {
+		dest[dest_idx].vport.vhca_id =
+			MLX5_CAP_GEN(esw_attr->dests[attr_idx].mdev, vhca_id);
 		dest[dest_idx].vport.flags |= MLX5_FLOW_DEST_VPORT_VHCA_ID;
+	}
 	if (esw_attr->dests[attr_idx].flags & MLX5_ESW_DEST_ENCAP) {
 		if (pkt_reformat) {
 			flow_act->action |= MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT;
-- 
2.31.1


  parent reply	other threads:[~2021-07-27 23:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 23:20 [pull request][net 00/12] mlx5 fixes 2021-07-27 Saeed Mahameed
2021-07-27 23:20 ` [net 01/12] net/mlx5: Fix flow table chaining Saeed Mahameed
2021-07-28  8:30   ` patchwork-bot+netdevbpf
2021-07-27 23:20 ` [net 02/12] net/mlx5e: Disable Rx ntuple offload for uplink representor Saeed Mahameed
2021-07-27 23:20 ` Saeed Mahameed [this message]
2021-07-27 23:20 ` [net 04/12] net/mlx5: E-Switch, handle devcom events only for ports on the same device Saeed Mahameed
2021-07-27 23:20 ` [net 05/12] net/mlx5e: RX, Avoid possible data corruption when relaxed ordering and LRO combined Saeed Mahameed
2021-07-27 23:20 ` [net 06/12] net/mlx5e: Add NETIF_F_HW_TC to hw_features when HTB offload is available Saeed Mahameed
2021-07-27 23:20 ` [net 07/12] net/mlx5e: Consider PTP-RQ when setting RX VLAN stripping Saeed Mahameed
2021-07-27 23:20 ` [net 08/12] net/mlx5e: Fix page allocation failure for trap-RQ over SF Saeed Mahameed
2021-07-27 23:20 ` [net 09/12] net/mlx5e: Fix page allocation failure for ptp-RQ " Saeed Mahameed
2021-07-27 23:20 ` [net 10/12] net/mlx5: Unload device upon firmware fatal error Saeed Mahameed
2021-07-27 23:20 ` [net 11/12] net/mlx5e: Fix nullptr in mlx5e_hairpin_get_mdev() Saeed Mahameed
2021-07-27 23:20 ` [net 12/12] net/mlx5: Fix mlx5_vport_tbl_attr chain from u16 to u32 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=20210727232050.606896-4-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=maord@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=roid@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --subject='Re: [net 03/12] net/mlx5: E-Switch, Set destination vport vhca id only when merged eswitch is supported' \
    /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

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).