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>,
	Gal Pressman <gal@nvidia.com>
Subject: [net-next 12/15] net/mlx5e: kTLS, Remove unnecessary per-callback completion
Date: Sat, 12 Nov 2022 02:21:44 -0800	[thread overview]
Message-ID: <20221112102147.496378-13-saeed@kernel.org> (raw)
In-Reply-To: <20221112102147.496378-1-saeed@kernel.org>

From: Tariq Toukan <tariqt@nvidia.com>

Waiting on a completion object for each callback before cleaning up their
async contexts is not necessary, as this is already implied in the
mlx5_cmd_cleanup_async_ctx() API.

Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 .../ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
index f8d9708feb7c..fcaa26847c8a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
@@ -127,7 +127,6 @@ struct mlx5e_async_ctx {
 	struct mlx5_async_work context;
 	struct mlx5_async_ctx async_ctx;
 	struct mlx5e_ktls_offload_context_tx *priv_tx;
-	struct completion complete;
 	int err;
 	union {
 		u32 out_create[MLX5_ST_SZ_DW(create_tis_out)];
@@ -148,7 +147,6 @@ static struct mlx5e_async_ctx *mlx5e_bulk_async_init(struct mlx5_core_dev *mdev,
 		struct mlx5e_async_ctx *async = &bulk_async[i];
 
 		mlx5_cmd_init_async_ctx(mdev, &async->async_ctx);
-		init_completion(&async->complete);
 	}
 
 	return bulk_async;
@@ -175,12 +173,10 @@ static void create_tis_callback(int status, struct mlx5_async_work *context)
 	if (status) {
 		async->err = status;
 		priv_tx->create_err = 1;
-		goto out;
+		return;
 	}
 
 	priv_tx->tisn = MLX5_GET(create_tis_out, async->out_create, tisn);
-out:
-	complete(&async->complete);
 }
 
 static void destroy_tis_callback(int status, struct mlx5_async_work *context)
@@ -189,7 +185,6 @@ static void destroy_tis_callback(int status, struct mlx5_async_work *context)
 		container_of(context, struct mlx5e_async_ctx, context);
 	struct mlx5e_ktls_offload_context_tx *priv_tx = async->priv_tx;
 
-	complete(&async->complete);
 	kfree(priv_tx);
 }
 
@@ -231,7 +226,6 @@ static void mlx5e_tls_priv_tx_cleanup(struct mlx5e_ktls_offload_context_tx *priv
 				      struct mlx5e_async_ctx *async)
 {
 	if (priv_tx->create_err) {
-		complete(&async->complete);
 		kfree(priv_tx);
 		return;
 	}
@@ -259,11 +253,6 @@ static void mlx5e_tls_priv_tx_list_cleanup(struct mlx5_core_dev *mdev,
 		i++;
 	}
 
-	for (i = 0; i < size; i++) {
-		struct mlx5e_async_ctx *async = &bulk_async[i];
-
-		wait_for_completion(&async->complete);
-	}
 	mlx5e_bulk_async_cleanup(bulk_async, size);
 }
 
@@ -310,7 +299,6 @@ static void create_work(struct work_struct *work)
 	for (j = 0; j < i; j++) {
 		struct mlx5e_async_ctx *async = &bulk_async[j];
 
-		wait_for_completion(&async->complete);
 		if (!err && async->err)
 			err = async->err;
 	}
-- 
2.38.1


  parent reply	other threads:[~2022-11-12 10:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12 10:21 [pull request][net-next 00/15] mlx5 updates 2022-11-12 Saeed Mahameed
2022-11-12 10:21 ` [net-next 01/15] net/mlx5: Bridge, Use debug instead of warn if entry doesn't exists Saeed Mahameed
2022-11-14 11:40   ` patchwork-bot+netdevbpf
2022-11-12 10:21 ` [net-next 02/15] net/mlx5: Fix spelling mistake "destoy" -> "destroy" Saeed Mahameed
2022-11-12 10:21 ` [net-next 03/15] net/mlx5: Unregister traps on driver unload flow Saeed Mahameed
2022-11-12 10:21 ` [net-next 04/15] net/mlx5: Expose vhca_id to debugfs Saeed Mahameed
2022-11-12 10:21 ` [net-next 05/15] net/mlx5e: remove unused list in arfs Saeed Mahameed
2022-11-12 10:21 ` [net-next 06/15] net/mlx5e: Use clamp operation instead of open coding it Saeed Mahameed
2022-11-12 10:21 ` [net-next 07/15] net/mlx5e: Support enhanced CQE compression Saeed Mahameed
2022-11-12 10:21 ` [net-next 08/15] net/mlx5e: Move params kernel log print to probe function Saeed Mahameed
2022-11-12 10:21 ` [net-next 09/15] net/mlx5e: Add error flow when failing update_rx Saeed Mahameed
2022-11-12 10:21 ` [net-next 10/15] net/mlx5e: TC, Remove redundant WARN_ON() Saeed Mahameed
2022-11-12 10:21 ` [net-next 11/15] net/mlx5e: kTLS, Remove unused work field Saeed Mahameed
2022-11-12 10:21 ` Saeed Mahameed [this message]
2022-11-12 10:21 ` [net-next 13/15] net/mlx5e: kTLS, Use a single async context object per a callback bulk Saeed Mahameed
2022-11-12 10:21 ` [net-next 14/15] net/mlx5e: CT, optimize pre_ct table lookup Saeed Mahameed
2022-11-12 10:21 ` [net-next 15/15] net/mlx5e: ethtool: get_link_ext_stats for PHY down events Saeed Mahameed

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=20221112102147.496378-13-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).