Netdev List
 help / color / mirror / Atom feed
From: Tariq Toukan <tariqt@nvidia.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, <netdev@vger.kernel.org>,
	Paolo Abeni <pabeni@redhat.com>
Cc: Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	Boris Pismenny <borisp@nvidia.com>, Chris Mi <cmi@nvidia.com>,
	Cosmin Ratiu <cratiu@nvidia.com>,
	Daniel Zahka <daniel.zahka@gmail.com>,
	Dragos Tatulea <dtatulea@nvidia.com>,
	Gal Pressman <gal@nvidia.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Jianbo Liu <jianbol@nvidia.com>, Lama Kayal <lkayal@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-rdma@vger.kernel.org>, Mark Bloch <mbloch@nvidia.com>,
	Raed Salem <raeds@nvidia.com>,
	Rahul Rameshbabu <rrameshbabu@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	"Stanislav Fomichev" <sdf@fomichev.me>,
	Stanislav Fomichev <sdf.kernel@gmail.com>,
	"Tariq Toukan" <tariqt@nvidia.com>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Subject: [PATCH net-next 07/15] net/mlx5e: psp: Remove unused PSP syndrome copy action
Date: Tue, 7 Jul 2026 16:08:50 +0300	[thread overview]
Message-ID: <20260707130858.969928-8-tariqt@nvidia.com> (raw)
In-Reply-To: <20260707130858.969928-1-tariqt@nvidia.com>

From: Cosmin Ratiu <cratiu@nvidia.com>

The PSP error flow table copies the HW syndrome to metadata register B,
but this value is never used in the RX path. Bad packets (auth fail,
bad trailer) are dropped by HW via explicit drop rules before reaching
software.

Remove the syndrome copy action, the syndrome macro, and the dead
syndrome check in the RX handler.

Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 .../mellanox/mlx5/core/en_accel/psp.c         | 30 +------------------
 .../mellanox/mlx5/core/en_accel/psp_rxtx.c    | 11 -------
 .../mellanox/mlx5/core/en_accel/psp_rxtx.h    |  3 +-
 3 files changed, 2 insertions(+), 42 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c
index bdf97e373b42..534dba678761 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c
@@ -35,7 +35,6 @@ struct mlx5e_psp_rx_err {
 	struct mlx5_flow_handle *auth_fail_rule;
 	struct mlx5_flow_handle *err_rule;
 	struct mlx5_flow_handle *bad_rule;
-	struct mlx5_modify_hdr *copy_modify_hdr;
 };
 
 struct mlx5e_accel_fs_psp_prot {
@@ -165,10 +164,6 @@ static void accel_psp_fs_rx_err_destroy_ft(struct mlx5e_psp_fs *fs,
 	accel_psp_fs_del_flow_rule(&rx_err->err_rule);
 	accel_psp_fs_del_flow_rule(&rx_err->auth_fail_rule);
 	accel_psp_fs_del_flow_rule(&rx_err->rule);
-	if (rx_err->copy_modify_hdr) {
-		mlx5_modify_header_dealloc(fs->mdev, rx_err->copy_modify_hdr);
-		rx_err->copy_modify_hdr = NULL;
-	}
 	accel_psp_fs_destroy_ft(&rx_err->ft);
 }
 
@@ -210,12 +205,10 @@ int accel_psp_fs_rx_err_create_ft(struct mlx5e_psp_fs *fs,
 				  struct mlx5e_accel_fs_psp_prot *fs_prot,
 				  struct mlx5e_psp_rx_err *rx_err)
 {
-	u8 action[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)] = {};
 	struct mlx5_flow_table_attr ft_attr = {};
 	struct mlx5_core_dev *mdev = fs->mdev;
 	struct mlx5_flow_destination dest[2];
 	struct mlx5_flow_act flow_act = {};
-	struct mlx5_modify_hdr *modify_hdr;
 	struct mlx5_flow_handle *fte;
 	struct mlx5_flow_spec *spec;
 	int err = 0;
@@ -235,30 +228,10 @@ int accel_psp_fs_rx_err_create_ft(struct mlx5e_psp_fs *fs,
 		goto out_err;
 	}
 
-	/* Action to copy 7 bit psp_syndrome to regB[23:29] */
-	MLX5_SET(copy_action_in, action, action_type, MLX5_ACTION_TYPE_COPY);
-	MLX5_SET(copy_action_in, action, src_field, MLX5_ACTION_IN_FIELD_PSP_SYNDROME);
-	MLX5_SET(copy_action_in, action, src_offset, 0);
-	MLX5_SET(copy_action_in, action, length, 7);
-	MLX5_SET(copy_action_in, action, dst_field, MLX5_ACTION_IN_FIELD_METADATA_REG_B);
-	MLX5_SET(copy_action_in, action, dst_offset, 23);
-
-	modify_hdr = mlx5_modify_header_alloc(mdev, MLX5_FLOW_NAMESPACE_KERNEL,
-					      1, action);
-	if (IS_ERR(modify_hdr)) {
-		err = PTR_ERR(modify_hdr);
-		mlx5_core_err(mdev,
-			      "fail to alloc psp copy modify_header_id err=%d\n", err);
-		goto out_err;
-	}
-	rx_err->copy_modify_hdr = modify_hdr;
-
 	accel_psp_setup_syndrome_match(spec, PSP_OK);
 	/* create fte */
-	flow_act.action = MLX5_FLOW_CONTEXT_ACTION_MOD_HDR |
-			  MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
+	flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
 			  MLX5_FLOW_CONTEXT_ACTION_COUNT;
-	flow_act.modify_hdr = modify_hdr;
 	dest[0].type = fs_prot->default_dest.type;
 	dest[0].ft = fs_prot->default_dest.ft;
 	dest[1].type = MLX5_FLOW_DESTINATION_TYPE_COUNTER;
@@ -389,7 +362,6 @@ static int accel_psp_fs_rx_create_ft(struct mlx5e_psp_fs *fs,
 	setup_fte_udp_psp(spec, PSP_DEFAULT_UDP_PORT);
 	flow_act.crypto.type = MLX5_FLOW_CONTEXT_ENCRYPT_DECRYPT_TYPE_PSP;
 	/* Set bit[31, 30] PSP marker */
-	/* Set bit[29-23] psp_syndrome is set in error FT */
 #define MLX5E_PSP_MARKER_BIT (BIT(30) | BIT(31))
 	MLX5_SET(set_action_in, action, action_type, MLX5_ACTION_TYPE_SET);
 	MLX5_SET(set_action_in, action, field, MLX5_ACTION_IN_FIELD_METADATA_REG_B);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.c
index c2f9899d23a5..348fd7a96261 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.c
@@ -14,12 +14,6 @@
 #include "en_accel/psp_rxtx.h"
 #include "en_accel/psp.h"
 
-enum {
-	MLX5E_PSP_OFFLOAD_RX_SYNDROME_DECRYPTED,
-	MLX5E_PSP_OFFLOAD_RX_SYNDROME_AUTH_FAILED,
-	MLX5E_PSP_OFFLOAD_RX_SYNDROME_BAD_TRAILER,
-};
-
 static void mlx5e_psp_set_swp(struct sk_buff *skb,
 			      struct mlx5e_accel_tx_psp_state *psp_st,
 			      struct mlx5_wqe_eth_seg *eseg)
@@ -122,16 +116,11 @@ static bool mlx5e_psp_set_state(struct mlx5e_priv *priv,
 bool mlx5e_psp_offload_handle_rx_skb(struct net_device *netdev, struct sk_buff *skb,
 				     struct mlx5_cqe64 *cqe)
 {
-	u32 psp_meta_data = be32_to_cpu(cqe->ft_metadata);
 	struct mlx5e_priv *priv = netdev_priv(netdev);
 	u16 dev_id = priv->psp->psd->id;
 	bool strip_icv = true;
 	u8 generation = 0;
 
-	/* TBD: report errors as SW counters to ethtool, any further handling ? */
-	if (MLX5_PSP_METADATA_SYNDROME(psp_meta_data) != MLX5E_PSP_OFFLOAD_RX_SYNDROME_DECRYPTED)
-		goto drop;
-
 	if (psp_dev_rcv(skb, dev_id, generation, strip_icv))
 		goto drop;
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.h b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.h
index 70289c921bd6..2b080c39cc37 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.h
@@ -10,9 +10,8 @@
 #include "en.h"
 #include "en/txrx.h"
 
-/* Bit30: PSP marker, Bit29-23: PSP syndrome, Bit22-0: PSP obj id */
+/* Bit30: PSP marker, Bit22-0: PSP obj id */
 #define MLX5_PSP_METADATA_MARKER(metadata)  ((((metadata) >> 30) & 0x3) == 0x3)
-#define MLX5_PSP_METADATA_SYNDROME(metadata) (((metadata) >> 23) & GENMASK(6, 0))
 #define MLX5_PSP_METADATA_HANDLE(metadata)  ((metadata) & GENMASK(22, 0))
 
 struct mlx5e_accel_tx_psp_state {
-- 
2.44.0


  parent reply	other threads:[~2026-07-07 13:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07 13:08 [PATCH net-next 00/15] net/mlx5e: PSP cleanups and improvements Tariq Toukan
2026-07-07 13:08 ` [PATCH net-next 01/15] net/mlx5e: psp: Rename the saved psp_dev to 'psd' Tariq Toukan
2026-07-07 14:11   ` Loktionov, Aleksandr
2026-07-07 13:08 ` [PATCH net-next 02/15] net/mlx5e: psp: Remove PSP steering mutexes Tariq Toukan
2026-07-07 14:14   ` Loktionov, Aleksandr
2026-07-07 13:08 ` [PATCH net-next 03/15] net/mlx5e: psp: Remove unneeded ref counting for PSP steering Tariq Toukan
2026-07-07 14:15   ` Loktionov, Aleksandr
2026-07-07 13:08 ` [PATCH net-next 04/15] net/mlx5e: psp: Merge rx_err rule add/delete with ft create/delete Tariq Toukan
2026-07-07 13:08 ` [PATCH net-next 05/15] net/mlx5e: psp: Use helpers for steering object manipulation Tariq Toukan
2026-07-07 13:08 ` [PATCH net-next 06/15] net/mlx5e: psp: Factor out drop rule creation code Tariq Toukan
2026-07-07 13:08 ` Tariq Toukan [this message]
2026-07-07 13:08 ` [PATCH net-next 08/15] net/mlx5e: psp: Rename and consolidate steering functions Tariq Toukan
2026-07-07 13:08 ` [PATCH net-next 09/15] net/mlx5e: psp: Adjust rx_check FT size and use a drop_group Tariq Toukan
2026-07-07 13:08 ` [PATCH net-next 10/15] net/mlx5e: psp: Add an RX steering table Tariq Toukan
2026-07-07 13:08 ` [PATCH net-next 11/15] net/mlx5e: psp: Use a single rx_check table Tariq Toukan
2026-07-07 13:08 ` [PATCH net-next 12/15] net/mlx5e: psp: Flatten steering structures Tariq Toukan
2026-07-07 13:08 ` [PATCH net-next 13/15] net/mlx5e: psp: Make PSP steering config dynamic Tariq Toukan
2026-07-07 13:08 ` [PATCH net-next 14/15] net/mlx5e: Return errors from profile->enable Tariq Toukan
2026-07-07 13:08 ` [PATCH net-next 15/15] net/mlx5e: psp: Report PSP dev registration errors Tariq Toukan
2026-07-07 18:29 ` [PATCH net-next 00/15] net/mlx5e: PSP cleanups and improvements Daniel Zahka

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=20260707130858.969928-8-tariqt@nvidia.com \
    --to=tariqt@nvidia.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=borisp@nvidia.com \
    --cc=cmi@nvidia.com \
    --cc=cratiu@nvidia.com \
    --cc=daniel.zahka@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jianbol@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lkayal@nvidia.com \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=raeds@nvidia.com \
    --cc=rrameshbabu@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=sdf.kernel@gmail.com \
    --cc=sdf@fomichev.me \
    --cc=willemdebruijn.kernel@gmail.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