[dpdk-dev] [PATCH v4 02/14] common/mlx5: add color register idle bits definition

Li Zhang lizh at nvidia.com
Wed Apr 14 04:57:23 CEST 2021


From: Shun Hao <shunh at nvidia.com>

8 bits are used for meter color in meter register. When the meter
register can be shared, the rest 24 bits can be used by others.
This adds the definination for the 24 bits that can be shared.

Signed-off-by: Shun Hao <shunh at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/common/mlx5/mlx5_prm.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 0ef0574f92..403ba80978 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -3382,6 +3382,12 @@ enum {
 /* The bits meter color use. */
 #define MLX5_MTR_COLOR_BITS 8
 
+/* The bit size of one register. */
+#define MLX5_REG_BITS 32
+
+/* Idle bits for non-color usage in color register. */
+#define MLX5_MTR_IDLE_BITS_IN_COLOR_REG (MLX5_REG_BITS - MLX5_MTR_COLOR_BITS)
+
 /* Length mode of dynamic flex parser graph node. */
 enum mlx5_parse_graph_node_len_mode {
 	MLX5_GRAPH_NODE_LEN_FIXED = 0x0,
-- 
2.27.0



More information about the dev mailing list