net/mlx5: use private structure for internal tag item
PATCH 2/2 net/mlx5: use private structure for internal tag item
The legacy DV API is used to translate the mask of a matcher and the value of a rule on the root table, no matter it is in SWS or HWS mode. The structure "mlx5_rte_flow_item_tag" is used instead of public "rte_flow_item_tag". This is used internally to speed up and simplify the usage of the available REG_Cs.
Since the offsets of the fields are different, the DV API would get the incorrect value when constructuing the matcher and value. The private structure should be used for the DV API. Also, in the validation stage, the proper structure should be used.
--- drivers/net/mlx5/mlx5.h | 4 ++-- drivers/net/mlx5/mlx5_flow_hw.c | 41 ++++++++++++++++----------------- 2 files changed, 22 insertions(+), 23 deletions(-)
drivers/net/mlx5/mlx5.h +2 -2
@@ -469,8 +469,8 @@ struct mlx5_flow_hw_pattern_params {struct rte_flow_item items[MLX5_HW_MAX_ITEMS ];/** Temporary REPRESENTED_PORT item generated by PMD. */ struct rte_flow_item_ethdev port_spec; -/** Temporary TAG item generated by PMD. */ -struct rte_flow_item_tag tag_spec; +/** Temporary internal MLX5_TAG item generated by PMD, no more than 2 DWs. */ +uint8_t mlx5_tag_spec[sizeof (uint32_t ) *2 ]; };/* HW steering flow management job descriptor. */
drivers/net/mlx5/mlx5_flow_hw.c +20 -21
98 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v2 2/2 net/mlx5: use private structure for internal tag item
The legacy DV API is used to translate the mask of a matcher and the value of a rule on the root table, no matter it is in SWS or HWS mode. The structure "mlx5_rte_flow_item_tag" is used instead of public "rte_flow_item_tag". This is used internally to speed up and simplify the usage of the available REG_Cs.
Since the offsets of the fields are different, the DV API would get the incorrect value when constructuing the matcher and value. The private structure should be used for the DV API. Also, in the validation stage, the proper structure should be used.
---
v2: fix the building failure of the unknown private structure size by using memcpy
--- drivers/net/mlx5/mlx5.h | 4 +-- drivers/net/mlx5/mlx5_flow_hw.c | 46 ++++++++++++++++----------------- 2 files changed, 25 insertions(+), 25 deletions(-)
drivers/net/mlx5/mlx5.h +2 -2
@@ -469,8 +469,8 @@ struct mlx5_flow_hw_pattern_params {struct rte_flow_item items[MLX5_HW_MAX_ITEMS ];/** Temporary REPRESENTED_PORT item generated by PMD. */ struct rte_flow_item_ethdev port_spec; -/** Temporary TAG item generated by PMD. */ -struct rte_flow_item_tag tag_spec; +/** Temporary internal MLX5_TAG item generated by PMD, no more than 2 DWs. */ +uint8_t mlx5_tag_spec[sizeof (uint32_t ) *2 ]; };/* HW steering flow management job descriptor. */
drivers/net/mlx5/mlx5_flow_hw.c +23 -23
107 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v3 1/1 net/mlx5: use private structure for internal tag item
The legacy DV API is used to translate the mask of a matcher and the value of a rule on the root table, no matter it is in SWS or HWS mode. The structure "mlx5_rte_flow_item_tag" is used instead of public "rte_flow_item_tag". This is used internally to speed up and simplify the usage of the available REG_Cs.
Since the offsets of the fields are different, the DV API would get the incorrect value when constructuing the matcher and value. The private structure should be used for the DV API. Also, in the validation stage, the proper structure should be used.
---
v2: fix the building failure of the unknown private structure size by using memcpy
v3: some compiler may not consider the structure name as a pointer address
--- drivers/net/mlx5/mlx5.h | 4 +-- drivers/net/mlx5/mlx5_flow_hw.c | 46 ++++++++++++++++----------------- 2 files changed, 25 insertions(+), 25 deletions(-)
drivers/net/mlx5/mlx5.h +2 -2
@@ -469,8 +469,8 @@ struct mlx5_flow_hw_pattern_params {struct rte_flow_item items[MLX5_HW_MAX_ITEMS ];/** Temporary REPRESENTED_PORT item generated by PMD. */ struct rte_flow_item_ethdev port_spec; -/** Temporary TAG item generated by PMD. */ -struct rte_flow_item_tag tag_spec; +/** Temporary internal MLX5_TAG item generated by PMD, no more than 2 DWs. */ +uint8_t mlx5_tag_spec[sizeof (uint32_t ) *2 ]; };/* HW steering flow management job descriptor. */
drivers/net/mlx5/mlx5_flow_hw.c +23 -23
107 lines not on this page · raw message
Signature · 1 line
2.34.1