[v1,15/16] net/mlx5/hws: rename pattern cache object

Message ID 20230131093346.1261066-16-valex@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5/hws: support range and partial hash matching |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Alex Vesker Jan. 31, 2023, 9:33 a.m. UTC
  To have the same name convention for future caches, use
cache and cache item naming.

Signed-off-by: Alex Vesker <valex@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_pat_arg.c | 22 +++++++++++-----------
 drivers/net/mlx5/hws/mlx5dr_pat_arg.h |  6 +++---
 2 files changed, 14 insertions(+), 14 deletions(-)
  

Patch

diff --git a/drivers/net/mlx5/hws/mlx5dr_pat_arg.c b/drivers/net/mlx5/hws/mlx5dr_pat_arg.c
index 152025d302..6ed04dac6d 100644
--- a/drivers/net/mlx5/hws/mlx5dr_pat_arg.c
+++ b/drivers/net/mlx5/hws/mlx5dr_pat_arg.c
@@ -94,13 +94,13 @@  static bool mlx5dr_pat_compare_pattern(enum mlx5dr_action_type cur_type,
 	return true;
 }
 
-static struct mlx5dr_pat_cached_pattern *
+static struct mlx5dr_pattern_cache_item *
 mlx5dr_pat_find_cached_pattern(struct mlx5dr_pattern_cache *cache,
 			       struct mlx5dr_action *action,
 			       uint16_t num_of_actions,
 			       __be64 *actions)
 {
-	struct mlx5dr_pat_cached_pattern *cached_pat;
+	struct mlx5dr_pattern_cache_item *cached_pat;
 
 	LIST_FOREACH(cached_pat, &cache->head, next) {
 		if (mlx5dr_pat_compare_pattern(cached_pat->type,
@@ -115,13 +115,13 @@  mlx5dr_pat_find_cached_pattern(struct mlx5dr_pattern_cache *cache,
 	return NULL;
 }
 
-static struct mlx5dr_pat_cached_pattern *
+static struct mlx5dr_pattern_cache_item *
 mlx5dr_pat_get_existing_cached_pattern(struct mlx5dr_pattern_cache *cache,
 				       struct mlx5dr_action *action,
 				       uint16_t num_of_actions,
 				       __be64 *actions)
 {
-	struct mlx5dr_pat_cached_pattern *cached_pattern;
+	struct mlx5dr_pattern_cache_item *cached_pattern;
 
 	cached_pattern = mlx5dr_pat_find_cached_pattern(cache, action, num_of_actions, actions);
 	if (cached_pattern) {
@@ -134,11 +134,11 @@  mlx5dr_pat_get_existing_cached_pattern(struct mlx5dr_pattern_cache *cache,
 	return cached_pattern;
 }
 
-static struct mlx5dr_pat_cached_pattern *
+static struct mlx5dr_pattern_cache_item *
 mlx5dr_pat_get_cached_pattern_by_action(struct mlx5dr_pattern_cache *cache,
 					struct mlx5dr_action *action)
 {
-	struct mlx5dr_pat_cached_pattern *cached_pattern;
+	struct mlx5dr_pattern_cache_item *cached_pattern;
 
 	LIST_FOREACH(cached_pattern, &cache->head, next) {
 		if (cached_pattern->mh_data.pattern_obj->id == action->modify_header.pattern_obj->id)
@@ -148,14 +148,14 @@  mlx5dr_pat_get_cached_pattern_by_action(struct mlx5dr_pattern_cache *cache,
 	return NULL;
 }
 
-static struct mlx5dr_pat_cached_pattern *
+static struct mlx5dr_pattern_cache_item *
 mlx5dr_pat_add_pattern_to_cache(struct mlx5dr_pattern_cache *cache,
 				struct mlx5dr_devx_obj *pattern_obj,
 				enum mlx5dr_action_type type,
 				uint16_t num_of_actions,
 				__be64 *actions)
 {
-	struct mlx5dr_pat_cached_pattern *cached_pattern;
+	struct mlx5dr_pattern_cache_item *cached_pattern;
 
 	cached_pattern = simple_calloc(1, sizeof(*cached_pattern));
 	if (!cached_pattern) {
@@ -189,7 +189,7 @@  mlx5dr_pat_add_pattern_to_cache(struct mlx5dr_pattern_cache *cache,
 }
 
 static void
-mlx5dr_pat_remove_pattern(struct mlx5dr_pat_cached_pattern *cached_pattern)
+mlx5dr_pat_remove_pattern(struct mlx5dr_pattern_cache_item *cached_pattern)
 {
 	LIST_REMOVE(cached_pattern, next);
 	simple_free(cached_pattern->mh_data.data);
@@ -200,7 +200,7 @@  static void
 mlx5dr_pat_put_pattern(struct mlx5dr_pattern_cache *cache,
 		       struct mlx5dr_action *action)
 {
-	struct mlx5dr_pat_cached_pattern *cached_pattern;
+	struct mlx5dr_pattern_cache_item *cached_pattern;
 
 	pthread_spin_lock(&cache->lock);
 	cached_pattern = mlx5dr_pat_get_cached_pattern_by_action(cache, action);
@@ -225,7 +225,7 @@  static int mlx5dr_pat_get_pattern(struct mlx5dr_context *ctx,
 				  size_t pattern_sz,
 				  __be64 *pattern)
 {
-	struct mlx5dr_pat_cached_pattern *cached_pattern;
+	struct mlx5dr_pattern_cache_item *cached_pattern;
 	int ret = 0;
 
 	pthread_spin_lock(&ctx->pattern_cache->lock);
diff --git a/drivers/net/mlx5/hws/mlx5dr_pat_arg.h b/drivers/net/mlx5/hws/mlx5dr_pat_arg.h
index d9353e9a3e..92db6d6aee 100644
--- a/drivers/net/mlx5/hws/mlx5dr_pat_arg.h
+++ b/drivers/net/mlx5/hws/mlx5dr_pat_arg.h
@@ -24,10 +24,10 @@  enum {
 struct mlx5dr_pattern_cache {
 	/* Protect pattern list */
 	pthread_spinlock_t lock;
-	LIST_HEAD(pattern_head, mlx5dr_pat_cached_pattern) head;
+	LIST_HEAD(pattern_head, mlx5dr_pattern_cache_item) head;
 };
 
-struct mlx5dr_pat_cached_pattern {
+struct mlx5dr_pattern_cache_item {
 	enum mlx5dr_action_type type;
 	struct {
 		struct mlx5dr_devx_obj *pattern_obj;
@@ -36,7 +36,7 @@  struct mlx5dr_pat_cached_pattern {
 		uint16_t num_of_actions;
 	} mh_data;
 	uint32_t refcount;
-	LIST_ENTRY(mlx5dr_pat_cached_pattern) next;
+	LIST_ENTRY(mlx5dr_pattern_cache_item) next;
 };
 
 enum mlx5dr_arg_chunk_size