All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Leon Romanovsky <leonro@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, Bharat Bhushan <bbhushan2@marvell.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: [PATCH xfrm-next 08/13] net/mlx5e: Provide intermediate pointer to access IPsec struct
Date: Fri,  2 Dec 2022 22:14:52 +0200	[thread overview]
Message-ID: <344c855c23ad578357851ad2ec8c22dde4ef3d21.1670011885.git.leonro@nvidia.com> (raw)
In-Reply-To: <cover.1670011885.git.leonro@nvidia.com>

From: Leon Romanovsky <leonro@nvidia.com>

Improve readability by providing direct pointer to struct mlx5e_ipsec.

Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 .../mellanox/mlx5/core/en_accel/ipsec_rxtx.c         | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c
index 6859f1c1a831..9f07e58f7737 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c
@@ -312,23 +312,23 @@ void mlx5e_ipsec_offload_handle_rx_skb(struct net_device *netdev,
 				       struct mlx5_cqe64 *cqe)
 {
 	u32 ipsec_meta_data = be32_to_cpu(cqe->ft_metadata);
-	struct mlx5e_priv *priv;
+	struct mlx5e_priv *priv = netdev_priv(netdev);
+	struct mlx5e_ipsec *ipsec = priv->ipsec;
 	struct xfrm_offload *xo;
 	struct xfrm_state *xs;
 	struct sec_path *sp;
 	u32  sa_handle;
 
 	sa_handle = MLX5_IPSEC_METADATA_HANDLE(ipsec_meta_data);
-	priv = netdev_priv(netdev);
 	sp = secpath_set(skb);
 	if (unlikely(!sp)) {
-		atomic64_inc(&priv->ipsec->sw_stats.ipsec_rx_drop_sp_alloc);
+		atomic64_inc(&ipsec->sw_stats.ipsec_rx_drop_sp_alloc);
 		return;
 	}
 
-	xs = mlx5e_ipsec_sadb_rx_lookup(priv->ipsec, sa_handle);
+	xs = mlx5e_ipsec_sadb_rx_lookup(ipsec, sa_handle);
 	if (unlikely(!xs)) {
-		atomic64_inc(&priv->ipsec->sw_stats.ipsec_rx_drop_sadb_miss);
+		atomic64_inc(&ipsec->sw_stats.ipsec_rx_drop_sadb_miss);
 		return;
 	}
 
@@ -349,6 +349,6 @@ void mlx5e_ipsec_offload_handle_rx_skb(struct net_device *netdev,
 		xo->status = CRYPTO_INVALID_PACKET_SYNTAX;
 		break;
 	default:
-		atomic64_inc(&priv->ipsec->sw_stats.ipsec_rx_drop_syndrome);
+		atomic64_inc(&ipsec->sw_stats.ipsec_rx_drop_syndrome);
 	}
 }
-- 
2.38.1


  parent reply	other threads:[~2022-12-02 20:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02 20:14 [PATCH xfrm-next 00/13] mlx5 IPsec packet offload support (Part I) Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 01/13] net/mlx5e: Create IPsec policy offload tables Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 02/13] net/mlx5e: Add XFRM policy offload logic Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 03/13] net/mlx5e: Use same coding pattern for Rx and Tx flows Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 04/13] net/mlx5e: Configure IPsec packet offload flow steering Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 05/13] net/mlx5e: Improve IPsec flow steering autogroup Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 06/13] net/mlx5e: Add statistics for Rx/Tx IPsec offloaded flows Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 07/13] net/mlx5e: Skip IPsec encryption for TX path without matching policy Leon Romanovsky
2022-12-02 20:14 ` Leon Romanovsky [this message]
2022-12-02 20:14 ` [PATCH xfrm-next 09/13] net/mlx5e: Store all XFRM SAs in Xarray Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 10/13] net/mlx5e: Update IPsec soft and hard limits Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 11/13] net/mlx5e: Handle hardware IPsec limits events Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 12/13] net/mlx5e: Handle ESN update events Leon Romanovsky
2022-12-02 20:14 ` [PATCH xfrm-next 13/13] net/mlx5e: Open mlx5 driver to accept IPsec packet offload Leon Romanovsky
2022-12-02 20:19 ` [PATCH xfrm-next 00/13] mlx5 IPsec packet offload support (Part I) Leon Romanovsky
2022-12-09  7:18 ` Steffen Klassert

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=344c855c23ad578357851ad2ec8c22dde4ef3d21.1670011885.git.leonro@nvidia.com \
    --to=leon@kernel.org \
    --cc=bbhushan2@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=steffen.klassert@secunet.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 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.