All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>, kuba@kernel.org
Cc: netdev@vger.kernel.org, Majd Dibbiny <majd@mellanox.com>,
	Mark Bloch <markb@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 03/11] net/mlx5: E-Switch, Use vport metadata matching only when mandatory
Date: Mon,  9 Mar 2020 18:42:38 -0700	[thread overview]
Message-ID: <20200310014246.30830-4-saeedm@mellanox.com> (raw)
In-Reply-To: <20200310014246.30830-1-saeedm@mellanox.com>

From: Majd Dibbiny <majd@mellanox.com>

Multi-port RoCE mode requires tagging traffic that passes through the
vport.
This matching can cause performance degradation, therefore disable it
and use the legacy matching on vhca_id and source_port when possible.

Fixes: 92ab1eb392c6 ("net/mlx5: E-Switch, Enable vport metadata matching if firmware supports it")
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 4b5b6618dff4..bd26a1891b42 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -2021,6 +2021,18 @@ esw_check_vport_match_metadata_supported(const struct mlx5_eswitch *esw)
 	return true;
 }
 
+static bool
+esw_check_vport_match_metadata_mandatory(const struct mlx5_eswitch *esw)
+{
+	return mlx5_core_mp_enabled(esw->dev);
+}
+
+static bool esw_use_vport_metadata(const struct mlx5_eswitch *esw)
+{
+	return esw_check_vport_match_metadata_mandatory(esw) &&
+	       esw_check_vport_match_metadata_supported(esw);
+}
+
 int
 esw_vport_create_offloads_acl_tables(struct mlx5_eswitch *esw,
 				     struct mlx5_vport *vport)
@@ -2059,7 +2071,7 @@ static int esw_create_uplink_offloads_acl_tables(struct mlx5_eswitch *esw)
 	struct mlx5_vport *vport;
 	int err;
 
-	if (esw_check_vport_match_metadata_supported(esw))
+	if (esw_use_vport_metadata(esw))
 		esw->flags |= MLX5_ESWITCH_VPORT_MATCH_METADATA;
 
 	vport = mlx5_eswitch_get_vport(esw, MLX5_VPORT_UPLINK);
-- 
2.24.1


  parent reply	other threads:[~2020-03-10  1:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10  1:42 [pull request][net-next 00/11] Mellanox, mlx5 updates 2020-03-09 Saeed Mahameed
2020-03-10  1:42 ` [net-next 01/11] net/mlx5: Expose port speed when possible Saeed Mahameed
2020-03-10  1:42 ` [net-next 02/11] net/mlx5: Tidy up and fix reverse christmas ordring Saeed Mahameed
2020-03-10  1:42 ` Saeed Mahameed [this message]
2020-03-10  1:42 ` [net-next 04/11] net/mlx5: Verify goto chain offload support Saeed Mahameed
2020-03-10  1:42 ` [net-next 05/11] net/mlx5e: Fix an IS_ERR() vs NULL check Saeed Mahameed
2020-03-10  1:42 ` [net-next 06/11] net/mlx5: Allocate smaller size tables for ft offload Saeed Mahameed
2020-03-10  1:42 ` [net-next 07/11] net/mlx5: E-switch, make query inline mode a static function Saeed Mahameed
2020-03-10  1:42 ` [net-next 08/11] net/mlx5e: Introduce root ft concept for representors netdevs Saeed Mahameed
2020-03-10  1:42 ` [net-next 09/11] net/mlx5e: Show/set Rx flow indir table and RSS hash key on ul rep Saeed Mahameed
2020-03-10  1:42 ` [net-next 10/11] net/mlx5e: Init ethtool steering for representors Saeed Mahameed
2020-03-10  1:42 ` [net-next 11/11] net/mlx5e: Show/set Rx network flow classification rules on ul rep Saeed Mahameed
2020-03-10  2:41 ` [pull request][net-next 00/11] Mellanox, mlx5 updates 2020-03-09 David Miller

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=20200310014246.30830-4-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=majd@mellanox.com \
    --cc=markb@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.