net/mlx5: remove unused function

Message ID 20220215094623.22655-1-suanmingm@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: remove unused function |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Suanming Mou Feb. 15, 2022, 9:46 a.m. UTC
  The mlx5_l3t_prepare_entry() function is not used anymore.
This commit removes the unused mlx5_l3t_prepare_entry() function.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_utils.c | 41 -----------------------------------
 drivers/net/mlx5/mlx5_utils.h | 28 ------------------------
 2 files changed, 69 deletions(-)
  

Comments

Raslan Darawsheh Feb. 22, 2022, 2:44 p.m. UTC | #1
Hi,

> -----Original Message-----
> From: Suanming Mou <suanmingm@nvidia.com>
> Sent: Tuesday, February 15, 2022 11:46 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>
> Cc: Raslan Darawsheh <rasland@nvidia.com>; dev@dpdk.org
> Subject: [PATCH] net/mlx5: remove unused function
> 
> The mlx5_l3t_prepare_entry() function is not used anymore.
> This commit removes the unused mlx5_l3t_prepare_entry() function.
> 
> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  
Ferruh Yigit Feb. 23, 2022, 6:45 p.m. UTC | #2
On 2/15/2022 9:46 AM, Suanming Mou wrote:
> The mlx5_l3t_prepare_entry() function is not used anymore.
> This commit removes the unused mlx5_l3t_prepare_entry() function.
> 

Can you please send the fixes tag, to document when this
function became unused?

I can add it in next-net.

> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

<...>
  
Suanming Mou Feb. 24, 2022, 1:29 a.m. UTC | #3
Hi,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Thursday, February 24, 2022 2:46 AM
> To: Suanming Mou <suanmingm@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>
> Cc: Raslan Darawsheh <rasland@nvidia.com>; dev@dpdk.org
> Subject: Re: [PATCH] net/mlx5: remove unused function
> 
> On 2/15/2022 9:46 AM, Suanming Mou wrote:
> > The mlx5_l3t_prepare_entry() function is not used anymore.
> > This commit removes the unused mlx5_l3t_prepare_entry() function.
> >
> 
> Can you please send the fixes tag, to document when this function became
> unused?

Fixes: 92ef4b8f1688 ("ethdev: remove deprecated shared counter attribute")

Thank you.

> 
> I can add it in next-net.
> 
> > Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> 
> <...>
  

Patch

diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
index e4e66ae4c5..be33af96fe 100644
--- a/drivers/net/mlx5/mlx5_utils.c
+++ b/drivers/net/mlx5/mlx5_utils.c
@@ -1184,44 +1184,3 @@  mlx5_l3t_set_entry(struct mlx5_l3t_tbl *tbl, uint32_t idx,
 	rte_spinlock_unlock(&tbl->sl);
 	return ret;
 }
-
-int32_t
-mlx5_l3t_prepare_entry(struct mlx5_l3t_tbl *tbl, uint32_t idx,
-		       union mlx5_l3t_data *data,
-		       mlx5_l3t_alloc_callback_fn cb, void *ctx)
-{
-	int32_t ret;
-
-	rte_spinlock_lock(&tbl->sl);
-	/* Check if entry data is ready. */
-	ret = __l3t_get_entry(tbl, idx, data);
-	if (!ret) {
-		switch (tbl->type) {
-		case MLX5_L3T_TYPE_WORD:
-			if (data->word)
-				goto out;
-			break;
-		case MLX5_L3T_TYPE_DWORD:
-			if (data->dword)
-				goto out;
-			break;
-		case MLX5_L3T_TYPE_QWORD:
-			if (data->qword)
-				goto out;
-			break;
-		default:
-			if (data->ptr)
-				goto out;
-			break;
-		}
-	}
-	/* Entry data is not ready, use user callback to create it. */
-	ret = cb(ctx, data);
-	if (ret)
-		goto out;
-	/* Save the new allocated data to entry. */
-	ret = __l3t_set_entry(tbl, idx, data);
-out:
-	rte_spinlock_unlock(&tbl->sl);
-	return ret;
-}
diff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h
index e2dcbafc0a..254c879d1a 100644
--- a/drivers/net/mlx5/mlx5_utils.h
+++ b/drivers/net/mlx5/mlx5_utils.h
@@ -459,34 +459,6 @@  void mlx5_l3t_destroy(struct mlx5_l3t_tbl *tbl);
 int32_t mlx5_l3t_get_entry(struct mlx5_l3t_tbl *tbl, uint32_t idx,
 			    union mlx5_l3t_data *data);
 
-/**
- * This function gets the index entry from Three-level table.
- *
- * If the index entry is not available, allocate new one by callback
- * function and fill in the entry.
- *
- * @param tbl
- *   Pointer to the l3t.
- * @param idx
- *   Index to the entry.
- * @param data
- *   Pointer to the memory which saves the entry data.
- *   When function call returns 0, data contains the entry data get from
- *   l3t.
- *   When function call returns -1, data is not modified.
- * @param cb
- *   Callback function to allocate new data.
- * @param ctx
- *   Context for callback function.
- *
- * @return
- *   0 if success, -1 on error.
- */
-
-int32_t mlx5_l3t_prepare_entry(struct mlx5_l3t_tbl *tbl, uint32_t idx,
-			       union mlx5_l3t_data *data,
-			       mlx5_l3t_alloc_callback_fn cb, void *ctx);
-
 /**
  * This function decreases and clear index entry if reference
  * counter is 0 from Three-level table.