DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alexander Kozyrev <akozyrev@nvidia.com>
To: <dev@dpdk.org>
Cc: <dsosnowski@nvidia.com>, <orika@nvidia.com>,
	<thomas@monjalon.net>, <matan@nvidia.com>, <ferruh.yigit@amd.com>,
	<stephen@networkplumber.org>
Subject: [PATCH v2 7/7] ethdev: add trace points to flow insertion by index
Date: Wed, 25 Sep 2024 21:05:32 +0300	[thread overview]
Message-ID: <20240925180532.3958656-8-akozyrev@nvidia.com> (raw)
In-Reply-To: <20240925180532.3958656-1-akozyrev@nvidia.com>

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(-)

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
-- 
2.18.2


  parent reply	other threads:[~2024-09-25 18:07 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-19  0:48 [PATCH 0/6] ethdev: jump to table support Alexander Kozyrev
2024-09-19  0:48 ` [PATCH 1/6] ethdev: add insertion by index with pattern Alexander Kozyrev
2024-09-25 15:01   ` Dariusz Sosnowski
2024-09-19  0:48 ` [PATCH 2/6] app/testpmd: add index with pattern insertion type Alexander Kozyrev
2024-09-25 15:01   ` Dariusz Sosnowski
2024-09-19  0:48 ` [PATCH 3/6] ethdev: add flow rule insertion by index with pattern Alexander Kozyrev
2024-09-25 15:00   ` Dariusz Sosnowski
2024-09-19  0:48 ` [PATCH 4/6] app/testpmd: add insertion by index with pattern option Alexander Kozyrev
2024-09-25 15:01   ` Dariusz Sosnowski
2024-09-19  0:48 ` [PATCH 5/6] ethdev: add jump to table index action Alexander Kozyrev
2024-09-25 15:01   ` Dariusz Sosnowski
2024-09-19  0:48 ` [PATCH 6/6] app/testpmd: " Alexander Kozyrev
2024-09-25 15:02   ` Dariusz Sosnowski
2024-09-25 18:05 ` [PATCH v2 0/7] ethdev: jump to table support Alexander Kozyrev
2024-09-25 18:05   ` [PATCH v2 1/7] ethdev: add insertion by index with pattern Alexander Kozyrev
2024-09-26  8:23     ` Ori Kam
2024-09-25 18:05   ` [PATCH v2 2/7] app/testpmd: add index with pattern insertion type Alexander Kozyrev
2024-09-26  8:24     ` Ori Kam
2024-09-25 18:05   ` [PATCH v2 3/7] ethdev: add flow rule insertion by index with pattern Alexander Kozyrev
2024-09-26  8:26     ` Ori Kam
2024-09-25 18:05   ` [PATCH v2 4/7] app/testpmd: add insertion by index with pattern option Alexander Kozyrev
2024-09-26  8:48     ` Ori Kam
2024-09-25 18:05   ` [PATCH v2 5/7] ethdev: add jump to table index action Alexander Kozyrev
2024-09-26  8:49     ` Ori Kam
2024-09-25 18:05   ` [PATCH v2 6/7] app/testpmd: " Alexander Kozyrev
2024-09-26  8:49     ` Ori Kam
2024-09-25 18:05   ` Alexander Kozyrev [this message]
2024-09-26  8:50     ` [PATCH v2 7/7] ethdev: add trace points to flow insertion by index Ori Kam
2024-09-25 19:28   ` [PATCH v2 0/7] ethdev: jump to table support Dariusz Sosnowski
2024-09-27  1:51   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240925180532.3958656-8-akozyrev@nvidia.com \
    --to=akozyrev@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=ferruh.yigit@amd.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).