[v2,7/7] ethdev: add trace points to flow insertion by index

Message ID 20240925180532.3958656-8-akozyrev@nvidia.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series ethdev: jump to table support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Alexander Kozyrev Sept. 25, 2024, 6:05 p.m. UTC
Adds trace points for rte_flow rule insertion by index functions:
rte_flow_async_create_by_index and
rte_flow_async_create_by_index_with_pattern.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 lib/ethdev/ethdev_trace.h        | 44 ++++++++++++++++++++++++++++++++
 lib/ethdev/ethdev_trace_points.c |  6 +++++
 lib/ethdev/rte_flow.c            | 18 +++++++++++--
 3 files changed, 66 insertions(+), 2 deletions(-)
  

Comments

Ori Kam Sept. 26, 2024, 8:50 a.m. UTC | #1
> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Wednesday, September 25, 2024 9:06 PM
> 
> Adds trace points for rte_flow rule insertion by index functions:
> rte_flow_async_create_by_index and
> rte_flow_async_create_by_index_with_pattern.
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> ---

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
  

Patch

diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h
index 3bec87bfdb..910bedbebd 100644
--- a/lib/ethdev/ethdev_trace.h
+++ b/lib/ethdev/ethdev_trace.h
@@ -2343,6 +2343,50 @@  RTE_TRACE_POINT_FP(
 	rte_trace_point_emit_ptr(flow);
 )
 
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_create_by_index,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_template_table *template_table,
+		uint32_t rule_index,
+		const struct rte_flow_action *actions,
+		uint8_t actions_template_index,
+		const void *user_data, const struct rte_flow *flow),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_ptr(op_attr);
+	rte_trace_point_emit_ptr(template_table);
+	rte_trace_point_emit_u32(rule_index);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_u8(actions_template_index);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_ptr(flow);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_create_by_index_with_pattern,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_template_table *template_table,
+		uint32_t rule_index,
+		const struct rte_flow_item *pattern,
+		uint8_t pattern_template_index,
+		const struct rte_flow_action *actions,
+		uint8_t actions_template_index,
+		const void *user_data, const struct rte_flow *flow),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_ptr(op_attr);
+	rte_trace_point_emit_ptr(template_table);
+	rte_trace_point_emit_u32(rule_index);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_u8(pattern_template_index);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_u8(actions_template_index);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_ptr(flow);
+)
+
 RTE_TRACE_POINT_FP(
 	rte_flow_trace_async_destroy,
 	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c
index 6ecbee289b..902e4f7533 100644
--- a/lib/ethdev/ethdev_trace_points.c
+++ b/lib/ethdev/ethdev_trace_points.c
@@ -589,6 +589,12 @@  RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_destroy,
 RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_create,
 	lib.ethdev.flow.async_create)
 
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_create_by_index,
+	lib.ethdev.flow.async_create_by_index)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_create_by_index_with_pattern,
+	lib.ethdev.flow.async_create_by_index_with_pattern)
+
 RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_destroy,
 	lib.ethdev.flow.async_destroy)
 
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index a56391b156..4a7735b5ab 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -2090,6 +2090,7 @@  rte_flow_async_create_by_index(uint16_t port_id,
 			       struct rte_flow_error *error)
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+	struct rte_flow *flow;
 
 #ifdef RTE_FLOW_DEBUG
 	if (!rte_eth_dev_is_valid_port(port_id)) {
@@ -2104,10 +2105,15 @@  rte_flow_async_create_by_index(uint16_t port_id,
 	}
 #endif
 
-	return dev->flow_fp_ops->async_create_by_index(dev, queue_id,
+	flow = dev->flow_fp_ops->async_create_by_index(dev, queue_id,
 						       op_attr, template_table, rule_index,
 						       actions, actions_template_index,
 						       user_data, error);
+
+	rte_flow_trace_async_create_by_index(port_id, queue_id, op_attr, template_table, rule_index,
+					     actions, actions_template_index, user_data, flow);
+
+	return flow;
 }
 
 struct rte_flow *
@@ -2124,6 +2130,7 @@  rte_flow_async_create_by_index_with_pattern(uint16_t port_id,
 					    struct rte_flow_error *error)
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+	struct rte_flow *flow;
 
 #ifdef RTE_FLOW_DEBUG
 	if (!rte_eth_dev_is_valid_port(port_id)) {
@@ -2139,11 +2146,18 @@  rte_flow_async_create_by_index_with_pattern(uint16_t port_id,
 	}
 #endif
 
-	return dev->flow_fp_ops->async_create_by_index_with_pattern(dev, queue_id, op_attr,
+	flow = dev->flow_fp_ops->async_create_by_index_with_pattern(dev, queue_id, op_attr,
 								    template_table, rule_index,
 								    pattern, pattern_template_index,
 								    actions, actions_template_index,
 								    user_data, error);
+
+	rte_flow_trace_async_create_by_index_with_pattern(port_id, queue_id, op_attr,
+							  template_table, rule_index, pattern,
+							  pattern_template_index, actions,
+							  actions_template_index, user_data, flow);
+
+	return flow;
 }
 
 int