[PATCH 3/5] regex/mlx5: remove useless constants

Thomas Monjalon
2025-11-02T15:57:08Z

All these constants were unused since their introduction:

- MLX5_REGEX_WQE_CTRL_OFFSET
- MLX5_REGEX_RXP_ROF2_LINE_LEN
- MLX5_RXP_BF4_ROF_VERSION_STRING
- MLX5_RXP_CTRL_TYPE_*
- MLX5_RXP_CTRL_JOB_DESC_FLAGS
- MLX5_RXP_CTRL_VALID
- MLX5_RXP_INITIALIZATION_TIMEOUT

This constant became unused after supporting combined rule file:

- MLX5_RXP_POLL_CSR_FOR_VALUE_TIMEOUT

All these constants became unused after removing DB and register R/W:

- MLX5_RXP_MAX_ENGINES
- MLX5_RXP_EM_COUNT
- MLX5_RXP_DB_NOT_ASSIGNED
- MLX5_RXP_CSR_NUM_ENTRIES
- MLX5_RXP_CSR_CTRL_DISABLE_L2C

Fixes: 4d4e245ad637 ("regex/mlx5: support enqueue")
Fixes: f324162e8e77 ("regex/mlx5: support combined rule file")
Fixes: ab74680160ba ("regex/mlx5: support combined ROF file")
Fixes: b34d816363b5 ("regex/mlx5: support rules import")
Fixes: ab2e0b0d3531 ("regex/mlx5: remove register read/write")
Fixes: 9fa82d287f65 ("regex/mlx5: move RXP to CrSpace")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/regex/mlx5/mlx5_regex_fastpath.c | 1 -
drivers/regex/mlx5/mlx5_rxp.c | 2 --
drivers/regex/mlx5/mlx5_rxp.h | 20 --------------------
3 files changed, 23 deletions(-)

diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c
index 8e5f8c9c95..6e21574d29 100644
--- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
+++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
@@ -27,7 +27,6 @@
#define MLX5_REGEX_MAX_WQE_INDEX 0xffff
#define MLX5_REGEX_METADATA_SIZE ((size_t)64)
#define MLX5_REGEX_MAX_OUTPUT (((size_t)1) << 11)
-#define MLX5_REGEX_WQE_CTRL_OFFSET 12
#define MLX5_REGEX_WQE_METADATA_OFFSET 16
#define MLX5_REGEX_WQE_GATHER_OFFSET 32
#define MLX5_REGEX_WQE_SCATTER_OFFSET 48
diff --git a/drivers/regex/mlx5/mlx5_rxp.c b/drivers/regex/mlx5/mlx5_rxp.c
index 7730e11fb1..dda4a7fdb0 100644
--- a/drivers/regex/mlx5/mlx5_rxp.c
+++ b/drivers/regex/mlx5/mlx5_rxp.c
@@ -24,8 +24,6 @@
#define MLX5_REGEX_MAX_RULES_PER_GROUP UINT32_MAX
#define MLX5_REGEX_MAX_GROUPS MLX5_RXP_MAX_SUBSETS

-#define MLX5_REGEX_RXP_ROF2_LINE_LEN 34
-
const uint64_t combined_rof_tag = 0xff52544424a52475;

/* Private Declarations */
diff --git a/drivers/regex/mlx5/mlx5_rxp.h b/drivers/regex/mlx5/mlx5_rxp.h
index 08b9a2680b..8ef1541d1a 100644
--- a/drivers/regex/mlx5/mlx5_rxp.h
+++ b/drivers/regex/mlx5/mlx5_rxp.h
@@ -9,27 +9,13 @@
#define MLX5_RXP_BF3_IDENTIFIER 0x1
#define MLX5_RXP_MAX_JOB_LENGTH 16384
#define MLX5_RXP_MAX_SUBSETS 4095
-#define MLX5_RXP_CSR_NUM_ENTRIES 31
#define MLX5_RXP_BF2_ROF_VERSION_STRING 0x07055254
#define MLX5_RXP_BF3_ROF_VERSION_STRING 0x00065254
-#define MLX5_RXP_BF4_ROF_VERSION_STRING 0x00075254
-
-#define MLX5_RXP_CTRL_TYPE_MASK 7
-#define MLX5_RXP_CTRL_TYPE_JOB_DESCRIPTOR 0
-#define MLX5_RXP_CTRL_TYPE_RESPONSE_DESCRIPTOR 1
-#define MLX5_RXP_CTRL_TYPE_MEMORY_WRITE 4
-#define MLX5_RXP_CSR_CTRL_DISABLE_L2C (1 << 7)

#define MLX5_RXP_CTRL_JOB_DESC_SOF 0x0010
#define MLX5_RXP_CTRL_JOB_DESC_EOF 0x0020
#define MLX5_RXP_CTRL_JOB_DESC_HPM_ENABLE 0x0100
#define MLX5_RXP_CTRL_JOB_DESC_ANYMATCH_ENABLE 0x0200
-#define MLX5_RXP_CTRL_JOB_DESC_FLAGS (MLX5_RXP_CTRL_JOB_DESC_SOF | \
- MLX5_RXP_CTRL_JOB_DESC_EOF | \
- MLX5_RXP_CTRL_JOB_DESC_HPM_ENABLE | \
- MLX5_RXP_CTRL_JOB_DESC_ANYMATCH_ENABLE)
-
-#define MLX5_RXP_CTRL_VALID 0x8000

#define MLX5_RXP_RESP_STATUS_MAX_PRI_THREADS (1 << 3)
#define MLX5_RXP_RESP_STATUS_MAX_SEC_THREADS (1 << 4)
@@ -128,12 +114,6 @@ enum mlx5_rxp_program_mode {
MLX5_RXP_PRIVATE_PROG_MODE,
};

-#define MLX5_RXP_POLL_CSR_FOR_VALUE_TIMEOUT 3000 /* Poll timeout in ms. */
-#define MLX5_RXP_INITIALIZATION_TIMEOUT 60000 /* Initialize timeout in ms. */
-#define MLX5_RXP_MAX_ENGINES 2u /* Number of RXP engines. */
-#define MLX5_RXP_EM_COUNT 1u /* Extra External Memories to use. */
-#define MLX5_RXP_DB_NOT_ASSIGNED 0xFF
-
struct mlx5_regex_mkey {
struct mlx5dv_devx_umem *umem;
struct mlx5_devx_obj *mkey;
--
2.51.0