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, Dima Chumak <dchumak@nvidia.com>,
	Oz Shlomo <ozsh@nvidia.com>, Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next 17/17] net/mlx5: VLAN push on RX, pop on TX
Date: Mon, 10 Jan 2022 17:43:35 -0800	[thread overview]
Message-ID: <20220111014335.178121-18-saeed@kernel.org> (raw)
In-Reply-To: <20220111014335.178121-1-saeed@kernel.org>

From: Dima Chumak <dchumak@nvidia.com>

Some older NIC hardware isn't capable of doing VLAN push on RX and pop
on TX.

A workaround has been added in software to support it, but it has a
performance penalty since it requires a hairpin + loopback.

There's no such limitation with the newer NICs, so no need to pay the
price of the w/a. With this change the software w/a is disabled for
certain HW versions and steering modes that support it.

Signed-off-by: Dima Chumak <dchumak@nvidia.com>
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 .../ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
index 4b354aed784a..ee568bf34ae2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
@@ -224,7 +224,9 @@ mlx5_eswitch_termtbl_required(struct mlx5_eswitch *esw,
 		return false;
 
 	/* push vlan on RX */
-	if (flow_act->action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH)
+	if (flow_act->action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH &&
+	    !(mlx5_fs_get_capabilities(esw->dev, MLX5_FLOW_NAMESPACE_FDB) &
+	      MLX5_FLOW_STEERING_CAP_VLAN_PUSH_ON_RX))
 		return true;
 
 	/* hairpin */
-- 
2.34.1


  parent reply	other threads:[~2022-01-11  1:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11  1:43 [pull request][net-next 00/17] mlx5 updates 2022-01-10 Saeed Mahameed
2022-01-11  1:43 ` [net-next 01/17] net/mlx5: Remove unused TIR modify bitmask enums Saeed Mahameed
2022-01-11  1:43 ` [net-next 02/17] net/mlx5e: Move code chunk setting encap dests into its own function Saeed Mahameed
2022-01-11  1:43 ` [net-next 03/17] net/mlx5e: Pass attr arg for attaching/detaching encaps Saeed Mahameed
2022-01-11  1:43 ` [net-next 04/17] net/mlx5e: Move counter creation call to alloc_flow_attr_counter() Saeed Mahameed
2022-01-11  1:43 ` [net-next 05/17] net/mlx5e: TC, Move pedit_headers_action to parse_attr Saeed Mahameed
2022-01-11  1:43 ` [net-next 06/17] net/mlx5e: TC, Split pedit offloads verify from alloc_tc_pedit_action() Saeed Mahameed
2022-01-11  1:43 ` [net-next 07/17] net/mlx5e: TC, Pass attr to tc_act can_offload() Saeed Mahameed
2022-01-11  1:43 ` [net-next 08/17] net/mlx5e: TC, Refactor mlx5e_tc_add_flow_mod_hdr() to get flow attr Saeed Mahameed
2022-01-11  1:43 ` [net-next 09/17] net/mlx5e: TC, Reject rules with multiple CT actions Saeed Mahameed
2022-01-11  1:43 ` [net-next 10/17] net/mlx5e: TC, Hold sample_attr on stack instead of pointer Saeed Mahameed
2022-01-11  1:43 ` [net-next 11/17] net/mlx5e: CT, Don't set flow flag CT for ct clear flow Saeed Mahameed
2022-01-11  1:43 ` [net-next 12/17] net/mlx5e: Refactor eswitch attr flags to just attr flags Saeed Mahameed
2022-01-11  1:43 ` [net-next 13/17] net/mlx5e: Test CT and SAMPLE on flow attr Saeed Mahameed
2022-01-11  1:43 ` [net-next 14/17] net/mlx5e: TC, Store mapped tunnel id " Saeed Mahameed
2022-01-11  1:43 ` [net-next 15/17] net/mlx5e: CT, Remove redundant flow args from tc ct calls Saeed Mahameed
2022-01-11  1:43 ` [net-next 16/17] net/mlx5: Introduce software defined steering capabilities Saeed Mahameed
2022-01-11  1:43 ` Saeed Mahameed [this message]
2022-01-11  2:50 ` [pull request][net-next 00/17] mlx5 updates 2022-01-10 Jakub Kicinski

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=20220111014335.178121-18-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dchumak@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ozsh@nvidia.com \
    --cc=saeedm@nvidia.com \
    --subject='Re: [net-next 17/17] net/mlx5: VLAN push on RX, pop on TX' \
    /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).