Skip to contentSkip to conversation

net/mlx5: Remove unused mlx5dr_domain_sync

PATCH Applied [email protected] 4 participants 4 messages Feb 3, 2025 – Feb 4, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: Remove unused mlx5dr_domain_sync

From: "Dr. David Alan Gilbert" <[email protected]>

mlx5dr_domain_sync() was added in 2019 by
commit 70605ea545e8 ("net/mlx5: DR, Expose APIs for direct rule managing") but hasn't been used.

Remove it.

mlx5dr_domain_sync() was the only user of
mlx5dr_send_ring_force_drain().
Remove it.

---
 .../mlx5/core/steering/sws/dr_domain.c        | 24 --------------
 .../mellanox/mlx5/core/steering/sws/dr_send.c | 33 -------------------
 .../mlx5/core/steering/sws/dr_types.h         |  1 -
 .../mellanox/mlx5/core/steering/sws/mlx5dr.h  |  2 --
 4 files changed, 60 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c +0 -24
index 60cb4527588a..65740bb68b09 100644
@@ -516,30 +516,6 @@ mlx5dr_domain_create(struct mlx5_core_dev *mdev, enum mlx5dr_domain_type type)
 	return NULL;
 }
 
-/* Assure synchronization of the device steering tables with updates made by SW
- * insertion.
- */
-int mlx5dr_domain_sync(struct mlx5dr_domain *dmn, u32 flags)
-{
-	int ret = 0;
-
-	if (flags & MLX5DR_DOMAIN_SYNC_FLAGS_SW) {
-		mlx5dr_domain_lock(dmn);
-		ret = mlx5dr_send_ring_force_drain(dmn);
-		mlx5dr_domain_unlock(dmn);
-		if (ret) {
-			mlx5dr_err(dmn, "Force drain failed flags: %d, ret: %d\n",
-				   flags, ret);
-			return ret;
-		}
-	}
-
-	if (flags & MLX5DR_DOMAIN_SYNC_FLAGS_HW)
-		ret = mlx5dr_cmd_sync_steering(dmn->mdev);
-
-	return ret;
-}
-
 int mlx5dr_domain_destroy(struct mlx5dr_domain *dmn)
 {
 	if (WARN_ON_ONCE(refcount_read(&dmn->refcount) > 1))
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c +0 -33
index f57c84e5128b..4fd4e8483382 100644
@@ -1331,36 +1331,3 @@ void mlx5dr_send_ring_free(struct mlx5dr_domain *dmn,
 	kfree(send_ring->sync_buff);
 	kfree(send_ring);
 }
-
-int mlx5dr_send_ring_force_drain(struct mlx5dr_domain *dmn)
-{
-	struct mlx5dr_send_ring *send_ring = dmn->send_ring;
-	struct postsend_info send_info = {};
-	u8 data[DR_STE_SIZE];
-	int num_of_sends_req;
-	int ret;
-	int i;
-
-	/* Sending this amount of requests makes sure we will get drain */
-	num_of_sends_req = send_ring->signal_th * TH_NUMS_TO_DRAIN / 2;
-
-	/* Send fake requests forcing the last to be signaled */
-	send_info.write.addr = (uintptr_t)data;
-	send_info.write.length = DR_STE_SIZE;
-	send_info.write.lkey = 0;
-	/* Using the sync_mr in order to write/read */
-	send_info.remote_addr = (uintptr_t)send_ring->sync_mr->addr;
-	send_info.rkey = send_ring->sync_mr->mkey;
-
-	for (i = 0; i < num_of_sends_req; i++) {
-		ret = dr_postsend_icm_data(dmn, &send_info);
-		if (ret)
-			return ret;
-	}
-
-	spin_lock(&send_ring->lock);
-	ret = dr_handle_pending_wc(dmn, send_ring);
-	spin_unlock(&send_ring->lock);
-
-	return ret;
-}
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_types.h +0 -1
index 7618c6147f86..cc328292bf84 100644
@@ -1473,7 +1473,6 @@ struct mlx5dr_send_ring {
 int mlx5dr_send_ring_alloc(struct mlx5dr_domain *dmn);
 void mlx5dr_send_ring_free(struct mlx5dr_domain *dmn,
 			   struct mlx5dr_send_ring *send_ring);
-int mlx5dr_send_ring_force_drain(struct mlx5dr_domain *dmn);
 int mlx5dr_send_postsend_ste(struct mlx5dr_domain *dmn,
 			     struct mlx5dr_ste *ste,
 			     u8 *data,
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/mlx5dr.h +0 -2
index 0bb3724c10c2..fc8a2169d1a1 100644
@@ -45,8 +45,6 @@ mlx5dr_domain_create(struct mlx5_core_dev *mdev, enum mlx5dr_domain_type type);
 
 int mlx5dr_domain_destroy(struct mlx5dr_domain *domain);
 
-int mlx5dr_domain_sync(struct mlx5dr_domain *domain, u32 flags);
-
 void mlx5dr_domain_set_peer(struct mlx5dr_domain *dmn,
 			    struct mlx5dr_domain *peer_dmn,
 			    u16 peer_vhca_id);
Signature · 1 line
2.48.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · On 03/02/2025 20:59, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

mlx5dr_domain_sync() was added in 2019 by
commit 70605ea545e8 ("net/mlx5: DR, Expose APIs for direct rule managing") but hasn't been used.

Remove it.

mlx5dr_domain_sync() was the only user of
mlx5dr_send_ring_force_drain().
Remove it.

Quoted 8 lines
---
  .../mlx5/core/steering/sws/dr_domain.c        | 24 --------------
  .../mellanox/mlx5/core/steering/sws/dr_send.c | 33 -------------------
  .../mlx5/core/steering/sws/dr_types.h         |  1 -
  .../mellanox/mlx5/core/steering/sws/mlx5dr.h  |  2 --
  4 files changed, 60 deletions(-)

Thanks for your patch.

Tariq.

Reviewed-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 7 lines · On Tue, Feb 4, 2025 at 12:30 AM <[email protected]> wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

mlx5dr_domain_sync() was added in 2019 by
commit 70605ea545e8 ("net/mlx5: DR, Expose APIs for direct rule managing") but hasn't been used.

Quoted 7 lines

Remove it.

mlx5dr_domain_sync() was the only user of
mlx5dr_send_ring_force_drain().
Remove it.

LGTM,

Signature · 2 lines
Regards,
Kalesh AP
#3 lore raw
In reply to [email protected]
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Mon, 3 Feb 2025 18:59:58 +0000 you wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

mlx5dr_domain_sync() was added in 2019 by
commit 70605ea545e8 ("net/mlx5: DR, Expose APIs for direct rule managing") but hasn't been used.

Remove it.

[...]

Here is the summary with links:
- [net-next] net/mlx5: Remove unused mlx5dr_domain_sync

    https://git.kernel.org/netdev/net-next/c/15c51f17bdc4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html