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>,
	Chris Mi <cmi@nvidia.com>, Roi Dayan <roid@nvidia.com>
Subject: [net 06/10] net/mlx5e: Set decap action based on attr for sample
Date: Wed, 18 Jan 2023 00:04:10 -0800	[thread overview]
Message-ID: <20230118080414.77902-7-saeed@kernel.org> (raw)
In-Reply-To: <20230118080414.77902-1-saeed@kernel.org>

From: Chris Mi <cmi@nvidia.com>

Currently decap action is set based on tunnel_id. That means it is
set unconditionally. But for decap, ct and sample actions, decap is
done before ct. No need to decap again in sample.

And the actions are set correctly when parsing. So set decap action
based on attr instead of tunnel_id.

Fixes: 2741f2230905 ("net/mlx5e: TC, Support sample offload action for tunneled traffic")
Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c
index 1cbd2eb9d04f..f2c2c752bd1c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c
@@ -477,7 +477,6 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
 	struct mlx5e_sample_flow *sample_flow;
 	struct mlx5e_sample_attr *sample_attr;
 	struct mlx5_flow_attr *pre_attr;
-	u32 tunnel_id = attr->tunnel_id;
 	struct mlx5_eswitch *esw;
 	u32 default_tbl_id;
 	u32 obj_id;
@@ -522,7 +521,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
 	restore_obj.sample.group_id = sample_attr->group_num;
 	restore_obj.sample.rate = sample_attr->rate;
 	restore_obj.sample.trunc_size = sample_attr->trunc_size;
-	restore_obj.sample.tunnel_id = tunnel_id;
+	restore_obj.sample.tunnel_id = attr->tunnel_id;
 	err = mapping_add(esw->offloads.reg_c0_obj_pool, &restore_obj, &obj_id);
 	if (err)
 		goto err_obj_id;
@@ -548,7 +547,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
 	/* For decap action, do decap in the original flow table instead of the
 	 * default flow table.
 	 */
-	if (tunnel_id)
+	if (attr->action & MLX5_FLOW_CONTEXT_ACTION_DECAP)
 		pre_attr->action |= MLX5_FLOW_CONTEXT_ACTION_DECAP;
 	pre_attr->modify_hdr = sample_flow->restore->modify_hdr;
 	pre_attr->flags = MLX5_ATTR_FLAG_SAMPLE;
-- 
2.39.0


  parent reply	other threads:[~2023-01-18  8:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18  8:04 [pull request][net 00/10] mlx5 fixes 2023-01-18 Saeed Mahameed
2023-01-18  8:04 ` [net 01/10] net/mlx5: fix missing mutex_unlock in mlx5_fw_fatal_reporter_err_work() Saeed Mahameed
2023-01-19 14:50   ` patchwork-bot+netdevbpf
2023-01-18  8:04 ` [net 02/10] net/mlx5e: Avoid false lock dependency warning on tc_ht even more Saeed Mahameed
2023-01-18  8:04 ` [net 03/10] net/mlx5e: Remove redundant xsk pointer check in mlx5e_mpwrq_validate_xsk Saeed Mahameed
2023-01-18  8:04 ` [net 04/10] net/mlx5: E-switch, Fix setting of reserved fields on MODIFY_SCHEDULING_ELEMENT Saeed Mahameed
2023-01-18  8:04 ` [net 05/10] net/mlx5e: QoS, Fix wrongfully setting parent_element_id " Saeed Mahameed
2023-01-18  8:04 ` Saeed Mahameed [this message]
2023-01-18  8:04 ` [net 07/10] net/mlx5e: Remove optimization which prevented update of ESN state Saeed Mahameed
2023-01-18  8:04 ` [net 08/10] net/mlx5e: Protect global IPsec ASO Saeed Mahameed
2023-01-18  8:04 ` [net 09/10] net/mlx5: E-switch, Fix switchdev mode after devlink reload Saeed Mahameed
2023-01-18  8:04 ` [net 10/10] net: mlx5: eliminate anonymous module_init & module_exit Saeed Mahameed
2023-01-19  4:55 ` [pull request][net 00/10] mlx5 fixes 2023-01-18 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=20230118080414.77902-7-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=cmi@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=roid@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@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).