]> git.itanic.dy.fi Git - linux-stable/commitdiff
net/mlx5: DR, Move ACTION_CACHE_LINE_SIZE macro to header
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Sun, 6 Nov 2022 10:50:41 +0000 (12:50 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 14 Apr 2023 22:06:20 +0000 (15:06 -0700)
Move ACTION_CACHE_LINE_SIZE macro to header to be used by
the pattern functions as well.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h

index ee104cf04392f8ad99d9a2c7dda6b61d70a929a8..724e4d9e70ac2fbb74fc7014c2c7d0486863f3ce 100644 (file)
@@ -1365,8 +1365,6 @@ dr_action_verify_reformat_params(enum mlx5dr_action_type reformat_type,
        return -EINVAL;
 }
 
-#define ACTION_CACHE_LINE_SIZE 64
-
 static int
 dr_action_create_reformat_action(struct mlx5dr_domain *dmn,
                                 u8 reformat_param_0, u8 reformat_param_1,
@@ -1403,13 +1401,13 @@ dr_action_create_reformat_action(struct mlx5dr_domain *dmn,
        }
        case DR_ACTION_TYP_TNL_L3_TO_L2:
        {
-               u8 hw_actions[ACTION_CACHE_LINE_SIZE] = {};
+               u8 hw_actions[DR_ACTION_CACHE_LINE_SIZE] = {};
                int ret;
 
                ret = mlx5dr_ste_set_action_decap_l3_list(dmn->ste_ctx,
                                                          data, data_sz,
                                                          hw_actions,
-                                                         ACTION_CACHE_LINE_SIZE,
+                                                         DR_ACTION_CACHE_LINE_SIZE,
                                                          &action->rewrite->num_of_actions);
                if (ret) {
                        mlx5dr_dbg(dmn, "Failed creating decap l3 action list\n");
@@ -1427,7 +1425,7 @@ dr_action_create_reformat_action(struct mlx5dr_domain *dmn,
                action->rewrite->index = (mlx5dr_icm_pool_get_chunk_icm_addr
                                          (action->rewrite->chunk) -
                                         dmn->info.caps.hdr_modify_icm_addr) /
-                                        ACTION_CACHE_LINE_SIZE;
+                                        DR_ACTION_CACHE_LINE_SIZE;
 
                ret = mlx5dr_send_postsend_action(dmn, action);
                if (ret) {
@@ -2006,7 +2004,7 @@ static int dr_action_create_modify_action(struct mlx5dr_domain *dmn,
        action->rewrite->num_of_actions = num_hw_actions;
        action->rewrite->index = (mlx5dr_icm_pool_get_chunk_icm_addr(chunk) -
                                  dmn->info.caps.hdr_modify_icm_addr) /
-                                 ACTION_CACHE_LINE_SIZE;
+                                 DR_ACTION_CACHE_LINE_SIZE;
 
        ret = mlx5dr_send_postsend_action(dmn, action);
        if (ret)
index 5b9faa714f42a9e0e7db281704f310f46d8cd404..7453fc6df49489f94d71a63fb89d5792adb06d0d 100644 (file)
@@ -21,6 +21,7 @@
 #define DR_NUM_OF_FLEX_PARSERS 8
 #define DR_STE_MAX_FLEX_0_ID 3
 #define DR_STE_MAX_FLEX_1_ID 7
+#define DR_ACTION_CACHE_LINE_SIZE 64
 
 #define mlx5dr_err(dmn, arg...) mlx5_core_err((dmn)->mdev, ##arg)
 #define mlx5dr_info(dmn, arg...) mlx5_core_info((dmn)->mdev, ##arg)