Skip to contentSkip to conversation

net/mlx5: enable hint in async table

PATCH Superseded Rongwei Liu 3 participants 5 messages Feb 16, 2023 – Mar 7, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: enable hint in async table

Driver gets the hint value from rte_table_attr for async flow. Parse the value and pass the supported value to hardware accordingly.

---
 drivers/net/mlx5/mlx5_flow_hw.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/mlx5/mlx5_flow_hw.c +9 -0
index b67b33bc22..06d6909974 100644
@@ -3102,6 +3102,15 @@ flow_hw_table_create(struct rte_eth_dev *dev,
 	matcher_attr.optimize_using_rule_idx = true;
 	matcher_attr.mode = MLX5DR_MATCHER_RESOURCE_MODE_RULE;
 	matcher_attr.rule.num_log = rte_log2_u32(nb_flows);
+	/* Parse hints information. */
+	if (attr->specialize) {
+		if (attr->specialize == RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG)
+			matcher_attr.optimize_flow_src = MLX5DR_MATCHER_FLOW_SRC_WIRE;
+		else if (attr->specialize == RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG)
+			matcher_attr.optimize_flow_src = MLX5DR_MATCHER_FLOW_SRC_VPORT;
+		else
+			DRV_LOG(INFO, "Unsupported hint value %x", attr->specialize);
+	}
 	/* Build the item template. */
 	for (i = 0; i < nb_item_templates; i++) {
 		uint32_t ret;
Signature · 1 line
2.27.0
#1 lore raw

@Slava Ovsiienko Can you help review and ACK?

BR
Rongwei

Quoted 47 lines

-----Original Message-----
From: Rongwei Liu <[email protected]>
Sent: Thursday, February 16, 2023 13:49
To: [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; NBU-Contact- Thomas Monjalon (EXTERNAL) <[email protected]>
Cc: Raslan Darawsheh <[email protected]>
Subject: [PATCH v1] net/mlx5: enable hint in async table

External email: Use caution opening links or attachments

Driver gets the hint value from rte_table_attr for async flow. Parse the value and pass the supported value to hardware accordingly.

---
 drivers/net/mlx5/mlx5_flow_hw.c | 9 +++++++++
 1 file changed, 9 insertions(+)
(quoted diff) +0 -0

b/drivers/net/mlx5/mlx5_flow_hw.c index b67b33bc22..06d6909974 100644

drivers/net/mlx5/mlx5_flow_hw.c +6 -0
@@ -3102,6 +3102,15 @@ flow_hw_table_create(struct rte_eth_dev *dev,
        matcher_attr.optimize_using_rule_idx = true;
        matcher_attr.mode = MLX5DR_MATCHER_RESOURCE_MODE_RULE;
        matcher_attr.rule.num_log = rte_log2_u32(nb_flows);
+       /* Parse hints information. */
+       if (attr->specialize) {
+               if (attr->specialize ==
 RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG)
+                       matcher_attr.optimize_flow_src =
 MLX5DR_MATCHER_FLOW_SRC_WIRE;
+               else if (attr->specialize ==
 RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG)
+                       matcher_attr.optimize_flow_src =

MLX5DR_MATCHER_FLOW_SRC_VPORT;

drivers/net/mlx5/mlx5_flow_hw.c +3 -1
+               else
+                       DRV_LOG(INFO, "Unsupported hint value %x", attr->specialize);
+       }
        /* Build the item template. */
        for (i = 0; i < nb_item_templates; i++) {
                uint32_t ret;
--

2.27.0

#2 lore raw

PATCH v2 1/1 net/mlx5: enable hint in async table

In reply to Rongwei Liu

Driver gets the hint value from rte_table_attr for async flow. Parse the value and pass the supported value to hardware accordingly.

---
 drivers/net/mlx5/mlx5_flow_hw.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/net/mlx5/mlx5_flow_hw.c +10 -0
index b67b33bc22..70b8e130e8 100644
@@ -3098,10 +3098,20 @@ flow_hw_table_create(struct rte_eth_dev *dev,
 	grp = container_of(ge, struct mlx5_flow_group, entry);
 	tbl->grp = grp;
 	/* Prepare matcher information. */
+	matcher_attr.optimize_flow_src = MLX5DR_MATCHER_FLOW_SRC_ANY;
 	matcher_attr.priority = attr->flow_attr.priority;
 	matcher_attr.optimize_using_rule_idx = true;
 	matcher_attr.mode = MLX5DR_MATCHER_RESOURCE_MODE_RULE;
 	matcher_attr.rule.num_log = rte_log2_u32(nb_flows);
+	/* Parse hints information. */
+	if (attr->specialize) {
+		if (attr->specialize == RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG)
+			matcher_attr.optimize_flow_src = MLX5DR_MATCHER_FLOW_SRC_WIRE;
+		else if (attr->specialize == RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG)
+			matcher_attr.optimize_flow_src = MLX5DR_MATCHER_FLOW_SRC_VPORT;
+		else
+			DRV_LOG(INFO, "Unsupported hint value %x", attr->specialize);
+	}
 	/* Build the item template. */
 	for (i = 0; i < nb_item_templates; i++) {
 		uint32_t ret;
Signature · 1 line
2.27.0
Acked-by on v2 1/1
#3 lore raw
Quoted 8 lines

-----Original Message-----
From: Rongwei Liu <[email protected]>
Sent: понедельник, 6 марта 2023 г. 13:37
To: [email protected]
Cc: Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>
Subject: [PATCH v2] net/mlx5: enable hint in async table

Quoted 4 lines

Driver gets the hint value from rte_table_attr for async flow. Parse the value and pass the supported value to hardware accordingly.

#4 lore raw
In reply to Rongwei Liu

Hi,

Quoted 8 lines

-----Original Message-----
From: Rongwei Liu <[email protected]>
Sent: Monday, March 6, 2023 1:37 PM
To: [email protected]
Cc: Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>
Subject: [PATCH v2] net/mlx5: enable hint in async table

Quoted 5 lines

Driver gets the hint value from rte_table_attr for async flow. Parse the value and pass the supported value to hardware accordingly.

---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh