Skip to contentSkip to conversation

add trace points in ethdev library

PATCH Superseded Ankur Dwivedi 12 participants 172 messages Aug 4, 2022 – Mar 16, 2023 Arm/Amlogic Meson SoC support Page 3 of 4

lore
Share & tools
lore
#83 lore raw

Re: [EXT] Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob

In reply to Ankur Dwivedi
Quoted 144 lines · Ankur Dwivedi
Quoted 135 lines

----------------------------------------------------------------------

lib/eal/common/eal_common_trace_points.c

Quoted 89 lines · Ankur Dwivedi

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

This patch also adds test case for emit blob tracepoint function.

---
 app/test/test_trace.c                      | 11 ++++++++
 doc/guides/prog_guide/trace_lib.rst        | 12 ++++++++
 lib/eal/common/eal_common_trace_points.c   |  2 ++
 lib/eal/include/rte_eal_trace.h            |  6 ++++
 lib/eal/include/rte_trace_point.h          | 32 ++++++++++++++++++++++
 lib/eal/include/rte_trace_point_register.h |  9 ++++++
 lib/eal/version.map                        |  3 ++
 7 files changed, 75 insertions(+)
app/test/test_trace.c index renamed from app/test/test_trace.c +0 -0

6bedf14024..ad4a394a29 100644

app/test/test_trace.c +11 -0
@@ -4,6 +4,7 @@
 
 #include <rte_eal_trace.h>
 #include <rte_lcore.h>
+#include <rte_random.h>
 #include <rte_trace.h>
 
 #include "test.h"
@@ -177,7 +178,12 @@ test_fp_trace_points(void)  static int
 test_generic_trace_points(void)
 {
+	uint8_t arr[RTE_TRACE_BLOB_LEN_MAX];
 	int tmp;
+	int i;
+
+	for (i = 0; i < RTE_TRACE_BLOB_LEN_MAX; i++)
+		arr[i] = i;
 
 	rte_eal_trace_generic_void();
 	rte_eal_trace_generic_u64(0x10000000000000);
@@ -195,6 +201,11 @@ test_generic_trace_points(void)
 	rte_eal_trace_generic_ptr(&tmp);
 	rte_eal_trace_generic_str("my string");
 	rte_eal_trace_generic_size_t(sizeof(void *));
+	rte_eal_trace_generic_blob(arr, 0);
+	rte_eal_trace_generic_blob(arr, 17);
+	rte_eal_trace_generic_blob(arr, RTE_TRACE_BLOB_LEN_MAX);
+	rte_eal_trace_generic_blob(arr, rte_rand() %
+					RTE_TRACE_BLOB_LEN_MAX);
 	RTE_EAL_TRACE_GENERIC_FUNC;
 
 	return TEST_SUCCESS;
doc/guides/prog_guide/trace_lib.rst +0 -0
index 9a8f38073d..3e0ea5835c 100644
@@ -352,3 +352,15 @@ event ID.
 The ``packet.header`` and ``packet.context`` will be written in the

slow path at the time of trace memory creation. The ``trace.header`` and trace payload will be emitted when the tracepoint function is invoked.

doc/guides/prog_guide/trace_lib.rst +17 -0
+
+Limitations
+-----------
+
+- The ``rte_trace_point_emit_blob()`` function can capture a maximum
+blob of
+  length ``RTE_TRACE_BLOB_LEN_MAX`` bytes. The application can call
+  ``rte_trace_point_emit_blob()`` multiple times with length less
+than or equal to
+  ``RTE_TRACE_BLOB_LEN_MAX``, if it needs to capture more than
+``RTE_TRACE_BLOB_LEN_MAX``
+  bytes.
+- If the length passed to the ``rte_trace_point_emit_blob()`` is less
+than
+  ``RTE_TRACE_BLOB_LEN_MAX``, then the trailing
+``(RTE_TRACE_BLOB_LEN_MAX - len)``
+  bytes in the trace are set to zero.
lib/eal/common/eal_common_trace_points.c +0 -0
index 0b0b254615..051f89809c 100644
@@ -40,6 +40,8 @@

RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_size_t,

Quoted 41 lines
lib/eal/common/eal_common_trace_points.c +2 -0
 	lib.eal.generic.size_t)
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_func,
 	lib.eal.generic.func)
+RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_blob,
+	lib.eal.generic.blob)
 
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set,
 	lib.eal.alarm.set)
(quoted diff) +0 -0

b/lib/eal/include/rte_eal_trace.h index 5ef4398230..e0b836eb2f 100644

lib/eal/include/rte_eal_trace.h +6 -0
@@ -143,6 +143,12 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_string(func);
 )
 
+RTE_TRACE_POINT(
+	rte_eal_trace_generic_blob,
+	RTE_TRACE_POINT_ARGS(void *in, uint8_t len),
+	rte_trace_point_emit_blob(in, len);
+)
+
 #define RTE_EAL_TRACE_GENERIC_FUNC
 rte_eal_trace_generic_func(__func__)
 

/* Interrupt */

lib/eal/include/rte_trace_point.h +6 -0
index 0f8700974f..aca8344dbf 100644
@@ -144,6 +144,16 @@ _tp _args \
 #define rte_trace_point_emit_ptr(val)
 /** Tracepoint function payload for string datatype */  #define
 rte_trace_point_emit_string(val)
+/**
+ * Tracepoint function to capture a blob.
+ *
+ * @param val
+ *   Pointer to the array to be captured.
+ * @param len
Quoted 8 lines

lib/eal/include/rte_trace_point.h _tp _args \ · line 157

Quoted 5 lines
lib/eal/include/rte_trace_point.h +4 -0
+ *   Length to be captured. The maximum supported length is
+ *   RTE_TRACE_BLOB_LEN_MAX bytes.
+ */
+#define rte_trace_point_emit_blob(val, len)
 

This is just for doxygen right, why doxygen comments are not above the actual macros but there is a separate #if block for it?

Quoted 2 lines

The actual macro is within a #ifndef __DOXYGEN__ block. I think that is the reason for including Doxygen comments here.

Thanks for confirming.

Why comments are not as part of actual macro, but there is a separate '#ifdef __DOXYGEN__' block?

Quoted 32 lines
Quoted 18 lines
Quoted 14 lines
lib/eal/include/rte_trace_point.h +3 -0
 #endif /* __DOXYGEN__ */
 
@@ -152,6 +162,9 @@ _tp _args \
 /** @internal Macro to define event header size. */  #define
 __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t)
 
+/** Macro to define maximum emit length of blob. */ #define
+RTE_TRACE_BLOB_LEN_MAX 64
+
 /**
  * Enable recording events of the given tracepoint in the trace buffer.
  *

lib/eal/include/rte_trace_point.h do { \ · line 387

Quoted 1 line
lib/eal/include/rte_trace_point.h +0 -0
@@ -374,12 +387,31 @@ do { \
 	mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX);

\ } while

Quoted 2 lines
lib/eal/include/rte_trace_point.h +0 -0
 (0)
 
Quoted 13 lines

lib/eal/include/rte_trace_point.h do { \ · line 400

Quoted 10 lines
lib/eal/include/rte_trace_point.h +10 -0
+#define rte_trace_point_emit_blob(in, len) \ do { \
+	if (unlikely(in == NULL)) \
+		return; \
+	if (len > RTE_TRACE_BLOB_LEN_MAX) \
+		len = RTE_TRACE_BLOB_LEN_MAX; \
+	__rte_trace_point_emit(len, uint8_t); \
+	memcpy(mem, in, len); \
+	mem = RTE_PTR_ADD(mem, len); \
+	memset(mem, 0, RTE_TRACE_BLOB_LEN_MAX - len); \
+	mem = RTE_PTR_ADD(mem, RTE_TRACE_BLOB_LEN_MAX - len); \

Is first memset later memcpy not done because of performance concerns?

Quoted 1 line

The memset sets to 0 the unused bytes (RTE_TRACE_BLOB_LEN_MAX - len). So memset is done after memcpy.

yep, I can see what is done.

Question is, you can do more simply:
memset(mem, 0, RTE_TRACE_BLOB_LEN_MAX); memcpy(mem, in, len);
mem = RTE_PTR_ADD(mem, RTE_TRACE_BLOB_LEN_MAX - len);

Why did you prefer the implementation you did, intentionally? If so what is the intention, performance concerns?

btw, I want to remind that size of the 'len' can be max 64 bytes.

Quoted 38 lines
Quoted 25 lines
Quoted 25 lines
lib/eal/include/rte_trace_point.h +2 -0
+} while (0)
+
 #else
 
 #define __rte_trace_point_emit_header_generic(t) RTE_SET_USED(t)
 #define __rte_trace_point_emit_header_fp(t) RTE_SET_USED(t)  #define

__rte_trace_point_emit(in, type) RTE_SET_USED(in) #define rte_trace_point_emit_string(in) RTE_SET_USED(in)

lib/eal/include/rte_trace_point.h +5 -0
+#define rte_trace_point_emit_blob(in, len) \ do { \
+	RTE_SET_USED(in); \
+	RTE_SET_USED(len); \
+} while (0)
+
 
 #endif /* ALLOW_EXPERIMENTAL_API */
 #endif /* _RTE_TRACE_POINT_REGISTER_H_ */ diff --git

a/lib/eal/include/rte_trace_point_register.h
b/lib/eal/include/rte_trace_point_register.h
index a32f4d731b..7efbac8a72 100644

lib/eal/include/rte_trace_point_register.h +0 -0
@@ -47,6 +47,15 @@ do { \
 		RTE_STR(in)"[32]", "string_bounded_t"); \  } while (0)
 
Quoted 12 lines

lib/eal/include/rte_trace_point_register.h do { \ · line 58

Quoted 8 lines
lib/eal/include/rte_trace_point_register.h +8 -0
+#define rte_trace_point_emit_blob(in, len) \ do { \
+	RTE_SET_USED(in); \
+	__rte_trace_point_emit(len, uint8_t); \
+	__rte_trace_point_emit_field(RTE_TRACE_BLOB_LEN_MAX, \
+		RTE_STR(in)"["RTE_STR(RTE_TRACE_BLOB_LEN_MAX)"]", \
+		RTE_STR(uint8_t)); \
+} while (0)
+

Why this macro defined here again, it is also defined in 'rte_trace_point.h' already?
Is it because of 'register_fn()' in '__rte_trace_point_register()'?

Quoted 1 line

Yes the register happens in this function.

You are not really answering questions.

There are three copy of '#define rte_trace_point_emit_blob(in, len)' one of them is for doxygen comment, please explain why there are two more copies of it?

Quoted 20 lines
Quoted 11 lines
Quoted 11 lines
lib/eal/include/rte_trace_point_register.h +0 -0
 #ifdef __cplusplus
 }
 #endif
lib/eal/version.map index renamed from lib/eal/version.map +0 -0

7ad12a7dc9..67be24686a 100644

lib/eal/version.map +0 -0
@@ -440,6 +440,9 @@ EXPERIMENTAL {
 	rte_thread_detach;
 	rte_thread_equal;
Quoted 8 lines

lib/eal/version.map EXPERIMENTAL { · line 445

Quoted 4 lines
lib/eal/version.map +3 -0
 	rte_thread_join;
+
+	# added in 23.03
+	__rte_eal_trace_generic_blob;

This is not a function but a trace object.
I guess it was agreed that trace object not need to be exported, and trace can be found by name?

Quoted 1 line

Yes the export in version.map can be removed. Will remove it in next patch series.

ack.

Will there be a separate patch to remove existing symbols? Although I am not sure if it will be ABI break.

#84 lore raw

RE: [EXT] Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob

Quoted 193 lines

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Wednesday, January 25, 2023 9:40 PM
To: Ankur Dwivedi <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob

Quoted 9 lines · Ankur Dwivedi
Quoted 9 lines

---------------------------------------------------------------------

Quoted 5 lines · Ankur Dwivedi

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro

is

Quoted 51 lines
Quoted 51 lines
Quoted 51 lines

64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

This patch also adds test case for emit blob tracepoint function.

---
 app/test/test_trace.c                      | 11 ++++++++
 doc/guides/prog_guide/trace_lib.rst        | 12 ++++++++
 lib/eal/common/eal_common_trace_points.c   |  2 ++
 lib/eal/include/rte_eal_trace.h            |  6 ++++
 lib/eal/include/rte_trace_point.h          | 32 ++++++++++++++++++++++
 lib/eal/include/rte_trace_point_register.h |  9 ++++++
 lib/eal/version.map                        |  3 ++
 7 files changed, 75 insertions(+)
app/test/test_trace.c index renamed from app/test/test_trace.c +0 -0

6bedf14024..ad4a394a29 100644

app/test/test_trace.c +11 -0
@@ -4,6 +4,7 @@
 
 #include <rte_eal_trace.h>
 #include <rte_lcore.h>
+#include <rte_random.h>
 #include <rte_trace.h>
 
 #include "test.h"
@@ -177,7 +178,12 @@ test_fp_trace_points(void)  static int
 test_generic_trace_points(void)
 {
+	uint8_t arr[RTE_TRACE_BLOB_LEN_MAX];
 	int tmp;
+	int i;
+
+	for (i = 0; i < RTE_TRACE_BLOB_LEN_MAX; i++)
+		arr[i] = i;
 
 	rte_eal_trace_generic_void();
 	rte_eal_trace_generic_u64(0x10000000000000);
@@ -195,6 +201,11 @@ test_generic_trace_points(void)
 	rte_eal_trace_generic_ptr(&tmp);
 	rte_eal_trace_generic_str("my string");
 	rte_eal_trace_generic_size_t(sizeof(void *));
+	rte_eal_trace_generic_blob(arr, 0);
+	rte_eal_trace_generic_blob(arr, 17);
+	rte_eal_trace_generic_blob(arr, RTE_TRACE_BLOB_LEN_MAX);
+	rte_eal_trace_generic_blob(arr, rte_rand() %
+					RTE_TRACE_BLOB_LEN_MAX);
 	RTE_EAL_TRACE_GENERIC_FUNC;
 
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
app/test/test_trace.c +0 -0
 	return TEST_SUCCESS;
doc/guides/prog_guide/trace_lib.rst +0 -0
index 9a8f38073d..3e0ea5835c 100644
@@ -352,3 +352,15 @@ event ID.
 The ``packet.header`` and ``packet.context`` will be written in the

slow path at the time of trace memory creation. The ``trace.header`` and trace payload will be emitted when the tracepoint

function is invoked.

Quoted 75 lines
Quoted 74 lines

lib/eal/common/eal_common_trace_points.c

Quoted 23 lines
doc/guides/prog_guide/trace_lib.rst +17 -0
+
+Limitations
+-----------
+
+- The ``rte_trace_point_emit_blob()`` function can capture a
+maximum blob of
+  length ``RTE_TRACE_BLOB_LEN_MAX`` bytes. The application can call
+  ``rte_trace_point_emit_blob()`` multiple times with length less
+than or equal to
+  ``RTE_TRACE_BLOB_LEN_MAX``, if it needs to capture more than
+``RTE_TRACE_BLOB_LEN_MAX``
+  bytes.
+- If the length passed to the ``rte_trace_point_emit_blob()`` is
+less than
+  ``RTE_TRACE_BLOB_LEN_MAX``, then the trailing
+``(RTE_TRACE_BLOB_LEN_MAX - len)``
+  bytes in the trace are set to zero.
lib/eal/common/eal_common_trace_points.c +0 -0
index 0b0b254615..051f89809c 100644
@@ -40,6 +40,8 @@

RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_size_t,

Quoted 37 lines
lib/eal/common/eal_common_trace_points.c +2 -0
 	lib.eal.generic.size_t)
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_func,
 	lib.eal.generic.func)
+RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_blob,
+	lib.eal.generic.blob)
 
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set,
 	lib.eal.alarm.set)
(quoted diff) +0 -0

b/lib/eal/include/rte_eal_trace.h index 5ef4398230..e0b836eb2f 100644

lib/eal/include/rte_eal_trace.h +6 -0
@@ -143,6 +143,12 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_string(func);
 )
 
+RTE_TRACE_POINT(
+	rte_eal_trace_generic_blob,
+	RTE_TRACE_POINT_ARGS(void *in, uint8_t len),
+	rte_trace_point_emit_blob(in, len);
+)
+
 #define RTE_EAL_TRACE_GENERIC_FUNC
 rte_eal_trace_generic_func(__func__)
 

/* Interrupt */

lib/eal/include/rte_trace_point.h +1 -0
index 0f8700974f..aca8344dbf 100644
@@ -144,6 +144,16 @@ _tp _args \
 #define rte_trace_point_emit_ptr(val)
 /** Tracepoint function payload for string datatype */  #define
 rte_trace_point_emit_string(val)
+/**

lib/eal/include/rte_trace_point.h _tp _args \ · line 157

Quoted 10 lines
lib/eal/include/rte_trace_point.h +9 -0
+ * Tracepoint function to capture a blob.
+ *
+ * @param val
+ *   Pointer to the array to be captured.
+ * @param len
+ *   Length to be captured. The maximum supported length is
+ *   RTE_TRACE_BLOB_LEN_MAX bytes.
+ */
+#define rte_trace_point_emit_blob(val, len)
 

This is just for doxygen right, why doxygen comments are not above the actual macros but there is a separate #if block for it?

Quoted 7 lines
Quoted 2 lines

The actual macro is within a #ifndef __DOXYGEN__ block. I think that is the reason for including Doxygen comments here.

Thanks for confirming.

Why comments are not as part of actual macro, but there is a separate '#ifdef __DOXYGEN__' block?

The actual rte_trace_point_emit_blob macro containing the definition, is inside a #ifdef ALLOW_EXPERIMENTAL_API block, so the doxygen will not get generated for rte_trace_point_emit_blob unless ALLOW_EXPERIMENTAL_API is defined in doxygen config.

Putting the macro in #ifdef __DOXYGEN__ generates doxygen for the macro, even if ALLOW_EXPERIMENTAL_API is not defined.

Quoted 38 lines
Quoted 33 lines
Quoted 19 lines
Quoted 15 lines
lib/eal/include/rte_trace_point.h +3 -0
 #endif /* __DOXYGEN__ */
 
@@ -152,6 +162,9 @@ _tp _args \
 /** @internal Macro to define event header size. */  #define
 __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t)
 
+/** Macro to define maximum emit length of blob. */ #define
+RTE_TRACE_BLOB_LEN_MAX 64
+
 /**
  * Enable recording events of the given tracepoint in the trace buffer.
  *

lib/eal/include/rte_trace_point.h do { \ · line 387

Quoted 1 line
lib/eal/include/rte_trace_point.h +0 -0
@@ -374,12 +387,31 @@ do { \
 	mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX);

\ } while

Quoted 2 lines
lib/eal/include/rte_trace_point.h +0 -0
 (0)
 
Quoted 13 lines

lib/eal/include/rte_trace_point.h do { \ · line 400

Quoted 10 lines
lib/eal/include/rte_trace_point.h +10 -0
+#define rte_trace_point_emit_blob(in, len) \ do { \
+	if (unlikely(in == NULL)) \
+		return; \
+	if (len > RTE_TRACE_BLOB_LEN_MAX) \
+		len = RTE_TRACE_BLOB_LEN_MAX; \
+	__rte_trace_point_emit(len, uint8_t); \
+	memcpy(mem, in, len); \
+	mem = RTE_PTR_ADD(mem, len); \
+	memset(mem, 0, RTE_TRACE_BLOB_LEN_MAX - len); \
+	mem = RTE_PTR_ADD(mem, RTE_TRACE_BLOB_LEN_MAX - len); \

Is first memset later memcpy not done because of performance concerns?

Quoted 1 line

The memset sets to 0 the unused bytes (RTE_TRACE_BLOB_LEN_MAX - len).

So memset is done after memcpy.

yep, I can see what is done.

Quoted 7 lines

Question is, you can do more simply:
memset(mem, 0, RTE_TRACE_BLOB_LEN_MAX); memcpy(mem, in, len);
mem = RTE_PTR_ADD(mem, RTE_TRACE_BLOB_LEN_MAX - len);

Why did you prefer the implementation you did, intentionally? If so what is the intention, performance concerns?

Yes performance is a concern. If memset is done before memcpy, then, 64 <= number of bytes written <= 128, depending on length value from 0 to 64. But in memset after memcpy, always 64 bytes will be written.

Quoted 41 lines

btw, I want to remind that size of the 'len' can be max 64 bytes.

Quoted 38 lines
Quoted 37 lines
Quoted 23 lines
lib/eal/include/rte_trace_point.h +2 -0
+} while (0)
+
 #else
 
 #define __rte_trace_point_emit_header_generic(t) RTE_SET_USED(t)
 #define __rte_trace_point_emit_header_fp(t) RTE_SET_USED(t)  #define

__rte_trace_point_emit(in, type) RTE_SET_USED(in) #define rte_trace_point_emit_string(in) RTE_SET_USED(in)

lib/eal/include/rte_trace_point.h +5 -0
+#define rte_trace_point_emit_blob(in, len) \ do { \
+	RTE_SET_USED(in); \
+	RTE_SET_USED(len); \
+} while (0)
+
 
 #endif /* ALLOW_EXPERIMENTAL_API */  #endif /*

_RTE_TRACE_POINT_REGISTER_H_ */ diff --git
a/lib/eal/include/rte_trace_point_register.h
b/lib/eal/include/rte_trace_point_register.h
index a32f4d731b..7efbac8a72 100644

lib/eal/include/rte_trace_point_register.h do { \ · line 56

Quoted 10 lines
lib/eal/include/rte_trace_point_register.h +8 -0
@@ -47,6 +47,15 @@ do { \
 		RTE_STR(in)"[32]", "string_bounded_t"); \  } while (0)
 
+#define rte_trace_point_emit_blob(in, len) \ do { \
+	RTE_SET_USED(in); \
+	__rte_trace_point_emit(len, uint8_t); \
+	__rte_trace_point_emit_field(RTE_TRACE_BLOB_LEN_MAX, \
+		RTE_STR(in)"["RTE_STR(RTE_TRACE_BLOB_LEN_MAX)"]", \
+		RTE_STR(uint8_t)); \
+} while (0)
+

Why this macro defined here again, it is also defined in 'rte_trace_point.h' already?
Is it because of 'register_fn()' in '__rte_trace_point_register()'?

Quoted 8 lines
Quoted 1 line

Yes the register happens in this function.

You are not really answering questions.

There are three copy of '#define rte_trace_point_emit_blob(in, len)' one of them is for doxygen comment, please explain why there are two more copies of it?

The rte_trace_point_emit_blob is used when ALLOW_EXPERIMENTAL_API is defined. One definition is for that. The other is basically a null definition when ALLOW_EXPERIMENTAL_API is not defined.

Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 9 lines
lib/eal/include/rte_trace_point_register.h +0 -0
 #ifdef __cplusplus
 }
 #endif
lib/eal/version.map index renamed from lib/eal/version.map +0 -0

7ad12a7dc9..67be24686a 100644

lib/eal/version.map EXPERIMENTAL { · line 445

Quoted 6 lines
lib/eal/version.map +3 -0
@@ -440,6 +440,9 @@ EXPERIMENTAL {
 	rte_thread_detach;
 	rte_thread_equal;
 	rte_thread_join;
+
+	# added in 23.03
+	__rte_eal_trace_generic_blob;

This is not a function but a trace object.
I guess it was agreed that trace object not need to be exported, and trace can be found by name?

Quoted 7 lines
Quoted 1 line

Yes the export in version.map can be removed. Will remove it in next patch

series.

ack.

Will there be a separate patch to remove existing symbols? Although I am not sure if it will be ABI break.

I will send a separate patch to remove existing tracepoint symbols.

#85 lore raw

PATCH v6 2/6 ethdev: add trace points for ethdev (part one)

In reply to Ankur Dwivedi

Adds trace points for ethdev functions.
Moved the rte_ethdev_trace_rx_burst and rte_ethdev_trace_tx_burst to a new file rte_ethdev_trace_fp_burst.h. This is needed to resolve cyclic dependency between rte_ethdev.h and rte_ethdev_trace_fp.h.

---
 lib/ethdev/ethdev_private.c            |   5 +
 lib/ethdev/ethdev_trace_points.c       | 193 +++++++++++++++++
 lib/ethdev/meson.build                 |   1 +
 lib/ethdev/rte_ethdev.c                | 235 +++++++++++++++++---
 lib/ethdev/rte_ethdev.h                |   2 +-
 lib/ethdev/rte_ethdev_trace.h          | 285 +++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h       | 279 +++++++++++++++++++++++-
 lib/ethdev/rte_ethdev_trace_fp_burst.h |  44 ++++
 lib/ethdev/version.map                 |  66 ++++++
 9 files changed, 1075 insertions(+), 35 deletions(-)
 create mode 100644 lib/ethdev/rte_ethdev_trace_fp_burst.h
lib/ethdev/ethdev_private.c +5 -0
index 48090c879a..fd16b25e55 100644
@@ -5,6 +5,7 @@
 #include <rte_debug.h>
 
 #include "rte_ethdev.h"
+#include "rte_ethdev_trace_fp.h"
 #include "ethdev_driver.h"
 #include "ethdev_private.h"
 
@@ -297,6 +298,8 @@ rte_eth_call_rx_callbacks(uint16_t port_id, uint16_t queue_id,
 		cb = cb->next;
 	}
 
+	rte_eth_trace_call_rx_callbacks(port_id, queue_id, rx_pkts, nb_rx, nb_pkts);
+
 	return nb_rx;
 }
 
@@ -312,6 +315,8 @@ rte_eth_call_tx_callbacks(uint16_t port_id, uint16_t queue_id,
 		cb = cb->next;
 	}
 
+	rte_eth_trace_call_tx_callbacks(port_id, queue_id, tx_pkts, nb_pkts);
+
 	return nb_pkts;
 }
 
lib/ethdev/ethdev_trace_points.c +193 -0

202 lines not on this page · raw message

lib/ethdev/meson.build +1 -0
index 39250b5da1..f5c0865023 100644
@@ -24,6 +24,7 @@ headers = files(
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',
         'rte_dev_info.h',
         'rte_flow.h',
         'rte_flow_driver.h',
lib/ethdev/rte_ethdev.c +207 -28

666 lines not on this page · raw message

lib/ethdev/rte_ethdev.h +1 -1
index 96d0650d0c..6340a84c10 100644
@@ -172,7 +172,7 @@ extern "C" {
 #include <rte_config.h>
 #include <rte_power_intrinsics.h>
 
-#include "rte_ethdev_trace_fp.h"
+#include "rte_ethdev_trace_fp_burst.h"
 #include "rte_dev_info.h"
 
 extern int rte_eth_dev_logtype;
lib/ethdev/rte_ethdev_trace.h +285 -0

291 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +273 -6

299 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp_burst.h new file +44 -0

44 lines not on this page · raw message

lib/ethdev/version.map +66 -0

72 lines not on this page · raw message

Signature · 1 line
2.25.1
#86 lore raw

Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 6 lines · Ankur Dwivedi

Adds trace points for ethdev functions.
Moved the rte_ethdev_trace_rx_burst and rte_ethdev_trace_tx_burst to a new file rte_ethdev_trace_fp_burst.h. This is needed to resolve cyclic dependency between rte_ethdev.h and rte_ethdev_trace_fp.h.

<...>

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_burst, · line 135

Quoted 3 lines
lib/ethdev/ethdev_trace_points.c +3 -0
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_hairpin_queue_setup,
+	lib.ethdev.rx.hairpin_queue_setup)
+

s/rx.hairpin_queue_setup/rx_hairpin_queue_setup/ ?

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_burst, · line 138

Quoted 3 lines
lib/ethdev/ethdev_trace_points.c +3 -0
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_hairpin_queue_setup,
+	lib.ethdev.tx.hairpin_queue_setup)
+

s/tx.hairpin_queue_setup/tx_hairpin_queue_setup/ ?

<...>

lib/ethdev/meson.build headers = files( · line 27

Quoted 9 lines
lib/ethdev/meson.build +1 -0
index 39250b5da1..f5c0865023 100644
@@ -24,6 +24,7 @@ headers = files(
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',

Why these trace headers are public?
Aren't trace points only used by the APIs, so I expect them to be internal, so applications shouldn't need them. Why they are expsed to user.

@David, what do you think?

<...>

lib/ethdev/meson.build rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str) · line 264

Quoted 7 lines
lib/ethdev/meson.build +1 -0
@@ -258,6 +259,7 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str)
 
 end:
 	iter->cls = rte_class_find_by_name("eth");
+	rte_eth_trace_iterator_init(devargs_str);
 	rte_devargs_reset(&devargs);
 	return 0;

Why not add trace call just before return, as a separate block, like:
``
end:
iter->cls = rte_class_find_by_name("eth"); rte_devargs_reset(&devargs);

rte_eth_trace_iterator_init(devargs_str);

return 0;
``

Quoted 11 lines
lib/ethdev/meson.build +2 -0
@@ -274,6 +276,8 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str)
 uint16_t
 rte_eth_iterator_next(struct rte_dev_iterator *iter)
 {
+	uint16_t id;
+
 	if (iter == NULL) {
 		RTE_ETHDEV_LOG(ERR,
 			"Cannot get next device from NULL iterator\n");

lib/ethdev/meson.build rte_eth_iterator_next(struct rte_dev_iterator *iter) · line 307

Quoted 9 lines
lib/ethdev/meson.build +4 -2
@@ -297,8 +301,11 @@ rte_eth_iterator_next(struct rte_dev_iterator *iter)
 		/* A device is matching bus part, need to check ethdev part. */
 		iter->class_device = iter->cls->dev_iterate(
 				iter->class_device, iter->cls_str, iter);
-		if (iter->class_device != NULL)
-			return eth_dev_to_id(iter->class_device); /* match */
+		if (iter->class_device != NULL) {
+			id = eth_dev_to_id(iter->class_device);
+			rte_eth_trace_iterator_next(iter, id);
+			return id; /* match */

please move 'id' declaration within the if block, and again put trace call into separate block to highlight it, otherwise easy to miss, like:

``

if (iter->class_device != NULL) {
	uint16_t id = eth_dev_to_id(iter->class_device);

	rte_eth_trace_iterator_next(iter, id);

	return id; /* match */
}

lib/ethdev/meson.build rte_eth_iterator_cleanup(struct rte_dev_iterator *iter) · line 326

Quoted 9 lines
lib/ethdev/meson.build +2 -0
+		}
 	} while (iter->bus != NULL); /* need to try next rte_device */
 
 	/* No more ethdev port to iterate. */
@@ -316,6 +323,7 @@ rte_eth_iterator_cleanup(struct rte_dev_iterator *iter)
 
 	if (iter->bus_str == NULL)
 		return; /* nothing to free in pure class filter */
+	rte_eth_trace_iterator_cleanup(iter);

Can you please make trace call a separate block, I won't comment same for bellow, can you please apply this to all.

lib/ethdev/meson.build rte_eth_iterator_cleanup(struct rte_dev_iterator *iter) · line 336

Quoted 9 lines
lib/ethdev/meson.build +2 -0
 	free(RTE_CAST_FIELD(iter, bus_str, char *)); /* workaround const */
 	free(RTE_CAST_FIELD(iter, cls_str, char *)); /* workaround const */
 	memset(iter, 0, sizeof(*iter));
@@ -324,12 +332,18 @@ rte_eth_iterator_cleanup(struct rte_dev_iterator *iter)
 uint16_t
 rte_eth_find_next(uint16_t port_id)
 {
+	rte_eth_trace_find_next(port_id);
+

Why tracing previous port_id, and other one below records next port_id, won't it be confusing to have both with same name.

I suggest just keep last one, (next port_id).

lib/ethdev/meson.build rte_eth_iterator_cleanup(struct rte_dev_iterator *iter) · line 342

Quoted 7 lines
lib/ethdev/meson.build +2 -1
 	while (port_id < RTE_MAX_ETHPORTS &&
 			rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)
 		port_id++;
 
-	if (port_id >= RTE_MAX_ETHPORTS)
+	if (port_id >= RTE_MAX_ETHPORTS) {
+		rte_eth_trace_find_next(RTE_MAX_ETHPORTS);

Is there a specific reason to trace all paths, why not just keep the last one?

Quoted 10 lines
lib/ethdev/meson.build +3 -0
 		return RTE_MAX_ETHPORTS;
+	}
+
+	rte_eth_trace_find_next(port_id);
 
 	return port_id;
 }
@@ -347,10 +361,15 @@ uint16_t
 rte_eth_find_next_of(uint16_t port_id, const struct rte_device *parent)
 {

lib/ethdev/meson.build uint16_t · line 372

Quoted 10 lines
lib/ethdev/meson.build +5 -0
 	port_id = rte_eth_find_next(port_id);
+
+	rte_eth_trace_find_next_of(port_id);
+
 	while (port_id < RTE_MAX_ETHPORTS &&
 			rte_eth_devices[port_id].device != parent)
 		port_id = rte_eth_find_next(port_id + 1);
 
+	rte_eth_trace_find_next_of(port_id);
+

Same here, lets keep only the last one.

lib/ethdev/meson.build uint16_t · line 382

Quoted 10 lines
lib/ethdev/meson.build +3 -0
 	return port_id;
 }
 
@@ -358,6 +377,9 @@ uint16_t
 rte_eth_find_next_sibling(uint16_t port_id, uint16_t ref_port_id)
 {
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(ref_port_id, RTE_MAX_ETHPORTS);
+
+	rte_eth_trace_find_next_sibling(port_id, ref_port_id);
+

This doesn't record the return values, function should be updated to keep the interim return value of 'rte_eth_find_next_of()' and trace functions should record it.

Quoted 6 lines
lib/ethdev/meson.build +0 -0
 	return rte_eth_find_next_of(port_id,
 			rte_eth_devices[ref_port_id].device);
 }
@@ -372,10 +394,13 @@ int
 rte_eth_dev_is_valid_port(uint16_t port_id)
 {

lib/ethdev/meson.build int · line 403

Quoted 10 lines
lib/ethdev/meson.build +5 -2
 	if (port_id >= RTE_MAX_ETHPORTS ||
-	    (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED))
+	    (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)) {
+		rte_ethdev_trace_is_valid_port(port_id, 0);
 		return 0;
-	else
+	} else {
+		rte_ethdev_trace_is_valid_port(port_id, 1);
 		return 1;
+	}

What about to create an interim 'is_valid' variable and record it with single trace call?

<...>

lib/ethdev/meson.build int

Quoted 4 lines
lib/ethdev/meson.build +1 -0
 uint32_t
 rte_eth_speed_bitflag(uint32_t speed, int duplex)
 {
+	rte_eth_trace_speed_bitflag(speed, duplex);

Let's create an interim return value and record it for the trace function, and please move trace function to the bottom of the function.

<...>

lib/ethdev/meson.build void · line 2532

Quoted 5 lines
lib/ethdev/meson.build +1 -0
@@ -2433,6 +2529,7 @@ void
 rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
 		void *userdata __rte_unused)
 {
+	rte_eth_trace_tx_buffer_drop_callback(pkts, unsent);

Since only pointer value is recorded, function can be moved down, please put emtpy line in between.

<...>

lib/ethdev/meson.build rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt) · line 2602

Quoted 7 lines
lib/ethdev/meson.build +2 -1
@@ -2495,7 +2598,12 @@ rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt)
 	/* Call driver to free pending mbufs. */
 	ret = (*dev->dev_ops->tx_done_cleanup)(dev->data->tx_queues[queue_id],
 					       free_cnt);
-	return eth_err(port_id, ret);
+
+	ret = eth_err(port_id, ret);

Please don't add new empty line _before_ this functions.

<...>

lib/ethdev/meson.build rte_eth_link_to_str(char *str, size_t len, const struct rte_eth_link *eth_link) · line 2838

Quoted 6 lines
lib/ethdev/meson.build +2 -0
@@ -2700,6 +2834,8 @@ rte_eth_link_to_str(char *str, size_t len, const struct rte_eth_link *eth_link)
 		return -EINVAL;
 	}
 
+	rte_eth_trace_link_to_str(len, eth_link);
+

Why not record return value and move trace function to the end of the function and record 'str' too.

Quoted 12 lines
lib/ethdev/meson.build +1 -0
 	if (eth_link->link_status == RTE_ETH_LINK_DOWN)
 		return snprintf(str, len, "Link down");
 	else
@@ -2715,6 +2851,7 @@ int
 rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];

lib/ethdev/meson.build rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats) · line 2871

Quoted 6 lines
lib/ethdev/meson.build +2 -1
@@ -2730,7 +2867,12 @@ rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats)
 	if (*dev->dev_ops->stats_get == NULL)
 		return -ENOTSUP;
 	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
-	return eth_err(port_id, (*dev->dev_ops->stats_get)(dev, stats));
+
+	ret = eth_err(port_id, (*dev->dev_ops->stats_get)(dev, stats));

Pleaes don't add empyt line above.

<...>

Quoted 4 lines
lib/ethdev/meson.build +0 -0
@@ -3229,13 +3384,19 @@ int
 rte_eth_xstats_reset(uint16_t port_id)
 {
 	struct rte_eth_dev *dev;

lib/ethdev/meson.build int · line 3394

Quoted 10 lines
lib/ethdev/meson.build +3 -2
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
 
 	/* implemented by the driver */
-	if (dev->dev_ops->xstats_reset != NULL)
-		return eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev));
+	if (dev->dev_ops->xstats_reset != NULL) {
+		ret = eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev));

Can you please move 'ret' decleration in if block.

``
int ret = eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev)); ``

Quoted 11 lines
lib/ethdev/meson.build +5 -0
+
+		rte_eth_trace_xstats_reset(port_id, ret);
+
+		return ret;
+	}
 
 	/* fallback to default */
 	return rte_eth_stats_reset(port_id);
@@ -3268,24 +3429,37 @@ int
 rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id,
 		uint8_t stat_idx)

lib/ethdev/meson.build int · line 3439

Quoted 10 lines
lib/ethdev/meson.build +6 -1
 {
-	return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id,
+	int ret;
+
+	ret = eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id,
 						tx_queue_id,
 						stat_idx, STAT_QMAP_TX));
+
+	rte_ethdev_trace_set_tx_queue_stats_mapping(port_id, tx_queue_id, stat_idx, ret);
+

In below function 'rte_ethdev_trace_set_rx_queue_stats_mapping()' call wrapped to fit 80 lines, but this one not, please be consistent and if possible break both to fit as done below.

<...>

lib/ethdev/meson.build int · line 3448

Quoted 9 lines
lib/ethdev/meson.build +9 -0
+RTE_TRACE_POINT(
+	rte_eth_trace_iterator_next,
+	RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter, uint16_t id),
+	rte_trace_point_emit_ptr(iter);
+	rte_trace_point_emit_string(iter->bus_str);
+	rte_trace_point_emit_string(iter->cls_str);
+	rte_trace_point_emit_u16(id);
+)
+

Trace functions don't chage parameters, what do you think to update all parameters with 'const' keywords for this:
``
RTE_TRACE_POINT(

	rte_eth_trace_iterator_next,
	RTE_TRACE_POINT_ARGS(const struct rte_dev_iterator *iter, uint16_t id),
	rte_trace_point_emit_ptr(iter);
	rte_trace_point_emit_string(iter->bus_str);
	rte_trace_point_emit_string(iter->cls_str);
	rte_trace_point_emit_u16(id);

)
``

This comment is not just for this trace point, but for *all* trace points.

<...>

Quoted 13 lines
lib/ethdev/meson.build +13 -0
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_hairpin_queue_setup,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id,
+		uint16_t nb_rx_desc, const struct rte_eth_hairpin_conf *conf,
+		int ret),
+	uint32_t peer_count = conf->peer_count;
+	uint32_t tx_explicit = conf->tx_explicit;
+	uint32_t manual_bind = conf->manual_bind;
+	uint32_t use_locked_device_memory = conf->use_locked_device_memory;
+	uint32_t use_rte_memory = conf->use_rte_memory;
+	uint32_t force_memory = conf->force_memory;
+
+	rte_trace_point_emit_u16(port_id);

lib/ethdev/meson.build int

Quoted 10 lines
lib/ethdev/meson.build +10 -0
+	rte_trace_point_emit_u16(rx_queue_id);
+	rte_trace_point_emit_u16(nb_rx_desc);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(peer_count);
+	rte_trace_point_emit_u32(tx_explicit);
+	rte_trace_point_emit_u32(manual_bind);
+	rte_trace_point_emit_u32(use_locked_device_memory);
+	rte_trace_point_emit_u32(use_rte_memory);
+	rte_trace_point_emit_u32(force_memory);
+	rte_trace_point_emit_int(ret);

Do we need temporary variables like 'peer_count', why not directly use them:
``
rte_trace_point_emit_u32(conf->peer_count);
``

Quoted 16 lines
lib/ethdev/meson.build +16 -0
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_tx_hairpin_queue_setup,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id,
+		uint16_t nb_tx_desc, const struct rte_eth_hairpin_conf *conf,
+		int ret),
+	uint32_t peer_count = conf->peer_count;
+	uint32_t tx_explicit = conf->tx_explicit;
+	uint32_t manual_bind = conf->manual_bind;
+	uint32_t use_locked_device_memory = conf->use_locked_device_memory;
+	uint32_t use_rte_memory = conf->use_rte_memory;
+	uint32_t force_memory = conf->force_memory;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(tx_queue_id);

lib/ethdev/meson.build

Quoted 10 lines
lib/ethdev/meson.build +10 -0
+	rte_trace_point_emit_u16(nb_tx_desc);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(peer_count);
+	rte_trace_point_emit_u32(tx_explicit);
+	rte_trace_point_emit_u32(manual_bind);
+	rte_trace_point_emit_u32(use_locked_device_memory);
+	rte_trace_point_emit_u32(use_rte_memory);
+	rte_trace_point_emit_u32(force_memory);
+	rte_trace_point_emit_int(ret);
+)

Same as above.

<...>

lib/ethdev/meson.build

Quoted 8 lines
lib/ethdev/meson.build +8 -0
+RTE_TRACE_POINT(
+	rte_eth_trace_allmulticast_disable,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int all_multicast, int diag),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(all_multicast);
+	rte_trace_point_emit_int(diag);
+)
+

Can you replace 'diag' with 'ret' for consistency, same for '*promiscuous/allmulticast_enable/disable'.

<...>

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why 'rte_eth_trace_find_next' added as fast path?
Can you please add comment for all why it is added as fast path, this help to evaluate/review this later.

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next_of,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why not record second parameter of the API, "struct rte_device *parent" too?

<...>

lib/ethdev/meson.build

Quoted 11 lines
lib/ethdev/meson.build +11 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_hairpin_get_peer_ports,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t *peer_ports,
+		size_t len, uint32_t direction, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(peer_ports);
+	rte_trace_point_emit_size_t(len);
+	rte_trace_point_emit_u32(direction);
+	rte_trace_point_emit_int(ret);
+)
+

Some of these functions I am not clear why fast path trace point is used, 'rte_eth_trace_hairpin_get_peer_ports' is one of them, can you please comment the justification to the code as suggested above.

<...>

lib/ethdev/meson.build

Quoted 13 lines
lib/ethdev/meson.build +13 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_link_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link),
+	uint16_t link_duplex = link->link_duplex;
+	uint16_t link_autoneg = link->link_autoneg;
+	uint16_t link_status = link->link_status;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(link->link_speed);
+	rte_trace_point_emit_u16(link_duplex);
+	rte_trace_point_emit_u16(link_autoneg);
+	rte_trace_point_emit_u16(link_status);
+)

Why creating varible for 'link_duplex' for 'link->link_duplex' but using 'link->link_speed', why not use all as 'link->xxx'?

<...>

lib/ethdev/meson.build

Quoted 11 lines
lib/ethdev/meson.build +11 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_xstats_get_names,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_eth_xstat_name *xstats_names,
+		unsigned int size, int cnt_used_entries),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_string(xstats_names->name);
+	rte_trace_point_emit_u32(size);
+	rte_trace_point_emit_int(cnt_used_entries);
+)
+

'xstats_names' is an array, whose size is 'cnt_used_entries', just printing 'xstats_names->name' for first element can be misleading, can print all values as done in 'rte_eth_xstats_get()'

<...>

lib/ethdev/meson.build

Quoted 10 lines
lib/ethdev/meson.build +10 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_xstats_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_xstat xstats,
+		int i),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u64(xstats.id);
+	rte_trace_point_emit_u64(xstats.value);
+	rte_trace_point_emit_u32(i);
+)
+

as far as I can see "id == i", so maybe 'i' can be dropped.

<...>

Quoted 60 lines
lib/ethdev/meson.build +56 -0
@@ -298,6 +298,72 @@ EXPERIMENTAL {
 	rte_flow_get_q_aged_flows;
 	rte_mtr_meter_policy_get;
 	rte_mtr_meter_profile_get;
+
+	# added in 23.03
+	__rte_eth_trace_allmulticast_disable;
+	__rte_eth_trace_allmulticast_enable;
+	__rte_eth_trace_allmulticast_get;
+	__rte_eth_trace_call_rx_callbacks;
+	__rte_eth_trace_call_tx_callbacks;
+	__rte_eth_trace_find_next;
+	__rte_eth_trace_find_next_of;
+	__rte_eth_trace_find_next_owned_by;
+	__rte_eth_trace_find_next_sibling;
+	__rte_eth_trace_hairpin_bind;
+	__rte_eth_trace_hairpin_get_peer_ports;
+	__rte_eth_trace_hairpin_unbind;
+	__rte_eth_trace_iterator_cleanup;
+	__rte_eth_trace_iterator_init;
+	__rte_eth_trace_iterator_next;
+	__rte_eth_trace_link_get;
+	__rte_eth_trace_link_get_nowait;
+	__rte_eth_trace_link_speed_to_str;
+	__rte_eth_trace_link_to_str;
+	__rte_eth_trace_promiscuous_disable;
+	__rte_eth_trace_promiscuous_enable;
+	__rte_eth_trace_promiscuous_get;
+	__rte_eth_trace_rx_hairpin_queue_setup;
+	__rte_eth_trace_speed_bitflag;
+	__rte_eth_trace_stats_get;
+	__rte_eth_trace_stats_reset;
+	__rte_eth_trace_tx_buffer_count_callback;
+	__rte_eth_trace_tx_buffer_drop_callback;
+	__rte_eth_trace_tx_buffer_init;
+	__rte_eth_trace_tx_buffer_set_err_callback;
+	__rte_eth_trace_tx_done_cleanup;
+	__rte_eth_trace_tx_hairpin_queue_setup;
+	__rte_eth_trace_xstats_get;
+	__rte_eth_trace_xstats_get_by_id;
+	__rte_eth_trace_xstats_get_id_by_name;
+	__rte_eth_trace_xstats_get_names;
+	__rte_eth_trace_xstats_get_names_by_id;
+	__rte_eth_trace_xstats_reset;
+	__rte_ethdev_trace_capability_name;
+	__rte_ethdev_trace_count_avail;
+	__rte_ethdev_trace_count_total;
+	__rte_ethdev_trace_fw_version_get;
+	__rte_ethdev_trace_get_name_by_port;
+	__rte_ethdev_trace_get_port_by_name;
+	__rte_ethdev_trace_get_sec_ctx;
+	__rte_ethdev_trace_is_removed;
+	__rte_ethdev_trace_is_valid_port;
+	__rte_ethdev_trace_owner_delete;
+	__rte_ethdev_trace_owner_get;
+	__rte_ethdev_trace_owner_new;
+	__rte_ethdev_trace_owner_set;
+	__rte_ethdev_trace_owner_unset;
+	__rte_ethdev_trace_reset;
+	__rte_ethdev_trace_rx_offload_name;

lib/ethdev/meson.build EXPERIMENTAL { · line 366

Quoted 10 lines
lib/ethdev/meson.build +10 -0
+	__rte_ethdev_trace_rx_queue_start;
+	__rte_ethdev_trace_rx_queue_stop;
+	__rte_ethdev_trace_set_link_down;
+	__rte_ethdev_trace_set_link_up;
+	__rte_ethdev_trace_set_rx_queue_stats_mapping;
+	__rte_ethdev_trace_set_tx_queue_stats_mapping;
+	__rte_ethdev_trace_socket_id;
+	__rte_ethdev_trace_tx_offload_name;
+	__rte_ethdev_trace_tx_queue_start;
+	__rte_ethdev_trace_tx_queue_stop;

Can you please drop these trace objects?

#87 lore raw

RE: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 66 lines

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Monday, January 23, 2023 10:59 PM
To: Ankur Dwivedi <[email protected]>; [email protected]; David Marchand <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

External Email

----------------------------------------------------------------------

Quoted 6 lines · Ankur Dwivedi

Adds trace points for ethdev functions.
Moved the rte_ethdev_trace_rx_burst and rte_ethdev_trace_tx_burst to a new file rte_ethdev_trace_fp_burst.h. This is needed to resolve cyclic dependency between rte_ethdev.h and rte_ethdev_trace_fp.h.

<...>

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_burst, · line 135

Quoted 3 lines
lib/ethdev/ethdev_trace_points.c +3 -0
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_hairpin_queue_setup,
+	lib.ethdev.rx.hairpin_queue_setup)
+

s/rx.hairpin_queue_setup/rx_hairpin_queue_setup/ ?

Quoted 5 lines

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_burst, · line 138

Quoted 3 lines
lib/ethdev/ethdev_trace_points.c +3 -0
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_hairpin_queue_setup,
+	lib.ethdev.tx.hairpin_queue_setup)
+

s/tx.hairpin_queue_setup/tx_hairpin_queue_setup/ ?

Ok.

Quoted 16 lines

<...>

lib/ethdev/meson.build headers = files( · line 27

Quoted 9 lines
lib/ethdev/meson.build index renamed from lib/ethdev/meson.build +0 -0

39250b5da1..f5c0865023 100644

lib/ethdev/meson.build +1 -0
@@ -24,6 +24,7 @@ headers = files(
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',

Why these trace headers are public?
Aren't trace points only used by the APIs, so I expect them to be internal, so applications shouldn't need them. Why they are expsed to user.

'rte_ethdev_trace.h' can be made as internal. Not sure about 'rte_ethdev_trace_fp.h' and 'rte_ethdev_trace_fp_burst.h' as the tracepoints in fast path may be called from public inline functions.

Quoted 8 lines

@David, what do you think?

<...>

Quoted 3 lines
lib/ethdev/meson.build +0 -0
@@ -258,6 +259,7 @@ rte_eth_iterator_init(struct rte_dev_iterator
 *iter, const char *devargs_str)
 
Quoted 7 lines

lib/ethdev/meson.build rte_eth_iterator_init(struct rte_dev_iterator · line 265

Quoted 5 lines
lib/ethdev/meson.build +1 -0
 end:
 	iter->cls = rte_class_find_by_name("eth");
+	rte_eth_trace_iterator_init(devargs_str);
 	rte_devargs_reset(&devargs);
 	return 0;

Why not add trace call just before return, as a separate block, like:

Ok.

Quoted 20 lines

``
end:

lib/ethdev/rte_ethdev.c +0 -0
 	iter->cls = rte_class_find_by_name("eth");
 	rte_devargs_reset(&devargs);
	rte_eth_trace_iterator_init(devargs_str);

return 0;
``

lib/ethdev/meson.build rte_eth_iterator_init(struct rte_dev_iterator · line 282

Quoted 9 lines
lib/ethdev/meson.build +2 -0
@@ -274,6 +276,8 @@ rte_eth_iterator_init(struct rte_dev_iterator
 *iter, const char *devargs_str)  uint16_t
 rte_eth_iterator_next(struct rte_dev_iterator *iter)  {
+	uint16_t id;
+
 	if (iter == NULL) {
 		RTE_ETHDEV_LOG(ERR,
 			"Cannot get next device from NULL iterator\n"); @@ -

297,8 +301,11

Quoted 13 lines

lib/ethdev/meson.build

Quoted 10 lines
lib/ethdev/meson.build +0 -0
 @@ rte_eth_iterator_next(struct rte_dev_iterator *iter)
lib/ethdev/meson.build +4 -2
 		/* A device is matching bus part, need to check ethdev part. */
 		iter->class_device = iter->cls->dev_iterate(
 				iter->class_device, iter->cls_str, iter);
-		if (iter->class_device != NULL)
-			return eth_dev_to_id(iter->class_device); /* match */
+		if (iter->class_device != NULL) {
+			id = eth_dev_to_id(iter->class_device);
+			rte_eth_trace_iterator_next(iter, id);
+			return id; /* match */

please move 'id' declaration within the if block, and again put trace call into separate block to highlight it, otherwise easy to miss, like:

Ok.

Quoted 17 lines

``

if (iter->class_device != NULL) {
	uint16_t id = eth_dev_to_id(iter->class_device);

	rte_eth_trace_iterator_next(iter, id);

	return id; /* match */
}
Quoted 6 lines
lib/ethdev/meson.build +1 -0
+		}
 	} while (iter->bus != NULL); /* need to try next rte_device */
 
 	/* No more ethdev port to iterate. */ @@ -316,6 +323,7 @@

rte_eth_iterator_cleanup(struct rte_dev_iterator *iter)

Quoted 6 lines

lib/ethdev/meson.build

Quoted 3 lines
lib/ethdev/meson.build +1 -0
 	if (iter->bus_str == NULL)
 		return; /* nothing to free in pure class filter */
+	rte_eth_trace_iterator_cleanup(iter);

Can you please make trace call a separate block, I won't comment same for bellow, can you please apply this to all.

Have missed to make few functions as separate block. Majority of the functions are made as separate block. Will make these as separate block.

Quoted 12 lines

lib/ethdev/meson.build rte_eth_iterator_cleanup(struct rte_dev_iterator · line 334

Quoted 8 lines
lib/ethdev/meson.build +2 -0
 	free(RTE_CAST_FIELD(iter, bus_str, char *)); /* workaround const */
 	free(RTE_CAST_FIELD(iter, cls_str, char *)); /* workaround const */
 	memset(iter, 0, sizeof(*iter));
@@ -324,12 +332,18 @@ rte_eth_iterator_cleanup(struct rte_dev_iterator
 *iter)  uint16_t  rte_eth_find_next(uint16_t port_id)  {
+	rte_eth_trace_find_next(port_id);
+

Why tracing previous port_id, and other one below records next port_id, won't it be confusing to have both with same name.

Quoted 1 line

I suggest just keep last one, (next port_id).

OK.

Quoted 11 lines

lib/ethdev/meson.build rte_eth_iterator_cleanup(struct rte_dev_iterator · line 336

Quoted 3 lines
lib/ethdev/meson.build +0 -0
 	while (port_id < RTE_MAX_ETHPORTS &&
 			rte_eth_devices[port_id].state ==

RTE_ETH_DEV_UNUSED)

lib/ethdev/meson.build rte_eth_iterator_cleanup(struct rte_dev_iterator · line 340

Quoted 5 lines
lib/ethdev/meson.build +2 -1
 		port_id++;
 
-	if (port_id >= RTE_MAX_ETHPORTS)
+	if (port_id >= RTE_MAX_ETHPORTS) {
+		rte_eth_trace_find_next(RTE_MAX_ETHPORTS);

Is there a specific reason to trace all paths, why not just keep the last one?

This can be kept as the function returns with RTE_MAX_ETHPORTS here.

Quoted 5 lines

lib/ethdev/meson.build rte_eth_iterator_cleanup(struct rte_dev_iterator · line 344

Quoted 5 lines
lib/ethdev/meson.build +3 -0
 		return RTE_MAX_ETHPORTS;
+	}
+
+	rte_eth_trace_find_next(port_id);

This can be also kept.

Quoted 14 lines
Quoted 14 lines
lib/ethdev/meson.build +3 -0
 	return port_id;
 }
@@ -347,10 +361,15 @@ uint16_t
 rte_eth_find_next_of(uint16_t port_id, const struct rte_device
 *parent)  {
 	port_id = rte_eth_find_next(port_id);
+
+	rte_eth_trace_find_next_of(port_id);
+
 	while (port_id < RTE_MAX_ETHPORTS &&
 			rte_eth_devices[port_id].device != parent)
 		port_id = rte_eth_find_next(port_id + 1);
 
Quoted 4 lines

lib/ethdev/meson.build uint16_t · line 372

Quoted 2 lines
lib/ethdev/meson.build +2 -0
+	rte_eth_trace_find_next_of(port_id);
+

Same here, lets keep only the last one.

Ok.

Quoted 8 lines

lib/ethdev/meson.build uint16_t · line 378

Quoted 7 lines
lib/ethdev/meson.build +0 -0
 	return port_id;
 }
 
@@ -358,6 +377,9 @@ uint16_t
 rte_eth_find_next_sibling(uint16_t port_id, uint16_t ref_port_id)  {
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(ref_port_id,

RTE_MAX_ETHPORTS);

Quoted 7 lines

lib/ethdev/meson.build uint16_t · line 381

Quoted 3 lines
lib/ethdev/meson.build +3 -0
+
+	rte_eth_trace_find_next_sibling(port_id, ref_port_id);
+

This doesn't record the return values, function should be updated to keep the interim return value of 'rte_eth_find_next_of()' and trace functions should record it.

Will make this change.

Quoted 11 lines
Quoted 11 lines
lib/ethdev/meson.build +2 -1
 	return rte_eth_find_next_of(port_id,
 			rte_eth_devices[ref_port_id].device);
 }
@@ -372,10 +394,13 @@ int
 rte_eth_dev_is_valid_port(uint16_t port_id)  {
 	if (port_id >= RTE_MAX_ETHPORTS ||
-	    (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED))
+	    (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)) {
+		rte_ethdev_trace_is_valid_port(port_id, 0);
 		return 0;
Quoted 8 lines

lib/ethdev/meson.build int · line 402

Quoted 5 lines
lib/ethdev/meson.build +3 -1
-	else
+	} else {
+		rte_ethdev_trace_is_valid_port(port_id, 1);
 		return 1;
+	}

What about to create an interim 'is_valid' variable and record it with single trace call?

Ok.

Quoted 9 lines

<...>

lib/ethdev/meson.build

Quoted 3 lines

uint32_t
rte_eth_speed_bitflag(uint32_t speed, int duplex) {

lib/ethdev/meson.build +1 -0
+	rte_eth_trace_speed_bitflag(speed, duplex);

Let's create an interim return value and record it for the trace function, and please move trace function to the bottom of the function.

Ok.

Quoted 11 lines

<...>

lib/ethdev/meson.build void · line 2532

Quoted 5 lines
lib/ethdev/meson.build +1 -0
@@ -2433,6 +2529,7 @@ void
 rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
 		void *userdata __rte_unused)
 {
+	rte_eth_trace_tx_buffer_drop_callback(pkts, unsent);

Since only pointer value is recorded, function can be moved down, please put emtpy line in between.

Ok.

Quoted 5 lines

<...>

lib/ethdev/meson.build rte_eth_tx_done_cleanup(uint16_t port_id,

Quoted 1 line
lib/ethdev/meson.build +0 -0
@@ -2495,7 +2598,12 @@ rte_eth_tx_done_cleanup(uint16_t port_id,

uint16_t queue_id, uint32_t free_cnt)

Quoted 9 lines

lib/ethdev/meson.build rte_eth_tx_done_cleanup(uint16_t port_id, · line 2603

Quoted 7 lines
lib/ethdev/meson.build +2 -1
 	/* Call driver to free pending mbufs. */
 	ret = (*dev->dev_ops->tx_done_cleanup)(dev->data-
 tx_queues[queue_id],
 					       free_cnt);
-	return eth_err(port_id, ret);
+
+	ret = eth_err(port_id, ret);

Please don't add new empty line _before_ this functions.

Ok.

Quoted 5 lines

<...>

lib/ethdev/meson.build rte_eth_link_to_str(char *str, size_t len, const

Quoted 1 line
lib/ethdev/meson.build +0 -0
@@ -2700,6 +2834,8 @@ rte_eth_link_to_str(char *str, size_t len, const

struct rte_eth_link *eth_link)

Quoted 8 lines

lib/ethdev/meson.build rte_eth_link_to_str(char *str, size_t len, const · line 2838

Quoted 5 lines
lib/ethdev/meson.build +2 -0
 		return -EINVAL;
 	}
 
+	rte_eth_trace_link_to_str(len, eth_link);
+

Why not record return value and move trace function to the end of the function and record 'str' too.

Ok.

Quoted 13 lines

lib/ethdev/meson.build rte_eth_stats_get(uint16_t port_id, struct

Quoted 12 lines
lib/ethdev/meson.build +1 -0
 	if (eth_link->link_status == RTE_ETH_LINK_DOWN)
 		return snprintf(str, len, "Link down");
 	else
@@ -2715,6 +2851,7 @@ int
 rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats)  {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -2730,7 +2867,12 @@ rte_eth_stats_get(uint16_t port_id, struct

rte_eth_stats *stats)

Quoted 8 lines

lib/ethdev/meson.build rte_eth_stats_get(uint16_t port_id, struct · line 2871

Quoted 6 lines
lib/ethdev/meson.build +2 -1
 	if (*dev->dev_ops->stats_get == NULL)
 		return -ENOTSUP;
 	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
-	return eth_err(port_id, (*dev->dev_ops->stats_get)(dev, stats));
+
+	ret = eth_err(port_id, (*dev->dev_ops->stats_get)(dev, stats));

Pleaes don't add empyt line above.

Ok.

Quoted 11 lines

<...>

Quoted 8 lines
lib/ethdev/meson.build +1 -0
@@ -3229,13 +3384,19 @@ int
 rte_eth_xstats_reset(uint16_t port_id)  {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
 
Quoted 7 lines

lib/ethdev/meson.build int · line 3393

Quoted 5 lines
lib/ethdev/meson.build +2 -2
 	/* implemented by the driver */
-	if (dev->dev_ops->xstats_reset != NULL)
-		return eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev));
+	if (dev->dev_ops->xstats_reset != NULL) {
+		ret = eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev));

Can you please move 'ret' decleration in if block.

Ok.

Quoted 15 lines

``
int ret = eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev)); ``

Quoted 9 lines
lib/ethdev/meson.build +5 -0
+
+		rte_eth_trace_xstats_reset(port_id, ret);
+
+		return ret;
+	}
 
 	/* fallback to default */
 	return rte_eth_stats_reset(port_id); @@ -3268,24 +3429,37 @@ int

rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t

tx_queue_id,

Quoted 16 lines

lib/ethdev/meson.build

Quoted 12 lines
lib/ethdev/meson.build +7 -1
 		uint8_t stat_idx)
 {
-	return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id,
+	int ret;
+
+	ret = eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id,
 						tx_queue_id,
 						stat_idx, STAT_QMAP_TX));
+
+	rte_ethdev_trace_set_tx_queue_stats_mapping(port_id, tx_queue_id,
+stat_idx, ret);
+

In below function 'rte_ethdev_trace_set_rx_queue_stats_mapping()' call wrapped to fit 80 lines, but this one not, please be consistent and if possible break both to fit as done below.

Ok.

Quoted 15 lines

<...>

lib/ethdev/meson.build

Quoted 9 lines
lib/ethdev/meson.build +9 -0
+RTE_TRACE_POINT(
+	rte_eth_trace_iterator_next,
+	RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter, uint16_t id),
+	rte_trace_point_emit_ptr(iter);
+	rte_trace_point_emit_string(iter->bus_str);
+	rte_trace_point_emit_string(iter->cls_str);
+	rte_trace_point_emit_u16(id);
+)
+

Trace functions don't chage parameters, what do you think to update all parameters with 'const' keywords for this:

Yes will make it as const.

Quoted 34 lines

``
RTE_TRACE_POINT(
rte_eth_trace_iterator_next, RTE_TRACE_POINT_ARGS(const struct rte_dev_iterator *iter, uint16_t
id),

	rte_trace_point_emit_ptr(iter);
	rte_trace_point_emit_string(iter->bus_str);
	rte_trace_point_emit_string(iter->cls_str);
	rte_trace_point_emit_u16(id);

)
``

This comment is not just for this trace point, but for *all* trace points.

<...>

Quoted 18 lines
lib/ethdev/meson.build +9 -0
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_hairpin_queue_setup,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id,
+		uint16_t nb_rx_desc, const struct rte_eth_hairpin_conf *conf,
+		int ret),
+	uint32_t peer_count = conf->peer_count;
+	uint32_t tx_explicit = conf->tx_explicit;
+	uint32_t manual_bind = conf->manual_bind;
+	uint32_t use_locked_device_memory = conf-

use_locked_device_memory;

lib/ethdev/meson.build +8 -0
+	uint32_t use_rte_memory = conf->use_rte_memory;
+	uint32_t force_memory = conf->force_memory;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(rx_queue_id);
+	rte_trace_point_emit_u16(nb_rx_desc);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(peer_count);
Quoted 8 lines

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+	rte_trace_point_emit_u32(tx_explicit);
+	rte_trace_point_emit_u32(manual_bind);
+	rte_trace_point_emit_u32(use_locked_device_memory);
+	rte_trace_point_emit_u32(use_rte_memory);
+	rte_trace_point_emit_u32(force_memory);
+	rte_trace_point_emit_int(ret);

Do we need temporary variables like 'peer_count', why not directly use them:

Temporary variables are needed where the actual variable is a bitfield. For example in struct rte_eth_hairpin_conf:
struct rte_eth_hairpin_conf {
uint32_t peer_count:16;
....
uint32_t tx_explicit:1
....
};

Otherwise there is a compilation error.
../lib/ethdev/rte_ethdev_trace.h:253:9: note: in expansion of macro ‘rte_trace_point_emit_u16’

  253 |         rte_trace_point_emit_u16(conf->peer_count);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~

../lib/eal/include/rte_trace_point.h:369:38: error: ‘sizeof’ applied to a bit-field
369 | mem = RTE_PTR_ADD(mem, sizeof(in)); \

Quoted 36 lines

``
rte_trace_point_emit_u32(conf->peer_count);
``

Quoted 17 lines
lib/ethdev/meson.build +11 -0
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_tx_hairpin_queue_setup,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id,
+		uint16_t nb_tx_desc, const struct rte_eth_hairpin_conf *conf,
+		int ret),
+	uint32_t peer_count = conf->peer_count;
+	uint32_t tx_explicit = conf->tx_explicit;
+	uint32_t manual_bind = conf->manual_bind;
+	uint32_t use_locked_device_memory = conf-

use_locked_device_memory;

lib/ethdev/meson.build +5 -0
+	uint32_t use_rte_memory = conf->use_rte_memory;
+	uint32_t force_memory = conf->force_memory;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(tx_queue_id);

lib/ethdev/meson.build

Quoted 10 lines
lib/ethdev/meson.build +10 -0
+	rte_trace_point_emit_u16(nb_tx_desc);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(peer_count);
+	rte_trace_point_emit_u32(tx_explicit);
+	rte_trace_point_emit_u32(manual_bind);
+	rte_trace_point_emit_u32(use_locked_device_memory);
+	rte_trace_point_emit_u32(use_rte_memory);
+	rte_trace_point_emit_u32(force_memory);
+	rte_trace_point_emit_int(ret);
+)

Same as above.

<...>

Quoted 11 lines

lib/ethdev/meson.build

Quoted 8 lines
lib/ethdev/meson.build +8 -0
+RTE_TRACE_POINT(
+	rte_eth_trace_allmulticast_disable,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int all_multicast, int diag),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(all_multicast);
+	rte_trace_point_emit_int(diag);
+)
+

Can you replace 'diag' with 'ret' for consistency, same for '*promiscuous/allmulticast_enable/disable'.

Ok.

Quoted 13 lines

<...>

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why 'rte_eth_trace_find_next' added as fast path?
Can you please add comment for all why it is added as fast path, this help to evaluate/review this later.

There were many functions for which I was not sure about whether they should be slow path or fast path. I made the following assumption:

For slow path I have chosen the function which do some setup, configure or write some configuration. For an example rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_tx_buffer_set_err_callback, rte_eth_trace_promiscuous_enable are slow path functions.

The functions which read data are made as fastpath functions. Also for functions for which I was not sure I made it as fastpath.

For an example rte_ethdev_trace_owner_get, rte_eth_trace_hairpin_get_peer_port, rte_eth_trace_macaddr_get are made as fastpath.

But there are few exceptions. Function like *_get_capability are made as slowpath. Also rte_ethdev_trace_info_get is slowpath.

The slowpath and fastpath functions are in separate files. rte_ethdev_trace.h (slowpath) and rte_ethdev_trace_fp.h (fastpath).

Please let me know if any function needs to be swapped. I will make that change.

Quoted 9 lines

lib/ethdev/meson.build

Quoted 7 lines
lib/ethdev/meson.build +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next_of,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why not record second parameter of the API, "struct rte_device *parent" too?

Ok.

Quoted 21 lines

<...>

lib/ethdev/meson.build

Quoted 11 lines
lib/ethdev/meson.build +11 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_hairpin_get_peer_ports,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t *peer_ports,
+		size_t len, uint32_t direction, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(peer_ports);
+	rte_trace_point_emit_size_t(len);
+	rte_trace_point_emit_u32(direction);
+	rte_trace_point_emit_int(ret);
+)
+

Some of these functions I am not clear why fast path trace point is used, 'rte_eth_trace_hairpin_get_peer_ports' is one of them, can you please comment the justification to the code as suggested above.

<...>

Quoted 16 lines

lib/ethdev/meson.build

Quoted 13 lines
lib/ethdev/meson.build +13 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_link_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link),
+	uint16_t link_duplex = link->link_duplex;
+	uint16_t link_autoneg = link->link_autoneg;
+	uint16_t link_status = link->link_status;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(link->link_speed);
+	rte_trace_point_emit_u16(link_duplex);
+	rte_trace_point_emit_u16(link_autoneg);
+	rte_trace_point_emit_u16(link_status);
+)

Why creating varible for 'link_duplex' for 'link->link_duplex' but using 'link-

Quoted 1 line

link_speed', why not use all as 'link->xxx'?

nink_duplex, link_autoneg and link_status are bit fields. Same reason as mentioned in earlier comment.

Quoted 4 lines

<...>

Quoted 15 lines

lib/ethdev/meson.build

Quoted 11 lines
lib/ethdev/meson.build +11 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_xstats_get_names,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_eth_xstat_name *xstats_names,
+		unsigned int size, int cnt_used_entries),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_string(xstats_names->name);
+	rte_trace_point_emit_u32(size);
+	rte_trace_point_emit_int(cnt_used_entries);
+)
+

'xstats_names' is an array, whose size is 'cnt_used_entries', just printing 'xstats_names->name' for first element can be misleading, can print all values as done in 'rte_eth_xstats_get()'

Ok.

Quoted 15 lines

<...>

lib/ethdev/meson.build

Quoted 10 lines
lib/ethdev/meson.build +10 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_xstats_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_xstat xstats,
+		int i),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u64(xstats.id);
+	rte_trace_point_emit_u64(xstats.value);
+	rte_trace_point_emit_u32(i);
+)
+

as far as I can see "id == i", so maybe 'i' can be dropped.

Ok.

Quoted 67 lines

<...>

Quoted 64 lines
lib/ethdev/meson.build +60 -0
@@ -298,6 +298,72 @@ EXPERIMENTAL {
 	rte_flow_get_q_aged_flows;
 	rte_mtr_meter_policy_get;
 	rte_mtr_meter_profile_get;
+
+	# added in 23.03
+	__rte_eth_trace_allmulticast_disable;
+	__rte_eth_trace_allmulticast_enable;
+	__rte_eth_trace_allmulticast_get;
+	__rte_eth_trace_call_rx_callbacks;
+	__rte_eth_trace_call_tx_callbacks;
+	__rte_eth_trace_find_next;
+	__rte_eth_trace_find_next_of;
+	__rte_eth_trace_find_next_owned_by;
+	__rte_eth_trace_find_next_sibling;
+	__rte_eth_trace_hairpin_bind;
+	__rte_eth_trace_hairpin_get_peer_ports;
+	__rte_eth_trace_hairpin_unbind;
+	__rte_eth_trace_iterator_cleanup;
+	__rte_eth_trace_iterator_init;
+	__rte_eth_trace_iterator_next;
+	__rte_eth_trace_link_get;
+	__rte_eth_trace_link_get_nowait;
+	__rte_eth_trace_link_speed_to_str;
+	__rte_eth_trace_link_to_str;
+	__rte_eth_trace_promiscuous_disable;
+	__rte_eth_trace_promiscuous_enable;
+	__rte_eth_trace_promiscuous_get;
+	__rte_eth_trace_rx_hairpin_queue_setup;
+	__rte_eth_trace_speed_bitflag;
+	__rte_eth_trace_stats_get;
+	__rte_eth_trace_stats_reset;
+	__rte_eth_trace_tx_buffer_count_callback;
+	__rte_eth_trace_tx_buffer_drop_callback;
+	__rte_eth_trace_tx_buffer_init;
+	__rte_eth_trace_tx_buffer_set_err_callback;
+	__rte_eth_trace_tx_done_cleanup;
+	__rte_eth_trace_tx_hairpin_queue_setup;
+	__rte_eth_trace_xstats_get;
+	__rte_eth_trace_xstats_get_by_id;
+	__rte_eth_trace_xstats_get_id_by_name;
+	__rte_eth_trace_xstats_get_names;
+	__rte_eth_trace_xstats_get_names_by_id;
+	__rte_eth_trace_xstats_reset;
+	__rte_ethdev_trace_capability_name;
+	__rte_ethdev_trace_count_avail;
+	__rte_ethdev_trace_count_total;
+	__rte_ethdev_trace_fw_version_get;
+	__rte_ethdev_trace_get_name_by_port;
+	__rte_ethdev_trace_get_port_by_name;
+	__rte_ethdev_trace_get_sec_ctx;
+	__rte_ethdev_trace_is_removed;
+	__rte_ethdev_trace_is_valid_port;
+	__rte_ethdev_trace_owner_delete;
+	__rte_ethdev_trace_owner_get;
+	__rte_ethdev_trace_owner_new;
+	__rte_ethdev_trace_owner_set;
+	__rte_ethdev_trace_owner_unset;
+	__rte_ethdev_trace_reset;
+	__rte_ethdev_trace_rx_offload_name;
+	__rte_ethdev_trace_rx_queue_start;
+	__rte_ethdev_trace_rx_queue_stop;
+	__rte_ethdev_trace_set_link_down;
+	__rte_ethdev_trace_set_link_up;
Quoted 8 lines

lib/ethdev/meson.build EXPERIMENTAL { · line 366

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+	__rte_ethdev_trace_set_rx_queue_stats_mapping;
+	__rte_ethdev_trace_set_tx_queue_stats_mapping;
+	__rte_ethdev_trace_socket_id;
+	__rte_ethdev_trace_tx_offload_name;
+	__rte_ethdev_trace_tx_queue_start;
+	__rte_ethdev_trace_tx_queue_stop;

Can you please drop these trace objects?

Yes these can be dropped.

Quoted 1 line
#88 lore raw

Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

On 1/30/2023 4:01 PM, Ankur Dwivedi wrote:

<...>

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
lib/ethdev/meson.build index renamed from lib/ethdev/meson.build +0 -0

39250b5da1..f5c0865023 100644

lib/ethdev/meson.build +0 -0
@@ -24,6 +24,7 @@ headers = files(
Quoted 8 lines

lib/ethdev/meson.build headers = files( · line 27

Quoted 4 lines
lib/ethdev/meson.build +1 -0
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',

Why these trace headers are public?
Aren't trace points only used by the APIs, so I expect them to be internal, so applications shouldn't need them. Why they are expsed to user.

Quoted 1 line

'rte_ethdev_trace.h' can be made as internal. Not sure about 'rte_ethdev_trace_fp.h' and 'rte_ethdev_trace_fp_burst.h' as the tracepoints in fast path may be called from public inline functions.

Trace calls used by inline functions needs to be public, in this case at least 'rte_ethdev_trace_fp_burst.h' needs to be public.

Can you please at least move all trace points that are called by inline functions to the same file, 'rte_ethdev_trace_fp_burst.h', to reduce number of the header files to make public? Feel free to rename header if required.

Meanwhile not sure about adding new header as dependency to end user. @Jerin, @Andrew, what do you think
1) to move these trace points to 'rte_ethdev_core.h'
OR
2) disable trace calls in inline functions on compile time, possibly with existing 'RTE_ETHDEV_DEBUG_*' macro

<...>

Quoted 6 lines
Quoted 5 lines

lib/ethdev/meson.build headers = files( · line 29

Quoted 3 lines
lib/ethdev/meson.build +2 -1
-	if (port_id >= RTE_MAX_ETHPORTS)
+	if (port_id >= RTE_MAX_ETHPORTS) {
+		rte_eth_trace_find_next(RTE_MAX_ETHPORTS);

Is there a specific reason to trace all paths, why not just keep the last one?

This can be kept as the function returns with RTE_MAX_ETHPORTS here.

'RTE_MAX_ETHPORTS' more like error path, that is returned when no more valid port left, since most of the trace doesn't record error return values, I thought this can be dropped as well unless there is an explicit need for it.

<...>

Quoted 35 lines
Quoted 18 lines
Quoted 18 lines
lib/ethdev/meson.build +9 -0
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_hairpin_queue_setup,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id,
+		uint16_t nb_rx_desc, const struct rte_eth_hairpin_conf *conf,
+		int ret),
+	uint32_t peer_count = conf->peer_count;
+	uint32_t tx_explicit = conf->tx_explicit;
+	uint32_t manual_bind = conf->manual_bind;
+	uint32_t use_locked_device_memory = conf-

use_locked_device_memory;

lib/ethdev/meson.build +8 -0
+	uint32_t use_rte_memory = conf->use_rte_memory;
+	uint32_t force_memory = conf->force_memory;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(rx_queue_id);
+	rte_trace_point_emit_u16(nb_rx_desc);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(peer_count);
Quoted 8 lines

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+	rte_trace_point_emit_u32(tx_explicit);
+	rte_trace_point_emit_u32(manual_bind);
+	rte_trace_point_emit_u32(use_locked_device_memory);
+	rte_trace_point_emit_u32(use_rte_memory);
+	rte_trace_point_emit_u32(force_memory);
+	rte_trace_point_emit_int(ret);

Do we need temporary variables like 'peer_count', why not directly use them:

Temporary variables are needed where the actual variable is a bitfield. For example in struct rte_eth_hairpin_conf:
struct rte_eth_hairpin_conf {
uint32_t peer_count:16;
....
uint32_t tx_explicit:1
....
};

Quoted 7 lines

Otherwise there is a compilation error.
../lib/ethdev/rte_ethdev_trace.h:253:9: note: in expansion of macro ‘rte_trace_point_emit_u16’

  253 |         rte_trace_point_emit_u16(conf->peer_count);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~

../lib/eal/include/rte_trace_point.h:369:38: error: ‘sizeof’ applied to a bit-field
369 | mem = RTE_PTR_ADD(mem, sizeof(in)); \

Got it, that is because of bitfields. But as I look the 'rte_trace_point_emit_u16' macro, it is like:

```
#define rte_trace_point_emit_u16(in) __rte_trace_point_emit(in, uint16_t)

#define __rte_trace_point_emit(in, type) \
do { \
        memcpy(mem, &(in), sizeof(in)); \
        mem = RTE_PTR_ADD(mem, sizeof(in)); \
} while (0)
```

Here, in '__rte_trace_point_emit' macro 'type' is not used at all, if so what is the point of passing type?

If 'sizeof(type)' used, instead of 'sizeof(in)', it would be possible to use bitfields directly, what do you think?

Also, as for the "struct rte_eth_hairpin_conf" sample, some of the bitfields are 1 bit length, does 'uint32_t' really needed for them?

<...>

Quoted 17 lines
Quoted 10 lines

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why 'rte_eth_trace_find_next' added as fast path?
Can you please add comment for all why it is added as fast path, this help to evaluate/review this later.

There were many functions for which I was not sure about whether they should be slow path or fast path. I made the following assumption:

For slow path I have chosen the function which do some setup, configure or write some configuration. For an example rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_tx_buffer_set_err_callback, rte_eth_trace_promiscuous_enable are slow path functions.

The functions which read data are made as fastpath functions. Also for functions for which I was not sure I made it as fastpath.

Quoted 8 lines

For an example rte_ethdev_trace_owner_get, rte_eth_trace_hairpin_get_peer_port, rte_eth_trace_macaddr_get are made as fastpath.

But there are few exceptions. Function like *_get_capability are made as slowpath. Also rte_ethdev_trace_info_get is slowpath.

The slowpath and fastpath functions are in separate files. rte_ethdev_trace.h (slowpath) and rte_ethdev_trace_fp.h (fastpath).

Please let me know if any function needs to be swapped. I will make that change.

Got it, I think most of the trace points in the 'rte_ethdev_trace_fp.h' are for control/helper functions like: 'rte_ethdev_trace_count_avail', 'rte_ethdev_trace_get_port_by_name', 'rte_eth_trace_promiscuous_get' ...

I thought you did based on some analysis, that is why I asked to add that reasoning as code comment.

I think we can generalize as:

1) Anything called by ethdev static inline functions are datapath, and must be 'RTE_TRACE_POINT_FP', like 'rte_eth_trace_call_[rt]x_callbacks', 'rte_ethdev_trace_[rt]x_burst',

2) Anything that is called in endless loop in application/sample that has potential impact although it may not really be datapath

3) Rest are regular trace points, RTE_TRACE_POINT.

Item (2) requires some analysis and whenever you found one of them please comment the reasoning in the code where trace point is defined.

#89 lore raw

Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 23 lines · Ferruh Yigit

On 1/30/2023 4:01 PM, Ankur Dwivedi wrote:

<...>

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
lib/ethdev/meson.build index renamed from lib/ethdev/meson.build +0 -0

39250b5da1..f5c0865023 100644

lib/ethdev/meson.build +0 -0
@@ -24,6 +24,7 @@ headers = files(
Quoted 8 lines

lib/ethdev/meson.build headers = files( · line 27

Quoted 4 lines
lib/ethdev/meson.build +1 -0
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',

Why these trace headers are public?
Aren't trace points only used by the APIs, so I expect them to be internal, so applications shouldn't need them. Why they are expsed to user.

Quoted 1 line

'rte_ethdev_trace.h' can be made as internal. Not sure about 'rte_ethdev_trace_fp.h' and 'rte_ethdev_trace_fp_burst.h' as the tracepoints in fast path may be called from public inline functions.

Trace calls used by inline functions needs to be public, in this case at least 'rte_ethdev_trace_fp_burst.h' needs to be public.

Quoted 7 lines

Can you please at least move all trace points that are called by inline functions to the same file, 'rte_ethdev_trace_fp_burst.h', to reduce number of the header files to make public? Feel free to rename header if required.

Meanwhile not sure about adding new header as dependency to end user. @Jerin, @Andrew, what do you think

rte_ethdev_trace_fp_burst.h will be installed through ninja install and application does not need to directly include this. So this scheme is OK. Right? I dont see any downside.

Quoted 4 lines

1) to move these trace points to 'rte_ethdev_core.h'
OR
2) disable trace calls in inline functions on compile time, possibly with existing 'RTE_ETHDEV_DEBUG_*' macro

#90 lore raw

Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 29 lines · Jerin Jacob
Quoted 28 lines · Ferruh Yigit

On 1/30/2023 4:01 PM, Ankur Dwivedi wrote:

<...>

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
lib/ethdev/meson.build index renamed from lib/ethdev/meson.build +0 -0

39250b5da1..f5c0865023 100644

lib/ethdev/meson.build +0 -0
@@ -24,6 +24,7 @@ headers = files(
Quoted 8 lines

lib/ethdev/meson.build headers = files( · line 27

Quoted 4 lines
lib/ethdev/meson.build +1 -0
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',

Why these trace headers are public?
Aren't trace points only used by the APIs, so I expect them to be internal, so applications shouldn't need them. Why they are expsed to user.

Quoted 1 line

'rte_ethdev_trace.h' can be made as internal. Not sure about 'rte_ethdev_trace_fp.h' and 'rte_ethdev_trace_fp_burst.h' as the tracepoints in fast path may be called from public inline functions.

Trace calls used by inline functions needs to be public, in this case at least 'rte_ethdev_trace_fp_burst.h' needs to be public.

Can you please at least move all trace points that are called by inline functions to the same file, 'rte_ethdev_trace_fp_burst.h', to reduce number of the header files to make public? Feel free to rename header if required.

Quoted 7 lines
Quoted 2 lines

Meanwhile not sure about adding new header as dependency to end user. @Jerin, @Andrew, what do you think

rte_ethdev_trace_fp_burst.h will be installed through ninja install and application does not need to directly include this. So this scheme is OK. Right? I dont see any downside.

Right. It is installed automatically with above meson change, and it is included by 'rte_ethdev.h', so user doesn't need to include it explicitly. Overall there is no functional problem here.

Only this header file needs to be included (directly or indirectly) by every application that use ethdev. I would much prefer to have an internal header but not able to because of technical reasons (inline functions).
After lots of effort we did to hide as much ethdev internals as we can, now we are exposing some new trace stuff to user.

As we can't prevent header to be public, I am just questioning below options to reduce exposure of this header, hoping that it may lead a better solution.

Quoted 5 lines
Quoted 5 lines

1) to move these trace points to 'rte_ethdev_core.h'
OR
2) disable trace calls in inline functions on compile time, possibly with existing 'RTE_ETHDEV_DEBUG_*' macro

#91 lore raw

Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 50 lines · Ferruh Yigit
Quoted 29 lines · Jerin Jacob
Quoted 28 lines · Ferruh Yigit

On 1/30/2023 4:01 PM, Ankur Dwivedi wrote:

<...>

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
lib/ethdev/meson.build index renamed from lib/ethdev/meson.build +0 -0

39250b5da1..f5c0865023 100644

lib/ethdev/meson.build +0 -0
@@ -24,6 +24,7 @@ headers = files(
Quoted 8 lines

lib/ethdev/meson.build headers = files( · line 27

Quoted 4 lines
lib/ethdev/meson.build +1 -0
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',

Why these trace headers are public?
Aren't trace points only used by the APIs, so I expect them to be internal, so applications shouldn't need them. Why they are expsed to user.

Quoted 1 line

'rte_ethdev_trace.h' can be made as internal. Not sure about 'rte_ethdev_trace_fp.h' and 'rte_ethdev_trace_fp_burst.h' as the tracepoints in fast path may be called from public inline functions.

Trace calls used by inline functions needs to be public, in this case at least 'rte_ethdev_trace_fp_burst.h' needs to be public.

Can you please at least move all trace points that are called by inline functions to the same file, 'rte_ethdev_trace_fp_burst.h', to reduce number of the header files to make public? Feel free to rename header if required.

Quoted 7 lines
Quoted 2 lines

Meanwhile not sure about adding new header as dependency to end user. @Jerin, @Andrew, what do you think

rte_ethdev_trace_fp_burst.h will be installed through ninja install and application does not need to directly include this. So this scheme is OK. Right? I dont see any downside.

Right. It is installed automatically with above meson change, and it is included by 'rte_ethdev.h', so user doesn't need to include it explicitly. Overall there is no functional problem here.

Only this header file needs to be included (directly or indirectly) by every application that use ethdev. I would much prefer to have an internal header but not able to because of technical reasons (inline functions).
After lots of effort we did to hide as much ethdev internals as we can, now we are exposing some new trace stuff to user.

Quoted 3 lines

As we can't prevent header to be public, I am just questioning below options to reduce exposure of this header, hoping that it may lead a better solution.

Yes. All non-inline function can goto internal header file. I think, it make sense
to have separated header file _fp functions using inline functions to avoid cluttering main 'rte_ethdev.h' file.

Quoted 2 lines

disable trace calls in inline functions on compile time, possibly with existing 'RTE_ETHDEV_DEBUG_*' macro

Disabling trace calls to inline functions, already possible with "enable_trace_fp"
build option. So it will be possible to wrap around that to virtually to disable

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

1) to move these trace points to 'rte_ethdev_core.h'
OR
2) disable trace calls in inline functions on compile time, possibly with existing 'RTE_ETHDEV_DEBUG_*' macro

#92 lore raw

Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 60 lines · Jerin Jacob
Quoted 50 lines · Ferruh Yigit
Quoted 29 lines · Jerin Jacob
Quoted 28 lines · Ferruh Yigit

On 1/30/2023 4:01 PM, Ankur Dwivedi wrote:

<...>

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
lib/ethdev/meson.build index renamed from lib/ethdev/meson.build +0 -0

39250b5da1..f5c0865023 100644

lib/ethdev/meson.build +0 -0
@@ -24,6 +24,7 @@ headers = files(
Quoted 8 lines

lib/ethdev/meson.build headers = files( · line 27

Quoted 4 lines
lib/ethdev/meson.build +1 -0
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',

Why these trace headers are public?
Aren't trace points only used by the APIs, so I expect them to be internal, so applications shouldn't need them. Why they are expsed to user.

Quoted 1 line

'rte_ethdev_trace.h' can be made as internal. Not sure about 'rte_ethdev_trace_fp.h' and 'rte_ethdev_trace_fp_burst.h' as the tracepoints in fast path may be called from public inline functions.

Trace calls used by inline functions needs to be public, in this case at least 'rte_ethdev_trace_fp_burst.h' needs to be public.

Can you please at least move all trace points that are called by inline functions to the same file, 'rte_ethdev_trace_fp_burst.h', to reduce number of the header files to make public? Feel free to rename header if required.

Quoted 7 lines
Quoted 2 lines

Meanwhile not sure about adding new header as dependency to end user. @Jerin, @Andrew, what do you think

rte_ethdev_trace_fp_burst.h will be installed through ninja install and application does not need to directly include this. So this scheme is OK. Right? I dont see any downside.

Right. It is installed automatically with above meson change, and it is included by 'rte_ethdev.h', so user doesn't need to include it explicitly. Overall there is no functional problem here.

Only this header file needs to be included (directly or indirectly) by every application that use ethdev. I would much prefer to have an internal header but not able to because of technical reasons (inline functions).
After lots of effort we did to hide as much ethdev internals as we can, now we are exposing some new trace stuff to user.

Quoted 3 lines

As we can't prevent header to be public, I am just questioning below options to reduce exposure of this header, hoping that it may lead a better solution.

Yes. All non-inline function can goto internal header file. I think, it make sense
to have separated header file _fp functions using inline functions to avoid cluttering main 'rte_ethdev.h' file.

Quoted 8 lines
Quoted 2 lines

disable trace calls in inline functions on compile time, possibly with existing 'RTE_ETHDEV_DEBUG_*' macro

Disabling trace calls to inline functions, already possible with "enable_trace_fp"
build option. So it will be possible to wrap around that to virtually to disable

With "enable_trace_fp" build option "rte_ethdev_trace_fp.h" dependency is still there, but wrapping with DEBUG macro can prevent it for non-debug use cases.

Anyway, "rte_ethdev_trace_fp.h" dependency is already there before this patch, so OK to not change it, and I am OK to move forward by making all trace points and trace related header internal as much as possible.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

1) to move these trace points to 'rte_ethdev_core.h'
OR
2) disable trace calls in inline functions on compile time, possibly with existing 'RTE_ETHDEV_DEBUG_*' macro

#93 lore raw

RE: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

In reply to Ferruh Yigit
Quoted 93 lines

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Wednesday, February 1, 2023 12:08 AM
To: Ankur Dwivedi <[email protected]>; [email protected]; David Marchand <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

On 1/30/2023 4:01 PM, Ankur Dwivedi wrote:

<...>

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
lib/ethdev/meson.build index renamed from lib/ethdev/meson.build +0 -0

39250b5da1..f5c0865023 100644

lib/ethdev/meson.build +0 -0
@@ -24,6 +24,7 @@ headers = files(
Quoted 8 lines
Quoted 8 lines

lib/ethdev/meson.build headers = files( · line 27

Quoted 4 lines
lib/ethdev/meson.build +1 -0
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',

Why these trace headers are public?
Aren't trace points only used by the APIs, so I expect them to be internal, so applications shouldn't need them. Why they are expsed to

user.

Quoted 1 line

'rte_ethdev_trace.h' can be made as internal. Not sure about

'rte_ethdev_trace_fp.h' and 'rte_ethdev_trace_fp_burst.h' as the tracepoints in fast path may be called from public inline functions.

Trace calls used by inline functions needs to be public, in this case at least 'rte_ethdev_trace_fp_burst.h' needs to be public.

Can you please at least move all trace points that are called by inline functions to the same file, 'rte_ethdev_trace_fp_burst.h', to reduce number of the header files to make public? Feel free to rename header if required.

Meanwhile not sure about adding new header as dependency to end user. @Jerin, @Andrew, what do you think
1) to move these trace points to 'rte_ethdev_core.h'
OR
2) disable trace calls in inline functions on compile time, possibly with existing 'RTE_ETHDEV_DEBUG_*' macro

<...>

Quoted 5 lines
Quoted 5 lines

lib/ethdev/meson.build headers = files( · line 29

Quoted 3 lines
lib/ethdev/meson.build +2 -1
-	if (port_id >= RTE_MAX_ETHPORTS)
+	if (port_id >= RTE_MAX_ETHPORTS) {
+		rte_eth_trace_find_next(RTE_MAX_ETHPORTS);

Is there a specific reason to trace all paths, why not just keep the last one?

Quoted 5 lines
Quoted 1 line

This can be kept as the function returns with RTE_MAX_ETHPORTS here.

'RTE_MAX_ETHPORTS' more like error path, that is returned when no more valid port left, since most of the trace doesn't record error return values, I thought this can be dropped as well unless there is an explicit need for it.

Ok.

Quoted 59 lines

<...>

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
lib/ethdev/meson.build +9 -0
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_hairpin_queue_setup,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id,
+		uint16_t nb_rx_desc, const struct rte_eth_hairpin_conf *conf,
+		int ret),
+	uint32_t peer_count = conf->peer_count;
+	uint32_t tx_explicit = conf->tx_explicit;
+	uint32_t manual_bind = conf->manual_bind;
+	uint32_t use_locked_device_memory = conf-

use_locked_device_memory;

lib/ethdev/meson.build +8 -0
+	uint32_t use_rte_memory = conf->use_rte_memory;
+	uint32_t force_memory = conf->force_memory;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(rx_queue_id);
+	rte_trace_point_emit_u16(nb_rx_desc);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(peer_count);
Quoted 8 lines
Quoted 8 lines

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+	rte_trace_point_emit_u32(tx_explicit);
+	rte_trace_point_emit_u32(manual_bind);
+	rte_trace_point_emit_u32(use_locked_device_memory);
+	rte_trace_point_emit_u32(use_rte_memory);
+	rte_trace_point_emit_u32(force_memory);
+	rte_trace_point_emit_int(ret);

Do we need temporary variables like 'peer_count', why not directly use

them:

Quoted 11 lines

Temporary variables are needed where the actual variable is a bitfield. For example in struct rte_eth_hairpin_conf:
struct rte_eth_hairpin_conf {
uint32_t peer_count:16;
....
uint32_t tx_explicit:1
....
};

Otherwise there is a compilation error. ../lib/ethdev/rte_ethdev_trace.h:253:9: note: in expansion of macro

‘rte_trace_point_emit_u16’

Quoted 3 lines
  253 |         rte_trace_point_emit_u16(conf->peer_count);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~

../lib/eal/include/rte_trace_point.h:369:38: error: ‘sizeof’ applied to a bit-

field

Quoted 2 lines
  369 |         mem = RTE_PTR_ADD(mem, sizeof(in)); \

Got it, that is because of bitfields. But as I look the 'rte_trace_point_emit_u16' macro, it is like:

```
#define rte_trace_point_emit_u16(in) __rte_trace_point_emit(in, uint16_t)

#define __rte_trace_point_emit(in, type) \ do { \
       memcpy(mem, &(in), sizeof(in)); \
       mem = RTE_PTR_ADD(mem, sizeof(in)); \ } while (0) ```
Quoted 5 lines

Here, in '__rte_trace_point_emit' macro 'type' is not used at all, if so what is the point of passing type?

If 'sizeof(type)' used, instead of 'sizeof(in)', it would be possible to use bitfields directly, what do you think?

After using 'sizeof(type)', the following compile time error is observed. In file included from ../lib/ethdev/rte_ethdev_trace_fp_burst.h:18,

                 from ../lib/ethdev/rte_ethdev.h:175,
                 from ../lib/ethdev/rte_tm.c:8:

../lib/ethdev/rte_ethdev_trace.h: In function ‘rte_eth_trace_rx_hairpin_queue_setup’:
../lib/eal/include/rte_trace_point.h:378:21: error: cannot take address of bit-field ‘peer_count’
378 | memcpy(mem, &(in), sizeof(type)); \
| ^

Quoted 5 lines

Also, as for the "struct rte_eth_hairpin_conf" sample, some of the bitfields are 1 bit length, does 'uint32_t' really needed for them?

uint8_t should suffice.

Quoted 48 lines

<...>

Quoted 11 lines
Quoted 10 lines

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why 'rte_eth_trace_find_next' added as fast path?
Can you please add comment for all why it is added as fast path, this help to evaluate/review this later.

Quoted 1 line

There were many functions for which I was not sure about whether they

should be slow path or fast path. I made the following assumption:

Quoted 2 lines

For slow path I have chosen the function which do some setup, configure or

write some configuration. For an example rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_tx_buffer_set_err_callback, rte_eth_trace_promiscuous_enable are slow path functions.

Quoted 2 lines

The functions which read data are made as fastpath functions. Also for

functions for which I was not sure I made it as fastpath.

Quoted 2 lines

For an example rte_ethdev_trace_owner_get,

rte_eth_trace_hairpin_get_peer_port, rte_eth_trace_macaddr_get are made as fastpath.

Quoted 2 lines

But there are few exceptions. Function like *_get_capability are made as

slowpath. Also rte_ethdev_trace_info_get is slowpath.

Quoted 2 lines

The slowpath and fastpath functions are in separate files.

rte_ethdev_trace.h (slowpath) and rte_ethdev_trace_fp.h (fastpath).

Quoted 2 lines

Please let me know if any function needs to be swapped. I will make that

change.

Quoted 1 line

Got it, I think most of the trace points in the 'rte_ethdev_trace_fp.h' are for control/helper functions like: 'rte_ethdev_trace_count_avail', 'rte_ethdev_trace_get_port_by_name', 'rte_eth_trace_promiscuous_get' ...

I thought you did based on some analysis, that is why I asked to add that reasoning as code comment.

Quoted 5 lines

I think we can generalize as:

1) Anything called by ethdev static inline functions are datapath, and must be 'RTE_TRACE_POINT_FP', like 'rte_eth_trace_call_[rt]x_callbacks', 'rte_ethdev_trace_[rt]x_burst',

In this category the following functions come:
rte_eth_rx_burst
rte_eth_tx_burst
rte_eth_call_rx_callbacks (called from rte_eth_rx_burst)
rte_eth_call_tx_callbacks (called from rte_eth_tx_burst) rte_eth_tx_buffer_count_callback (registered as error callback, called from rte_eth_tx_buffer_flush) rte_eth_tx_buffer_drop_callback (registered as error callback)

Quoted 3 lines

2) Anything that is called in endless loop in application/sample that has potential impact although it may not really be datapath

Apart from functions in category [1], I have observed the following functions in ethdev library, called in some while loop in app/examples. rte_eth_stats_get (called in while loop in examples/qos_sched and examples/distributor)
rte_eth_macaddr_get (called in while loop in examples/bond and examples/ethtool)
rte_eth_link_get (called in for loop in examples/ip_pipeline)
rte_eth_dev_get_mtu (called in for loop in examples/ip_pipeline)
rte_eth_link_speed_to_str (called in for loop in examples/ip_pipeline)
rte_eth_dev_rx_intr_enable ( called in loop in examples/l3fwd-power)
rte_eth_dev_rx_intr_disable ( called in loop in examples/l3fwd-power)
rte_eth_timesync_read_rx_timestamp (called in loop in examples/ptpclient)
rte_eth_timesync_read_tx_timestamp (called in loop in examples/ptpclient)
rte_eth_timesync_adjust_time (called in loop in examples/ptpclient)
rte_eth_timesync_read_time (called in loop in examples/ptpclient)
rte_flow_classifier_query (called in examples/flow_classify)
rte_mtr_create (in app/test-flow-perf loop)
rte_mtr_destroy (in app/test-flow-perf loop)
rte_mtr_meter_policy_delete ((in app/test-flow-perf loop)
rte_flow_create (in app/test-flow-perf)
rte_flow_destroy (in app/test-flow-perf)

Apart from the above can all other functions be moved to slowpath tracepoints?
I think it was discussed in tech board meeting on 2022-11-30 that the functions for which the slowpath or fastpath distinction is not clear, they should be fastpath tracepoints.

Quoted 6 lines

3) Rest are regular trace points, RTE_TRACE_POINT.

Item (2) requires some analysis and whenever you found one of them please comment the reasoning in the code where trace point is defined.

#94 lore raw

Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 164 lines · Ankur Dwivedi
Quoted 93 lines

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Wednesday, February 1, 2023 12:08 AM
To: Ankur Dwivedi <[email protected]>; [email protected]; David Marchand <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

On 1/30/2023 4:01 PM, Ankur Dwivedi wrote:

<...>

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
lib/ethdev/meson.build index renamed from lib/ethdev/meson.build +0 -0

39250b5da1..f5c0865023 100644

lib/ethdev/meson.build +0 -0
@@ -24,6 +24,7 @@ headers = files(
Quoted 8 lines
Quoted 8 lines

lib/ethdev/meson.build headers = files( · line 27

Quoted 4 lines
lib/ethdev/meson.build +1 -0
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',

Why these trace headers are public?
Aren't trace points only used by the APIs, so I expect them to be internal, so applications shouldn't need them. Why they are expsed to

user.

Quoted 1 line

'rte_ethdev_trace.h' can be made as internal. Not sure about

'rte_ethdev_trace_fp.h' and 'rte_ethdev_trace_fp_burst.h' as the tracepoints in fast path may be called from public inline functions.

Trace calls used by inline functions needs to be public, in this case at least 'rte_ethdev_trace_fp_burst.h' needs to be public.

Can you please at least move all trace points that are called by inline functions to the same file, 'rte_ethdev_trace_fp_burst.h', to reduce number of the header files to make public? Feel free to rename header if required.

Meanwhile not sure about adding new header as dependency to end user. @Jerin, @Andrew, what do you think
1) to move these trace points to 'rte_ethdev_core.h'
OR
2) disable trace calls in inline functions on compile time, possibly with existing 'RTE_ETHDEV_DEBUG_*' macro

<...>

Quoted 5 lines
Quoted 5 lines

lib/ethdev/meson.build headers = files( · line 29

Quoted 3 lines
lib/ethdev/meson.build +2 -1
-	if (port_id >= RTE_MAX_ETHPORTS)
+	if (port_id >= RTE_MAX_ETHPORTS) {
+		rte_eth_trace_find_next(RTE_MAX_ETHPORTS);

Is there a specific reason to trace all paths, why not just keep the last one?

Quoted 5 lines
Quoted 1 line

This can be kept as the function returns with RTE_MAX_ETHPORTS here.

'RTE_MAX_ETHPORTS' more like error path, that is returned when no more valid port left, since most of the trace doesn't record error return values, I thought this can be dropped as well unless there is an explicit need for it.

Ok.

Quoted 59 lines

<...>

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
lib/ethdev/meson.build +9 -0
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_hairpin_queue_setup,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id,
+		uint16_t nb_rx_desc, const struct rte_eth_hairpin_conf *conf,
+		int ret),
+	uint32_t peer_count = conf->peer_count;
+	uint32_t tx_explicit = conf->tx_explicit;
+	uint32_t manual_bind = conf->manual_bind;
+	uint32_t use_locked_device_memory = conf-

use_locked_device_memory;

lib/ethdev/meson.build +8 -0
+	uint32_t use_rte_memory = conf->use_rte_memory;
+	uint32_t force_memory = conf->force_memory;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(rx_queue_id);
+	rte_trace_point_emit_u16(nb_rx_desc);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(peer_count);
Quoted 8 lines
Quoted 8 lines

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+	rte_trace_point_emit_u32(tx_explicit);
+	rte_trace_point_emit_u32(manual_bind);
+	rte_trace_point_emit_u32(use_locked_device_memory);
+	rte_trace_point_emit_u32(use_rte_memory);
+	rte_trace_point_emit_u32(force_memory);
+	rte_trace_point_emit_int(ret);

Do we need temporary variables like 'peer_count', why not directly use

them:

Quoted 11 lines

Temporary variables are needed where the actual variable is a bitfield. For example in struct rte_eth_hairpin_conf:
struct rte_eth_hairpin_conf {
uint32_t peer_count:16;
....
uint32_t tx_explicit:1
....
};

Otherwise there is a compilation error. ../lib/ethdev/rte_ethdev_trace.h:253:9: note: in expansion of macro

‘rte_trace_point_emit_u16’

Quoted 3 lines
  253 |         rte_trace_point_emit_u16(conf->peer_count);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~

../lib/eal/include/rte_trace_point.h:369:38: error: ‘sizeof’ applied to a bit-

field

Quoted 2 lines
  369 |         mem = RTE_PTR_ADD(mem, sizeof(in)); \

Got it, that is because of bitfields. But as I look the 'rte_trace_point_emit_u16' macro, it is like:

```
#define rte_trace_point_emit_u16(in) __rte_trace_point_emit(in, uint16_t)

#define __rte_trace_point_emit(in, type) \ do { \
       memcpy(mem, &(in), sizeof(in)); \
       mem = RTE_PTR_ADD(mem, sizeof(in)); \ } while (0) ```
Quoted 5 lines

Here, in '__rte_trace_point_emit' macro 'type' is not used at all, if so what is the point of passing type?

If 'sizeof(type)' used, instead of 'sizeof(in)', it would be possible to use bitfields directly, what do you think?

Quoted 8 lines

After using 'sizeof(type)', the following compile time error is observed. In file included from ../lib/ethdev/rte_ethdev_trace_fp_burst.h:18,

                 from ../lib/ethdev/rte_ethdev.h:175,
                 from ../lib/ethdev/rte_tm.c:8:

../lib/ethdev/rte_ethdev_trace.h: In function ‘rte_eth_trace_rx_hairpin_queue_setup’:
../lib/eal/include/rte_trace_point.h:378:21: error: cannot take address of bit-field ‘peer_count’
378 | memcpy(mem, &(in), sizeof(type)); \
| ^

Right, you can't memcpy to bitfiled, so temporary variables are required, OK.

Still, is it OK to ignore 'type' in the '__rte_trace_point_emit()'? If variable (in) is uint8_t, it won't matter if 'rte_trace_point_emit_u8', 'rte_trace_point_emit_u16' or 'rte_trace_point_emit_u32' used, they will all give same result, right?

Quoted 7 lines
Quoted 5 lines

Also, as for the "struct rte_eth_hairpin_conf" sample, some of the bitfields are 1 bit length, does 'uint32_t' really needed for them?

uint8_t should suffice.

ack

Quoted 54 lines
Quoted 48 lines

<...>

Quoted 11 lines
Quoted 10 lines

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why 'rte_eth_trace_find_next' added as fast path?
Can you please add comment for all why it is added as fast path, this help to evaluate/review this later.

Quoted 1 line

There were many functions for which I was not sure about whether they

should be slow path or fast path. I made the following assumption:

Quoted 2 lines

For slow path I have chosen the function which do some setup, configure or

write some configuration. For an example rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_tx_buffer_set_err_callback, rte_eth_trace_promiscuous_enable are slow path functions.

Quoted 2 lines

The functions which read data are made as fastpath functions. Also for

functions for which I was not sure I made it as fastpath.

Quoted 2 lines

For an example rte_ethdev_trace_owner_get,

rte_eth_trace_hairpin_get_peer_port, rte_eth_trace_macaddr_get are made as fastpath.

Quoted 2 lines

But there are few exceptions. Function like *_get_capability are made as

slowpath. Also rte_ethdev_trace_info_get is slowpath.

Quoted 2 lines

The slowpath and fastpath functions are in separate files.

rte_ethdev_trace.h (slowpath) and rte_ethdev_trace_fp.h (fastpath).

Quoted 2 lines

Please let me know if any function needs to be swapped. I will make that

change.

Quoted 1 line

Got it, I think most of the trace points in the 'rte_ethdev_trace_fp.h' are for control/helper functions like: 'rte_ethdev_trace_count_avail', 'rte_ethdev_trace_get_port_by_name', 'rte_eth_trace_promiscuous_get' ...

I thought you did based on some analysis, that is why I asked to add that reasoning as code comment.

Quoted 5 lines

I think we can generalize as:

1) Anything called by ethdev static inline functions are datapath, and must be 'RTE_TRACE_POINT_FP', like 'rte_eth_trace_call_[rt]x_callbacks', 'rte_ethdev_trace_[rt]x_burst',

Quoted 7 lines

In this category the following functions come:
rte_eth_rx_burst
rte_eth_tx_burst
rte_eth_call_rx_callbacks (called from rte_eth_rx_burst)
rte_eth_call_tx_callbacks (called from rte_eth_tx_burst) rte_eth_tx_buffer_count_callback (registered as error callback, called from rte_eth_tx_buffer_flush) rte_eth_tx_buffer_drop_callback (registered as error callback)

ack

Quoted 14 lines
Quoted 3 lines

2) Anything that is called in endless loop in application/sample that has potential impact although it may not really be datapath

Apart from functions in category [1], I have observed the following functions in ethdev library, called in some while loop in app/examples. rte_eth_stats_get (called in while loop in examples/qos_sched and examples/distributor)
rte_eth_macaddr_get (called in while loop in examples/bond and examples/ethtool)
rte_eth_link_get (called in for loop in examples/ip_pipeline)
rte_eth_dev_get_mtu (called in for loop in examples/ip_pipeline)
rte_eth_link_speed_to_str (called in for loop in examples/ip_pipeline)
rte_eth_dev_rx_intr_enable ( called in loop in examples/l3fwd-power)
rte_eth_dev_rx_intr_disable ( called in loop in examples/l3fwd-power)
rte_eth_timesync_read_rx_timestamp (called in loop in examples/ptpclient)
rte_eth_timesync_read_tx_timestamp (called in loop in examples/ptpclient)

Quoted 9 lines

rte_eth_timesync_adjust_time (called in loop in examples/ptpclient) rte_eth_timesync_read_time (called in loop in examples/ptpclient) rte_flow_classifier_query (called in examples/flow_classify) rte_mtr_create (in app/test-flow-perf loop) rte_mtr_destroy (in app/test-flow-perf loop) rte_mtr_meter_policy_delete ((in app/test-flow-perf loop) rte_flow_create (in app/test-flow-perf)
rte_flow_destroy (in app/test-flow-perf)

Ack, and can you please add the note within the parenthesis as a comment, whoever visits these later knows why there trace points added as fast path trace point?

Quoted 1 line

Apart from the above can all other functions be moved to slowpath tracepoints?

I think yes, we can start with this.
At least this gives us a logic to follow.

And does trace point and fast path trace points needs to be in separate header files?
Can you please put first group into a header an expose it to the user, rest (as a mixture) to another header and keep it internal to ethdev?

Thanks.

Quoted 10 lines

I think it was discussed in tech board meeting on 2022-11-30 that the functions for which the slowpath or fastpath distinction is not clear, they should be fastpath tracepoints.

Quoted 6 lines

3) Rest are regular trace points, RTE_TRACE_POINT.

Item (2) requires some analysis and whenever you found one of them please comment the reasoning in the code where trace point is defined.

#95 lore raw

RE: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 231 lines

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, February 2, 2023 2:27 PM
To: Ankur Dwivedi <[email protected]>; [email protected]; David Marchand <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 17 lines · Ankur Dwivedi
Quoted 17 lines

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Wednesday, February 1, 2023 12:08 AM
To: Ankur Dwivedi <[email protected]>; [email protected]; David Marchand <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin

Jacob

Quoted 14 lines
Quoted 14 lines

Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>;

Quoted 8 lines
Quoted 8 lines

[email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>;

Devendra

Quoted 1 line
Quoted 1 line

Singh Rawat <[email protected]>;

[email protected];

Quoted 34 lines
Quoted 34 lines

[email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part
one)

On 1/30/2023 4:01 PM, Ankur Dwivedi wrote:

<...>

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
lib/ethdev/meson.build index renamed from lib/ethdev/meson.build +0 -0

39250b5da1..f5c0865023 100644

lib/ethdev/meson.build +0 -0
@@ -24,6 +24,7 @@ headers = files(
         'rte_ethdev.h',
Quoted 8 lines
Quoted 8 lines

lib/ethdev/meson.build headers = files( · line 27

Quoted 3 lines
lib/ethdev/meson.build +1 -0
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',

Why these trace headers are public?
Aren't trace points only used by the APIs, so I expect them to be internal, so applications shouldn't need them. Why they are expsed to

user.

Quoted 1 line

'rte_ethdev_trace.h' can be made as internal. Not sure about

'rte_ethdev_trace_fp.h' and 'rte_ethdev_trace_fp_burst.h' as the tracepoints in fast path may be called from public inline functions.

Quoted 6 lines
Quoted 6 lines

Trace calls used by inline functions needs to be public, in this case at least 'rte_ethdev_trace_fp_burst.h' needs to be public.

Can you please at least move all trace points that are called by inline functions to the same file, 'rte_ethdev_trace_fp_burst.h', to reduce number of the header files to make public? Feel free to rename

header if required.

Quoted 8 lines
Quoted 8 lines

Meanwhile not sure about adding new header as dependency to end user. @Jerin, @Andrew, what do you think
1) to move these trace points to 'rte_ethdev_core.h'
OR
2) disable trace calls in inline functions on compile time, possibly with existing 'RTE_ETHDEV_DEBUG_*' macro

Quoted 7 lines
Quoted 7 lines

<...>

Quoted 5 lines
Quoted 5 lines

lib/ethdev/meson.build

Quoted 3 lines
lib/ethdev/meson.build +2 -1
-	if (port_id >= RTE_MAX_ETHPORTS)
+	if (port_id >= RTE_MAX_ETHPORTS) {
+		rte_eth_trace_find_next(RTE_MAX_ETHPORTS);

Is there a specific reason to trace all paths, why not just keep the last

one?

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

This can be kept as the function returns with RTE_MAX_ETHPORTS here.

'RTE_MAX_ETHPORTS' more like error path, that is returned when no more valid port left, since most of the trace doesn't record error return values, I thought this can be dropped as well unless there is an

explicit need for it.

Quoted 7 lines

Ok.

Quoted 6 lines

<...>

Quoted 3 lines
Quoted 3 lines

lib/ethdev/meson.build

Quoted 3 lines
lib/ethdev/meson.build +3 -0
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_hairpin_queue_setup,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t

rx_queue_id,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

lib/ethdev/meson.build

Quoted 1 line
lib/ethdev/meson.build +1 -0
+		uint16_t nb_rx_desc, const struct

rte_eth_hairpin_conf *conf,

Quoted 40 lines
Quoted 40 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
lib/ethdev/meson.build +5 -0
+		int ret),
+	uint32_t peer_count = conf->peer_count;
+	uint32_t tx_explicit = conf->tx_explicit;
+	uint32_t manual_bind = conf->manual_bind;
+	uint32_t use_locked_device_memory = conf-

use_locked_device_memory;

lib/ethdev/meson.build +9 -0
+	uint32_t use_rte_memory = conf->use_rte_memory;
+	uint32_t force_memory = conf->force_memory;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(rx_queue_id);
+	rte_trace_point_emit_u16(nb_rx_desc);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(peer_count);
+	rte_trace_point_emit_u32(tx_explicit);
Quoted 8 lines
Quoted 8 lines

lib/ethdev/meson.build

Quoted 5 lines
lib/ethdev/meson.build +5 -0
+	rte_trace_point_emit_u32(manual_bind);
+	rte_trace_point_emit_u32(use_locked_device_memory);
+	rte_trace_point_emit_u32(use_rte_memory);
+	rte_trace_point_emit_u32(force_memory);
+	rte_trace_point_emit_int(ret);

Do we need temporary variables like 'peer_count', why not directly use

them:

Quoted 11 lines

Temporary variables are needed where the actual variable is a bitfield. For example in struct rte_eth_hairpin_conf:
struct rte_eth_hairpin_conf {
uint32_t peer_count:16;
....
uint32_t tx_explicit:1
....
};

Otherwise there is a compilation error. ../lib/ethdev/rte_ethdev_trace.h:253:9: note: in expansion of macro

‘rte_trace_point_emit_u16’

Quoted 4 lines
  253 |         rte_trace_point_emit_u16(conf->peer_count);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~

../lib/eal/include/rte_trace_point.h:369:38: error: ‘sizeof’ applied to a bit-

Quoted 5 lines
Quoted 5 lines

field

Quoted 2 lines
  369 |         mem = RTE_PTR_ADD(mem, sizeof(in)); \

Got it, that is because of bitfields. But as I look the

'rte_trace_point_emit_u16'

Quoted 13 lines
Quoted 13 lines

macro, it is like:

```
#define rte_trace_point_emit_u16(in) __rte_trace_point_emit(in, uint16_t)

#define __rte_trace_point_emit(in, type) \ do { \
       memcpy(mem, &(in), sizeof(in)); \
       mem = RTE_PTR_ADD(mem, sizeof(in)); \ } while (0) ```

Here, in '__rte_trace_point_emit' macro 'type' is not used at all, if so what is the point of passing type?

Quoted 8 lines
Quoted 2 lines

If 'sizeof(type)' used, instead of 'sizeof(in)', it would be possible to use bitfields directly, what do you think?

After using 'sizeof(type)', the following compile time error is observed. In file included from ../lib/ethdev/rte_ethdev_trace_fp_burst.h:18,

                 from ../lib/ethdev/rte_ethdev.h:175,
                 from ../lib/ethdev/rte_tm.c:8:

../lib/ethdev/rte_ethdev_trace.h: In function

Quoted 7 lines

‘rte_eth_trace_rx_hairpin_queue_setup’:

Quoted 1 line

../lib/eal/include/rte_trace_point.h:378:21: error: cannot take address of

bit-field ‘peer_count’

Quoted 2 lines
  378 |         memcpy(mem, &(in), sizeof(type)); \
          |                                     ^

Right, you can't memcpy to bitfiled, so temporary variables are required, OK.

Yes.

Quoted 5 lines

Still, is it OK to ignore 'type' in the '__rte_trace_point_emit()'? If variable (in) is uint8_t, it won't matter if 'rte_trace_point_emit_u8', 'rte_trace_point_emit_u16' or 'rte_trace_point_emit_u32' used, they will all give same result, right?

Calling (in) which is uint8_t is not allowed in 'rte_trace_point_emit_u16' because there is other __rte_trace_point_emit in lib/eal/include/rte_trace_point_register.h called during trace point register which prevents this.

There would be compilation error because of this check in '__rte_trace_point_emit()' RTE_BUILD_BUG_ON(sizeof(type) != sizeof(typeof(in)));

So type can be ignored in '__rte_trace_point_emit()' in lib/eal/include/rte_trace_point.h.

Quoted 114 lines
Quoted 10 lines
Quoted 8 lines

Also, as for the "struct rte_eth_hairpin_conf" sample, some of the bitfields are
1 bit length, does 'uint32_t' really needed for them?

uint8_t should suffice.

ack

Quoted 40 lines
Quoted 40 lines

<...>

Quoted 11 lines
Quoted 10 lines

lib/ethdev/meson.build

Quoted 6 lines
lib/ethdev/meson.build +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why 'rte_eth_trace_find_next' added as fast path?
Can you please add comment for all why it is added as fast path, this help to evaluate/review this later.

Quoted 2 lines

There were many functions for which I was not sure about whether they

should be slow path or fast path. I made the following assumption:

Quoted 3 lines

For slow path I have chosen the function which do some setup, configure or

write some configuration. For an example rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_tx_buffer_set_err_callback, rte_eth_trace_promiscuous_enable are slow path functions.

Quoted 3 lines

The functions which read data are made as fastpath functions. Also for

functions for which I was not sure I made it as fastpath.

Quoted 2 lines

For an example rte_ethdev_trace_owner_get,

rte_eth_trace_hairpin_get_peer_port, rte_eth_trace_macaddr_get are made as fastpath.

Quoted 3 lines

But there are few exceptions. Function like *_get_capability are made as

slowpath. Also rte_ethdev_trace_info_get is slowpath.

Quoted 2 lines

The slowpath and fastpath functions are in separate files.

rte_ethdev_trace.h (slowpath) and rte_ethdev_trace_fp.h (fastpath).

Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

Please let me know if any function needs to be swapped. I will make that

change.

Quoted 1 line

Got it, I think most of the trace points in the 'rte_ethdev_trace_fp.h' are for control/helper functions like:
'rte_ethdev_trace_count_avail', 'rte_ethdev_trace_get_port_by_name',

'rte_eth_trace_promiscuous_get' ...

Quoted 12 lines
Quoted 11 lines

I thought you did based on some analysis, that is why I asked to add that reasoning as code comment.

I think we can generalize as:

1) Anything called by ethdev static inline functions are datapath, and must be 'RTE_TRACE_POINT_FP', like 'rte_eth_trace_call_[rt]x_callbacks', 'rte_ethdev_trace_[rt]x_burst',

Quoted 8 lines

In this category the following functions come:
rte_eth_rx_burst
rte_eth_tx_burst
rte_eth_call_rx_callbacks (called from rte_eth_rx_burst) rte_eth_call_tx_callbacks (called from rte_eth_tx_burst) rte_eth_tx_buffer_count_callback (registered as error callback, called from rte_eth_tx_buffer_flush) rte_eth_tx_buffer_drop_callback (registered as error callback)

ack

Quoted 5 lines
Quoted 3 lines

2) Anything that is called in endless loop in application/sample that has potential impact although it may not really be datapath

Apart from functions in category [1], I have observed the following functions

in ethdev library, called in some while loop in app/examples.

Quoted 9 lines

rte_eth_stats_get (called in while loop in examples/qos_sched and examples/distributor) rte_eth_macaddr_get (called in while loop in examples/bond and examples/ethtool) rte_eth_link_get (called in for loop in examples/ip_pipeline) rte_eth_dev_get_mtu (called in for loop in examples/ip_pipeline) rte_eth_link_speed_to_str (called in for loop in examples/ip_pipeline) rte_eth_dev_rx_intr_enable ( called in loop in examples/l3fwd-power) rte_eth_dev_rx_intr_disable ( called in loop in examples/l3fwd-power) rte_eth_timesync_read_rx_timestamp (called in loop in examples/ptpclient) rte_eth_timesync_read_tx_timestamp (called

Quoted 9 lines

in loop in examples/ptpclient) rte_eth_timesync_adjust_time (called in loop in examples/ptpclient) rte_eth_timesync_read_time (called in loop in examples/ptpclient) rte_flow_classifier_query (called in examples/flow_classify) rte_mtr_create (in app/test-flow-perf loop) rte_mtr_destroy (in app/test-flow-perf loop) rte_mtr_meter_policy_delete ((in app/test-flow-perf loop) rte_flow_create (in app/test-flow-perf) rte_flow_destroy (in app/test-flow-perf)

Ack, and can you please add the note within the parenthesis as a comment, whoever visits these later knows why there trace points added as fast path trace point?

Quoted 8 lines
Quoted 1 line

Apart from the above can all other functions be moved to slowpath

tracepoints?

I think yes, we can start with this.
At least this gives us a logic to follow.

And does trace point and fast path trace points needs to be in separate header files?

I do not think separate header files is a requirement, but it is easy to segregate slowpath/fastpath if they are in separate files. What do you think ?

Quoted 2 lines

Can you please put first group into a header an expose it to the user, rest (as a mixture) to another header and keep it internal to ethdev?

Ok.

Quoted 14 lines

Thanks.

Quoted 2 lines

I think it was discussed in tech board meeting on 2022-11-30 that the functions for which the slowpath or fastpath distinction is not clear, they

should be fastpath tracepoints.

Quoted 8 lines
Quoted 7 lines

3) Rest are regular trace points, RTE_TRACE_POINT.

Item (2) requires some analysis and whenever you found one of them please comment the reasoning in the code where trace point is defined.

#96 lore raw

Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 101 lines · Ankur Dwivedi
Quoted 101 lines
Quoted 37 lines
Quoted 37 lines
Quoted 11 lines
Quoted 10 lines

Review

Quoted 6 lines
(quoted diff) +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why 'rte_eth_trace_find_next' added as fast path?
Can you please add comment for all why it is added as fast path, this help to evaluate/review this later.

Quoted 2 lines

There were many functions for which I was not sure about whether they

should be slow path or fast path. I made the following assumption:

Quoted 3 lines

For slow path I have chosen the function which do some setup, configure or

write some configuration. For an example rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_tx_buffer_set_err_callback, rte_eth_trace_promiscuous_enable are slow path functions.

Quoted 3 lines

The functions which read data are made as fastpath functions. Also for

functions for which I was not sure I made it as fastpath.

Quoted 2 lines

For an example rte_ethdev_trace_owner_get,

rte_eth_trace_hairpin_get_peer_port, rte_eth_trace_macaddr_get are made as fastpath.

Quoted 3 lines

But there are few exceptions. Function like *_get_capability are made as

slowpath. Also rte_ethdev_trace_info_get is slowpath.

Quoted 2 lines

The slowpath and fastpath functions are in separate files.

rte_ethdev_trace.h (slowpath) and rte_ethdev_trace_fp.h (fastpath).

Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

Please let me know if any function needs to be swapped. I will make that

change.

Quoted 1 line

Got it, I think most of the trace points in the 'rte_ethdev_trace_fp.h' are for control/helper functions like:
'rte_ethdev_trace_count_avail', 'rte_ethdev_trace_get_port_by_name',

'rte_eth_trace_promiscuous_get' ...

Quoted 12 lines
Quoted 11 lines

I thought you did based on some analysis, that is why I asked to add that reasoning as code comment.

I think we can generalize as:

1) Anything called by ethdev static inline functions are datapath, and must be 'RTE_TRACE_POINT_FP', like 'rte_eth_trace_call_[rt]x_callbacks', 'rte_ethdev_trace_[rt]x_burst',

Quoted 8 lines

In this category the following functions come:
rte_eth_rx_burst
rte_eth_tx_burst
rte_eth_call_rx_callbacks (called from rte_eth_rx_burst) rte_eth_call_tx_callbacks (called from rte_eth_tx_burst) rte_eth_tx_buffer_count_callback (registered as error callback, called from rte_eth_tx_buffer_flush) rte_eth_tx_buffer_drop_callback (registered as error callback)

ack

Quoted 5 lines
Quoted 3 lines

2) Anything that is called in endless loop in application/sample that has potential impact although it may not really be datapath

Apart from functions in category [1], I have observed the following functions

in ethdev library, called in some while loop in app/examples.

Quoted 9 lines

rte_eth_stats_get (called in while loop in examples/qos_sched and examples/distributor) rte_eth_macaddr_get (called in while loop in examples/bond and examples/ethtool) rte_eth_link_get (called in for loop in examples/ip_pipeline) rte_eth_dev_get_mtu (called in for loop in examples/ip_pipeline) rte_eth_link_speed_to_str (called in for loop in examples/ip_pipeline) rte_eth_dev_rx_intr_enable ( called in loop in examples/l3fwd-power) rte_eth_dev_rx_intr_disable ( called in loop in examples/l3fwd-power) rte_eth_timesync_read_rx_timestamp (called in loop in examples/ptpclient) rte_eth_timesync_read_tx_timestamp (called

Quoted 9 lines

in loop in examples/ptpclient) rte_eth_timesync_adjust_time (called in loop in examples/ptpclient) rte_eth_timesync_read_time (called in loop in examples/ptpclient) rte_flow_classifier_query (called in examples/flow_classify) rte_mtr_create (in app/test-flow-perf loop) rte_mtr_destroy (in app/test-flow-perf loop) rte_mtr_meter_policy_delete ((in app/test-flow-perf loop) rte_flow_create (in app/test-flow-perf) rte_flow_destroy (in app/test-flow-perf)

Ack, and can you please add the note within the parenthesis as a comment, whoever visits these later knows why there trace points added as fast path trace point?

Quoted 1 line

Apart from the above can all other functions be moved to slowpath

tracepoints?

Quoted 8 lines
Quoted 5 lines

I think yes, we can start with this.
At least this gives us a logic to follow.

And does trace point and fast path trace points needs to be in separate header files?

I do not think separate header files is a requirement, but it is easy to segregate slowpath/fastpath if they are in separate files. What do you think ?

I think it is not good to expose trace points to user more than we have to, that is why I think better to segregate as public/internal.

It is possible to group and comment them as slowpath/fastpath within the internal header.

#97 lore raw

RE: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 113 lines · Ankur Dwivedi
Quoted 111 lines
Quoted 110 lines
Quoted 40 lines
Quoted 40 lines
Quoted 12 lines
Quoted 11 lines

Review

Quoted 7 lines
(quoted diff) +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why 'rte_eth_trace_find_next' added as fast path?
Can you please add comment for all why it is added as fast path, this help to evaluate/review this later.

Quoted 2 lines

There were many functions for which I was not sure about whether they

should be slow path or fast path. I made the following assumption:

Quoted 3 lines

For slow path I have chosen the function which do some setup, configure or

write some configuration. For an example rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_tx_buffer_set_err_callback, rte_eth_trace_promiscuous_enable are slow path functions.

Quoted 3 lines

The functions which read data are made as fastpath functions. Also for

functions for which I was not sure I made it as fastpath.

Quoted 2 lines

For an example rte_ethdev_trace_owner_get,

rte_eth_trace_hairpin_get_peer_port, rte_eth_trace_macaddr_get are made as fastpath.

Quoted 3 lines

But there are few exceptions. Function like *_get_capability are made as

slowpath. Also rte_ethdev_trace_info_get is slowpath.

Quoted 2 lines

The slowpath and fastpath functions are in separate files.

rte_ethdev_trace.h (slowpath) and rte_ethdev_trace_fp.h (fastpath).

Quoted 3 lines

Please let me know if any function needs to be swapped. I will make that

Quoted 7 lines
Quoted 7 lines

change.

Quoted 1 line

Got it, I think most of the trace points in the 'rte_ethdev_trace_fp.h' are for control/helper functions like:
'rte_ethdev_trace_count_avail', 'rte_ethdev_trace_get_port_by_name',

'rte_eth_trace_promiscuous_get' ...

Quoted 12 lines
Quoted 11 lines

I thought you did based on some analysis, that is why I asked to add that reasoning as code comment.

I think we can generalize as:

1) Anything called by ethdev static inline functions are datapath, and must be 'RTE_TRACE_POINT_FP', like 'rte_eth_trace_call_[rt]x_callbacks', 'rte_ethdev_trace_[rt]x_burst',

Quoted 8 lines

In this category the following functions come:
rte_eth_rx_burst
rte_eth_tx_burst
rte_eth_call_rx_callbacks (called from rte_eth_rx_burst) rte_eth_call_tx_callbacks (called from rte_eth_tx_burst) rte_eth_tx_buffer_count_callback (registered as error callback, called from rte_eth_tx_buffer_flush) rte_eth_tx_buffer_drop_callback (registered as error callback)

ack

Quoted 6 lines
Quoted 3 lines

2) Anything that is called in endless loop in application/sample that has potential impact although it may not really be datapath

Apart from functions in category [1], I have observed the following functions

in ethdev library, called in some while loop in app/examples.

Quoted 10 lines

rte_eth_stats_get (called in while loop in examples/qos_sched and examples/distributor) rte_eth_macaddr_get (called in while loop in examples/bond and examples/ethtool) rte_eth_link_get (called in for loop in examples/ip_pipeline) rte_eth_dev_get_mtu (called in for loop in examples/ip_pipeline) rte_eth_link_speed_to_str (called in for loop in examples/ip_pipeline) rte_eth_dev_rx_intr_enable ( called in loop in examples/l3fwd-power) rte_eth_dev_rx_intr_disable ( called in loop in examples/l3fwd-power) rte_eth_timesync_read_rx_timestamp (called in loop in examples/ptpclient) rte_eth_timesync_read_tx_timestamp (called in

Quoted 9 lines

loop in examples/ptpclient) rte_eth_timesync_adjust_time (called in loop in examples/ptpclient) rte_eth_timesync_read_time (called in loop in examples/ptpclient) rte_flow_classifier_query (called in examples/flow_classify) rte_mtr_create (in app/test-flow-perf loop) rte_mtr_destroy (in app/test-flow-perf loop) rte_mtr_meter_policy_delete ((in app/test-flow-perf loop) rte_flow_create (in app/test-flow-perf) rte_flow_destroy (in app/test-flow-perf)

Ack, and can you please add the note within the parenthesis as a comment, whoever visits these later knows why there trace points added as fast path trace point?

Quoted 1 line

Apart from the above can all other functions be moved to slowpath

tracepoints?

I think yes, we can start with this.
At least this gives us a logic to follow.

And does trace point and fast path trace points needs to be in separate header files?

Quoted 6 lines
Quoted 2 lines

I do not think separate header files is a requirement, but it is easy to segregate slowpath/fastpath if they are in separate files. What do you

think ?

I think it is not good to expose trace points to user more than we have to, that is why I think better to segregate as public/internal.

In my earlier comment I was thinking of something like this:
- Functions in category [1] (fastpath tracepoints) can be in public header named rte_ethdev_trace_fp.h(exposed to the user).

- Functions in category [2] (fastpath tracepoints)can be in internal header named ethdev_trace_fp.h
- Functions in category [3] (slowpath tracepoints) can be in internal header ethdev_trace.h

Quoted 3 lines

It is possible to group and comment them as slowpath/fastpath within the internal header.

#98 lore raw

Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 117 lines · Ankur Dwivedi
Quoted 117 lines · Ankur Dwivedi
Quoted 105 lines
Quoted 105 lines
Quoted 40 lines
Quoted 40 lines
Quoted 12 lines
Quoted 11 lines

Review

Quoted 7 lines
(quoted diff) +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why 'rte_eth_trace_find_next' added as fast path?
Can you please add comment for all why it is added as fast path, this help to evaluate/review this later.

Quoted 2 lines

There were many functions for which I was not sure about whether they

should be slow path or fast path. I made the following assumption:

Quoted 3 lines

For slow path I have chosen the function which do some setup, configure or

write some configuration. For an example rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_tx_buffer_set_err_callback, rte_eth_trace_promiscuous_enable are slow path functions.

Quoted 3 lines

The functions which read data are made as fastpath functions. Also for

functions for which I was not sure I made it as fastpath.

Quoted 2 lines

For an example rte_ethdev_trace_owner_get,

rte_eth_trace_hairpin_get_peer_port, rte_eth_trace_macaddr_get are made as fastpath.

Quoted 3 lines

But there are few exceptions. Function like *_get_capability are made as

slowpath. Also rte_ethdev_trace_info_get is slowpath.

Quoted 2 lines

The slowpath and fastpath functions are in separate files.

rte_ethdev_trace.h (slowpath) and rte_ethdev_trace_fp.h (fastpath).

Quoted 3 lines

Please let me know if any function needs to be swapped. I will make that

Quoted 7 lines
Quoted 7 lines

change.

Quoted 1 line

Got it, I think most of the trace points in the 'rte_ethdev_trace_fp.h' are for control/helper functions like:
'rte_ethdev_trace_count_avail', 'rte_ethdev_trace_get_port_by_name',

'rte_eth_trace_promiscuous_get' ...

Quoted 12 lines
Quoted 11 lines

I thought you did based on some analysis, that is why I asked to add that reasoning as code comment.

I think we can generalize as:

1) Anything called by ethdev static inline functions are datapath, and must be 'RTE_TRACE_POINT_FP', like 'rte_eth_trace_call_[rt]x_callbacks', 'rte_ethdev_trace_[rt]x_burst',

Quoted 8 lines

In this category the following functions come:
rte_eth_rx_burst
rte_eth_tx_burst
rte_eth_call_rx_callbacks (called from rte_eth_rx_burst) rte_eth_call_tx_callbacks (called from rte_eth_tx_burst) rte_eth_tx_buffer_count_callback (registered as error callback, called from rte_eth_tx_buffer_flush) rte_eth_tx_buffer_drop_callback (registered as error callback)

ack

Quoted 6 lines
Quoted 3 lines

2) Anything that is called in endless loop in application/sample that has potential impact although it may not really be datapath

Apart from functions in category [1], I have observed the following functions

in ethdev library, called in some while loop in app/examples.

Quoted 10 lines

rte_eth_stats_get (called in while loop in examples/qos_sched and examples/distributor) rte_eth_macaddr_get (called in while loop in examples/bond and examples/ethtool) rte_eth_link_get (called in for loop in examples/ip_pipeline) rte_eth_dev_get_mtu (called in for loop in examples/ip_pipeline) rte_eth_link_speed_to_str (called in for loop in examples/ip_pipeline) rte_eth_dev_rx_intr_enable ( called in loop in examples/l3fwd-power) rte_eth_dev_rx_intr_disable ( called in loop in examples/l3fwd-power) rte_eth_timesync_read_rx_timestamp (called in loop in examples/ptpclient) rte_eth_timesync_read_tx_timestamp (called in

Quoted 9 lines

loop in examples/ptpclient) rte_eth_timesync_adjust_time (called in loop in examples/ptpclient) rte_eth_timesync_read_time (called in loop in examples/ptpclient) rte_flow_classifier_query (called in examples/flow_classify) rte_mtr_create (in app/test-flow-perf loop) rte_mtr_destroy (in app/test-flow-perf loop) rte_mtr_meter_policy_delete ((in app/test-flow-perf loop) rte_flow_create (in app/test-flow-perf) rte_flow_destroy (in app/test-flow-perf)

Ack, and can you please add the note within the parenthesis as a comment, whoever visits these later knows why there trace points added as fast path trace point?

Quoted 1 line

Apart from the above can all other functions be moved to slowpath

tracepoints?

Quoted 8 lines
Quoted 5 lines

I think yes, we can start with this.
At least this gives us a logic to follow.

And does trace point and fast path trace points needs to be in separate header files?

I do not think separate header files is a requirement, but it is easy to segregate slowpath/fastpath if they are in separate files. What do you

think ?

Quoted 8 lines
Quoted 2 lines

I think it is not good to expose trace points to user more than we have to, that is why I think better to segregate as public/internal.

In my earlier comment I was thinking of something like this:
- Functions in category [1] (fastpath tracepoints) can be in public header named rte_ethdev_trace_fp.h(exposed to the user).

- Functions in category [2] (fastpath tracepoints)can be in internal header named ethdev_trace_fp.h
- Functions in category [3] (slowpath tracepoints) can be in internal header ethdev_trace.h

Do we need three headers for trace? What is the downside to merge [2] and [3] but group them withing the same header?

#99 lore raw

RE: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one)

Quoted 129 lines · Ankur Dwivedi
Quoted 118 lines
Quoted 118 lines · Ankur Dwivedi
Quoted 116 lines
Quoted 104 lines
Quoted 40 lines
Quoted 40 lines
Quoted 12 lines
Quoted 11 lines

Review

Quoted 7 lines
(quoted diff) +6 -0
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_find_next,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+

Why 'rte_eth_trace_find_next' added as fast path? Can you please add comment for all why it is added as fast path, this help to evaluate/review this later.

Quoted 2 lines

There were many functions for which I was not sure about whether they

should be slow path or fast path. I made the following assumption:

Quoted 3 lines

For slow path I have chosen the function which do some setup, configure or

write some configuration. For an example rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_tx_buffer_set_err_callback, rte_eth_trace_promiscuous_enable are slow path functions.

Quoted 3 lines

The functions which read data are made as fastpath functions. Also for

functions for which I was not sure I made it as fastpath.

Quoted 2 lines

For an example rte_ethdev_trace_owner_get,

rte_eth_trace_hairpin_get_peer_port, rte_eth_trace_macaddr_get are made as fastpath.

Quoted 3 lines

But there are few exceptions. Function like *_get_capability are made as

slowpath. Also rte_ethdev_trace_info_get is slowpath.

Quoted 2 lines

The slowpath and fastpath functions are in separate files.

rte_ethdev_trace.h (slowpath) and rte_ethdev_trace_fp.h (fastpath).

Quoted 3 lines

Please let me know if any function needs to be swapped. I will make that

Quoted 7 lines
Quoted 7 lines

change.

Quoted 1 line

Got it, I think most of the trace points in the 'rte_ethdev_trace_fp.h' are for control/helper functions like:
'rte_ethdev_trace_count_avail', 'rte_ethdev_trace_get_port_by_name',

'rte_eth_trace_promiscuous_get' ...

Quoted 12 lines
Quoted 11 lines

I thought you did based on some analysis, that is why I asked to add that reasoning as code comment.

I think we can generalize as:

1) Anything called by ethdev static inline functions are datapath, and must be 'RTE_TRACE_POINT_FP', like 'rte_eth_trace_call_[rt]x_callbacks', 'rte_ethdev_trace_[rt]x_burst',

Quoted 8 lines

In this category the following functions come:
rte_eth_rx_burst
rte_eth_tx_burst
rte_eth_call_rx_callbacks (called from rte_eth_rx_burst) rte_eth_call_tx_callbacks (called from rte_eth_tx_burst) rte_eth_tx_buffer_count_callback (registered as error callback, called from rte_eth_tx_buffer_flush) rte_eth_tx_buffer_drop_callback (registered as error callback)

ack

Quoted 6 lines
Quoted 3 lines

2) Anything that is called in endless loop in application/sample that has potential impact although it may not really be datapath

Apart from functions in category [1], I have observed the following functions

in ethdev library, called in some while loop in app/examples.

Quoted 12 lines

rte_eth_stats_get (called in while loop in examples/qos_sched and examples/distributor) rte_eth_macaddr_get (called in while loop in examples/bond and examples/ethtool) rte_eth_link_get (called in for loop in examples/ip_pipeline) rte_eth_dev_get_mtu (called in for loop in examples/ip_pipeline) rte_eth_link_speed_to_str (called in for loop in examples/ip_pipeline) rte_eth_dev_rx_intr_enable ( called in loop in examples/l3fwd-power) rte_eth_dev_rx_intr_disable ( called in loop in examples/l3fwd-power) rte_eth_timesync_read_rx_timestamp (called in loop in
examples/ptpclient) rte_eth_timesync_read_tx_timestamp (called in loop in examples/ptpclient) rte_eth_timesync_adjust_time (called

Quoted 9 lines

in loop in examples/ptpclient) rte_eth_timesync_read_time (called in loop in examples/ptpclient) rte_flow_classifier_query (called in
examples/flow_classify) rte_mtr_create (in app/test-flow-perf loop) rte_mtr_destroy (in app/test-flow-perf loop) rte_mtr_meter_policy_delete ((in app/test-flow-perf loop) rte_flow_create (in app/test-flow-perf) rte_flow_destroy (in app/test-flow-perf)

Ack, and can you please add the note within the parenthesis as a comment, whoever visits these later knows why there trace points added as fast path trace point?

Quoted 8 lines
Quoted 1 line

Apart from the above can all other functions be moved to slowpath

tracepoints?

I think yes, we can start with this.
At least this gives us a logic to follow.

And does trace point and fast path trace points needs to be in separate header files?

I do not think separate header files is a requirement, but it is easy to segregate slowpath/fastpath if they are in separate files. What do you

Quoted 7 lines
Quoted 4 lines

think ?

I think it is not good to expose trace points to user more than we have to, that is why I think better to segregate as public/internal.

In my earlier comment I was thinking of something like this:
- Functions in category [1] (fastpath tracepoints) can be in public header

named rte_ethdev_trace_fp.h(exposed to the user).

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

- Functions in category [2] (fastpath tracepoints)can be in internal header named ethdev_trace_fp.h
- Functions in category [3] (slowpath tracepoints) can be in internal header ethdev_trace.h

Do we need three headers for trace? What is the downside to merge [2] and
[3] but group them withing the same header?

There is no downside.
Will merge [2] and [3], with file named as ethdev_trace.h.

#100 lore raw

PATCH v6 3/6 ethdev: add trace points for ethdev (part two)

In reply to Ankur Dwivedi

Adds trace points for remaining ethdev functions.

---
 lib/ethdev/ethdev_trace_points.c | 252 +++++++++++++++
 lib/ethdev/rte_ethdev.c          | 476 ++++++++++++++++++++++-----
 lib/ethdev/rte_ethdev_cman.c     |  30 +-
 lib/ethdev/rte_ethdev_trace.h    | 529 +++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 342 ++++++++++++++++++++
 lib/ethdev/version.map           |  81 +++++
 6 files changed, 1622 insertions(+), 88 deletions(-)
lib/ethdev/ethdev_trace_points.c +252 -0
index 4fea76e0ff..102a18fcc1 100644
@@ -222,3 +222,255 @@ RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping,
 
 RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_fw_version_get,
 	lib.ethdev.fw_version_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_info_get,
+	lib.ethdev.info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_conf_get,
+	lib.ethdev.conf_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_supported_ptypes,
+	lib.ethdev.get_supported_ptypes)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_ptypes,
+	lib.ethdev.set_ptypes)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_macaddrs_get,
+	lib.ethdev.macaddrs_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_macaddr_get,
+	lib.ethdev.macaddr_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_mtu,
+	lib.ethdev.get_mtu)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_mtu,
+	lib.ethdev.set_mtu)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_vlan_filter,
+	lib.ethdev.vlan_filter)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_vlan_strip_on_queue,
+	lib.ethdev.set_vlan_strip_on_queue)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_vlan_ether_type,
+	lib.ethdev.set_vlan_ether_type)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_vlan_offload,
+	lib.ethdev.set_vlan_offload)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_vlan_offload,
+	lib.ethdev.get_vlan_offload)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_vlan_pvid,
+	lib.ethdev.set_vlan_pvid)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_flow_ctrl_get,
+	lib.ethdev.flow_ctrl_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_flow_ctrl_set,
+	lib.ethdev.flow_ctrl_set)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_set,
+	lib.ethdev.priority_flow_ctrl_set)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_info_get,
+	lib.ethdev.priority_flow_ctrl_queue_info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_configure,
+	lib.ethdev.priority_flow_ctrl_queue_configure)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_update,
+	lib.ethdev.rss_reta_update)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_query,
+	lib.ethdev.rss_reta_query)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_update,
+	lib.ethdev.rss_hash_update)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_conf_get,
+	lib.ethdev.rss_hash_conf_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_udp_tunnel_port_add,
+	lib.ethdev.udp_tunnel_port_add)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_udp_tunnel_port_delete,
+	lib.ethdev.udp_tunnel_port_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_led_on,
+	lib.ethdev.led_on)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_led_off,
+	lib.ethdev.led_off)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_fec_get_capability,
+	lib.ethdev.fec_get_capability)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_fec_get,
+	lib.ethdev.fec_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_fec_set,
+	lib.ethdev.fec_set)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_mac_addr_add,
+	lib.ethdev.mac_addr_add)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_mac_addr_remove,
+	lib.ethdev.mac_addr_remove)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_default_mac_addr_set,
+	lib.ethdev.default_mac_addr_set)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_uc_hash_table_set,
+	lib.ethdev.uc_hash_table_set)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_uc_all_hash_table_set,
+	lib.ethdev.uc_all_hash_table_set)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_set_queue_rate_limit,
+	lib.ethdev.set_queue_rate_limit)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set,
+	lib.ethdev.rx_avail_thresh_set)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_query,
+	lib.ethdev.rx_avail_thresh_query)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_callback_register,
+	lib.ethdev.callback_register)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_callback_unregister,
+	lib.ethdev.callback_unregister)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_ctl,
+	lib.ethdev.rx_intr_ctl)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_ctl_q_get_fd,
+	lib.ethdev.rx_intr_ctl_q_get_fd)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_ctl_q,
+	lib.ethdev.rx_intr_ctl_q)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_enable,
+	lib.ethdev.rx_intr_enable)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_disable,
+	lib.ethdev.rx_intr_disable)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_rx_callback,
+	lib.ethdev.add_rx_callback)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_first_rx_callback,
+	lib.ethdev.add_first_rx_callback)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_tx_callback,
+	lib.ethdev.add_tx_callback)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_remove_rx_callback,
+	lib.ethdev.remove_rx_callback)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_remove_tx_callback,
+	lib.ethdev.remove_tx_callback)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_info_get,
+	lib.ethdev.rx_queue_info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_queue_info_get,
+	lib.ethdev.tx_queue_info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_burst_mode_get,
+	lib.ethdev.rx_burst_mode_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_burst_mode_get,
+	lib.ethdev.tx_burst_mode_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_get_monitor_addr,
+	lib.ethdev.get_monitor_addr)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_mc_addr_list,
+	lib.ethdev.set_mc_addr_list)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_enable,
+	lib.ethdev.timesync_enable)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_disable,
+	lib.ethdev.timesync_disable)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_read_rx_timestamp,
+	lib.ethdev.timesync_read_rx_timestamp)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_read_tx_timestamp,
+	lib.ethdev.timesync_read_tx_timestamp)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_adjust_time,
+	lib.ethdev.timesync_adjust_time)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_read_time,
+	lib.ethdev.timesync_read_time)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_write_time,
+	lib.ethdev.timesync_write_time)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_read_clock,
+	lib.ethdev.read_clock)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_reg_info,
+	lib.ethdev.get_reg_info)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom_length,
+	lib.ethdev.get_eeprom_length)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom,
+	lib.ethdev.get_eeprom)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_eeprom,
+	lib.ethdev.set_eeprom)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_module_info,
+	lib.ethdev.get_module_info)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_module_eeprom,
+	lib.ethdev.get_module_eeprom)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_dcb_info,
+	lib.ethdev.get_dcb_info)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_adjust_nb_rx_tx_desc,
+	lib.ethdev.adjust_nb_rx_tx_desc)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_hairpin_capability_get,
+	lib.ethdev.hairpin_capability_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_pool_ops_supported,
+	lib.ethdev.pool_ops_supported)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_representor_info_get,
+	lib.ethdev.representor_info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_metadata_negotiate,
+	lib.ethdev.rx_metadata_negotiate)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_ip_reassembly_capability_get,
+	lib.ethdev.ip_reassembly_capability_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_ip_reassembly_conf_get,
+	lib.ethdev.ip_reassembly_conf_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_ip_reassembly_conf_set,
+	lib.ethdev.ip_reassembly_conf_set)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_buffer_split_get_supported_hdr_ptypes,
+	lib.ethdev.buffer_split_get_supported_hdr_ptypes)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_info_get,
+	lib.ethdev.cman_info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_init,
+	lib.ethdev.cman_config_init)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set,
+	lib.ethdev.cman_config_set)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_get,
+	lib.ethdev.cman_config_get)
lib/ethdev/rte_ethdev.c +392 -84

1,214 lines not on this page · raw message

lib/ethdev/rte_ethdev_cman.c +26 -4
index 4a1bdd7bd0..c4d877d878 100644
@@ -6,6 +6,8 @@
 
 #include <rte_errno.h>
 #include "rte_ethdev.h"
+#include "rte_ethdev_trace.h"
+#include "rte_ethdev_trace_fp.h"
 #include "ethdev_driver.h"
 #include "ethdev_private.h"
 
@@ -14,6 +16,7 @@ int
 rte_eth_cman_info_get(uint16_t port_id, struct rte_eth_cman_info *info)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -29,7 +32,11 @@ rte_eth_cman_info_get(uint16_t port_id, struct rte_eth_cman_info *info)
 	}
 
 	memset(info, 0, sizeof(struct rte_eth_cman_info));
-	return eth_err(port_id, (*dev->dev_ops->cman_info_get)(dev, info));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_info_get)(dev, info));
+
+	rte_eth_trace_cman_info_get(port_id, info, ret);
+
+	return ret;
 }
 
 /* Initialize congestion management structure with default values */
@@ -37,6 +44,7 @@ int
 rte_eth_cman_config_init(uint16_t port_id, struct rte_eth_cman_config *config)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -52,7 +60,11 @@ rte_eth_cman_config_init(uint16_t port_id, struct rte_eth_cman_config *config)
 	}
 
 	memset(config, 0, sizeof(struct rte_eth_cman_config));
-	return eth_err(port_id, (*dev->dev_ops->cman_config_init)(dev, config));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_config_init)(dev, config));
+
+	rte_eth_trace_cman_config_init(port_id, config, ret);
+
+	return ret;
 }
 
 /* Configure congestion management on a port */
@@ -60,6 +72,7 @@ int
 rte_eth_cman_config_set(uint16_t port_id, const struct rte_eth_cman_config *config)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -74,7 +87,11 @@ rte_eth_cman_config_set(uint16_t port_id, const struct rte_eth_cman_config *conf
 		return -ENOTSUP;
 	}
 
-	return eth_err(port_id, (*dev->dev_ops->cman_config_set)(dev, config));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_config_set)(dev, config));
+
+	rte_eth_trace_cman_config_set(port_id, config, ret);
+
+	return ret;
 }
 
 /* Retrieve congestion management configuration of a port */
@@ -82,6 +99,7 @@ int
 rte_eth_cman_config_get(uint16_t port_id, struct rte_eth_cman_config *config)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -97,5 +115,9 @@ rte_eth_cman_config_get(uint16_t port_id, struct rte_eth_cman_config *config)
 	}
 
 	memset(config, 0, sizeof(struct rte_eth_cman_config));
-	return eth_err(port_id, (*dev->dev_ops->cman_config_get)(dev, config));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_config_get)(dev, config));
+
+	rte_eth_trace_cman_config_get(port_id, config, ret);
+
+	return ret;
 }
lib/ethdev/rte_ethdev_trace.h +529 -0

535 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +342 -0

348 lines not on this page · raw message

lib/ethdev/version.map +81 -0

149 lines not on this page · raw message

Signature · 1 line
2.25.1
#101 lore raw

PATCH v6 4/6 ethdev: add trace points for flow

In reply to Ankur Dwivedi

Adds trace points for rte_flow specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace_points.c | 117 ++++++++++
 lib/ethdev/rte_ethdev_trace.h    | 383 +++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 113 +++++++++
 lib/ethdev/rte_flow.c            | 314 +++++++++++++++++++------
 lib/ethdev/version.map           |  37 +++
 5 files changed, 898 insertions(+), 66 deletions(-)
lib/ethdev/ethdev_trace_points.c +117 -0
index 102a18fcc1..1953d90a5a 100644
@@ -474,3 +474,120 @@ RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set,
 
 RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_get,
 	lib.ethdev.cman_config_get)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_copy,
+	lib.ethdev.flow.copy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_create,
+	lib.ethdev.flow.create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_destroy,
+	lib.ethdev.flow.destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flush,
+	lib.ethdev.flow.flush)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_isolate,
+	lib.ethdev.flow.isolate)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_query,
+	lib.ethdev.flow.query)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_validate,
+	lib.ethdev.flow.validate)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_conv,
+	lib.ethdev.flow.conv)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_dynf_metadata_register,
+	lib.ethdev.dynf_metadata_register)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_aged_flows,
+	lib.ethdev.flow.get_aged_flows)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_q_aged_flows,
+	lib.ethdev.flow.get_q_aged_flows)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_decap_set,
+	lib.ethdev.flow.tunnel_decap_set)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_match,
+	lib.ethdev.flow.tunnel_match)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_restore_info,
+	lib.ethdev.flow.get_restore_info)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_action_decap_release,
+	lib.ethdev.flow.tunnel_action_decap_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_item_release,
+	lib.ethdev.flow.tunnel_item_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_create,
+	lib.ethdev.flow.action_handle_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_destroy,
+	lib.ethdev.flow.action_handle_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_update,
+	lib.ethdev.flow.action_handle_update)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_query,
+	lib.ethdev.flow.action_handle_query)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_create,
+	lib.ethdev.flow.flex_item_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_release,
+	lib.ethdev.flow.flex_item_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pick_transfer_proxy,
+	lib.ethdev.flow.pick_transfer_proxy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_info_get,
+	lib.ethdev.flow.info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_configure,
+	lib.ethdev.flow.configure)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_create,
+	lib.ethdev.flow.pattern_template_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_destroy,
+	lib.ethdev.flow.pattern_template_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_create,
+	lib.ethdev.flow.actions_template_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_destroy,
+	lib.ethdev.flow.actions_template_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_create,
+	lib.ethdev.flow.template_table_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_destroy,
+	lib.ethdev.flow.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_destroy,
+	lib.ethdev.flow.async_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_push,
+	lib.ethdev.flow.push)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pull,
+	lib.ethdev.flow.pull)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_create,
+	lib.ethdev.flow.async_action_handle_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_destroy,
+	lib.ethdev.flow.async_action_handle_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_update,
+	lib.ethdev.flow.async_action_handle_update)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_query,
+	lib.ethdev.flow.async.action.handle.query)
lib/ethdev/rte_ethdev_trace.h +383 -0

389 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +113 -0

119 lines not on this page · raw message

lib/ethdev/rte_flow.c +248 -66

606 lines not on this page · raw message

lib/ethdev/version.map +37 -0
index c7c6bcd42b..0cb8222ad9 100644
@@ -445,6 +445,43 @@ EXPERIMENTAL {
 	__rte_ethdev_trace_udp_tunnel_port_add;
 	__rte_ethdev_trace_udp_tunnel_port_delete;
 	__rte_ethdev_trace_vlan_filter;
+	__rte_flow_trace_action_handle_create;
+	__rte_flow_trace_action_handle_destroy;
+	__rte_flow_trace_action_handle_query;
+	__rte_flow_trace_action_handle_update;
+	__rte_flow_trace_actions_template_create;
+	__rte_flow_trace_actions_template_destroy;
+	__rte_flow_trace_async_action_handle_create;
+	__rte_flow_trace_async_action_handle_destroy;
+	__rte_flow_trace_async_action_handle_update;
+	__rte_flow_trace_async_create;
+	__rte_flow_trace_async_destroy;
+	__rte_flow_trace_conv;
+	__rte_flow_trace_configure;
+	__rte_flow_trace_copy;
+	__rte_flow_trace_create;
+	__rte_flow_trace_destroy;
+	__rte_flow_trace_dynf_metadata_register;
+	__rte_flow_trace_flex_item_create;
+	__rte_flow_trace_flex_item_release;
+	__rte_flow_trace_flush;
+	__rte_flow_trace_get_aged_flows;
+	__rte_flow_trace_get_restore_info;
+	__rte_flow_trace_info_get;
+	__rte_flow_trace_isolate;
+	__rte_flow_trace_pattern_template_create;
+	__rte_flow_trace_pattern_template_destroy;
+	__rte_flow_trace_pick_transfer_proxy;
+	__rte_flow_trace_push;
+	__rte_flow_trace_pull;
+	__rte_flow_trace_query;
+	__rte_flow_trace_template_table_create;
+	__rte_flow_trace_template_table_destroy;
+	__rte_flow_trace_tunnel_action_decap_release;
+	__rte_flow_trace_tunnel_decap_set;
+	__rte_flow_trace_tunnel_item_release;
+	__rte_flow_trace_tunnel_match;
+	__rte_flow_trace_validate;
 };
 
 INTERNAL {
Signature · 1 line
2.25.1
#102 lore raw

PATCH v6 5/6 ethdev: add trace points for mtr

In reply to Ankur Dwivedi

Adds trace points for rte_mtr specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace_points.c |  63 +++++++++++++
 lib/ethdev/rte_ethdev_trace.h    | 112 ++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 100 ++++++++++++++++++++
 lib/ethdev/rte_mtr.c             | 156 +++++++++++++++++++++++++++----
 lib/ethdev/version.map           |  21 +++++
 5 files changed, 434 insertions(+), 18 deletions(-)
lib/ethdev/ethdev_trace_points.c +63 -0
index 1953d90a5a..067e5fdab4 100644
@@ -591,3 +591,66 @@ RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_update,
 
 RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_query,
 	lib.ethdev.flow.async.action.handle.query)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_capabilities_get,
+	lib.ethdev.mtr.capabilities_get)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_create,
+	lib.ethdev.mtr.create)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_destroy,
+	lib.ethdev.mtr.destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_disable,
+	lib.ethdev.mtr.meter_disable)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_dscp_table_update,
+	lib.ethdev.mtr.meter_dscp_table_update)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_enable,
+	lib.ethdev.mtr.meter_enable)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_profile_add,
+	lib.ethdev.mtr.meter_profile_add)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_profile_delete,
+	lib.ethdev.mtr.meter_profile_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_profile_get,
+	lib.ethdev.mtr.meter_profile_get)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_profile_update,
+	lib.ethdev.mtr.meter_profile_update)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_stats_read,
+	lib.ethdev.mtr.stats_read)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_stats_update,
+	lib.ethdev.mtr.stats_update)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_policy_add,
+	lib.ethdev.mtr.meter_policy_add)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_policy_delete,
+	lib.ethdev.mtr.meter_policy_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_policy_get,
+	lib.ethdev.mtr.meter_policy_get)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_policy_update,
+	lib.ethdev.mtr.meter_policy_update)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_policy_validate,
+	lib.ethdev.mtr.meter_policy_validate)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_vlan_table_update,
+	lib.ethdev.mtr.meter_vlan_table_update)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_get,
+	lib.ethdev.mtr.color_in_protocol_get)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_priority_get,
+	lib.ethdev.mtr.color_in_protocol_priority_get)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_set,
+	lib.ethdev.mtr.color_in_protocol_set)
lib/ethdev/rte_ethdev_trace.h +112 -0

124 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +100 -0

112 lines not on this page · raw message

lib/ethdev/rte_mtr.c +138 -18

304 lines not on this page · raw message

lib/ethdev/version.map +21 -0
index 0cb8222ad9..c1a6e4d30a 100644
@@ -482,6 +482,27 @@ EXPERIMENTAL {
 	__rte_flow_trace_tunnel_item_release;
 	__rte_flow_trace_tunnel_match;
 	__rte_flow_trace_validate;
+	__rte_mtr_trace_capabilities_get;
+	__rte_mtr_trace_color_in_protocol_get;
+	__rte_mtr_trace_color_in_protocol_priority_get;
+	__rte_mtr_trace_color_in_protocol_set;
+	__rte_mtr_trace_create;
+	__rte_mtr_trace_destroy;
+	__rte_mtr_trace_meter_disable;
+	__rte_mtr_trace_meter_dscp_table_update;
+	__rte_mtr_trace_meter_enable;
+	__rte_mtr_trace_meter_policy_add;
+	__rte_mtr_trace_meter_policy_delete;
+	__rte_mtr_trace_meter_policy_get;
+	__rte_mtr_trace_meter_policy_update;
+	__rte_mtr_trace_meter_policy_validate;
+	__rte_mtr_trace_meter_profile_add;
+	__rte_mtr_trace_meter_profile_delete;
+	__rte_mtr_trace_meter_profile_get;
+	__rte_mtr_trace_meter_profile_update;
+	__rte_mtr_trace_meter_vlan_table_update;
+	__rte_mtr_trace_stats_read;
+	__rte_mtr_trace_stats_update;
 };
 
 INTERNAL {
Signature · 1 line
2.25.1
#103 lore raw

PATCH v6 6/6 ethdev: add trace points for tm

In reply to Ankur Dwivedi

Adds trace points for rte_tm specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace_points.c |  90 +++++++++++
 lib/ethdev/rte_ethdev_trace.h    | 141 ++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 171 +++++++++++++++++++++
 lib/ethdev/rte_tm.c              | 247 +++++++++++++++++++++++++++----
 lib/ethdev/version.map           |  30 ++++
 5 files changed, 650 insertions(+), 29 deletions(-)
lib/ethdev/ethdev_trace_points.c +90 -0
index 067e5fdab4..af66a139df 100644
@@ -654,3 +654,93 @@ RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_priority_get,
 
 RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_set,
 	lib.ethdev.mtr.color_in_protocol_set)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_capabilities_get,
+	lib.ethdev.tm.capabilities_get)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_get_number_of_leaf_nodes,
+	lib.ethdev.tm.get_number_of_leaf_nodes)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_hierarchy_commit,
+	lib.ethdev.tm.hierarchy_commit)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_level_capabilities_get,
+	lib.ethdev.tm.level_capabilities_get)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_ip_dscp,
+	lib.ethdev.tm.mark_ip_dscp)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_ip_ecn,
+	lib.ethdev.tm.mark_ip_ecn)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_vlan_dei,
+	lib.ethdev.tm.mark_vlan_dei)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_add,
+	lib.ethdev.tm.node_add)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_capabilities_get,
+	lib.ethdev.tm.node_capabilities_get)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_cman_update,
+	lib.ethdev.tm.node_cman_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_delete,
+	lib.ethdev.tm.node_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_parent_update,
+	lib.ethdev.tm.node_parent_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_resume,
+	lib.ethdev.tm.node_resume)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_shaper_update,
+	lib.ethdev.tm.node_shaper_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_shared_shaper_update,
+	lib.ethdev.tm.node_shared_shaper_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_shared_wred_context_update,
+	lib.ethdev.tm.node_shared_wred_context_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_stats_read,
+	lib.ethdev.tm.node_stats_read)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_stats_update,
+	lib.ethdev.tm.node_stats_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_suspend,
+	lib.ethdev.tm.node_suspend)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_type_get,
+	lib.ethdev.tm.node_type_get)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_wfq_weight_mode_update,
+	lib.ethdev.tm.node_wfq_weight_mode_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_wred_context_update,
+	lib.ethdev.tm.node_wred_context_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shaper_profile_add,
+	lib.ethdev.tm.shaper_profile_add)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shaper_profile_delete,
+	lib.ethdev.tm.shaper_profile_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_shaper_add_update,
+	lib.ethdev.tm.shared_shaper_add_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_shaper_delete,
+	lib.ethdev.tm.shared_shaper_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_wred_context_add_update,
+	lib.ethdev.tm.shared_wred_context_add_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_wred_context_delete,
+	lib.ethdev.tm.shared_wred_context_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_wred_profile_add,
+	lib.ethdev.tm.wred_profile_add)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_wred_profile_delete,
+	lib.ethdev.tm.wred_profile_delete)
lib/ethdev/rte_ethdev_trace.h +141 -0

153 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +171 -0

183 lines not on this page · raw message

lib/ethdev/rte_tm.c +218 -29

461 lines not on this page · raw message

lib/ethdev/version.map +30 -0
index c1a6e4d30a..112b2b1039 100644
@@ -503,6 +503,36 @@ EXPERIMENTAL {
 	__rte_mtr_trace_meter_vlan_table_update;
 	__rte_mtr_trace_stats_read;
 	__rte_mtr_trace_stats_update;
+	__rte_tm_trace_capabilities_get;
+	__rte_tm_trace_get_number_of_leaf_nodes;
+	__rte_tm_trace_hierarchy_commit;
+	__rte_tm_trace_level_capabilities_get;
+	__rte_tm_trace_mark_ip_dscp;
+	__rte_tm_trace_mark_ip_ecn;
+	__rte_tm_trace_mark_vlan_dei;
+	__rte_tm_trace_node_add;
+	__rte_tm_trace_node_capabilities_get;
+	__rte_tm_trace_node_cman_update;
+	__rte_tm_trace_node_delete;
+	__rte_tm_trace_node_parent_update;
+	__rte_tm_trace_node_resume;
+	__rte_tm_trace_node_shaper_update;
+	__rte_tm_trace_node_shared_shaper_update;
+	__rte_tm_trace_node_shared_wred_context_update;
+	__rte_tm_trace_node_stats_read;
+	__rte_tm_trace_node_stats_update;
+	__rte_tm_trace_node_suspend;
+	__rte_tm_trace_node_type_get;
+	__rte_tm_trace_node_wfq_weight_mode_update;
+	__rte_tm_trace_node_wred_context_update;
+	__rte_tm_trace_shaper_profile_add;
+	__rte_tm_trace_shaper_profile_delete;
+	__rte_tm_trace_shared_shaper_add_update;
+	__rte_tm_trace_shared_shaper_delete;
+	__rte_tm_trace_shared_wred_context_add_update;
+	__rte_tm_trace_shared_wred_context_delete;
+	__rte_tm_trace_wred_profile_add;
+	__rte_tm_trace_wred_profile_delete;
 };
 
 INTERNAL {
Signature · 1 line
2.25.1
#104 lore raw

v7 cover add trace points in ethdev library

In reply to Ankur Dwivedi

This series adds trace points for functions in the ethdev library. The trace points are added in ethdev, flow, mtr and tm files.

v7:
- Resolves build failure.
- Changes in rte_trace_point_emit_blob() function in rte_trace_point.h and rte_trace_point_register.h.

v6:
- Resolves compilation error with 32 bit build.
- Resolves a bug found in v5 in the trace autotest application where the traces where not getting generated after the first blob test case. The trace size needs to be known at trace point register, so a dynamic length array cannot be implemented with current implementation. So changing the metadata of blob to make the array as 64 bytes. The length will denote the blob length(passed by the application). The trailing unused fields will be set to zero if length is less than 64.

For example, the following is the ctf metadata created to display a mac addr array in rte_eth_trace_macaddr_get():

   struct {
      ...
      uint8_t len;
      uint8_t mac_addr_addr_bytes[64];

};
- Minor changes in the subject of patches (2/6) and (3/6).

v5:
- The rte_trace_point_emit_char_array function is renamed to rte_trace_point_emit_blob. With this function an array of any length upto 65535 bytes can be captured.
For example, the following is the ctf metadata created to display a mac addr array in rte_eth_trace_macaddr_get():

   struct {
      ...
      uint16_t len;
      uint8_t mac_addr_addr_bytes[len];

};
- Added additional test cases for rte_eal_trace_generic_blob test case.
- Capturing of return value of a function is added to tracepoint for flow, mtr and tm patches.
- In ehdev patch (1/6), removed extra line. Also added rx_pkts and tx_pkts pointer in trace point.

v4:
- Adds tracepoint function to emit char array. Also adds the test case.
- Resolved review comments on "ethdev: add trace point" patch. This patch is divided into 2 patches to minimize per patch size.
- From the earlier version (v3), few tracepoints in ethdev, flow, mtr, tm are made as fast path tracepoints. For the tracepoint which i was unsure, i have made it as fastpath. All the fast path tracepoints can be found in rte_ethdev_trace_fp.h and rte_ethdev_trace_fp_burst.h. All the slow path tracepoints can be found in rte_ethdev_trace.h.
- Capturing of return value is added to tracepoint in ethdev. For flow, mtr and tm these changes are still yet to bde done. Will do it in the next versions.
- Moved the trace functions from INTERNAL to EXPERIMENTAL in version.map.

v3:
- Moved the trace functions from EXPERIMENTAL to INTERNAL in version.map.
- Moved trace functions call to the end, in ethdev and flow trace.
- Added code to print the input value of features in rte_eth_trace_rx_metadata_negotiate().
- Added code to capture return value in flow trace.

Ankur Dwivedi (6):
eal: trace: add trace point emit for blob
ethdev: add trace points for ethdev (part one)
ethdev: add trace points for ethdev (part two)
ethdev: add trace points for flow
ethdev: add trace points for mtr
ethdev: add trace points for tm

 app/test/test_trace.c                      |   11 +
 doc/guides/prog_guide/trace_lib.rst        |   12 +
 lib/eal/common/eal_common_trace_points.c   |    2 +
 lib/eal/include/rte_eal_trace.h            |    6 +
 lib/eal/include/rte_trace_point.h          |   31 +
 lib/eal/include/rte_trace_point_register.h |    9 +
 lib/eal/version.map                        |    3 +
 lib/ethdev/ethdev_private.c                |    5 +
 lib/ethdev/ethdev_trace_points.c           |  715 ++++++++++
 lib/ethdev/meson.build                     |    1 +
 lib/ethdev/rte_ethdev.c                    |  711 ++++++++--
 lib/ethdev/rte_ethdev.h                    |    2 +-
 lib/ethdev/rte_ethdev_cman.c               |   30 +-
 lib/ethdev/rte_ethdev_trace.h              | 1450 ++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h           | 1005 +++++++++++++-
 lib/ethdev/rte_ethdev_trace_fp_burst.h     |   44 +
 lib/ethdev/rte_flow.c                      |  314 ++++-
 lib/ethdev/rte_mtr.c                       |  156 ++-
 lib/ethdev/rte_tm.c                        |  247 +++-
 lib/ethdev/version.map                     |  235 ++++
 20 files changed, 4753 insertions(+), 236 deletions(-)
 create mode 100644 lib/ethdev/rte_ethdev_trace_fp_burst.h
Signature · 1 line
2.25.1
#105 lore raw

PATCH v7 1/6 eal: trace: add trace point emit for blob

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

This patch also adds test case for emit blob tracepoint function.

---
 app/test/test_trace.c                      | 11 ++++++++
 doc/guides/prog_guide/trace_lib.rst        | 12 +++++++++
 lib/eal/common/eal_common_trace_points.c   |  2 ++
 lib/eal/include/rte_eal_trace.h            |  6 +++++
 lib/eal/include/rte_trace_point.h          | 31 ++++++++++++++++++++++
 lib/eal/include/rte_trace_point_register.h |  9 +++++++
 lib/eal/version.map                        |  3 +++
 7 files changed, 74 insertions(+)
app/test/test_trace.c +11 -0
index 6bedf14024..ad4a394a29 100644
@@ -4,6 +4,7 @@
 
 #include <rte_eal_trace.h>
 #include <rte_lcore.h>
+#include <rte_random.h>
 #include <rte_trace.h>
 
 #include "test.h"
@@ -177,7 +178,12 @@ test_fp_trace_points(void)
 static int
 test_generic_trace_points(void)
 {
+	uint8_t arr[RTE_TRACE_BLOB_LEN_MAX];
 	int tmp;
+	int i;
+
+	for (i = 0; i < RTE_TRACE_BLOB_LEN_MAX; i++)
+		arr[i] = i;
 
 	rte_eal_trace_generic_void();
 	rte_eal_trace_generic_u64(0x10000000000000);
@@ -195,6 +201,11 @@ test_generic_trace_points(void)
 	rte_eal_trace_generic_ptr(&tmp);
 	rte_eal_trace_generic_str("my string");
 	rte_eal_trace_generic_size_t(sizeof(void *));
+	rte_eal_trace_generic_blob(arr, 0);
+	rte_eal_trace_generic_blob(arr, 17);
+	rte_eal_trace_generic_blob(arr, RTE_TRACE_BLOB_LEN_MAX);
+	rte_eal_trace_generic_blob(arr, rte_rand() %
+					RTE_TRACE_BLOB_LEN_MAX);
 	RTE_EAL_TRACE_GENERIC_FUNC;
 
 	return TEST_SUCCESS;
doc/guides/prog_guide/trace_lib.rst +12 -0
index 9a8f38073d..3e0ea5835c 100644
@@ -352,3 +352,15 @@ event ID.
 The ``packet.header`` and ``packet.context`` will be written in the slow path
 at the time of trace memory creation. The ``trace.header`` and trace payload
 will be emitted when the tracepoint function is invoked.
+
+Limitations
+-----------
+
+- The ``rte_trace_point_emit_blob()`` function can capture a maximum blob of
+  length ``RTE_TRACE_BLOB_LEN_MAX`` bytes. The application can call
+  ``rte_trace_point_emit_blob()`` multiple times with length less than or equal to
+  ``RTE_TRACE_BLOB_LEN_MAX``, if it needs to capture more than ``RTE_TRACE_BLOB_LEN_MAX``
+  bytes.
+- If the length passed to the ``rte_trace_point_emit_blob()`` is less than
+  ``RTE_TRACE_BLOB_LEN_MAX``, then the trailing ``(RTE_TRACE_BLOB_LEN_MAX - len)``
+  bytes in the trace are set to zero.
lib/eal/common/eal_common_trace_points.c +2 -0
index 0b0b254615..051f89809c 100644
@@ -40,6 +40,8 @@ RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_size_t,
 	lib.eal.generic.size_t)
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_func,
 	lib.eal.generic.func)
+RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_blob,
+	lib.eal.generic.blob)
 
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set,
 	lib.eal.alarm.set)
lib/eal/include/rte_eal_trace.h +6 -0
index 5ef4398230..e0b836eb2f 100644
@@ -143,6 +143,12 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_string(func);
 )
 
+RTE_TRACE_POINT(
+	rte_eal_trace_generic_blob,
+	RTE_TRACE_POINT_ARGS(void *in, uint8_t len),
+	rte_trace_point_emit_blob(in, len);
+)
+
 #define RTE_EAL_TRACE_GENERIC_FUNC rte_eal_trace_generic_func(__func__)
 
 /* Interrupt */
lib/eal/include/rte_trace_point.h +31 -0
index 0f8700974f..4d6b5700dd 100644
@@ -144,6 +144,16 @@ _tp _args \
 #define rte_trace_point_emit_ptr(val)
 /** Tracepoint function payload for string datatype */
 #define rte_trace_point_emit_string(val)
+/**
+ * Tracepoint function to capture a blob.
+ *
+ * @param val
+ *   Pointer to the array to be captured.
+ * @param len
+ *   Length to be captured. The maximum supported length is
+ *   RTE_TRACE_BLOB_LEN_MAX bytes.
+ */
+#define rte_trace_point_emit_blob(val, len)
 
 #endif /* __DOXYGEN__ */
 
@@ -152,6 +162,9 @@ _tp _args \
 /** @internal Macro to define event header size. */
 #define __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t)
 
+/** Macro to define maximum emit length of blob. */
+#define RTE_TRACE_BLOB_LEN_MAX 64
+
 /**
  * Enable recording events of the given tracepoint in the trace buffer.
  *
@@ -374,12 +387,30 @@ do { \
 	mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX); \
 } while (0)
 
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+	if (unlikely(in == NULL)) \
+		return; \
+	if (len > RTE_TRACE_BLOB_LEN_MAX) \
+		len = RTE_TRACE_BLOB_LEN_MAX; \
+	__rte_trace_point_emit(len, uint8_t); \
+	memcpy(mem, in, len); \
+	memset(RTE_PTR_ADD(mem, len), 0, RTE_TRACE_BLOB_LEN_MAX - len); \
+	mem = RTE_PTR_ADD(mem, RTE_TRACE_BLOB_LEN_MAX); \
+} while (0)
+
 #else
 
 #define __rte_trace_point_emit_header_generic(t) RTE_SET_USED(t)
 #define __rte_trace_point_emit_header_fp(t) RTE_SET_USED(t)
 #define __rte_trace_point_emit(in, type) RTE_SET_USED(in)
 #define rte_trace_point_emit_string(in) RTE_SET_USED(in)
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+	RTE_SET_USED(in); \
+	RTE_SET_USED(len); \
+} while (0)
+
 
 #endif /* ALLOW_EXPERIMENTAL_API */
 #endif /* _RTE_TRACE_POINT_REGISTER_H_ */
lib/eal/include/rte_trace_point_register.h +9 -0
index a32f4d731b..a9682d3f22 100644
@@ -47,6 +47,15 @@ do { \
 		RTE_STR(in)"[32]", "string_bounded_t"); \
 } while (0)
 
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+	RTE_SET_USED(in); \
+	__rte_trace_point_emit(len, uint8_t); \
+	__rte_trace_point_emit_field(RTE_TRACE_BLOB_LEN_MAX, \
+		RTE_STR(in)"[" RTE_STR(RTE_TRACE_BLOB_LEN_MAX)"]", \
+		RTE_STR(uint8_t)); \
+} while (0)
+
 #ifdef __cplusplus
 }
 #endif
lib/eal/version.map +3 -0
index 7ad12a7dc9..67be24686a 100644
@@ -440,6 +440,9 @@ EXPERIMENTAL {
 	rte_thread_detach;
 	rte_thread_equal;
 	rte_thread_join;
+
+	# added in 23.03
+	__rte_eal_trace_generic_blob;
 };
 
 INTERNAL {
Signature · 1 line
2.25.1
Acked-by on v7 1/6
#106 lore raw

Re: [PATCH v7 1/6] eal: trace: add trace point emit for blob

Quoted 4 lines · Ankur Dwivedi

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

Quoted 8 lines

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

This patch also adds test case for emit blob tracepoint function.

Quoted 196 lines
---
 app/test/test_trace.c                      | 11 ++++++++
 doc/guides/prog_guide/trace_lib.rst        | 12 +++++++++
 lib/eal/common/eal_common_trace_points.c   |  2 ++
 lib/eal/include/rte_eal_trace.h            |  6 +++++
 lib/eal/include/rte_trace_point.h          | 31 ++++++++++++++++++++++
 lib/eal/include/rte_trace_point_register.h |  9 +++++++
 lib/eal/version.map                        |  3 +++
 7 files changed, 74 insertions(+)
app/test/test_trace.c +11 -0
index 6bedf14024..ad4a394a29 100644
@@ -4,6 +4,7 @@
 
 #include <rte_eal_trace.h>
 #include <rte_lcore.h>
+#include <rte_random.h>
 #include <rte_trace.h>
 
 #include "test.h"
@@ -177,7 +178,12 @@ test_fp_trace_points(void)
 static int
 test_generic_trace_points(void)
 {
+       uint8_t arr[RTE_TRACE_BLOB_LEN_MAX];
        int tmp;
+       int i;
+
+       for (i = 0; i < RTE_TRACE_BLOB_LEN_MAX; i++)
+               arr[i] = i;
 
        rte_eal_trace_generic_void();
        rte_eal_trace_generic_u64(0x10000000000000);
@@ -195,6 +201,11 @@ test_generic_trace_points(void)
        rte_eal_trace_generic_ptr(&tmp);
        rte_eal_trace_generic_str("my string");
        rte_eal_trace_generic_size_t(sizeof(void *));
+       rte_eal_trace_generic_blob(arr, 0);
+       rte_eal_trace_generic_blob(arr, 17);
+       rte_eal_trace_generic_blob(arr, RTE_TRACE_BLOB_LEN_MAX);
+       rte_eal_trace_generic_blob(arr, rte_rand() %
+                                       RTE_TRACE_BLOB_LEN_MAX);
        RTE_EAL_TRACE_GENERIC_FUNC;
 
        return TEST_SUCCESS;
doc/guides/prog_guide/trace_lib.rst +12 -0
index 9a8f38073d..3e0ea5835c 100644
@@ -352,3 +352,15 @@ event ID.
 The ``packet.header`` and ``packet.context`` will be written in the slow path
 at the time of trace memory creation. The ``trace.header`` and trace payload
 will be emitted when the tracepoint function is invoked.
+
+Limitations
+-----------
+
+- The ``rte_trace_point_emit_blob()`` function can capture a maximum blob of
+  length ``RTE_TRACE_BLOB_LEN_MAX`` bytes. The application can call
+  ``rte_trace_point_emit_blob()`` multiple times with length less than or equal to
+  ``RTE_TRACE_BLOB_LEN_MAX``, if it needs to capture more than ``RTE_TRACE_BLOB_LEN_MAX``
+  bytes.
+- If the length passed to the ``rte_trace_point_emit_blob()`` is less than
+  ``RTE_TRACE_BLOB_LEN_MAX``, then the trailing ``(RTE_TRACE_BLOB_LEN_MAX - len)``
+  bytes in the trace are set to zero.
lib/eal/common/eal_common_trace_points.c +2 -0
index 0b0b254615..051f89809c 100644
@@ -40,6 +40,8 @@ RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_size_t,
        lib.eal.generic.size_t)
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_func,
        lib.eal.generic.func)
+RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_blob,
+       lib.eal.generic.blob)
 
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set,
        lib.eal.alarm.set)
lib/eal/include/rte_eal_trace.h +6 -0
index 5ef4398230..e0b836eb2f 100644
@@ -143,6 +143,12 @@ RTE_TRACE_POINT(
        rte_trace_point_emit_string(func);
 )
 
+RTE_TRACE_POINT(
+       rte_eal_trace_generic_blob,
+       RTE_TRACE_POINT_ARGS(void *in, uint8_t len),
+       rte_trace_point_emit_blob(in, len);
+)
+
 #define RTE_EAL_TRACE_GENERIC_FUNC rte_eal_trace_generic_func(__func__)
 
 /* Interrupt */
lib/eal/include/rte_trace_point.h +31 -0
index 0f8700974f..4d6b5700dd 100644
@@ -144,6 +144,16 @@ _tp _args \
 #define rte_trace_point_emit_ptr(val)
 /** Tracepoint function payload for string datatype */
 #define rte_trace_point_emit_string(val)
+/**
+ * Tracepoint function to capture a blob.
+ *
+ * @param val
+ *   Pointer to the array to be captured.
+ * @param len
+ *   Length to be captured. The maximum supported length is
+ *   RTE_TRACE_BLOB_LEN_MAX bytes.
+ */
+#define rte_trace_point_emit_blob(val, len)
 
 #endif /* __DOXYGEN__ */
 
@@ -152,6 +162,9 @@ _tp _args \
 /** @internal Macro to define event header size. */
 #define __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t)
 
+/** Macro to define maximum emit length of blob. */
+#define RTE_TRACE_BLOB_LEN_MAX 64
+
 /**
  * Enable recording events of the given tracepoint in the trace buffer.
  *
@@ -374,12 +387,30 @@ do { \
        mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX); \
 } while (0)
 
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+       if (unlikely(in == NULL)) \
+               return; \
+       if (len > RTE_TRACE_BLOB_LEN_MAX) \
+               len = RTE_TRACE_BLOB_LEN_MAX; \
+       __rte_trace_point_emit(len, uint8_t); \
+       memcpy(mem, in, len); \
+       memset(RTE_PTR_ADD(mem, len), 0, RTE_TRACE_BLOB_LEN_MAX - len); \
+       mem = RTE_PTR_ADD(mem, RTE_TRACE_BLOB_LEN_MAX); \
+} while (0)
+
 #else
 
 #define __rte_trace_point_emit_header_generic(t) RTE_SET_USED(t)
 #define __rte_trace_point_emit_header_fp(t) RTE_SET_USED(t)
 #define __rte_trace_point_emit(in, type) RTE_SET_USED(in)
 #define rte_trace_point_emit_string(in) RTE_SET_USED(in)
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+       RTE_SET_USED(in); \
+       RTE_SET_USED(len); \
+} while (0)
+
 
 #endif /* ALLOW_EXPERIMENTAL_API */
 #endif /* _RTE_TRACE_POINT_REGISTER_H_ */
lib/eal/include/rte_trace_point_register.h +9 -0
index a32f4d731b..a9682d3f22 100644
@@ -47,6 +47,15 @@ do { \
                RTE_STR(in)"[32]", "string_bounded_t"); \
 } while (0)
 
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+       RTE_SET_USED(in); \
+       __rte_trace_point_emit(len, uint8_t); \
+       __rte_trace_point_emit_field(RTE_TRACE_BLOB_LEN_MAX, \
+               RTE_STR(in)"[" RTE_STR(RTE_TRACE_BLOB_LEN_MAX)"]", \
+               RTE_STR(uint8_t)); \
+} while (0)
+
 #ifdef __cplusplus
 }
 #endif
lib/eal/version.map +3 -1
index 7ad12a7dc9..67be24686a 100644
@@ -440,6 +440,9 @@ EXPERIMENTAL {
        rte_thread_detach;
        rte_thread_equal;
        rte_thread_join;
+
+       # added in 23.03
+       __rte_eal_trace_generic_blob;
 };
 
 INTERNAL {
--

2.25.1

#107 lore raw

RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob

Quoted 17 lines

From: Jerin Jacob [mailto:[email protected]]
Sent: Monday, 23 January 2023 14.01

Quoted 12 lines · Ankur Dwivedi

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

This patch also adds test case for emit blob tracepoint function.

I already acked v6 of this patch.

You are allowed to include acks in the commit message of the following patch versions, so Patchwork can count the acks without us needing to ack again. Remember to put any acked-by and reviewed-by lines after your sign-off line, or checkpatches will complain about it.

For the benefit of Patchwork, here it is again:

#108 lore raw

RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob

Quoted 63 lines

-----Original Message-----
From: Morten Brørup <[email protected]>
Sent: Monday, January 23, 2023 6:39 PM
To: Jerin Jacob <[email protected]>; Ankur Dwivedi <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [EXT] RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob

External Email

----------------------------------------------------------------------

Quoted 16 lines

From: Jerin Jacob [mailto:[email protected]]
Sent: Monday, 23 January 2023 14.01

Quoted 11 lines · Ankur Dwivedi

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

This patch also adds test case for emit blob tracepoint function.

Quoted 8 lines
Quoted 1 line
Quoted 1 line

I already acked v6 of this patch.

You are allowed to include acks in the commit message of the following patch versions, so Patchwork can count the acks without us needing to ack again. Remember to put any acked-by and reviewed-by lines after your sign-off line, or checkpatches will complain about it.

Sure.

Quoted 4 lines

For the benefit of Patchwork, here it is again:

Thanks.

Acked-by on v7 1/6
#109 lore raw

RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob

In reply to Ankur Dwivedi
Quoted 56 lines

-----Original Message-----
From: Ankur Dwivedi <[email protected]>
Sent: Monday, January 23, 2023 2:32 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ankur Dwivedi <[email protected]>
Subject: [PATCH v7 1/6] eal: trace: add trace point emit for blob

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

This patch also adds test case for emit blob tracepoint function.

Quoted 10 lines
---
 app/test/test_trace.c                      | 11 ++++++++
 doc/guides/prog_guide/trace_lib.rst        | 12 +++++++++
 lib/eal/common/eal_common_trace_points.c   |  2 ++
 lib/eal/include/rte_eal_trace.h            |  6 +++++
 lib/eal/include/rte_trace_point.h          | 31 ++++++++++++++++++++++
 lib/eal/include/rte_trace_point_register.h |  9 +++++++
 lib/eal/version.map                        |  3 +++
 7 files changed, 74 insertions(+)
Quoted 82 lines
app/test/test_trace.c index renamed from app/test/test_trace.c +0 -0

6bedf14024..ad4a394a29 100644

app/test/test_trace.c +11 -0
@@ -4,6 +4,7 @@
 
 #include <rte_eal_trace.h>
 #include <rte_lcore.h>
+#include <rte_random.h>
 #include <rte_trace.h>
 
 #include "test.h"
@@ -177,7 +178,12 @@ test_fp_trace_points(void)  static int
 test_generic_trace_points(void)
 {
+	uint8_t arr[RTE_TRACE_BLOB_LEN_MAX];
 	int tmp;
+	int i;
+
+	for (i = 0; i < RTE_TRACE_BLOB_LEN_MAX; i++)
+		arr[i] = i;
 
 	rte_eal_trace_generic_void();
 	rte_eal_trace_generic_u64(0x10000000000000);
@@ -195,6 +201,11 @@ test_generic_trace_points(void)
 	rte_eal_trace_generic_ptr(&tmp);
 	rte_eal_trace_generic_str("my string");
 	rte_eal_trace_generic_size_t(sizeof(void *));
+	rte_eal_trace_generic_blob(arr, 0);
+	rte_eal_trace_generic_blob(arr, 17);
+	rte_eal_trace_generic_blob(arr, RTE_TRACE_BLOB_LEN_MAX);
+	rte_eal_trace_generic_blob(arr, rte_rand() %
+					RTE_TRACE_BLOB_LEN_MAX);
 	RTE_EAL_TRACE_GENERIC_FUNC;
 
 	return TEST_SUCCESS;
doc/guides/prog_guide/trace_lib.rst +0 -0
index 9a8f38073d..3e0ea5835c 100644
@@ -352,3 +352,15 @@ event ID.
 The ``packet.header`` and ``packet.context`` will be written in the slow path

at the time of trace memory creation. The ``trace.header`` and trace payload will be emitted when the tracepoint function is invoked.

doc/guides/prog_guide/trace_lib.rst +17 -0
+
+Limitations
+-----------
+
+- The ``rte_trace_point_emit_blob()`` function can capture a maximum
+blob of
+  length ``RTE_TRACE_BLOB_LEN_MAX`` bytes. The application can call
+  ``rte_trace_point_emit_blob()`` multiple times with length less than
+or equal to
+  ``RTE_TRACE_BLOB_LEN_MAX``, if it needs to capture more than
+``RTE_TRACE_BLOB_LEN_MAX``
+  bytes.
+- If the length passed to the ``rte_trace_point_emit_blob()`` is less
+than
+  ``RTE_TRACE_BLOB_LEN_MAX``, then the trailing
+``(RTE_TRACE_BLOB_LEN_MAX - len)``
+  bytes in the trace are set to zero.
lib/eal/common/eal_common_trace_points.c +2 -0
index 0b0b254615..051f89809c 100644
@@ -40,6 +40,8 @@
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_size_t,
 	lib.eal.generic.size_t)
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_func,
 	lib.eal.generic.func)
+RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_blob,
+	lib.eal.generic.blob)
 
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set,
lib/eal/common/eal_common_trace_points.c +0 -0
 	lib.eal.alarm.set)
lib/eal/include/rte_eal_trace.h +0 -0
index 5ef4398230..e0b836eb2f 100644

lib/eal/include/rte_eal_trace.h RTE_TRACE_POINT( · line 151

Quoted 9 lines
lib/eal/include/rte_eal_trace.h +6 -0
@@ -143,6 +143,12 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_string(func);
 )
 
+RTE_TRACE_POINT(
+	rte_eal_trace_generic_blob,
+	RTE_TRACE_POINT_ARGS(void *in, uint8_t len),
+	rte_trace_point_emit_blob(in, len);
+)
+

As per documentation rte_eal_trace_generic_blob() will emit 64 bytes only i.e. input array cannot be other than uint8_t. So will it not be better to make it more readable like RTE_TRACE_POINT_ARGS(uint8_t *in, uint8_t len) instead of using void *in.

Rest is fine. Already acked above.

Quoted 4 lines
lib/eal/include/rte_eal_trace.h +0 -0
 #define RTE_EAL_TRACE_GENERIC_FUNC
 rte_eal_trace_generic_func(__func__)
 

/* Interrupt */

[snipped]

Quoted 1 line

2.25.1

#110 lore raw

RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob

Quoted 6 lines

From: Sunil Kumar Kori [mailto:[email protected]]
Sent: Monday, 30 January 2023 08.31

Quoted 3 lines

From: Ankur Dwivedi <[email protected]>
Sent: Monday, January 23, 2023 2:32 PM

[...]

Quoted 4 lines
Quoted 4 lines
lib/eal/include/rte_eal_trace.h +4 -0
+RTE_TRACE_POINT(
+	rte_eal_trace_generic_blob,
+	RTE_TRACE_POINT_ARGS(void *in, uint8_t len),
+	rte_trace_point_emit_blob(in, len);
Quoted 8 lines

lib/eal/include/rte_eal_trace.h RTE_TRACE_POINT( · line 151

Quoted 2 lines
lib/eal/include/rte_eal_trace.h +2 -0
+)
+

As per documentation rte_eal_trace_generic_blob() will emit 64 bytes only i.e. input array cannot be other than uint8_t.
So will it not be better to make it more readable like RTE_TRACE_POINT_ARGS(uint8_t *in, uint8_t len) instead of using void *in.

No. Using uint8_t* would cause type conversion problems. The advantage of using void* is that it is has no type - which is exactly the purpose of a BLOB (which is short for Binary Large OBject). We want to be able to pass a pointer to e.g. a structure. Using void* makes that directly available.

I didn't notice before, but the const qualifier is missing. It should be:

RTE_TRACE_POINT_ARGS(const void *in, uint8_t len),

Quoted 12 lines

Rest is fine. Already acked above.

Quoted 4 lines

#define RTE_EAL_TRACE_GENERIC_FUNC
rte_eal_trace_generic_func(__func__)

/* Interrupt */

[snipped]

Quoted 1 line

2.25.1

#111 lore raw

RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob

Quoted 70 lines

-----Original Message-----
From: Morten Brørup <[email protected]>
Sent: Monday, January 30, 2023 1:45 PM
To: Sunil Kumar Kori <[email protected]>; Ankur Dwivedi <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ankur Dwivedi <[email protected]>
Subject: [EXT] RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob

External Email

----------------------------------------------------------------------

Quoted 6 lines

From: Sunil Kumar Kori [mailto:[email protected]]
Sent: Monday, 30 January 2023 08.31

Quoted 3 lines

From: Ankur Dwivedi <[email protected]>
Sent: Monday, January 23, 2023 2:32 PM

[...]

Quoted 4 lines
Quoted 4 lines
lib/eal/include/rte_eal_trace.h +4 -0
+RTE_TRACE_POINT(
+	rte_eal_trace_generic_blob,
+	RTE_TRACE_POINT_ARGS(void *in, uint8_t len),
+	rte_trace_point_emit_blob(in, len);
Quoted 8 lines

lib/eal/include/rte_eal_trace.h RTE_TRACE_POINT( · line 151

Quoted 2 lines
lib/eal/include/rte_eal_trace.h +2 -0
+)
+

As per documentation rte_eal_trace_generic_blob() will emit 64 bytes only i.e. input array cannot be other than uint8_t.
So will it not be better to make it more readable like RTE_TRACE_POINT_ARGS(uint8_t *in, uint8_t len) instead of using void *in.

Quoted 9 lines

No. Using uint8_t* would cause type conversion problems. The advantage of using void* is that it is has no type - which is exactly the purpose of a BLOB (which is short for Binary Large OBject). We want to be able to pass a pointer to e.g. a structure. Using void* makes that directly available.

I didn't notice before, but the const qualifier is missing. It should be:

RTE_TRACE_POINT_ARGS(const void *in, uint8_t len),

Makes sense. Ack.

Quoted 12 lines
Quoted 12 lines

Rest is fine. Already acked above.

Quoted 4 lines

#define RTE_EAL_TRACE_GENERIC_FUNC
rte_eal_trace_generic_func(__func__)

/* Interrupt */

[snipped]

Quoted 1 line

2.25.1

#112 lore raw

PATCH v7 2/6 ethdev: add trace points for ethdev (part one)

In reply to Ankur Dwivedi

Adds trace points for ethdev functions.
Moved the rte_ethdev_trace_rx_burst and rte_ethdev_trace_tx_burst to a new file rte_ethdev_trace_fp_burst.h. This is needed to resolve cyclic dependency between rte_ethdev.h and rte_ethdev_trace_fp.h.

---
 lib/ethdev/ethdev_private.c            |   5 +
 lib/ethdev/ethdev_trace_points.c       | 193 +++++++++++++++++
 lib/ethdev/meson.build                 |   1 +
 lib/ethdev/rte_ethdev.c                | 235 +++++++++++++++++---
 lib/ethdev/rte_ethdev.h                |   2 +-
 lib/ethdev/rte_ethdev_trace.h          | 285 +++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h       | 279 +++++++++++++++++++++++-
 lib/ethdev/rte_ethdev_trace_fp_burst.h |  44 ++++
 lib/ethdev/version.map                 |  66 ++++++
 9 files changed, 1075 insertions(+), 35 deletions(-)
 create mode 100644 lib/ethdev/rte_ethdev_trace_fp_burst.h
lib/ethdev/ethdev_private.c +5 -0
index 48090c879a..fd16b25e55 100644
@@ -5,6 +5,7 @@
 #include <rte_debug.h>
 
 #include "rte_ethdev.h"
+#include "rte_ethdev_trace_fp.h"
 #include "ethdev_driver.h"
 #include "ethdev_private.h"
 
@@ -297,6 +298,8 @@ rte_eth_call_rx_callbacks(uint16_t port_id, uint16_t queue_id,
 		cb = cb->next;
 	}
 
+	rte_eth_trace_call_rx_callbacks(port_id, queue_id, rx_pkts, nb_rx, nb_pkts);
+
 	return nb_rx;
 }
 
@@ -312,6 +315,8 @@ rte_eth_call_tx_callbacks(uint16_t port_id, uint16_t queue_id,
 		cb = cb->next;
 	}
 
+	rte_eth_trace_call_tx_callbacks(port_id, queue_id, tx_pkts, nb_pkts);
+
 	return nb_pkts;
 }
 
lib/ethdev/ethdev_trace_points.c +193 -0

202 lines not on this page · raw message

lib/ethdev/meson.build +1 -0
index 39250b5da1..f5c0865023 100644
@@ -24,6 +24,7 @@ headers = files(
         'rte_ethdev.h',
         'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
+        'rte_ethdev_trace_fp_burst.h',
         'rte_dev_info.h',
         'rte_flow.h',
         'rte_flow_driver.h',
lib/ethdev/rte_ethdev.c +207 -28

666 lines not on this page · raw message

lib/ethdev/rte_ethdev.h +1 -1
index 96d0650d0c..6340a84c10 100644
@@ -172,7 +172,7 @@ extern "C" {
 #include <rte_config.h>
 #include <rte_power_intrinsics.h>
 
-#include "rte_ethdev_trace_fp.h"
+#include "rte_ethdev_trace_fp_burst.h"
 #include "rte_dev_info.h"
 
 extern int rte_eth_dev_logtype;
lib/ethdev/rte_ethdev_trace.h +285 -0

291 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +273 -6

299 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp_burst.h new file +44 -0

44 lines not on this page · raw message

lib/ethdev/version.map +66 -0

72 lines not on this page · raw message

Signature · 1 line
2.25.1
Acked-by on v7 2/6
#113 lore raw

RE: [PATCH v7 2/6] ethdev: add trace points for ethdev (part one)

Quoted 51 lines

-----Original Message-----
From: Ankur Dwivedi <[email protected]>
Sent: Monday, January 23, 2023 2:32 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ankur Dwivedi <[email protected]>
Subject: [PATCH v7 2/6] ethdev: add trace points for ethdev (part one)

Adds trace points for ethdev functions.
Moved the rte_ethdev_trace_rx_burst and rte_ethdev_trace_tx_burst to a new file rte_ethdev_trace_fp_burst.h. This is needed to resolve cyclic dependency between rte_ethdev.h and rte_ethdev_trace_fp.h.

Quoted 13 lines
---
 lib/ethdev/ethdev_private.c            |   5 +
 lib/ethdev/ethdev_trace_points.c       | 193 +++++++++++++++++
 lib/ethdev/meson.build                 |   1 +
 lib/ethdev/rte_ethdev.c                | 235 +++++++++++++++++---
 lib/ethdev/rte_ethdev.h                |   2 +-
 lib/ethdev/rte_ethdev_trace.h          | 285 +++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h       | 279 +++++++++++++++++++++++-
 lib/ethdev/rte_ethdev_trace_fp_burst.h |  44 ++++
 lib/ethdev/version.map                 |  66 ++++++
 9 files changed, 1075 insertions(+), 35 deletions(-)
 create mode 100644 lib/ethdev/rte_ethdev_trace_fp_burst.h
Quoted 14 lines
lib/ethdev/ethdev_private.c +1 -1
index 48090c879a..fd16b25e55 100644
@@ -5,6 +5,7 @@
 #include <rte_debug.h>
 
 #include "rte_ethdev.h"
+#include "rte_ethdev_trace_fp.h"
 #include "ethdev_driver.h"
 #include "ethdev_private.h"
 
--

2.25.1

#114 lore raw

PATCH v7 3/6 ethdev: add trace points for ethdev (part two)

In reply to Ankur Dwivedi

Adds trace points for remaining ethdev functions.

---
 lib/ethdev/ethdev_trace_points.c | 252 +++++++++++++++
 lib/ethdev/rte_ethdev.c          | 476 ++++++++++++++++++++++-----
 lib/ethdev/rte_ethdev_cman.c     |  30 +-
 lib/ethdev/rte_ethdev_trace.h    | 529 +++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 342 ++++++++++++++++++++
 lib/ethdev/version.map           |  81 +++++
 6 files changed, 1622 insertions(+), 88 deletions(-)
lib/ethdev/ethdev_trace_points.c +252 -0
index 4fea76e0ff..102a18fcc1 100644
@@ -222,3 +222,255 @@ RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping,
 
 RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_fw_version_get,
 	lib.ethdev.fw_version_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_info_get,
+	lib.ethdev.info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_conf_get,
+	lib.ethdev.conf_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_supported_ptypes,
+	lib.ethdev.get_supported_ptypes)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_ptypes,
+	lib.ethdev.set_ptypes)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_macaddrs_get,
+	lib.ethdev.macaddrs_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_macaddr_get,
+	lib.ethdev.macaddr_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_mtu,
+	lib.ethdev.get_mtu)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_mtu,
+	lib.ethdev.set_mtu)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_vlan_filter,
+	lib.ethdev.vlan_filter)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_vlan_strip_on_queue,
+	lib.ethdev.set_vlan_strip_on_queue)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_vlan_ether_type,
+	lib.ethdev.set_vlan_ether_type)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_vlan_offload,
+	lib.ethdev.set_vlan_offload)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_vlan_offload,
+	lib.ethdev.get_vlan_offload)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_vlan_pvid,
+	lib.ethdev.set_vlan_pvid)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_flow_ctrl_get,
+	lib.ethdev.flow_ctrl_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_flow_ctrl_set,
+	lib.ethdev.flow_ctrl_set)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_set,
+	lib.ethdev.priority_flow_ctrl_set)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_info_get,
+	lib.ethdev.priority_flow_ctrl_queue_info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_configure,
+	lib.ethdev.priority_flow_ctrl_queue_configure)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_update,
+	lib.ethdev.rss_reta_update)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_query,
+	lib.ethdev.rss_reta_query)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_update,
+	lib.ethdev.rss_hash_update)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_conf_get,
+	lib.ethdev.rss_hash_conf_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_udp_tunnel_port_add,
+	lib.ethdev.udp_tunnel_port_add)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_udp_tunnel_port_delete,
+	lib.ethdev.udp_tunnel_port_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_led_on,
+	lib.ethdev.led_on)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_led_off,
+	lib.ethdev.led_off)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_fec_get_capability,
+	lib.ethdev.fec_get_capability)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_fec_get,
+	lib.ethdev.fec_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_fec_set,
+	lib.ethdev.fec_set)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_mac_addr_add,
+	lib.ethdev.mac_addr_add)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_mac_addr_remove,
+	lib.ethdev.mac_addr_remove)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_default_mac_addr_set,
+	lib.ethdev.default_mac_addr_set)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_uc_hash_table_set,
+	lib.ethdev.uc_hash_table_set)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_uc_all_hash_table_set,
+	lib.ethdev.uc_all_hash_table_set)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_set_queue_rate_limit,
+	lib.ethdev.set_queue_rate_limit)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set,
+	lib.ethdev.rx_avail_thresh_set)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_query,
+	lib.ethdev.rx_avail_thresh_query)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_callback_register,
+	lib.ethdev.callback_register)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_callback_unregister,
+	lib.ethdev.callback_unregister)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_ctl,
+	lib.ethdev.rx_intr_ctl)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_ctl_q_get_fd,
+	lib.ethdev.rx_intr_ctl_q_get_fd)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_ctl_q,
+	lib.ethdev.rx_intr_ctl_q)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_enable,
+	lib.ethdev.rx_intr_enable)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_disable,
+	lib.ethdev.rx_intr_disable)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_rx_callback,
+	lib.ethdev.add_rx_callback)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_first_rx_callback,
+	lib.ethdev.add_first_rx_callback)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_tx_callback,
+	lib.ethdev.add_tx_callback)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_remove_rx_callback,
+	lib.ethdev.remove_rx_callback)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_remove_tx_callback,
+	lib.ethdev.remove_tx_callback)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_info_get,
+	lib.ethdev.rx_queue_info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_queue_info_get,
+	lib.ethdev.tx_queue_info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_burst_mode_get,
+	lib.ethdev.rx_burst_mode_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_burst_mode_get,
+	lib.ethdev.tx_burst_mode_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_get_monitor_addr,
+	lib.ethdev.get_monitor_addr)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_mc_addr_list,
+	lib.ethdev.set_mc_addr_list)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_enable,
+	lib.ethdev.timesync_enable)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_disable,
+	lib.ethdev.timesync_disable)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_read_rx_timestamp,
+	lib.ethdev.timesync_read_rx_timestamp)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_read_tx_timestamp,
+	lib.ethdev.timesync_read_tx_timestamp)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_adjust_time,
+	lib.ethdev.timesync_adjust_time)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_read_time,
+	lib.ethdev.timesync_read_time)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_write_time,
+	lib.ethdev.timesync_write_time)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_read_clock,
+	lib.ethdev.read_clock)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_reg_info,
+	lib.ethdev.get_reg_info)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom_length,
+	lib.ethdev.get_eeprom_length)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom,
+	lib.ethdev.get_eeprom)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_eeprom,
+	lib.ethdev.set_eeprom)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_module_info,
+	lib.ethdev.get_module_info)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_module_eeprom,
+	lib.ethdev.get_module_eeprom)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_dcb_info,
+	lib.ethdev.get_dcb_info)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_adjust_nb_rx_tx_desc,
+	lib.ethdev.adjust_nb_rx_tx_desc)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_hairpin_capability_get,
+	lib.ethdev.hairpin_capability_get)
+
+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_pool_ops_supported,
+	lib.ethdev.pool_ops_supported)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_representor_info_get,
+	lib.ethdev.representor_info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_metadata_negotiate,
+	lib.ethdev.rx_metadata_negotiate)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_ip_reassembly_capability_get,
+	lib.ethdev.ip_reassembly_capability_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_ip_reassembly_conf_get,
+	lib.ethdev.ip_reassembly_conf_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_ip_reassembly_conf_set,
+	lib.ethdev.ip_reassembly_conf_set)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_buffer_split_get_supported_hdr_ptypes,
+	lib.ethdev.buffer_split_get_supported_hdr_ptypes)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_info_get,
+	lib.ethdev.cman_info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_init,
+	lib.ethdev.cman_config_init)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set,
+	lib.ethdev.cman_config_set)
+
+RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_get,
+	lib.ethdev.cman_config_get)
lib/ethdev/rte_ethdev.c +392 -84

1,214 lines not on this page · raw message

lib/ethdev/rte_ethdev_cman.c +26 -4
index 4a1bdd7bd0..c4d877d878 100644
@@ -6,6 +6,8 @@
 
 #include <rte_errno.h>
 #include "rte_ethdev.h"
+#include "rte_ethdev_trace.h"
+#include "rte_ethdev_trace_fp.h"
 #include "ethdev_driver.h"
 #include "ethdev_private.h"
 
@@ -14,6 +16,7 @@ int
 rte_eth_cman_info_get(uint16_t port_id, struct rte_eth_cman_info *info)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -29,7 +32,11 @@ rte_eth_cman_info_get(uint16_t port_id, struct rte_eth_cman_info *info)
 	}
 
 	memset(info, 0, sizeof(struct rte_eth_cman_info));
-	return eth_err(port_id, (*dev->dev_ops->cman_info_get)(dev, info));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_info_get)(dev, info));
+
+	rte_eth_trace_cman_info_get(port_id, info, ret);
+
+	return ret;
 }
 
 /* Initialize congestion management structure with default values */
@@ -37,6 +44,7 @@ int
 rte_eth_cman_config_init(uint16_t port_id, struct rte_eth_cman_config *config)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -52,7 +60,11 @@ rte_eth_cman_config_init(uint16_t port_id, struct rte_eth_cman_config *config)
 	}
 
 	memset(config, 0, sizeof(struct rte_eth_cman_config));
-	return eth_err(port_id, (*dev->dev_ops->cman_config_init)(dev, config));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_config_init)(dev, config));
+
+	rte_eth_trace_cman_config_init(port_id, config, ret);
+
+	return ret;
 }
 
 /* Configure congestion management on a port */
@@ -60,6 +72,7 @@ int
 rte_eth_cman_config_set(uint16_t port_id, const struct rte_eth_cman_config *config)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -74,7 +87,11 @@ rte_eth_cman_config_set(uint16_t port_id, const struct rte_eth_cman_config *conf
 		return -ENOTSUP;
 	}
 
-	return eth_err(port_id, (*dev->dev_ops->cman_config_set)(dev, config));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_config_set)(dev, config));
+
+	rte_eth_trace_cman_config_set(port_id, config, ret);
+
+	return ret;
 }
 
 /* Retrieve congestion management configuration of a port */
@@ -82,6 +99,7 @@ int
 rte_eth_cman_config_get(uint16_t port_id, struct rte_eth_cman_config *config)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -97,5 +115,9 @@ rte_eth_cman_config_get(uint16_t port_id, struct rte_eth_cman_config *config)
 	}
 
 	memset(config, 0, sizeof(struct rte_eth_cman_config));
-	return eth_err(port_id, (*dev->dev_ops->cman_config_get)(dev, config));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_config_get)(dev, config));
+
+	rte_eth_trace_cman_config_get(port_id, config, ret);
+
+	return ret;
 }
lib/ethdev/rte_ethdev_trace.h +529 -0

535 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +342 -0

348 lines not on this page · raw message

lib/ethdev/version.map +81 -0

149 lines not on this page · raw message

Signature · 1 line
2.25.1
Acked-by on v7 3/6
#115 lore raw

RE: [PATCH v7 3/6] ethdev: add trace points for ethdev (part two)

Quoted 48 lines

-----Original Message-----
From: Ankur Dwivedi <[email protected]>
Sent: Monday, January 23, 2023 2:32 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ankur Dwivedi <[email protected]>
Subject: [PATCH v7 3/6] ethdev: add trace points for ethdev (part two)

Adds trace points for remaining ethdev functions.

Quoted 9 lines
---
 lib/ethdev/ethdev_trace_points.c | 252 +++++++++++++++
 lib/ethdev/rte_ethdev.c          | 476 ++++++++++++++++++++++-----
 lib/ethdev/rte_ethdev_cman.c     |  30 +-
 lib/ethdev/rte_ethdev_trace.h    | 529 +++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 342 ++++++++++++++++++++
 lib/ethdev/version.map           |  81 +++++
 6 files changed, 1622 insertions(+), 88 deletions(-)
Quoted 8 lines
lib/ethdev/ethdev_trace_points.c +0 -1
index 4fea76e0ff..102a18fcc1 100644
@@ -222,3 +222,255 @@
--

2.25.1

#116 lore raw

PATCH v7 4/6 ethdev: add trace points for flow

In reply to Ankur Dwivedi

Adds trace points for rte_flow specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace_points.c | 117 ++++++++++
 lib/ethdev/rte_ethdev_trace.h    | 383 +++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 113 +++++++++
 lib/ethdev/rte_flow.c            | 314 +++++++++++++++++++------
 lib/ethdev/version.map           |  37 +++
 5 files changed, 898 insertions(+), 66 deletions(-)
lib/ethdev/ethdev_trace_points.c +117 -0
index 102a18fcc1..1953d90a5a 100644
@@ -474,3 +474,120 @@ RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set,
 
 RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_get,
 	lib.ethdev.cman_config_get)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_copy,
+	lib.ethdev.flow.copy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_create,
+	lib.ethdev.flow.create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_destroy,
+	lib.ethdev.flow.destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flush,
+	lib.ethdev.flow.flush)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_isolate,
+	lib.ethdev.flow.isolate)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_query,
+	lib.ethdev.flow.query)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_validate,
+	lib.ethdev.flow.validate)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_conv,
+	lib.ethdev.flow.conv)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_dynf_metadata_register,
+	lib.ethdev.dynf_metadata_register)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_aged_flows,
+	lib.ethdev.flow.get_aged_flows)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_q_aged_flows,
+	lib.ethdev.flow.get_q_aged_flows)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_decap_set,
+	lib.ethdev.flow.tunnel_decap_set)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_match,
+	lib.ethdev.flow.tunnel_match)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_restore_info,
+	lib.ethdev.flow.get_restore_info)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_action_decap_release,
+	lib.ethdev.flow.tunnel_action_decap_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_item_release,
+	lib.ethdev.flow.tunnel_item_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_create,
+	lib.ethdev.flow.action_handle_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_destroy,
+	lib.ethdev.flow.action_handle_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_update,
+	lib.ethdev.flow.action_handle_update)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_query,
+	lib.ethdev.flow.action_handle_query)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_create,
+	lib.ethdev.flow.flex_item_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_release,
+	lib.ethdev.flow.flex_item_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pick_transfer_proxy,
+	lib.ethdev.flow.pick_transfer_proxy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_info_get,
+	lib.ethdev.flow.info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_configure,
+	lib.ethdev.flow.configure)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_create,
+	lib.ethdev.flow.pattern_template_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_destroy,
+	lib.ethdev.flow.pattern_template_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_create,
+	lib.ethdev.flow.actions_template_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_destroy,
+	lib.ethdev.flow.actions_template_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_create,
+	lib.ethdev.flow.template_table_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_destroy,
+	lib.ethdev.flow.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_destroy,
+	lib.ethdev.flow.async_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_push,
+	lib.ethdev.flow.push)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pull,
+	lib.ethdev.flow.pull)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_create,
+	lib.ethdev.flow.async_action_handle_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_destroy,
+	lib.ethdev.flow.async_action_handle_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_update,
+	lib.ethdev.flow.async_action_handle_update)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_query,
+	lib.ethdev.flow.async.action.handle.query)
lib/ethdev/rte_ethdev_trace.h +383 -0

389 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +113 -0

119 lines not on this page · raw message

lib/ethdev/rte_flow.c +248 -66

606 lines not on this page · raw message

lib/ethdev/version.map +37 -0
index c7c6bcd42b..0cb8222ad9 100644
@@ -445,6 +445,43 @@ EXPERIMENTAL {
 	__rte_ethdev_trace_udp_tunnel_port_add;
 	__rte_ethdev_trace_udp_tunnel_port_delete;
 	__rte_ethdev_trace_vlan_filter;
+	__rte_flow_trace_action_handle_create;
+	__rte_flow_trace_action_handle_destroy;
+	__rte_flow_trace_action_handle_query;
+	__rte_flow_trace_action_handle_update;
+	__rte_flow_trace_actions_template_create;
+	__rte_flow_trace_actions_template_destroy;
+	__rte_flow_trace_async_action_handle_create;
+	__rte_flow_trace_async_action_handle_destroy;
+	__rte_flow_trace_async_action_handle_update;
+	__rte_flow_trace_async_create;
+	__rte_flow_trace_async_destroy;
+	__rte_flow_trace_conv;
+	__rte_flow_trace_configure;
+	__rte_flow_trace_copy;
+	__rte_flow_trace_create;
+	__rte_flow_trace_destroy;
+	__rte_flow_trace_dynf_metadata_register;
+	__rte_flow_trace_flex_item_create;
+	__rte_flow_trace_flex_item_release;
+	__rte_flow_trace_flush;
+	__rte_flow_trace_get_aged_flows;
+	__rte_flow_trace_get_restore_info;
+	__rte_flow_trace_info_get;
+	__rte_flow_trace_isolate;
+	__rte_flow_trace_pattern_template_create;
+	__rte_flow_trace_pattern_template_destroy;
+	__rte_flow_trace_pick_transfer_proxy;
+	__rte_flow_trace_push;
+	__rte_flow_trace_pull;
+	__rte_flow_trace_query;
+	__rte_flow_trace_template_table_create;
+	__rte_flow_trace_template_table_destroy;
+	__rte_flow_trace_tunnel_action_decap_release;
+	__rte_flow_trace_tunnel_decap_set;
+	__rte_flow_trace_tunnel_item_release;
+	__rte_flow_trace_tunnel_match;
+	__rte_flow_trace_validate;
 };
 
 INTERNAL {
Signature · 1 line
2.25.1
#117 lore raw

RE: [PATCH v7 4/6] ethdev: add trace points for flow

Hi Ankur,

Quoted 164 lines

-----Original Message-----
From: Ankur Dwivedi <[email protected]>
Sent: Monday, 23 January 2023 11:02

Adds trace points for rte_flow specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace_points.c | 117 ++++++++++
 lib/ethdev/rte_ethdev_trace.h    | 383
+++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 113 +++++++++
 lib/ethdev/rte_flow.c            | 314 +++++++++++++++++++------
 lib/ethdev/version.map           |  37 +++
 5 files changed, 898 insertions(+), 66 deletions(-)
lib/ethdev/ethdev_trace_points.c +44 -0
index 102a18fcc1..1953d90a5a 100644
@@ -474,3 +474,120 @@
 RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set,
 
 RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_get,
 	lib.ethdev.cman_config_get)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_copy,
+	lib.ethdev.flow.copy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_create,
+	lib.ethdev.flow.create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_destroy,
+	lib.ethdev.flow.destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flush,
+	lib.ethdev.flow.flush)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_isolate,
+	lib.ethdev.flow.isolate)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_query,
+	lib.ethdev.flow.query)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_validate,
+	lib.ethdev.flow.validate)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_conv,
+	lib.ethdev.flow.conv)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_dynf_metadata_register,
+	lib.ethdev.dynf_metadata_register)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_aged_flows,
+	lib.ethdev.flow.get_aged_flows)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_q_aged_flows,
+	lib.ethdev.flow.get_q_aged_flows)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_decap_set,
+	lib.ethdev.flow.tunnel_decap_set)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_match,
+	lib.ethdev.flow.tunnel_match)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_restore_info,
+	lib.ethdev.flow.get_restore_info)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_action_decap_releas

e,

lib/ethdev/ethdev_trace_points.c +63 -0
+	lib.ethdev.flow.tunnel_action_decap_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_item_release,
+	lib.ethdev.flow.tunnel_item_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_create,
+	lib.ethdev.flow.action_handle_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_destroy,
+	lib.ethdev.flow.action_handle_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_update,
+	lib.ethdev.flow.action_handle_update)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_query,
+	lib.ethdev.flow.action_handle_query)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_create,
+	lib.ethdev.flow.flex_item_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_release,
+	lib.ethdev.flow.flex_item_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pick_transfer_proxy,
+	lib.ethdev.flow.pick_transfer_proxy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_info_get,
+	lib.ethdev.flow.info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_configure,
+	lib.ethdev.flow.configure)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_create,
+	lib.ethdev.flow.pattern_template_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_destroy,
+	lib.ethdev.flow.pattern_template_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_create,
+	lib.ethdev.flow.actions_template_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_destroy,
+	lib.ethdev.flow.actions_template_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_create,
+	lib.ethdev.flow.template_table_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_destroy,
+	lib.ethdev.flow.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_destroy,
+	lib.ethdev.flow.async_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_push,
+	lib.ethdev.flow.push)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pull,
+	lib.ethdev.flow.pull)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_creat

e,

lib/ethdev/ethdev_trace_points.c +3 -0
+	lib.ethdev.flow.async_action_handle_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_destr

oy,

lib/ethdev/ethdev_trace_points.c +3 -0
+	lib.ethdev.flow.async_action_handle_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_updat

e,

lib/ethdev/ethdev_trace_points.c +3 -0
+	lib.ethdev.flow.async_action_handle_update)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_query

,

lib/ethdev/ethdev_trace_points.c +1 -0
+	lib.ethdev.flow.async.action.handle.query)
lib/ethdev/rte_ethdev_trace.h +8 -0
index fa195c5cde..fd4fbaf6de 100644
@@ -902,6 +902,389 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_int(ret);
 )
 
+RTE_TRACE_POINT(
+	rte_flow_trace_copy,
+	RTE_TRACE_POINT_ARGS(struct rte_flow_desc *fd, size_t len,
+		const struct rte_flow_attr *attr,
+		const struct rte_flow_item *items,
+		const struct rte_flow_action *actions, int ret),
+	rte_trace_point_emit_ptr(fd);
+	rte_trace_point_emit_size_t(len);

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 922

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_int(items->type);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_int(actions->type);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Quoted 5 lines
lib/ethdev/rte_ethdev_trace.h +4 -0
+	rte_flow_trace_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct
 rte_flow_attr *attr,
+		const struct rte_flow_item *pattern,
+		const struct rte_flow_action *actions, struct rte_flow *flow),

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 936

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(flow);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_destroy,

Part of the datapath should be _FP

Quoted 84 lines
lib/ethdev/rte_ethdev_trace.h +83 -0
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow, int
 ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(flow);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flush,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_validate,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_attr *attr,
+		const struct rte_flow_item *pattern,
+		const struct rte_flow_action *actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_conv,
+	RTE_TRACE_POINT_ARGS(enum rte_flow_conv_op op, void *dst,
+		size_t size, const void *src),
+	rte_trace_point_emit_int(op);
+	rte_trace_point_emit_ptr(dst);
+	rte_trace_point_emit_size_t(size);
+	rte_trace_point_emit_ptr(src);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_dynf_metadata_register,
+	RTE_TRACE_POINT_ARGS(int offset, uint64_t flag),
+	rte_trace_point_emit_int(offset);
+	rte_trace_point_emit_u64(flag);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_decap_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_tunnel *tunnel,
+		struct rte_flow_action **actions,
+		uint32_t *num_of_actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(tunnel);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(num_of_actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_match,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_tunnel *tunnel,
+		struct rte_flow_item **items,
+		uint32_t *num_of_items, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(tunnel);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_ptr(num_of_items);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_action_decap_release,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_action *actions,
+		uint32_t num_of_actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_u32(num_of_actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_item_release,

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1029

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_item *items,
+		uint32_t num_of_items, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_u32(num_of_items);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	rte_flow_trace_action_handle_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_indir_action_conf *conf,
+		const struct rte_flow_action *action,
+		struct rte_flow_action_handle *handle),
+	uint32_t ingress = conf->ingress;
+	uint32_t egress = conf->egress;
+	uint32_t transfer = conf->transfer;
+
+	rte_trace_point_emit_u16(port_id);

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1049

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(ingress);
+	rte_trace_point_emit_u32(egress);
+	rte_trace_point_emit_u32(transfer);
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_int(action->type);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Quoted 1,131 lines
lib/ethdev/rte_ethdev_trace.h +91 -0
+	rte_flow_trace_action_handle_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_action_handle *handle, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flex_item_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_item_flex_conf *conf,
+		struct rte_flow_item_flex_handle *handle),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_int(conf->tunnel);
+	rte_trace_point_emit_int(conf->nb_samples);
+	rte_trace_point_emit_int(conf->nb_inputs);
+	rte_trace_point_emit_int(conf->nb_outputs);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flex_item_release,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_item_flex_handle *handle, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_info_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_port_info *port_info,
+		struct rte_flow_queue_info *queue_info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(port_info);
+	rte_trace_point_emit_u32(port_info->max_nb_queues);
+	rte_trace_point_emit_u32(port_info->max_nb_counters);
+	rte_trace_point_emit_u32(port_info->max_nb_aging_objects);
+	rte_trace_point_emit_u32(port_info->max_nb_meters);
+	rte_trace_point_emit_u32(port_info->max_nb_conn_tracks);
+	rte_trace_point_emit_u32(port_info->supported_flags);
+	rte_trace_point_emit_ptr(queue_info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_configure,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_port_attr *port_attr,
+		uint16_t nb_queue,
+		const struct rte_flow_queue_attr **queue_attr, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(port_attr);
+	rte_trace_point_emit_u32(port_attr->nb_counters);
+	rte_trace_point_emit_u32(port_attr->nb_aging_objects);
+	rte_trace_point_emit_u32(port_attr->nb_meters);
+	rte_trace_point_emit_u32(port_attr->nb_conn_tracks);
+	rte_trace_point_emit_u32(port_attr->flags);
+	rte_trace_point_emit_u16(nb_queue);
+	rte_trace_point_emit_ptr(queue_attr);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_pattern_template_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_pattern_template_attr
 *template_attr,
+		const struct rte_flow_item *pattern,
+		void *tmplate),
+	uint32_t relaxed_matching = template_attr->relaxed_matching;
+	uint32_t ingress = template_attr->ingress;
+	uint32_t egress = template_attr->egress;
+	uint32_t transfer = template_attr->transfer;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_attr);
+	rte_trace_point_emit_u32(relaxed_matching);
+	rte_trace_point_emit_u32(ingress);
+	rte_trace_point_emit_u32(egress);
+	rte_trace_point_emit_u32(transfer);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(tmplate);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_pattern_template_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_pattern_template *pattern_template, int

ret),

lib/ethdev/rte_ethdev_trace.h +30 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(pattern_template);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_actions_template_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_actions_template_attr *template_attr,
+		const struct rte_flow_action *actions,
+		const struct rte_flow_action *masks,
+		void *tmplate),
+	uint32_t ingress = template_attr->ingress;
+	uint32_t egress = template_attr->egress;
+	uint32_t transfer = template_attr->transfer;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_attr);
+	rte_trace_point_emit_u32(ingress);
+	rte_trace_point_emit_u32(egress);
+	rte_trace_point_emit_u32(transfer);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(masks);
+	rte_trace_point_emit_ptr(tmplate);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_actions_template_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_actions_template *actions_template, int

ret),

lib/ethdev/rte_ethdev_trace.h +71 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(actions_template);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_template_table_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_template_table_attr *table_attr,
+		struct rte_flow_pattern_template **pattern_templates,
+		uint8_t nb_pattern_templates,
+		struct rte_flow_actions_template **actions_templates,
+		uint8_t nb_actions_templates,
+		struct rte_flow_template_table *table),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(table_attr);
+	rte_trace_point_emit_u32(table_attr->nb_flows);
+	rte_trace_point_emit_ptr(pattern_templates);
+	rte_trace_point_emit_u8(nb_pattern_templates);
+	rte_trace_point_emit_ptr(actions_templates);
+	rte_trace_point_emit_u8(nb_actions_templates);
+	rte_trace_point_emit_ptr(table);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_template_table_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_template_table *template_table, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_table);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_async_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow_template_table *template_table,
+		const struct rte_flow_item *pattern,
+		uint8_t pattern_template_index,
+		const struct rte_flow_action *actions,
+		uint8_t actions_template_index,
+		void *user_data, 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_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(
+	rte_flow_trace_async_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow *flow, void *user_data, int ret),
+	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(flow);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_push,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, int

ret),

lib/ethdev/rte_ethdev_trace.h +46 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_pull,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		struct rte_flow_op_result *res, uint16_t n_res, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_ptr(res);
+	rte_trace_point_emit_u16(n_res);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_async_action_handle_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_indir_action_conf *indir_action_conf,
+		const struct rte_flow_action *action,
+		void *user_data, struct rte_flow_action_handle *handle),
+	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(indir_action_conf);
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_async_action_handle_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow_action_handle *action_handle,
+		void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
 #ifdef __cplusplus
 }
 #endif
lib/ethdev/rte_ethdev_trace_fp.h +113 -0
index d4b2e4b312..c5b8083de2 100644
@@ -646,6 +646,119 @@ RTE_TRACE_POINT_FP(
 	rte_trace_point_emit_int(ret);
 )
 
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow,
+		const struct rte_flow_action *action, void *data, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(flow);
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_int(action->type);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_isolate,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int set, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(set);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_restore_info,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_mbuf *m, struct rte_flow_restore_info *info,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(m);
+	rte_trace_point_emit_ptr(info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_aged_flows,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, void **contexts,
+		uint32_t nb_contexts, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(contexts);
+	rte_trace_point_emit_u32(nb_contexts);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_q_aged_flows,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, void
 **contexts,
+		uint32_t nb_contexts, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_ptr(contexts);
+	rte_trace_point_emit_u32(nb_contexts);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_action_handle_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_action_handle *handle,
+		const void *update, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_ptr(update);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_action_handle_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_action_handle *handle,
+		void *data, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_pick_transfer_proxy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t
 *proxy_port_id,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(proxy_port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_action_handle_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow_action_handle *action_handle,
+		const void *update, void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(update);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_action_handle_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_action_handle *action_handle,
+		void *data, void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
 #ifdef __cplusplus

}
#endif

lib/ethdev/rte_flow.c +13 -1
index 7d0c24366c..43f13f79b4 100644
@@ -13,6 +13,8 @@
 #include <rte_string_fns.h>
 #include <rte_mbuf_dyn.h>
 #include "rte_ethdev.h"
+#include "rte_ethdev_trace.h"
+#include "rte_ethdev_trace_fp.h"
 #include "rte_flow_driver.h"
 #include "rte_flow.h"
 
@@ -276,6 +278,9 @@ rte_flow_dynf_metadata_register(void)
 		goto error;
 	rte_flow_dynf_metadata_offs = offset;
 	rte_flow_dynf_metadata_mask = RTE_BIT64(flag);
+
+	rte_flow_trace_dynf_metadata_register(offset, RTE_BIT64(flag));
+
 	return 0;
 
 error:
@@ -362,7 +367,11 @@ rte_flow_validate(uint16_t port_id,
 		fts_enter(dev);
 		ret = ops->validate(dev, attr, pattern, actions, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_validate(port_id, attr, pattern, actions, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOSYS,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -389,6 +398,9 @@ rte_flow_create(uint16_t port_id,
 		fts_exit(dev);
 		if (flow == NULL)
 			flow_err(port_id, -rte_errno, error);
+
+		rte_flow_trace_create(port_id, attr, pattern, actions, flow);
+
 		return flow;
 	}
 	rte_flow_error_set(error, ENOSYS,

RTE_FLOW_ERROR_TYPE_UNSPECIFIED,

lib/ethdev/rte_flow.c +30 -5
@@ -412,7 +424,11 @@ rte_flow_destroy(uint16_t port_id,
 		fts_enter(dev);
 		ret = ops->destroy(dev, flow, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_destroy(port_id, flow, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOSYS,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -434,7 +450,11 @@ rte_flow_flush(uint16_t port_id,
 		fts_enter(dev);
 		ret = ops->flush(dev, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_flush(port_id, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOSYS,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -459,7 +479,11 @@ rte_flow_query(uint16_t port_id,
 		fts_enter(dev);
 		ret = ops->query(dev, flow, action, data, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_query(port_id, flow, action, data, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOSYS,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -482,7 +506,11 @@ rte_flow_isolate(uint16_t port_id,
 		fts_enter(dev);
 		ret = ops->isolate(dev, set, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_isolate(port_id, set, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOSYS,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1003,6 +1031,8 @@ rte_flow_conv(enum rte_flow_conv_op op,
 	      const void *src,
 	      struct rte_flow_error *error)
 {
+	rte_flow_trace_conv(op, dst, size, src);
+
 	switch (op) {
 		const struct rte_flow_attr *attr;
 
@@ -1087,6 +1117,9 @@ rte_flow_copy(struct rte_flow_desc *desc, size_t
 len,
 			.actions = dst_size ? dst->actions : NULL,
 		   }),
 		   len > sizeof(*desc) ? sizeof(*desc) : len);
+
+	rte_flow_trace_copy(desc, len, attr, items, actions, ret);
+
 	return ret;
 }
@@ -1125,7 +1158,11 @@ rte_flow_get_aged_flows(uint16_t port_id, void
 **contexts,
 		fts_enter(dev);
 		ret = ops->get_aged_flows(dev, contexts, nb_contexts,
 error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_get_aged_flows(port_id, contexts,
 nb_contexts, ret);
+
+		return ret;
lib/ethdev/rte_flow.c +6 -1
 	}
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1147,7 +1184,12 @@ rte_flow_get_q_aged_flows(uint16_t port_id,
 uint32_t queue_id, void **contexts,
 		ret = ops->get_q_aged_flows(dev, queue_id, contexts,
 					    nb_contexts, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_get_q_aged_flows(port_id, queue_id,
 contexts,
+						nb_contexts, ret);
+
+		return ret;
 	}
lib/ethdev/rte_flow.c +8 -1
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1175,6 +1217,9 @@ rte_flow_action_handle_create(uint16_t port_id,
 					   conf, action, error);
 	if (handle == NULL)
 		flow_err(port_id, -rte_errno, error);
+
+	rte_flow_trace_action_handle_create(port_id, conf, action, handle);
+
 	return handle;
 }
 
@@ -1194,7 +1239,11 @@ rte_flow_action_handle_destroy(uint16_t
 port_id,
 					  NULL, rte_strerror(ENOSYS));
 	ret = ops->action_handle_destroy(&rte_eth_devices[port_id],
 					 handle, error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_action_handle_destroy(port_id, handle, ret);
+
+	return ret;
 }
 

int

lib/ethdev/rte_flow.c +5 -1
@@ -1214,7 +1263,11 @@ rte_flow_action_handle_update(uint16_t port_id,
 					  NULL, rte_strerror(ENOSYS));
 	ret = ops->action_handle_update(&rte_eth_devices[port_id],
 handle,
 					update, error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_action_handle_update(port_id, handle, update,
 ret);
+
+	return ret;
 }

int

lib/ethdev/rte_flow.c +25 -9
@@ -1234,7 +1287,11 @@ rte_flow_action_handle_query(uint16_t port_id,
 					  NULL, rte_strerror(ENOSYS));
 	ret = ops->action_handle_query(&rte_eth_devices[port_id], handle,
 				       data, error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_action_handle_query(port_id, handle, data, ret);
+
+	return ret;
 }
 
 int
@@ -1246,14 +1303,20 @@ rte_flow_tunnel_decap_set(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (likely(!!ops->tunnel_decap_set)) {
-		return flow_err(port_id,
-				ops->tunnel_decap_set(dev, tunnel, actions,
-						      num_of_actions, error),
-				error);
+		ret = flow_err(port_id,
+			       ops->tunnel_decap_set(dev, tunnel, actions,
+						     num_of_actions, error),
+			       error);
+
+		rte_flow_trace_tunnel_decap_set(port_id, tunnel, actions,
+						num_of_actions, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1269,14 +1332,20 @@ rte_flow_tunnel_match(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (likely(!!ops->tunnel_match)) {
-		return flow_err(port_id,
-				ops->tunnel_match(dev, tunnel, items,
-						  num_of_items, error),
-				error);
+		ret = flow_err(port_id,
+			       ops->tunnel_match(dev, tunnel, items,
+						 num_of_items, error),
+			       error);
+
+		rte_flow_trace_tunnel_match(port_id, tunnel, items,
 num_of_items,
+					    ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOTSUP,
lib/ethdev/rte_flow.c +9 -4
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1291,14 +1360,19 @@ rte_flow_get_restore_info(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (likely(!!ops->get_restore_info)) {
-		return flow_err(port_id,
-				ops->get_restore_info(dev, m, restore_info,
-						      error),
-				error);
+		ret = flow_err(port_id,
+			       ops->get_restore_info(dev, m, restore_info,
+						     error),
+			       error);
+
+		rte_flow_trace_get_restore_info(port_id, m, restore_info,
 ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOTSUP,
lib/ethdev/rte_flow.c +4 -5
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1313,15 +1387,21 @@ rte_flow_tunnel_action_decap_release(uint16_t
 port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (likely(!!ops->tunnel_action_decap_release)) {
-		return flow_err(port_id,
-				ops->tunnel_action_decap_release(dev,
 actions,
-
 num_of_actions,
-								 error),
-				error);
+		ret = flow_err(port_id,
+			       ops->tunnel_action_decap_release(dev, actions,
+

num_of_actions,

lib/ethdev/rte_flow.c +4 -0
+								error),
+			       error);
+
+		rte_flow_trace_tunnel_action_decap_release(port_id,

actions,

lib/ethdev/rte_flow.c +1 -0
+							   num_of_actions,

ret);

lib/ethdev/rte_flow.c +11 -4
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1336,14 +1416,19 @@ rte_flow_tunnel_item_release(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (likely(!!ops->tunnel_item_release)) {
-		return flow_err(port_id,
-				ops->tunnel_item_release(dev, items,
-							 num_of_items,
 error),
-				error);
+		ret = flow_err(port_id,
+			       ops->tunnel_item_release(dev, items,
+							num_of_items,
 error),
+			       error);
+
+		rte_flow_trace_tunnel_item_release(port_id, items,
 num_of_items, ret);
+
+		return ret;
lib/ethdev/rte_flow.c +1 -0
 	}
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1356,6 +1441,7 @@ rte_flow_pick_transfer_proxy(uint16_t port_id,
 uint16_t *proxy_port_id,
 {
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
 	struct rte_eth_dev *dev;
+	int ret;
 
 	if (unlikely(ops == NULL))
lib/ethdev/rte_flow.c +7 -3
 		return -rte_errno;
@@ -1367,9 +1453,13 @@ rte_flow_pick_transfer_proxy(uint16_t port_id,
 uint16_t *proxy_port_id,
 
 	dev = &rte_eth_devices[port_id];
 
-	return flow_err(port_id,
-			ops->pick_transfer_proxy(dev, proxy_port_id,
 error),
-			error);
+	ret = flow_err(port_id,
+		       ops->pick_transfer_proxy(dev, proxy_port_id, error),
+		       error);
+
+	rte_flow_trace_pick_transfer_proxy(port_id, proxy_port_id, ret);
+
+	return ret;
 }

struct rte_flow_item_flex_handle *

lib/ethdev/rte_flow.c +8 -1
@@ -1392,6 +1482,9 @@ rte_flow_flex_item_create(uint16_t port_id,
 	handle = ops->flex_item_create(dev, conf, error);
 	if (handle == NULL)
 		flow_err(port_id, -rte_errno, error);
+
+	rte_flow_trace_flex_item_create(port_id, conf, handle);
+
 	return handle;
 }
 
@@ -1409,7 +1502,11 @@ rte_flow_flex_item_release(uint16_t port_id,
 
 RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 					  NULL, rte_strerror(ENOTSUP));
 	ret = ops->flex_item_release(dev, handle, error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_flex_item_release(port_id, handle, ret);
+
+	return ret;
 }
 

int

lib/ethdev/rte_flow.c +8 -3
@@ -1420,6 +1517,7 @@ rte_flow_info_get(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
@@ -1434,9 +1532,13 @@ rte_flow_info_get(uint16_t port_id,
 		return -EINVAL;
 	}
 	if (likely(!!ops->info_get)) {
-		return flow_err(port_id,
-				ops->info_get(dev, port_info, queue_info,
 error),
-				error);
+		ret = flow_err(port_id,
+			       ops->info_get(dev, port_info, queue_info,
 error),
+			       error);
+
+		rte_flow_trace_info_get(port_id, port_info, queue_info,
 ret);
+
+		return ret;
lib/ethdev/rte_flow.c +5 -1
 	}
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1480,7 +1582,11 @@ rte_flow_configure(uint16_t port_id,
 		ret = ops->configure(dev, port_attr, nb_queue, queue_attr,
 error);
 		if (ret == 0)
 			dev->data->flow_configured = 1;
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_configure(port_id, port_attr, nb_queue,
 queue_attr, ret);
+
+		return ret;
 	}
lib/ethdev/rte_flow.c +4 -0
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1531,6 +1637,10 @@ rte_flow_pattern_template_create(uint16_t
 port_id,
 							pattern, error);
 		if (template == NULL)
 			flow_err(port_id, -rte_errno, error);
+
+		rte_flow_trace_pattern_template_create(port_id,
 template_attr,
+						       pattern, template);
+
 		return template;
lib/ethdev/rte_flow.c +11 -5
 	}
 	rte_flow_error_set(error, ENOTSUP,
@@ -1546,17 +1656,23 @@ rte_flow_pattern_template_destroy(uint16_t
 port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (unlikely(pattern_template == NULL))
 		return 0;
 	if (likely(!!ops->pattern_template_destroy)) {
-		return flow_err(port_id,
-				ops->pattern_template_destroy(dev,
-							      pattern_template,
-							      error),
-				error);
+		ret = flow_err(port_id,
+			       ops->pattern_template_destroy(dev,
+							     pattern_template,
+							     error),
+			       error);
+
+		rte_flow_trace_pattern_template_destroy(port_id,
 pattern_template,
+							ret);
+
+		return ret;
 	}
lib/ethdev/rte_flow.c +4 -0
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1617,6 +1733,10 @@ rte_flow_actions_template_create(uint16_t
 port_id,
 							actions, masks,
 error);
 		if (template == NULL)
 			flow_err(port_id, -rte_errno, error);
+
+		rte_flow_trace_actions_template_create(port_id,
 template_attr, actions,
+						       masks, template);
+
lib/ethdev/rte_flow.c +11 -5
 		return template;
 	}
 	rte_flow_error_set(error, ENOTSUP,
@@ -1632,17 +1752,23 @@ rte_flow_actions_template_destroy(uint16_t
 port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (unlikely(actions_template == NULL))
 		return 0;
 	if (likely(!!ops->actions_template_destroy)) {
-		return flow_err(port_id,
-				ops->actions_template_destroy(dev,
-							      actions_template,
-							      error),
-				error);
+		ret = flow_err(port_id,
+			       ops->actions_template_destroy(dev,
+							     actions_template,
+							     error),
+			       error);
+
+		rte_flow_trace_actions_template_destroy(port_id,
 actions_template,
+							ret);
+
+		return ret;
 	}
lib/ethdev/rte_flow.c +7 -0
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1707,6 +1833,13 @@ rte_flow_template_table_create(uint16_t
 port_id,
 					error);
 		if (table == NULL)
 			flow_err(port_id, -rte_errno, error);
+
+		rte_flow_trace_template_table_create(port_id, table_attr,
+						     pattern_templates,
+						     nb_pattern_templates,
+						     actions_templates,
+						     nb_actions_templates,
 table);
+
 		return table;
lib/ethdev/rte_flow.c +11 -5
 	}
 	rte_flow_error_set(error, ENOTSUP,
@@ -1722,17 +1855,23 @@ rte_flow_template_table_destroy(uint16_t
 port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (unlikely(template_table == NULL))
 		return 0;
 	if (likely(!!ops->template_table_destroy)) {
-		return flow_err(port_id,
-				ops->template_table_destroy(dev,
-							    template_table,
-							    error),
-				error);
+		ret = flow_err(port_id,
+			       ops->template_table_destroy(dev,
+							   template_table,
+							   error),
+			       error);
+
+		rte_flow_trace_template_table_destroy(port_id,
 template_table,
+						      ret);
+
+		return ret;
 	}
lib/ethdev/rte_flow.c +35 -9
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1762,6 +1901,11 @@ rte_flow_async_create(uint16_t port_id,
 				 user_data, error);
 	if (flow == NULL)
 		flow_err(port_id, -rte_errno, error);
+
+	rte_flow_trace_async_create(port_id, queue_id, op_attr,
 template_table,
+				    pattern, pattern_template_index, actions,
+				    actions_template_index, user_data, flow);
+
 	return flow;
 }
@@ -1775,12 +1919,18 @@ rte_flow_async_destroy(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
-	return flow_err(port_id,
-			ops->async_destroy(dev, queue_id,
-					   op_attr, flow,
-					   user_data, error),
-			error);
+	ret = flow_err(port_id,
+		       ops->async_destroy(dev, queue_id,
+					  op_attr, flow,
+					  user_data, error),
+		       error);
+
+	rte_flow_trace_async_destroy(port_id, queue_id, op_attr, flow,
+				     user_data, ret);
+
+	return ret;
 }
 
 int
@@ -1790,10 +1940,15 @@ rte_flow_push(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
-	return flow_err(port_id,
-			ops->push(dev, queue_id, error),
-			error);
+	ret = flow_err(port_id,
+		       ops->push(dev, queue_id, error),
+		       error);
+
+	rte_flow_trace_push(port_id, queue_id, ret);
+
+	return ret;
 }
 
 int
@@ -1806,9 +1961,14 @@ rte_flow_pull(uint16_t port_id,
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
 	int ret;
+	int rc;
 
 	ret = ops->pull(dev, queue_id, res, n_res, error);
-	return ret ? ret : flow_err(port_id, ret, error);
+	rc = ret ? ret : flow_err(port_id, ret, error);
+
+	rte_flow_trace_pull(port_id, queue_id, res, n_res, rc);
+
+	return rc;
 }
 
 struct rte_flow_action_handle *
@@ -1828,6 +1988,11 @@ rte_flow_async_action_handle_create(uint16_t
 port_id,
 					     indir_action_conf, action,
 user_data, error);
 	if (handle == NULL)
 		flow_err(port_id, -rte_errno, error);
+
+	rte_flow_trace_async_action_handle_create(port_id, queue_id,
 op_attr,
+						  indir_action_conf, action,
+						  user_data, handle);
+
lib/ethdev/rte_flow.c +6 -1
 	return handle;
 }
@@ -1845,7 +2010,12 @@ rte_flow_async_action_handle_destroy(uint16_t
 port_id,
 
 	ret = ops->async_action_handle_destroy(dev, queue_id, op_attr,
 					   action_handle, user_data, error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_async_action_handle_destroy(port_id, queue_id,
 op_attr,
+						   action_handle, user_data,
 ret);
+
+	return ret;

}

int

lib/ethdev/rte_flow.c +7 -1
@@ -1863,7 +2033,13 @@ rte_flow_async_action_handle_update(uint16_t
 port_id,
 
 	ret = ops->async_action_handle_update(dev, queue_id, op_attr,
 					  action_handle, update, user_data,
 error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_async_action_handle_update(port_id, queue_id,
 op_attr,
+						  action_handle, update,
+						  user_data, ret);
+
+	return ret;

}

int

lib/ethdev/rte_flow.c +3 -1
@@ -1881,5 +2057,11 @@ rte_flow_async_action_handle_query(uint16_t
 port_id,
 
 	ret = ops->async_action_handle_query(dev, queue_id, op_attr,
 					  action_handle, data, user_data,
 error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_async_action_handle_query(port_id, queue_id,

op_attr,

lib/ethdev/rte_flow.c +1 -0
+						 action_handle, data,

user_data,

lib/ethdev/rte_flow.c +3 -0
+						 ret);
+
+	return ret;
 }
lib/ethdev/version.map +37 -1
index c7c6bcd42b..0cb8222ad9 100644
@@ -445,6 +445,43 @@ EXPERIMENTAL {
 	__rte_ethdev_trace_udp_tunnel_port_add;
 	__rte_ethdev_trace_udp_tunnel_port_delete;
 	__rte_ethdev_trace_vlan_filter;
+	__rte_flow_trace_action_handle_create;
+	__rte_flow_trace_action_handle_destroy;
+	__rte_flow_trace_action_handle_query;
+	__rte_flow_trace_action_handle_update;
+	__rte_flow_trace_actions_template_create;
+	__rte_flow_trace_actions_template_destroy;
+	__rte_flow_trace_async_action_handle_create;
+	__rte_flow_trace_async_action_handle_destroy;
+	__rte_flow_trace_async_action_handle_update;
+	__rte_flow_trace_async_create;
+	__rte_flow_trace_async_destroy;
+	__rte_flow_trace_conv;
+	__rte_flow_trace_configure;
+	__rte_flow_trace_copy;
+	__rte_flow_trace_create;
+	__rte_flow_trace_destroy;
+	__rte_flow_trace_dynf_metadata_register;
+	__rte_flow_trace_flex_item_create;
+	__rte_flow_trace_flex_item_release;
+	__rte_flow_trace_flush;
+	__rte_flow_trace_get_aged_flows;
+	__rte_flow_trace_get_restore_info;
+	__rte_flow_trace_info_get;
+	__rte_flow_trace_isolate;
+	__rte_flow_trace_pattern_template_create;
+	__rte_flow_trace_pattern_template_destroy;
+	__rte_flow_trace_pick_transfer_proxy;
+	__rte_flow_trace_push;
+	__rte_flow_trace_pull;
+	__rte_flow_trace_query;
+	__rte_flow_trace_template_table_create;
+	__rte_flow_trace_template_table_destroy;
+	__rte_flow_trace_tunnel_action_decap_release;
+	__rte_flow_trace_tunnel_decap_set;
+	__rte_flow_trace_tunnel_item_release;
+	__rte_flow_trace_tunnel_match;
+	__rte_flow_trace_validate;
 };
 
 INTERNAL {
--

2.25.1

#118 lore raw

RE: [PATCH v7 4/6] ethdev: add trace points for flow

Sorry sent before all comments,
Adding missing comments

Quoted 478 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Thursday, 2 February 2023 15:52

Hi Ankur,

Quoted 60 lines

-----Original Message-----
From: Ankur Dwivedi <[email protected]>
Sent: Monday, 23 January 2023 11:02

Adds trace points for rte_flow specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace_points.c | 117 ++++++++++
 lib/ethdev/rte_ethdev_trace.h    | 383
+++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 113 +++++++++
 lib/ethdev/rte_flow.c            | 314 +++++++++++++++++++------
 lib/ethdev/version.map           |  37 +++
 5 files changed, 898 insertions(+), 66 deletions(-)
lib/ethdev/ethdev_trace_points.c +33 -0
index 102a18fcc1..1953d90a5a 100644
@@ -474,3 +474,120 @@
 RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set,
 
 RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_get,
 	lib.ethdev.cman_config_get)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_copy,
+	lib.ethdev.flow.copy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_create,
+	lib.ethdev.flow.create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_destroy,
+	lib.ethdev.flow.destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flush,
+	lib.ethdev.flow.flush)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_isolate,
+	lib.ethdev.flow.isolate)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_query,
+	lib.ethdev.flow.query)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_validate,
+	lib.ethdev.flow.validate)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_conv,
+	lib.ethdev.flow.conv)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_dynf_metadata_register,
+	lib.ethdev.dynf_metadata_register)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_aged_flows,
+	lib.ethdev.flow.get_aged_flows)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_q_aged_flows,
+	lib.ethdev.flow.get_q_aged_flows)

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 519

Quoted 10 lines
lib/ethdev/ethdev_trace_points.c +10 -0
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_decap_set,
+	lib.ethdev.flow.tunnel_decap_set)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_match,
+	lib.ethdev.flow.tunnel_match)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_restore_info,
+	lib.ethdev.flow.get_restore_info)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_action_decap_releas

Quoted 27 lines

e,

lib/ethdev/ethdev_trace_points.c +25 -0
+	lib.ethdev.flow.tunnel_action_decap_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_item_release,
+	lib.ethdev.flow.tunnel_item_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_create,
+	lib.ethdev.flow.action_handle_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_destroy,
+	lib.ethdev.flow.action_handle_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_update,
+	lib.ethdev.flow.action_handle_update)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_query,
+	lib.ethdev.flow.action_handle_query)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_create,
+	lib.ethdev.flow.flex_item_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_release,
+	lib.ethdev.flow.flex_item_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pick_transfer_proxy,
+	lib.ethdev.flow.pick_transfer_proxy)

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 555

Quoted 10 lines
lib/ethdev/ethdev_trace_points.c +10 -0
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_info_get,
+	lib.ethdev.flow.info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_configure,
+	lib.ethdev.flow.configure)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_create,
+	lib.ethdev.flow.pattern_template_create)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_destroy,

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 561

Quoted 6 lines
lib/ethdev/ethdev_trace_points.c +5 -0
+	lib.ethdev.flow.pattern_template_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_create,
+	lib.ethdev.flow.actions_template_create)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_destroy,

Quoted 11 lines
lib/ethdev/ethdev_trace_points.c +10 -0
+	lib.ethdev.flow.actions_template_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_create,
+	lib.ethdev.flow.template_table_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_destroy,
+	lib.ethdev.flow.template_table_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_create,
+	lib.ethdev.flow.async_create)

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 582

Quoted 10 lines
lib/ethdev/ethdev_trace_points.c +10 -0
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_destroy,
+	lib.ethdev.flow.async_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_push,
+	lib.ethdev.flow.push)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pull,
+	lib.ethdev.flow.pull)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_creat

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 585

Quoted 4 lines

e,

lib/ethdev/ethdev_trace_points.c +2 -0
+	lib.ethdev.flow.async_action_handle_create)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_destr

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 588

Quoted 4 lines

oy,

lib/ethdev/ethdev_trace_points.c +2 -0
+	lib.ethdev.flow.async_action_handle_destroy)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_updat

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 591

Quoted 4 lines

e,

lib/ethdev/ethdev_trace_points.c +2 -0
+	lib.ethdev.flow.async_action_handle_update)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_query

Review

Quoted 3 lines

,

lib/ethdev/ethdev_trace_points.c +1 -0
+	lib.ethdev.flow.async.action.handle.query)
(quoted diff) +0 -0

b/lib/ethdev/rte_ethdev_trace.h

Quoted 15 lines

index fa195c5cde..fd4fbaf6de 100644

lib/ethdev/rte_ethdev_trace.h +8 -0
@@ -902,6 +902,389 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_int(ret);
 )
 
+RTE_TRACE_POINT(
+	rte_flow_trace_copy,
+	RTE_TRACE_POINT_ARGS(struct rte_flow_desc *fd, size_t len,
+		const struct rte_flow_attr *attr,
+		const struct rte_flow_item *items,
+		const struct rte_flow_action *actions, int ret),
+	rte_trace_point_emit_ptr(fd);
+	rte_trace_point_emit_size_t(len);

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 922

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_int(items->type);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_int(actions->type);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Quoted 5 lines
lib/ethdev/rte_ethdev_trace.h +4 -0
+	rte_flow_trace_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct
 rte_flow_attr *attr,
+		const struct rte_flow_item *pattern,
+		const struct rte_flow_action *actions, struct rte_flow *flow),

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 936

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(flow);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_destroy,

Part of the datapath should be _FP

Quoted 84 lines
lib/ethdev/rte_ethdev_trace.h +83 -0
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow, int
 ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(flow);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flush,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_validate,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_attr *attr,
+		const struct rte_flow_item *pattern,
+		const struct rte_flow_action *actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_conv,
+	RTE_TRACE_POINT_ARGS(enum rte_flow_conv_op op, void *dst,
+		size_t size, const void *src),
+	rte_trace_point_emit_int(op);
+	rte_trace_point_emit_ptr(dst);
+	rte_trace_point_emit_size_t(size);
+	rte_trace_point_emit_ptr(src);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_dynf_metadata_register,
+	RTE_TRACE_POINT_ARGS(int offset, uint64_t flag),
+	rte_trace_point_emit_int(offset);
+	rte_trace_point_emit_u64(flag);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_decap_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_tunnel *tunnel,
+		struct rte_flow_action **actions,
+		uint32_t *num_of_actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(tunnel);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(num_of_actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_match,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_tunnel *tunnel,
+		struct rte_flow_item **items,
+		uint32_t *num_of_items, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(tunnel);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_ptr(num_of_items);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_action_decap_release,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_action *actions,
+		uint32_t num_of_actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_u32(num_of_actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_item_release,

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1029

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_item *items,
+		uint32_t num_of_items, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_u32(num_of_items);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	rte_flow_trace_action_handle_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_indir_action_conf *conf,
+		const struct rte_flow_action *action,
+		struct rte_flow_action_handle *handle),
+	uint32_t ingress = conf->ingress;
+	uint32_t egress = conf->egress;
+	uint32_t transfer = conf->transfer;
+
+	rte_trace_point_emit_u16(port_id);

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1049

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(ingress);
+	rte_trace_point_emit_u32(egress);
+	rte_trace_point_emit_u32(transfer);
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_int(action->type);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Quoted 150 lines
lib/ethdev/rte_ethdev_trace.h +91 -0
+	rte_flow_trace_action_handle_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_action_handle *handle, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flex_item_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_item_flex_conf *conf,
+		struct rte_flow_item_flex_handle *handle),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_int(conf->tunnel);
+	rte_trace_point_emit_int(conf->nb_samples);
+	rte_trace_point_emit_int(conf->nb_inputs);
+	rte_trace_point_emit_int(conf->nb_outputs);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flex_item_release,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_item_flex_handle *handle, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_info_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_port_info *port_info,
+		struct rte_flow_queue_info *queue_info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(port_info);
+	rte_trace_point_emit_u32(port_info->max_nb_queues);
+	rte_trace_point_emit_u32(port_info->max_nb_counters);
+	rte_trace_point_emit_u32(port_info->max_nb_aging_objects);
+	rte_trace_point_emit_u32(port_info->max_nb_meters);
+	rte_trace_point_emit_u32(port_info->max_nb_conn_tracks);
+	rte_trace_point_emit_u32(port_info->supported_flags);
+	rte_trace_point_emit_ptr(queue_info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_configure,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_port_attr *port_attr,
+		uint16_t nb_queue,
+		const struct rte_flow_queue_attr **queue_attr, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(port_attr);
+	rte_trace_point_emit_u32(port_attr->nb_counters);
+	rte_trace_point_emit_u32(port_attr->nb_aging_objects);
+	rte_trace_point_emit_u32(port_attr->nb_meters);
+	rte_trace_point_emit_u32(port_attr->nb_conn_tracks);
+	rte_trace_point_emit_u32(port_attr->flags);
+	rte_trace_point_emit_u16(nb_queue);
+	rte_trace_point_emit_ptr(queue_attr);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_pattern_template_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_pattern_template_attr
 *template_attr,
+		const struct rte_flow_item *pattern,
+		void *tmplate),
+	uint32_t relaxed_matching = template_attr->relaxed_matching;
+	uint32_t ingress = template_attr->ingress;
+	uint32_t egress = template_attr->egress;
+	uint32_t transfer = template_attr->transfer;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_attr);
+	rte_trace_point_emit_u32(relaxed_matching);
+	rte_trace_point_emit_u32(ingress);
+	rte_trace_point_emit_u32(egress);
+	rte_trace_point_emit_u32(transfer);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(tmplate);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_pattern_template_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_pattern_template *pattern_template, int

ret),

lib/ethdev/rte_ethdev_trace.h +30 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(pattern_template);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_actions_template_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_actions_template_attr *template_attr,
+		const struct rte_flow_action *actions,
+		const struct rte_flow_action *masks,
+		void *tmplate),
+	uint32_t ingress = template_attr->ingress;
+	uint32_t egress = template_attr->egress;
+	uint32_t transfer = template_attr->transfer;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_attr);
+	rte_trace_point_emit_u32(ingress);
+	rte_trace_point_emit_u32(egress);
+	rte_trace_point_emit_u32(transfer);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(masks);
+	rte_trace_point_emit_ptr(tmplate);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_actions_template_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_actions_template *actions_template, int

ret),

lib/ethdev/rte_ethdev_trace.h +26 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(actions_template);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_template_table_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_template_table_attr *table_attr,
+		struct rte_flow_pattern_template **pattern_templates,
+		uint8_t nb_pattern_templates,
+		struct rte_flow_actions_template **actions_templates,
+		uint8_t nb_actions_templates,
+		struct rte_flow_template_table *table),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(table_attr);
+	rte_trace_point_emit_u32(table_attr->nb_flows);
+	rte_trace_point_emit_ptr(pattern_templates);
+	rte_trace_point_emit_u8(nb_pattern_templates);
+	rte_trace_point_emit_ptr(actions_templates);
+	rte_trace_point_emit_u8(nb_actions_templates);
+	rte_trace_point_emit_ptr(table);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_template_table_destroy,
Quoted 8 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1204

Quoted 8 lines
lib/ethdev/rte_ethdev_trace.h +8 -0
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_template_table *template_table, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_table);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Quoted 36 lines
Quoted 36 lines
lib/ethdev/rte_ethdev_trace.h +36 -0
+	rte_flow_trace_async_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow_template_table *template_table,
+		const struct rte_flow_item *pattern,
+		uint8_t pattern_template_index,
+		const struct rte_flow_action *actions,
+		uint8_t actions_template_index,
+		void *user_data, 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_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(
+	rte_flow_trace_async_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow *flow, void *user_data, int ret),
+	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(flow);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_push,
Quoted 8 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1239

Quoted 8 lines
lib/ethdev/rte_ethdev_trace.h +1 -0
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, int

ret),

lib/ethdev/rte_ethdev_trace.h +6 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Quoted 11 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1258

Quoted 11 lines
lib/ethdev/rte_ethdev_trace.h +11 -0
+	rte_flow_trace_pull,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		struct rte_flow_op_result *res, uint16_t n_res, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_ptr(res);
+	rte_trace_point_emit_u16(n_res);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Quoted 8 lines
Quoted 8 lines
lib/ethdev/rte_ethdev_trace.h +8 -0
+	rte_flow_trace_async_action_handle_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_indir_action_conf *indir_action_conf,
+		const struct rte_flow_action *action,
+		void *user_data, struct rte_flow_action_handle *handle),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
Quoted 8 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1274

Quoted 8 lines
lib/ethdev/rte_ethdev_trace.h +8 -0
+	rte_trace_point_emit_ptr(op_attr);
+	rte_trace_point_emit_ptr(indir_action_conf);
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Quoted 905 lines

lib/ethdev/rte_flow.c rte_flow_action_handle_update(uint16_t

Quoted 319 lines
lib/ethdev/rte_ethdev_trace.h +13 -0
+	rte_flow_trace_async_action_handle_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow_action_handle *action_handle,
+		void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
 #ifdef __cplusplus
 }
 #endif
lib/ethdev/rte_ethdev_trace_fp.h +113 -0
index d4b2e4b312..c5b8083de2 100644
@@ -646,6 +646,119 @@ RTE_TRACE_POINT_FP(
 	rte_trace_point_emit_int(ret);
 )
 
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow,
+		const struct rte_flow_action *action, void *data, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(flow);
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_int(action->type);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_isolate,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int set, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(set);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_restore_info,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_mbuf *m, struct rte_flow_restore_info *info,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(m);
+	rte_trace_point_emit_ptr(info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_aged_flows,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, void **contexts,
+		uint32_t nb_contexts, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(contexts);
+	rte_trace_point_emit_u32(nb_contexts);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_q_aged_flows,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, void
 **contexts,
+		uint32_t nb_contexts, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_ptr(contexts);
+	rte_trace_point_emit_u32(nb_contexts);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_action_handle_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_action_handle *handle,
+		const void *update, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_ptr(update);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_action_handle_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_action_handle *handle,
+		void *data, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_pick_transfer_proxy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t
 *proxy_port_id,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(proxy_port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_action_handle_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow_action_handle *action_handle,
+		const void *update, void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(update);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_action_handle_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_action_handle *action_handle,
+		void *data, void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
 #ifdef __cplusplus

}
#endif

lib/ethdev/rte_flow.c +13 -1
index 7d0c24366c..43f13f79b4 100644
@@ -13,6 +13,8 @@
 #include <rte_string_fns.h>
 #include <rte_mbuf_dyn.h>
 #include "rte_ethdev.h"
+#include "rte_ethdev_trace.h"
+#include "rte_ethdev_trace_fp.h"
 #include "rte_flow_driver.h"
 #include "rte_flow.h"
 
@@ -276,6 +278,9 @@ rte_flow_dynf_metadata_register(void)
 		goto error;
 	rte_flow_dynf_metadata_offs = offset;
 	rte_flow_dynf_metadata_mask = RTE_BIT64(flag);
+
+	rte_flow_trace_dynf_metadata_register(offset, RTE_BIT64(flag));
+
 	return 0;
 
 error:
@@ -362,7 +367,11 @@ rte_flow_validate(uint16_t port_id,
 		fts_enter(dev);
 		ret = ops->validate(dev, attr, pattern, actions, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_validate(port_id, attr, pattern, actions, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOSYS,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -389,6 +398,9 @@ rte_flow_create(uint16_t port_id,
 		fts_exit(dev);
 		if (flow == NULL)
 			flow_err(port_id, -rte_errno, error);
+
+		rte_flow_trace_create(port_id, attr, pattern, actions, flow);
+
 		return flow;
 	}
 	rte_flow_error_set(error, ENOSYS,

RTE_FLOW_ERROR_TYPE_UNSPECIFIED,

lib/ethdev/rte_flow.c +30 -5
@@ -412,7 +424,11 @@ rte_flow_destroy(uint16_t port_id,
 		fts_enter(dev);
 		ret = ops->destroy(dev, flow, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_destroy(port_id, flow, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOSYS,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -434,7 +450,11 @@ rte_flow_flush(uint16_t port_id,
 		fts_enter(dev);
 		ret = ops->flush(dev, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_flush(port_id, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOSYS,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -459,7 +479,11 @@ rte_flow_query(uint16_t port_id,
 		fts_enter(dev);
 		ret = ops->query(dev, flow, action, data, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_query(port_id, flow, action, data, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOSYS,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -482,7 +506,11 @@ rte_flow_isolate(uint16_t port_id,
 		fts_enter(dev);
 		ret = ops->isolate(dev, set, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_isolate(port_id, set, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOSYS,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1003,6 +1031,8 @@ rte_flow_conv(enum rte_flow_conv_op op,
 	      const void *src,
 	      struct rte_flow_error *error)
 {
+	rte_flow_trace_conv(op, dst, size, src);
+
 	switch (op) {
 		const struct rte_flow_attr *attr;
 
@@ -1087,6 +1117,9 @@ rte_flow_copy(struct rte_flow_desc *desc, size_t
 len,
 			.actions = dst_size ? dst->actions : NULL,
 		   }),
 		   len > sizeof(*desc) ? sizeof(*desc) : len);
+
+	rte_flow_trace_copy(desc, len, attr, items, actions, ret);
+
 	return ret;
 }
@@ -1125,7 +1158,11 @@ rte_flow_get_aged_flows(uint16_t port_id, void
 **contexts,
 		fts_enter(dev);
 		ret = ops->get_aged_flows(dev, contexts, nb_contexts,
 error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_get_aged_flows(port_id, contexts,
 nb_contexts, ret);
+
+		return ret;
lib/ethdev/rte_flow.c +6 -1
 	}
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1147,7 +1184,12 @@ rte_flow_get_q_aged_flows(uint16_t port_id,
 uint32_t queue_id, void **contexts,
 		ret = ops->get_q_aged_flows(dev, queue_id, contexts,
 					    nb_contexts, error);
 		fts_exit(dev);
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_get_q_aged_flows(port_id, queue_id,
 contexts,
+						nb_contexts, ret);
+
+		return ret;
 	}
lib/ethdev/rte_flow.c +8 -1
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1175,6 +1217,9 @@ rte_flow_action_handle_create(uint16_t port_id,
 					   conf, action, error);
 	if (handle == NULL)
 		flow_err(port_id, -rte_errno, error);
+
+	rte_flow_trace_action_handle_create(port_id, conf, action, handle);
+
 	return handle;
 }
 
@@ -1194,7 +1239,11 @@ rte_flow_action_handle_destroy(uint16_t
 port_id,
 					  NULL, rte_strerror(ENOSYS));
 	ret = ops->action_handle_destroy(&rte_eth_devices[port_id],
 					 handle, error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_action_handle_destroy(port_id, handle, ret);
+
+	return ret;
 }
 

int

lib/ethdev/rte_flow.c +0 -0
@@ -1214,7 +1263,11 @@ rte_flow_action_handle_update(uint16_t

port_id,

lib/ethdev/rte_flow.c rte_flow_action_handle_query(uint16_t

Quoted 15 lines
lib/ethdev/rte_flow.c +5 -1
 					  NULL, rte_strerror(ENOSYS));
 	ret = ops->action_handle_update(&rte_eth_devices[port_id],
 handle,
 					update, error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_action_handle_update(port_id, handle, update,
 ret);
+
+	return ret;
 }

int

lib/ethdev/rte_flow.c +0 -0
@@ -1234,7 +1287,11 @@ rte_flow_action_handle_query(uint16_t

port_id,

lib/ethdev/rte_flow.c

Quoted 89 lines
lib/ethdev/rte_flow.c +25 -9
 					  NULL, rte_strerror(ENOSYS));
 	ret = ops->action_handle_query(&rte_eth_devices[port_id], handle,
 				       data, error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_action_handle_query(port_id, handle, data, ret);
+
+	return ret;
 }
 
 int
@@ -1246,14 +1303,20 @@ rte_flow_tunnel_decap_set(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (likely(!!ops->tunnel_decap_set)) {
-		return flow_err(port_id,
-				ops->tunnel_decap_set(dev, tunnel, actions,
-						      num_of_actions, error),
-				error);
+		ret = flow_err(port_id,
+			       ops->tunnel_decap_set(dev, tunnel, actions,
+						     num_of_actions, error),
+			       error);
+
+		rte_flow_trace_tunnel_decap_set(port_id, tunnel, actions,
+						num_of_actions, ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1269,14 +1332,20 @@ rte_flow_tunnel_match(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (likely(!!ops->tunnel_match)) {
-		return flow_err(port_id,
-				ops->tunnel_match(dev, tunnel, items,
-						  num_of_items, error),
-				error);
+		ret = flow_err(port_id,
+			       ops->tunnel_match(dev, tunnel, items,
+						 num_of_items, error),
+			       error);
+
+		rte_flow_trace_tunnel_match(port_id, tunnel, items,
 num_of_items,
+					    ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOTSUP,
lib/ethdev/rte_flow.c +9 -4
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1291,14 +1360,19 @@ rte_flow_get_restore_info(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (likely(!!ops->get_restore_info)) {
-		return flow_err(port_id,
-				ops->get_restore_info(dev, m, restore_info,
-						      error),
-				error);
+		ret = flow_err(port_id,
+			       ops->get_restore_info(dev, m, restore_info,
+						     error),
+			       error);
+
+		rte_flow_trace_get_restore_info(port_id, m, restore_info,
 ret);
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOTSUP,
lib/ethdev/rte_flow.c +0 -0
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1313,15 +1387,21 @@

rte_flow_tunnel_action_decap_release(uint16_t

lib/ethdev/rte_flow.c rte_flow_tunnel_item_release(uint16_t

Quoted 33 lines
lib/ethdev/rte_flow.c +4 -5
 port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (likely(!!ops->tunnel_action_decap_release)) {
-		return flow_err(port_id,
-				ops->tunnel_action_decap_release(dev,
 actions,
-
 num_of_actions,
-								 error),
-				error);
+		ret = flow_err(port_id,
+			       ops->tunnel_action_decap_release(dev, actions,
+

num_of_actions,

lib/ethdev/rte_flow.c +4 -0
+								error),
+			       error);
+
+		rte_flow_trace_tunnel_action_decap_release(port_id,

actions,

lib/ethdev/rte_flow.c +1 -0
+							   num_of_actions,

ret);

lib/ethdev/rte_flow.c +2 -0
+
+		return ret;
 	}
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1336,14 +1416,19 @@ rte_flow_tunnel_item_release(uint16_t

port_id,

lib/ethdev/rte_flow.c

Quoted 345 lines
lib/ethdev/rte_flow.c +9 -4
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (likely(!!ops->tunnel_item_release)) {
-		return flow_err(port_id,
-				ops->tunnel_item_release(dev, items,
-							 num_of_items,
 error),
-				error);
+		ret = flow_err(port_id,
+			       ops->tunnel_item_release(dev, items,
+							num_of_items,
 error),
+			       error);
+
+		rte_flow_trace_tunnel_item_release(port_id, items,
 num_of_items, ret);
+
+		return ret;
lib/ethdev/rte_flow.c +1 -0
 	}
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1356,6 +1441,7 @@ rte_flow_pick_transfer_proxy(uint16_t port_id,
 uint16_t *proxy_port_id,
 {
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
 	struct rte_eth_dev *dev;
+	int ret;
 
 	if (unlikely(ops == NULL))
lib/ethdev/rte_flow.c +7 -3
 		return -rte_errno;
@@ -1367,9 +1453,13 @@ rte_flow_pick_transfer_proxy(uint16_t port_id,
 uint16_t *proxy_port_id,
 
 	dev = &rte_eth_devices[port_id];
 
-	return flow_err(port_id,
-			ops->pick_transfer_proxy(dev, proxy_port_id,
 error),
-			error);
+	ret = flow_err(port_id,
+		       ops->pick_transfer_proxy(dev, proxy_port_id, error),
+		       error);
+
+	rte_flow_trace_pick_transfer_proxy(port_id, proxy_port_id, ret);
+
+	return ret;
 }

struct rte_flow_item_flex_handle *

lib/ethdev/rte_flow.c +8 -1
@@ -1392,6 +1482,9 @@ rte_flow_flex_item_create(uint16_t port_id,
 	handle = ops->flex_item_create(dev, conf, error);
 	if (handle == NULL)
 		flow_err(port_id, -rte_errno, error);
+
+	rte_flow_trace_flex_item_create(port_id, conf, handle);
+
 	return handle;
 }
 
@@ -1409,7 +1502,11 @@ rte_flow_flex_item_release(uint16_t port_id,
 
 RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 					  NULL, rte_strerror(ENOTSUP));
 	ret = ops->flex_item_release(dev, handle, error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_flex_item_release(port_id, handle, ret);
+
+	return ret;
 }
 

int

lib/ethdev/rte_flow.c +8 -3
@@ -1420,6 +1517,7 @@ rte_flow_info_get(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
@@ -1434,9 +1532,13 @@ rte_flow_info_get(uint16_t port_id,
 		return -EINVAL;
 	}
 	if (likely(!!ops->info_get)) {
-		return flow_err(port_id,
-				ops->info_get(dev, port_info, queue_info,
 error),
-				error);
+		ret = flow_err(port_id,
+			       ops->info_get(dev, port_info, queue_info,
 error),
+			       error);
+
+		rte_flow_trace_info_get(port_id, port_info, queue_info,
 ret);
+
+		return ret;
lib/ethdev/rte_flow.c +5 -1
 	}
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1480,7 +1582,11 @@ rte_flow_configure(uint16_t port_id,
 		ret = ops->configure(dev, port_attr, nb_queue, queue_attr,
 error);
 		if (ret == 0)
 			dev->data->flow_configured = 1;
-		return flow_err(port_id, ret, error);
+		ret = flow_err(port_id, ret, error);
+
+		rte_flow_trace_configure(port_id, port_attr, nb_queue,
 queue_attr, ret);
+
+		return ret;
 	}
lib/ethdev/rte_flow.c +4 -0
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1531,6 +1637,10 @@ rte_flow_pattern_template_create(uint16_t
 port_id,
 							pattern, error);
 		if (template == NULL)
 			flow_err(port_id, -rte_errno, error);
+
+		rte_flow_trace_pattern_template_create(port_id,
 template_attr,
+						       pattern, template);
+
 		return template;
lib/ethdev/rte_flow.c +11 -5
 	}
 	rte_flow_error_set(error, ENOTSUP,
@@ -1546,17 +1656,23 @@ rte_flow_pattern_template_destroy(uint16_t
 port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (unlikely(pattern_template == NULL))
 		return 0;
 	if (likely(!!ops->pattern_template_destroy)) {
-		return flow_err(port_id,
-				ops->pattern_template_destroy(dev,
-							      pattern_template,
-							      error),
-				error);
+		ret = flow_err(port_id,
+			       ops->pattern_template_destroy(dev,
+							     pattern_template,
+							     error),
+			       error);
+
+		rte_flow_trace_pattern_template_destroy(port_id,
 pattern_template,
+							ret);
+
+		return ret;
 	}
lib/ethdev/rte_flow.c +4 -0
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1617,6 +1733,10 @@ rte_flow_actions_template_create(uint16_t
 port_id,
 							actions, masks,
 error);
 		if (template == NULL)
 			flow_err(port_id, -rte_errno, error);
+
+		rte_flow_trace_actions_template_create(port_id,
 template_attr, actions,
+						       masks, template);
+
lib/ethdev/rte_flow.c +11 -5
 		return template;
 	}
 	rte_flow_error_set(error, ENOTSUP,
@@ -1632,17 +1752,23 @@ rte_flow_actions_template_destroy(uint16_t
 port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (unlikely(actions_template == NULL))
 		return 0;
 	if (likely(!!ops->actions_template_destroy)) {
-		return flow_err(port_id,
-				ops->actions_template_destroy(dev,
-							      actions_template,
-							      error),
-				error);
+		ret = flow_err(port_id,
+			       ops->actions_template_destroy(dev,
+							     actions_template,
+							     error),
+			       error);
+
+		rte_flow_trace_actions_template_destroy(port_id,
 actions_template,
+							ret);
+
+		return ret;
 	}
lib/ethdev/rte_flow.c +7 -0
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1707,6 +1833,13 @@ rte_flow_template_table_create(uint16_t
 port_id,
 					error);
 		if (table == NULL)
 			flow_err(port_id, -rte_errno, error);
+
+		rte_flow_trace_template_table_create(port_id, table_attr,
+						     pattern_templates,
+						     nb_pattern_templates,
+						     actions_templates,
+						     nb_actions_templates,
 table);
+
 		return table;
lib/ethdev/rte_flow.c +11 -5
 	}
 	rte_flow_error_set(error, ENOTSUP,
@@ -1722,17 +1855,23 @@ rte_flow_template_table_destroy(uint16_t
 port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
 	if (unlikely(!ops))
 		return -rte_errno;
 	if (unlikely(template_table == NULL))
 		return 0;
 	if (likely(!!ops->template_table_destroy)) {
-		return flow_err(port_id,
-				ops->template_table_destroy(dev,
-							    template_table,
-							    error),
-				error);
+		ret = flow_err(port_id,
+			       ops->template_table_destroy(dev,
+							   template_table,
+							   error),
+			       error);
+
+		rte_flow_trace_template_table_destroy(port_id,
 template_table,
+						      ret);
+
+		return ret;
 	}
lib/ethdev/rte_flow.c +35 -9
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -1762,6 +1901,11 @@ rte_flow_async_create(uint16_t port_id,
 				 user_data, error);
 	if (flow == NULL)
 		flow_err(port_id, -rte_errno, error);
+
+	rte_flow_trace_async_create(port_id, queue_id, op_attr,
 template_table,
+				    pattern, pattern_template_index, actions,
+				    actions_template_index, user_data, flow);
+
 	return flow;
 }
@@ -1775,12 +1919,18 @@ rte_flow_async_destroy(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
-	return flow_err(port_id,
-			ops->async_destroy(dev, queue_id,
-					   op_attr, flow,
-					   user_data, error),
-			error);
+	ret = flow_err(port_id,
+		       ops->async_destroy(dev, queue_id,
+					  op_attr, flow,
+					  user_data, error),
+		       error);
+
+	rte_flow_trace_async_destroy(port_id, queue_id, op_attr, flow,
+				     user_data, ret);
+
+	return ret;
 }
 
 int
@@ -1790,10 +1940,15 @@ rte_flow_push(uint16_t port_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+	int ret;
 
-	return flow_err(port_id,
-			ops->push(dev, queue_id, error),
-			error);
+	ret = flow_err(port_id,
+		       ops->push(dev, queue_id, error),
+		       error);
+
+	rte_flow_trace_push(port_id, queue_id, ret);
+
+	return ret;
 }
 
 int
@@ -1806,9 +1961,14 @@ rte_flow_pull(uint16_t port_id,
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
 	int ret;
+	int rc;
 
 	ret = ops->pull(dev, queue_id, res, n_res, error);
-	return ret ? ret : flow_err(port_id, ret, error);
+	rc = ret ? ret : flow_err(port_id, ret, error);
+
+	rte_flow_trace_pull(port_id, queue_id, res, n_res, rc);
+
+	return rc;
 }
 
 struct rte_flow_action_handle *
@@ -1828,6 +1988,11 @@ rte_flow_async_action_handle_create(uint16_t
 port_id,
 					     indir_action_conf, action,
 user_data, error);
 	if (handle == NULL)
 		flow_err(port_id, -rte_errno, error);
+
+	rte_flow_trace_async_action_handle_create(port_id, queue_id,
 op_attr,
+						  indir_action_conf, action,
+						  user_data, handle);
+
lib/ethdev/rte_flow.c +0 -0
 	return handle;
 }
@@ -1845,7 +2010,12 @@

rte_flow_async_action_handle_destroy(uint16_t

lib/ethdev/rte_flow.c

Quoted 17 lines
lib/ethdev/rte_flow.c +6 -1
 port_id,
 
 	ret = ops->async_action_handle_destroy(dev, queue_id, op_attr,
 					   action_handle, user_data, error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_async_action_handle_destroy(port_id, queue_id,
 op_attr,
+						   action_handle, user_data,
 ret);
+
+	return ret;

}

int

lib/ethdev/rte_flow.c +0 -0
@@ -1863,7 +2033,13 @@

rte_flow_async_action_handle_update(uint16_t

Quoted 81 lines
lib/ethdev/rte_flow.c +7 -1
 port_id,
 
 	ret = ops->async_action_handle_update(dev, queue_id, op_attr,
 					  action_handle, update, user_data,
 error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_async_action_handle_update(port_id, queue_id,
 op_attr,
+						  action_handle, update,
+						  user_data, ret);
+
+	return ret;

}

int

lib/ethdev/rte_flow.c +3 -1
@@ -1881,5 +2057,11 @@ rte_flow_async_action_handle_query(uint16_t
 port_id,
 
 	ret = ops->async_action_handle_query(dev, queue_id, op_attr,
 					  action_handle, data, user_data,
 error);
-	return flow_err(port_id, ret, error);
+	ret = flow_err(port_id, ret, error);
+
+	rte_flow_trace_async_action_handle_query(port_id, queue_id,

op_attr,

lib/ethdev/rte_flow.c +1 -0
+						 action_handle, data,

user_data,

lib/ethdev/rte_flow.c +3 -0
+						 ret);
+
+	return ret;
 }
lib/ethdev/version.map +37 -0
index c7c6bcd42b..0cb8222ad9 100644
@@ -445,6 +445,43 @@ EXPERIMENTAL {
 	__rte_ethdev_trace_udp_tunnel_port_add;
 	__rte_ethdev_trace_udp_tunnel_port_delete;
 	__rte_ethdev_trace_vlan_filter;
+	__rte_flow_trace_action_handle_create;
+	__rte_flow_trace_action_handle_destroy;
+	__rte_flow_trace_action_handle_query;
+	__rte_flow_trace_action_handle_update;
+	__rte_flow_trace_actions_template_create;
+	__rte_flow_trace_actions_template_destroy;
+	__rte_flow_trace_async_action_handle_create;
+	__rte_flow_trace_async_action_handle_destroy;
+	__rte_flow_trace_async_action_handle_update;
+	__rte_flow_trace_async_create;
+	__rte_flow_trace_async_destroy;
+	__rte_flow_trace_conv;
+	__rte_flow_trace_configure;
+	__rte_flow_trace_copy;
+	__rte_flow_trace_create;
+	__rte_flow_trace_destroy;
+	__rte_flow_trace_dynf_metadata_register;
+	__rte_flow_trace_flex_item_create;
+	__rte_flow_trace_flex_item_release;
+	__rte_flow_trace_flush;
+	__rte_flow_trace_get_aged_flows;
+	__rte_flow_trace_get_restore_info;
+	__rte_flow_trace_info_get;
+	__rte_flow_trace_isolate;
+	__rte_flow_trace_pattern_template_create;
+	__rte_flow_trace_pattern_template_destroy;
+	__rte_flow_trace_pick_transfer_proxy;
+	__rte_flow_trace_push;
+	__rte_flow_trace_pull;
+	__rte_flow_trace_query;
+	__rte_flow_trace_template_table_create;
+	__rte_flow_trace_template_table_destroy;
+	__rte_flow_trace_tunnel_action_decap_release;
+	__rte_flow_trace_tunnel_decap_set;
+	__rte_flow_trace_tunnel_item_release;
+	__rte_flow_trace_tunnel_match;
+	__rte_flow_trace_validate;
 };
 
Quoted 3 lines
Quoted 3 lines
lib/ethdev/version.map +0 -1
 INTERNAL {
--

2.25.1

Thanks,
Ori

#119 lore raw

RE: [PATCH v7 4/6] ethdev: add trace points for flow

Quoted 199 lines

Subject: [EXT] RE: [PATCH v7 4/6] ethdev: add trace points for flow

External Email

----------------------------------------------------------------------
Sorry sent before all comments,
Adding missing comments

Quoted 190 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Thursday, 2 February 2023 15:52

Hi Ankur,

Quoted 60 lines

-----Original Message-----
From: Ankur Dwivedi <[email protected]>
Sent: Monday, 23 January 2023 11:02

Adds trace points for rte_flow specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace_points.c | 117 ++++++++++
 lib/ethdev/rte_ethdev_trace.h    | 383
+++++++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 113 +++++++++
 lib/ethdev/rte_flow.c            | 314 +++++++++++++++++++------
 lib/ethdev/version.map           |  37 +++
 5 files changed, 898 insertions(+), 66 deletions(-)
lib/ethdev/ethdev_trace_points.c +33 -0
index 102a18fcc1..1953d90a5a 100644
@@ -474,3 +474,120 @@
 RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set,
 
 RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_get,
 	lib.ethdev.cman_config_get)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_copy,
+	lib.ethdev.flow.copy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_create,
+	lib.ethdev.flow.create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_destroy,
+	lib.ethdev.flow.destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flush,
+	lib.ethdev.flow.flush)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_isolate,
+	lib.ethdev.flow.isolate)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_query,
+	lib.ethdev.flow.query)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_validate,
+	lib.ethdev.flow.validate)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_conv,
+	lib.ethdev.flow.conv)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_dynf_metadata_register,
+	lib.ethdev.dynf_metadata_register)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_aged_flows,
+	lib.ethdev.flow.get_aged_flows)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_q_aged_flows,
+	lib.ethdev.flow.get_q_aged_flows)

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 519

Quoted 10 lines
lib/ethdev/ethdev_trace_points.c +10 -0
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_decap_set,
+	lib.ethdev.flow.tunnel_decap_set)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_match,
+	lib.ethdev.flow.tunnel_match)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_restore_info,
+	lib.ethdev.flow.get_restore_info)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_action_decap_releas

Quoted 27 lines

e,

lib/ethdev/ethdev_trace_points.c +25 -0
+	lib.ethdev.flow.tunnel_action_decap_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_item_release,
+	lib.ethdev.flow.tunnel_item_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_create,
+	lib.ethdev.flow.action_handle_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_destroy,
+	lib.ethdev.flow.action_handle_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_update,
+	lib.ethdev.flow.action_handle_update)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_query,
+	lib.ethdev.flow.action_handle_query)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_create,
+	lib.ethdev.flow.flex_item_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_release,
+	lib.ethdev.flow.flex_item_release)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pick_transfer_proxy,
+	lib.ethdev.flow.pick_transfer_proxy)

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 555

Quoted 10 lines
lib/ethdev/ethdev_trace_points.c +10 -0
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_info_get,
+	lib.ethdev.flow.info_get)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_configure,
+	lib.ethdev.flow.configure)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_create,
+	lib.ethdev.flow.pattern_template_create)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_destroy,

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 561

Quoted 6 lines
lib/ethdev/ethdev_trace_points.c +5 -0
+	lib.ethdev.flow.pattern_template_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_create,
+	lib.ethdev.flow.actions_template_create)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_destroy,

Quoted 11 lines
lib/ethdev/ethdev_trace_points.c +10 -0
+	lib.ethdev.flow.actions_template_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_create,
+	lib.ethdev.flow.template_table_create)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_destroy,
+	lib.ethdev.flow.template_table_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_create,
+	lib.ethdev.flow.async_create)

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 582

Quoted 10 lines
lib/ethdev/ethdev_trace_points.c +10 -0
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_destroy,
+	lib.ethdev.flow.async_destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_push,
+	lib.ethdev.flow.push)
+
+RTE_TRACE_POINT_REGISTER(rte_flow_trace_pull,
+	lib.ethdev.flow.pull)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_creat

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 585

Quoted 4 lines

e,

lib/ethdev/ethdev_trace_points.c +2 -0
+	lib.ethdev.flow.async_action_handle_create)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_destr

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 588

Quoted 4 lines

oy,

lib/ethdev/ethdev_trace_points.c +2 -0
+	lib.ethdev.flow.async_action_handle_destroy)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_updat

lib/ethdev/ethdev_trace_points.c RTE_TRACE_POINT_REGISTER(rte_eth_trace_cman_config_set, · line 591

Quoted 4 lines

e,

lib/ethdev/ethdev_trace_points.c +2 -0
+	lib.ethdev.flow.async_action_handle_update)
+

+RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_query

Review

Quoted 3 lines

,

lib/ethdev/ethdev_trace_points.c +1 -0
+	lib.ethdev.flow.async.action.handle.query)
(quoted diff) +0 -0

b/lib/ethdev/rte_ethdev_trace.h

Quoted 15 lines

index fa195c5cde..fd4fbaf6de 100644

lib/ethdev/rte_ethdev_trace.h +8 -0
@@ -902,6 +902,389 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_int(ret);
 )
 
+RTE_TRACE_POINT(
+	rte_flow_trace_copy,
+	RTE_TRACE_POINT_ARGS(struct rte_flow_desc *fd, size_t len,
+		const struct rte_flow_attr *attr,
+		const struct rte_flow_item *items,
+		const struct rte_flow_action *actions, int ret),
+	rte_trace_point_emit_ptr(fd);
+	rte_trace_point_emit_size_t(len);

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 922

Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_int(items->type);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_int(actions->type);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Will make it as fastpath.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +8 -0
+	rte_flow_trace_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct
 rte_flow_attr *attr,
+		const struct rte_flow_item *pattern,
+		const struct rte_flow_action *actions, struct rte_flow *flow),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(pattern);
Quoted 8 lines
Quoted 8 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 936

Quoted 6 lines
lib/ethdev/rte_ethdev_trace.h +6 -0
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(flow);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_destroy,

Part of the datapath should be _FP

Will make it as fastpath.

Quoted 89 lines
Quoted 89 lines
Quoted 89 lines
lib/ethdev/rte_ethdev_trace.h +87 -0
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow, int
 ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(flow);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flush,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_validate,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_attr *attr,
+		const struct rte_flow_item *pattern,
+		const struct rte_flow_action *actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_conv,
+	RTE_TRACE_POINT_ARGS(enum rte_flow_conv_op op, void *dst,
+		size_t size, const void *src),
+	rte_trace_point_emit_int(op);
+	rte_trace_point_emit_ptr(dst);
+	rte_trace_point_emit_size_t(size);
+	rte_trace_point_emit_ptr(src);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_dynf_metadata_register,
+	RTE_TRACE_POINT_ARGS(int offset, uint64_t flag),
+	rte_trace_point_emit_int(offset);
+	rte_trace_point_emit_u64(flag);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_decap_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_tunnel *tunnel,
+		struct rte_flow_action **actions,
+		uint32_t *num_of_actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(tunnel);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(num_of_actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_match,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_tunnel *tunnel,
+		struct rte_flow_item **items,
+		uint32_t *num_of_items, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(tunnel);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_ptr(num_of_items);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_action_decap_release,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_action *actions,
+		uint32_t num_of_actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_u32(num_of_actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_item_release,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_item *items,
+		uint32_t num_of_items, int ret),
+	rte_trace_point_emit_u16(port_id);
Quoted 8 lines
Quoted 8 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1029

Quoted 6 lines
lib/ethdev/rte_ethdev_trace.h +6 -0
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_u32(num_of_items);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Will make it as fastpath.

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
lib/ethdev/rte_ethdev_trace.h +14 -0
+	rte_flow_trace_action_handle_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_indir_action_conf *conf,
+		const struct rte_flow_action *action,
+		struct rte_flow_action_handle *handle),
+	uint32_t ingress = conf->ingress;
+	uint32_t egress = conf->egress;
+	uint32_t transfer = conf->transfer;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(ingress);
+	rte_trace_point_emit_u32(egress);
+	rte_trace_point_emit_u32(transfer);
Quoted 8 lines
Quoted 8 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1049

Quoted 6 lines
lib/ethdev/rte_ethdev_trace.h +6 -0
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_int(action->type);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Will make it as fastpath.

Quoted 152 lines
Quoted 152 lines
Quoted 152 lines
lib/ethdev/rte_ethdev_trace.h +91 -0
+	rte_flow_trace_action_handle_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_action_handle *handle, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flex_item_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_item_flex_conf *conf,
+		struct rte_flow_item_flex_handle *handle),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_int(conf->tunnel);
+	rte_trace_point_emit_int(conf->nb_samples);
+	rte_trace_point_emit_int(conf->nb_inputs);
+	rte_trace_point_emit_int(conf->nb_outputs);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flex_item_release,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_item_flex_handle *handle, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_info_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_port_info *port_info,
+		struct rte_flow_queue_info *queue_info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(port_info);
+	rte_trace_point_emit_u32(port_info->max_nb_queues);
+	rte_trace_point_emit_u32(port_info->max_nb_counters);
+	rte_trace_point_emit_u32(port_info->max_nb_aging_objects);
+	rte_trace_point_emit_u32(port_info->max_nb_meters);
+	rte_trace_point_emit_u32(port_info->max_nb_conn_tracks);
+	rte_trace_point_emit_u32(port_info->supported_flags);
+	rte_trace_point_emit_ptr(queue_info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_configure,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_port_attr *port_attr,
+		uint16_t nb_queue,
+		const struct rte_flow_queue_attr **queue_attr, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(port_attr);
+	rte_trace_point_emit_u32(port_attr->nb_counters);
+	rte_trace_point_emit_u32(port_attr->nb_aging_objects);
+	rte_trace_point_emit_u32(port_attr->nb_meters);
+	rte_trace_point_emit_u32(port_attr->nb_conn_tracks);
+	rte_trace_point_emit_u32(port_attr->flags);
+	rte_trace_point_emit_u16(nb_queue);
+	rte_trace_point_emit_ptr(queue_attr);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_pattern_template_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_pattern_template_attr
 *template_attr,
+		const struct rte_flow_item *pattern,
+		void *tmplate),
+	uint32_t relaxed_matching = template_attr->relaxed_matching;
+	uint32_t ingress = template_attr->ingress;
+	uint32_t egress = template_attr->egress;
+	uint32_t transfer = template_attr->transfer;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_attr);
+	rte_trace_point_emit_u32(relaxed_matching);
+	rte_trace_point_emit_u32(ingress);
+	rte_trace_point_emit_u32(egress);
+	rte_trace_point_emit_u32(transfer);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(tmplate);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_pattern_template_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_pattern_template *pattern_template, int

ret),

lib/ethdev/rte_ethdev_trace.h +30 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(pattern_template);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_actions_template_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_actions_template_attr *template_attr,
+		const struct rte_flow_action *actions,
+		const struct rte_flow_action *masks,
+		void *tmplate),
+	uint32_t ingress = template_attr->ingress;
+	uint32_t egress = template_attr->egress;
+	uint32_t transfer = template_attr->transfer;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_attr);
+	rte_trace_point_emit_u32(ingress);
+	rte_trace_point_emit_u32(egress);
+	rte_trace_point_emit_u32(transfer);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(masks);
+	rte_trace_point_emit_ptr(tmplate);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_actions_template_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_actions_template *actions_template, int

ret),

lib/ethdev/rte_ethdev_trace.h +28 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(actions_template);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_template_table_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_template_table_attr *table_attr,
+		struct rte_flow_pattern_template **pattern_templates,
+		uint8_t nb_pattern_templates,
+		struct rte_flow_actions_template **actions_templates,
+		uint8_t nb_actions_templates,
+		struct rte_flow_template_table *table),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(table_attr);
+	rte_trace_point_emit_u32(table_attr->nb_flows);
+	rte_trace_point_emit_ptr(pattern_templates);
+	rte_trace_point_emit_u8(nb_pattern_templates);
+	rte_trace_point_emit_ptr(actions_templates);
+	rte_trace_point_emit_u8(nb_actions_templates);
+	rte_trace_point_emit_ptr(table);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_template_table_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_template_table *template_table, int ret),
Quoted 9 lines
Quoted 6 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1204

Quoted 6 lines
lib/ethdev/rte_ethdev_trace.h +6 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_table);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Will make it as fastpath.

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
lib/ethdev/rte_ethdev_trace.h +37 -0
+	rte_flow_trace_async_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow_template_table *template_table,
+		const struct rte_flow_item *pattern,
+		uint8_t pattern_template_index,
+		const struct rte_flow_action *actions,
+		uint8_t actions_template_index,
+		void *user_data, 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_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(
+	rte_flow_trace_async_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow *flow, void *user_data, int ret),
+	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(flow);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_push,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, int

ret),

Quoted 9 lines
Quoted 6 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1239

Quoted 6 lines
lib/ethdev/rte_ethdev_trace.h +6 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Will make it as fastpath.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
lib/ethdev/rte_ethdev_trace.h +5 -0
+	rte_flow_trace_pull,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		struct rte_flow_op_result *res, uint16_t n_res, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
Quoted 9 lines
Quoted 6 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1258

Quoted 6 lines
lib/ethdev/rte_ethdev_trace.h +6 -0
+	rte_trace_point_emit_ptr(res);
+	rte_trace_point_emit_u16(n_res);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Will make it as fastpath.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
lib/ethdev/rte_ethdev_trace.h +10 -0
+	rte_flow_trace_async_action_handle_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_indir_action_conf *indir_action_conf,
+		const struct rte_flow_action *action,
+		void *user_data, struct rte_flow_action_handle *handle),
+	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(indir_action_conf);
Quoted 9 lines
Quoted 6 lines

lib/ethdev/rte_ethdev_trace.h RTE_TRACE_POINT( · line 1274

Quoted 6 lines
lib/ethdev/rte_ethdev_trace.h +6 -0
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT(

Part of the datapath should be _FP

Will make it as fastpath.

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
lib/ethdev/rte_ethdev_trace.h +13 -0
+	rte_flow_trace_async_action_handle_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow_action_handle *action_handle,
+		void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
 #ifdef __cplusplus
 }
 #endif
(quoted diff) +0 -0
Quoted 8 lines
Quoted 8 lines

lib/ethdev/rte_ethdev_trace_fp.h RTE_TRACE_POINT_FP( · line 648

Quoted 8 lines

b/lib/ethdev/rte_ethdev_trace_fp.h
index d4b2e4b312..c5b8083de2 100644

lib/ethdev/rte_ethdev_trace_fp.h +0 -0
@@ -646,6 +646,119 @@ RTE_TRACE_POINT_FP(
 	rte_trace_point_emit_int(ret);
 )
 

Is the below fastpath function list correct ?

Quoted 121 lines
Quoted 110 lines
Quoted 110 lines
lib/ethdev/rte_ethdev_trace_fp.h +108 -0
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow,
+		const struct rte_flow_action *action, void *data, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(flow);
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_int(action->type);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_isolate,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int set, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(set);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_restore_info,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_mbuf *m, struct rte_flow_restore_info *info,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(m);
+	rte_trace_point_emit_ptr(info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_aged_flows,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, void **contexts,
+		uint32_t nb_contexts, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(contexts);
+	rte_trace_point_emit_u32(nb_contexts);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_q_aged_flows,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, void
 **contexts,
+		uint32_t nb_contexts, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_ptr(contexts);
+	rte_trace_point_emit_u32(nb_contexts);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_action_handle_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		struct rte_flow_action_handle *handle,
+		const void *update, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_ptr(update);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_action_handle_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_action_handle *handle,
+		void *data, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_pick_transfer_proxy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t
 *proxy_port_id,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(proxy_port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_action_handle_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		struct rte_flow_action_handle *action_handle,
+		const void *update, void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(update);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_action_handle_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_action_handle *action_handle,
+		void *data, void *user_data, int ret),
+	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(action_handle);
Quoted 8 lines
Quoted 8 lines
lib/ethdev/rte_ethdev_trace_fp.h +5 -0
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
 #ifdef __cplusplus

}
#endif

Thanks,
Ori

#120 lore raw

PATCH v7 5/6 ethdev: add trace points for mtr

In reply to Ankur Dwivedi

Adds trace points for rte_mtr specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace_points.c |  63 +++++++++++++
 lib/ethdev/rte_ethdev_trace.h    | 112 ++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 100 ++++++++++++++++++++
 lib/ethdev/rte_mtr.c             | 156 +++++++++++++++++++++++++++----
 lib/ethdev/version.map           |  21 +++++
 5 files changed, 434 insertions(+), 18 deletions(-)
lib/ethdev/ethdev_trace_points.c +63 -0
index 1953d90a5a..067e5fdab4 100644
@@ -591,3 +591,66 @@ RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_update,
 
 RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_query,
 	lib.ethdev.flow.async.action.handle.query)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_capabilities_get,
+	lib.ethdev.mtr.capabilities_get)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_create,
+	lib.ethdev.mtr.create)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_destroy,
+	lib.ethdev.mtr.destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_disable,
+	lib.ethdev.mtr.meter_disable)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_dscp_table_update,
+	lib.ethdev.mtr.meter_dscp_table_update)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_enable,
+	lib.ethdev.mtr.meter_enable)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_profile_add,
+	lib.ethdev.mtr.meter_profile_add)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_profile_delete,
+	lib.ethdev.mtr.meter_profile_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_profile_get,
+	lib.ethdev.mtr.meter_profile_get)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_profile_update,
+	lib.ethdev.mtr.meter_profile_update)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_stats_read,
+	lib.ethdev.mtr.stats_read)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_stats_update,
+	lib.ethdev.mtr.stats_update)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_policy_add,
+	lib.ethdev.mtr.meter_policy_add)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_policy_delete,
+	lib.ethdev.mtr.meter_policy_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_policy_get,
+	lib.ethdev.mtr.meter_policy_get)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_policy_update,
+	lib.ethdev.mtr.meter_policy_update)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_policy_validate,
+	lib.ethdev.mtr.meter_policy_validate)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_meter_vlan_table_update,
+	lib.ethdev.mtr.meter_vlan_table_update)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_get,
+	lib.ethdev.mtr.color_in_protocol_get)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_priority_get,
+	lib.ethdev.mtr.color_in_protocol_priority_get)
+
+RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_set,
+	lib.ethdev.mtr.color_in_protocol_set)
lib/ethdev/rte_ethdev_trace.h +112 -0

124 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +100 -0

112 lines not on this page · raw message

lib/ethdev/rte_mtr.c +138 -18

304 lines not on this page · raw message

lib/ethdev/version.map +21 -0
index 0cb8222ad9..c1a6e4d30a 100644
@@ -482,6 +482,27 @@ EXPERIMENTAL {
 	__rte_flow_trace_tunnel_item_release;
 	__rte_flow_trace_tunnel_match;
 	__rte_flow_trace_validate;
+	__rte_mtr_trace_capabilities_get;
+	__rte_mtr_trace_color_in_protocol_get;
+	__rte_mtr_trace_color_in_protocol_priority_get;
+	__rte_mtr_trace_color_in_protocol_set;
+	__rte_mtr_trace_create;
+	__rte_mtr_trace_destroy;
+	__rte_mtr_trace_meter_disable;
+	__rte_mtr_trace_meter_dscp_table_update;
+	__rte_mtr_trace_meter_enable;
+	__rte_mtr_trace_meter_policy_add;
+	__rte_mtr_trace_meter_policy_delete;
+	__rte_mtr_trace_meter_policy_get;
+	__rte_mtr_trace_meter_policy_update;
+	__rte_mtr_trace_meter_policy_validate;
+	__rte_mtr_trace_meter_profile_add;
+	__rte_mtr_trace_meter_profile_delete;
+	__rte_mtr_trace_meter_profile_get;
+	__rte_mtr_trace_meter_profile_update;
+	__rte_mtr_trace_meter_vlan_table_update;
+	__rte_mtr_trace_stats_read;
+	__rte_mtr_trace_stats_update;
 };
 
 INTERNAL {
Signature · 1 line
2.25.1
Acked-by on v7 5/6
#121 lore raw

RE: [PATCH v7 5/6] ethdev: add trace points for mtr

Quoted 47 lines

-----Original Message-----
From: Ankur Dwivedi <[email protected]>
Sent: Monday, January 23, 2023 2:32 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Igor Russkikh <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Maciej Czekaj [C] <[email protected]>; Shijith Thotton <[email protected]>; Srisivasubramanian Srinivasan <[email protected]>; Harman Kalra <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Liron Himi <[email protected]>; [email protected]; Radha Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Sathesh B Edara <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Devendra Singh Rawat <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ankur Dwivedi <[email protected]>
Subject: [PATCH v7 5/6] ethdev: add trace points for mtr

Adds trace points for rte_mtr specific functions in ethdev lib.

Quoted 9 lines
---
 lib/ethdev/ethdev_trace_points.c |  63 +++++++++++++
 lib/ethdev/rte_ethdev_trace.h    | 112 ++++++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 100 ++++++++++++++++++++
 lib/ethdev/rte_mtr.c             | 156 +++++++++++++++++++++++++++----
 lib/ethdev/version.map           |  21 +++++
 5 files changed, 434 insertions(+), 18 deletions(-)
Quoted 8 lines
lib/ethdev/ethdev_trace_points.c +0 -1
index 1953d90a5a..067e5fdab4 100644
@@ -591,3 +591,66 @@
--

2.25.1

#122 lore raw

PATCH v7 6/6 ethdev: add trace points for tm

In reply to Ankur Dwivedi

Adds trace points for rte_tm specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace_points.c |  90 +++++++++++
 lib/ethdev/rte_ethdev_trace.h    | 141 ++++++++++++++++++
 lib/ethdev/rte_ethdev_trace_fp.h | 171 +++++++++++++++++++++
 lib/ethdev/rte_tm.c              | 247 +++++++++++++++++++++++++++----
 lib/ethdev/version.map           |  30 ++++
 5 files changed, 650 insertions(+), 29 deletions(-)
lib/ethdev/ethdev_trace_points.c +90 -0
index 067e5fdab4..af66a139df 100644
@@ -654,3 +654,93 @@ RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_priority_get,
 
 RTE_TRACE_POINT_REGISTER(rte_mtr_trace_color_in_protocol_set,
 	lib.ethdev.mtr.color_in_protocol_set)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_capabilities_get,
+	lib.ethdev.tm.capabilities_get)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_get_number_of_leaf_nodes,
+	lib.ethdev.tm.get_number_of_leaf_nodes)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_hierarchy_commit,
+	lib.ethdev.tm.hierarchy_commit)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_level_capabilities_get,
+	lib.ethdev.tm.level_capabilities_get)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_ip_dscp,
+	lib.ethdev.tm.mark_ip_dscp)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_ip_ecn,
+	lib.ethdev.tm.mark_ip_ecn)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_mark_vlan_dei,
+	lib.ethdev.tm.mark_vlan_dei)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_add,
+	lib.ethdev.tm.node_add)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_capabilities_get,
+	lib.ethdev.tm.node_capabilities_get)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_cman_update,
+	lib.ethdev.tm.node_cman_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_delete,
+	lib.ethdev.tm.node_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_parent_update,
+	lib.ethdev.tm.node_parent_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_resume,
+	lib.ethdev.tm.node_resume)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_shaper_update,
+	lib.ethdev.tm.node_shaper_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_shared_shaper_update,
+	lib.ethdev.tm.node_shared_shaper_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_shared_wred_context_update,
+	lib.ethdev.tm.node_shared_wred_context_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_stats_read,
+	lib.ethdev.tm.node_stats_read)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_stats_update,
+	lib.ethdev.tm.node_stats_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_suspend,
+	lib.ethdev.tm.node_suspend)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_type_get,
+	lib.ethdev.tm.node_type_get)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_wfq_weight_mode_update,
+	lib.ethdev.tm.node_wfq_weight_mode_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_node_wred_context_update,
+	lib.ethdev.tm.node_wred_context_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shaper_profile_add,
+	lib.ethdev.tm.shaper_profile_add)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shaper_profile_delete,
+	lib.ethdev.tm.shaper_profile_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_shaper_add_update,
+	lib.ethdev.tm.shared_shaper_add_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_shaper_delete,
+	lib.ethdev.tm.shared_shaper_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_wred_context_add_update,
+	lib.ethdev.tm.shared_wred_context_add_update)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_shared_wred_context_delete,
+	lib.ethdev.tm.shared_wred_context_delete)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_wred_profile_add,
+	lib.ethdev.tm.wred_profile_add)
+
+RTE_TRACE_POINT_REGISTER(rte_tm_trace_wred_profile_delete,
+	lib.ethdev.tm.wred_profile_delete)
lib/ethdev/rte_ethdev_trace.h +141 -0

153 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +171 -0

183 lines not on this page · raw message

lib/ethdev/rte_tm.c +218 -29

461 lines not on this page · raw message

lib/ethdev/version.map +30 -0
index c1a6e4d30a..112b2b1039 100644
@@ -503,6 +503,36 @@ EXPERIMENTAL {
 	__rte_mtr_trace_meter_vlan_table_update;
 	__rte_mtr_trace_stats_read;
 	__rte_mtr_trace_stats_update;
+	__rte_tm_trace_capabilities_get;
+	__rte_tm_trace_get_number_of_leaf_nodes;
+	__rte_tm_trace_hierarchy_commit;
+	__rte_tm_trace_level_capabilities_get;
+	__rte_tm_trace_mark_ip_dscp;
+	__rte_tm_trace_mark_ip_ecn;
+	__rte_tm_trace_mark_vlan_dei;
+	__rte_tm_trace_node_add;
+	__rte_tm_trace_node_capabilities_get;
+	__rte_tm_trace_node_cman_update;
+	__rte_tm_trace_node_delete;
+	__rte_tm_trace_node_parent_update;
+	__rte_tm_trace_node_resume;
+	__rte_tm_trace_node_shaper_update;
+	__rte_tm_trace_node_shared_shaper_update;
+	__rte_tm_trace_node_shared_wred_context_update;
+	__rte_tm_trace_node_stats_read;
+	__rte_tm_trace_node_stats_update;
+	__rte_tm_trace_node_suspend;
+	__rte_tm_trace_node_type_get;
+	__rte_tm_trace_node_wfq_weight_mode_update;
+	__rte_tm_trace_node_wred_context_update;
+	__rte_tm_trace_shaper_profile_add;
+	__rte_tm_trace_shaper_profile_delete;
+	__rte_tm_trace_shared_shaper_add_update;
+	__rte_tm_trace_shared_shaper_delete;
+	__rte_tm_trace_shared_wred_context_add_update;
+	__rte_tm_trace_shared_wred_context_delete;
+	__rte_tm_trace_wred_profile_add;
+	__rte_tm_trace_wred_profile_delete;
 };
 
 INTERNAL {
Signature · 1 line
2.25.1
#123 lore raw

v8 cover add trace points in ethdev library

In reply to Ankur Dwivedi

This series adds trace points for functions in the ethdev library. The trace points are added in ethdev, flow, mtr and tm files.

v8:
- Resolved review comments on ethdev patch.
- The file rte_ethdev_trace.h and rte_ethdev_trace_fp_burst.h(added in this patch series) is removed. The file ethdev_trace.h is added as an internal header. It contains internal slow path and fastpath tracepoints. The rte_ethdev_trace_fp.h contains public fastpath tracepoints.
- In patch (2/6) removed extra call to rte_eth_trace_find_next with RTE_MAX_ETHPORTS.
- In patch (2/6), added parent argument in rte_eth_trace_find_next_of().
- In patches (2/6 and 4/6), provided appropriate data type to bit fields in following tracepoints:
rte_eth_trace_rx_hairpin_queue_setup, rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_link_get_nowait, rte_eth_trace_link_to_str, rte_eth_trace_link_get, rte_flow_trace_pattern_template_create, rte_flow_trace_actions_template_create and rte_flow_trace_action_handle_create.
- Tracepoints moved from fastpath to slowpath in ethdev, mtr and tm.
- Moved few flow related tracepoints to fastpath as suggested in review comments.
- Added const to the pointer parameters in tracepoints.
- The following tracepoints are moved to the end of the function to capture return values:
rte_eth_trace_link_speed_to_str, rte_flow_trace_conv, rte_mtr_trace_meter_policy_validate, rte_mtr_trace_meter_policy_add, rte_mtr_trace_meter_policy_delete, rte_eth_find_next_sibling and rte_eth_trace_speed_bitflag.
- Removed tracepoints from version.map file.
- Formatting changes.

v7:
- Resolves build failure.
- Changes in rte_trace_point_emit_blob() function in rte_trace_point.h and rte_trace_point_register.h.

v6:
- Resolves compilation error with 32 bit build.
- Resolves a bug found in v5 in the trace autotest application where the traces where not getting generated after the first blob test case. The trace size needs to be known at trace point register, so a dynamic length array cannot be implemented with current implementation. So changing the metadata of blob to make the array as 64 bytes. The length will denote the blob length(passed by the application). The trailing unused fields will be set to zero if length is less than 64.

For example, the following is the ctf metadata created to display a mac addr array in rte_eth_trace_macaddr_get():

   struct {
      ...
      uint8_t len;
      uint8_t mac_addr_addr_bytes[64];

};
- Minor changes in the subject of patches (2/6) and (3/6).

v5:
- The rte_trace_point_emit_char_array function is renamed to rte_trace_point_emit_blob. With this function an array of any length upto 65535 bytes can be captured.
For example, the following is the ctf metadata created to display a mac addr array in rte_eth_trace_macaddr_get():

   struct {
      ...
      uint16_t len;
      uint8_t mac_addr_addr_bytes[len];

};
- Added additional test cases for rte_eal_trace_generic_blob test case.
- Capturing of return value of a function is added to tracepoint for flow, mtr and tm patches.
- In ehdev patch (1/6), removed extra line. Also added rx_pkts and tx_pkts pointer in trace point.

v4:
- Adds tracepoint function to emit char array. Also adds the test case.
- Resolved review comments on "ethdev: add trace point" patch. This patch is divided into 2 patches to minimize per patch size.
- From the earlier version (v3), few tracepoints in ethdev, flow, mtr, tm are made as fast path tracepoints. For the tracepoint which i was unsure, i have made it as fastpath. All the fast path tracepoints can be found in rte_ethdev_trace_fp.h and rte_ethdev_trace_fp_burst.h. All the slow path tracepoints can be found in rte_ethdev_trace.h.
- Capturing of return value is added to tracepoint in ethdev. For flow, mtr and tm these changes are still yet to bde done. Will do it in the next versions.
- Moved the trace functions from INTERNAL to EXPERIMENTAL in version.map.

v3:
- Moved the trace functions from EXPERIMENTAL to INTERNAL in version.map.
- Moved trace functions call to the end, in ethdev and flow trace.
- Added code to print the input value of features in rte_eth_trace_rx_metadata_negotiate().
- Added code to capture return value in flow trace.

Ankur Dwivedi (6):
eal: trace: add trace point emit for blob
ethdev: add trace points for ethdev (part one)
ethdev: add trace points for ethdev (part two)
ethdev: add trace points for flow
ethdev: add trace points for mtr
ethdev: add trace points for tm

 app/test/test_trace.c                      |   11 +
 doc/guides/prog_guide/trace_lib.rst        |   12 +
 lib/eal/common/eal_common_trace_points.c   |    2 +
 lib/eal/include/rte_eal_trace.h            |    6 +
 lib/eal/include/rte_trace_point.h          |   31 +
 lib/eal/include/rte_trace_point_register.h |    9 +
 lib/ethdev/ethdev_private.c                |    7 +
 lib/ethdev/ethdev_trace.h                  | 2592 ++++++++++++++++++++
 lib/ethdev/ethdev_trace_points.c           |  717 +++++-
 lib/ethdev/meson.build                     |    2 +-
 lib/ethdev/rte_ethdev.c                    |  872 ++++++-
 lib/ethdev/rte_ethdev_cman.c               |   29 +-
 lib/ethdev/rte_ethdev_trace.h              |   95 -
 lib/ethdev/rte_ethdev_trace_fp.h           |   36 +
 lib/ethdev/rte_flow.c                      |  356 ++-
 lib/ethdev/rte_mtr.c                       |  156 +-
 lib/ethdev/rte_tm.c                        |  225 +-
 17 files changed, 4793 insertions(+), 365 deletions(-)
 create mode 100644 lib/ethdev/ethdev_trace.h
 delete mode 100644 lib/ethdev/rte_ethdev_trace.h
Signature · 1 line
2.25.1
#124 lore raw

PATCH v8 1/6 eal: trace: add trace point emit for blob

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

This patch also adds test case for emit blob tracepoint function.

---
 app/test/test_trace.c                      | 11 ++++++++
 doc/guides/prog_guide/trace_lib.rst        | 12 +++++++++
 lib/eal/common/eal_common_trace_points.c   |  2 ++
 lib/eal/include/rte_eal_trace.h            |  6 +++++
 lib/eal/include/rte_trace_point.h          | 31 ++++++++++++++++++++++
 lib/eal/include/rte_trace_point_register.h |  9 +++++++
 6 files changed, 71 insertions(+)
app/test/test_trace.c +11 -0
index 6bedf14024..ad4a394a29 100644
@@ -4,6 +4,7 @@
 
 #include <rte_eal_trace.h>
 #include <rte_lcore.h>
+#include <rte_random.h>
 #include <rte_trace.h>
 
 #include "test.h"
@@ -177,7 +178,12 @@ test_fp_trace_points(void)
 static int
 test_generic_trace_points(void)
 {
+	uint8_t arr[RTE_TRACE_BLOB_LEN_MAX];
 	int tmp;
+	int i;
+
+	for (i = 0; i < RTE_TRACE_BLOB_LEN_MAX; i++)
+		arr[i] = i;
 
 	rte_eal_trace_generic_void();
 	rte_eal_trace_generic_u64(0x10000000000000);
@@ -195,6 +201,11 @@ test_generic_trace_points(void)
 	rte_eal_trace_generic_ptr(&tmp);
 	rte_eal_trace_generic_str("my string");
 	rte_eal_trace_generic_size_t(sizeof(void *));
+	rte_eal_trace_generic_blob(arr, 0);
+	rte_eal_trace_generic_blob(arr, 17);
+	rte_eal_trace_generic_blob(arr, RTE_TRACE_BLOB_LEN_MAX);
+	rte_eal_trace_generic_blob(arr, rte_rand() %
+					RTE_TRACE_BLOB_LEN_MAX);
 	RTE_EAL_TRACE_GENERIC_FUNC;
 
 	return TEST_SUCCESS;
doc/guides/prog_guide/trace_lib.rst +12 -0
index 9a8f38073d..3e0ea5835c 100644
@@ -352,3 +352,15 @@ event ID.
 The ``packet.header`` and ``packet.context`` will be written in the slow path
 at the time of trace memory creation. The ``trace.header`` and trace payload
 will be emitted when the tracepoint function is invoked.
+
+Limitations
+-----------
+
+- The ``rte_trace_point_emit_blob()`` function can capture a maximum blob of
+  length ``RTE_TRACE_BLOB_LEN_MAX`` bytes. The application can call
+  ``rte_trace_point_emit_blob()`` multiple times with length less than or equal to
+  ``RTE_TRACE_BLOB_LEN_MAX``, if it needs to capture more than ``RTE_TRACE_BLOB_LEN_MAX``
+  bytes.
+- If the length passed to the ``rte_trace_point_emit_blob()`` is less than
+  ``RTE_TRACE_BLOB_LEN_MAX``, then the trailing ``(RTE_TRACE_BLOB_LEN_MAX - len)``
+  bytes in the trace are set to zero.
lib/eal/common/eal_common_trace_points.c +2 -0
index 0b0b254615..051f89809c 100644
@@ -40,6 +40,8 @@ RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_size_t,
 	lib.eal.generic.size_t)
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_func,
 	lib.eal.generic.func)
+RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_blob,
+	lib.eal.generic.blob)
 
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set,
 	lib.eal.alarm.set)
lib/eal/include/rte_eal_trace.h +6 -0
index 5ef4398230..6f5c022558 100644
@@ -143,6 +143,12 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_string(func);
 )
 
+RTE_TRACE_POINT(
+	rte_eal_trace_generic_blob,
+	RTE_TRACE_POINT_ARGS(const void *in, uint8_t len),
+	rte_trace_point_emit_blob(in, len);
+)
+
 #define RTE_EAL_TRACE_GENERIC_FUNC rte_eal_trace_generic_func(__func__)
 
 /* Interrupt */
lib/eal/include/rte_trace_point.h +31 -0
index 0f8700974f..4d6b5700dd 100644
@@ -144,6 +144,16 @@ _tp _args \
 #define rte_trace_point_emit_ptr(val)
 /** Tracepoint function payload for string datatype */
 #define rte_trace_point_emit_string(val)
+/**
+ * Tracepoint function to capture a blob.
+ *
+ * @param val
+ *   Pointer to the array to be captured.
+ * @param len
+ *   Length to be captured. The maximum supported length is
+ *   RTE_TRACE_BLOB_LEN_MAX bytes.
+ */
+#define rte_trace_point_emit_blob(val, len)
 
 #endif /* __DOXYGEN__ */
 
@@ -152,6 +162,9 @@ _tp _args \
 /** @internal Macro to define event header size. */
 #define __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t)
 
+/** Macro to define maximum emit length of blob. */
+#define RTE_TRACE_BLOB_LEN_MAX 64
+
 /**
  * Enable recording events of the given tracepoint in the trace buffer.
  *
@@ -374,12 +387,30 @@ do { \
 	mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX); \
 } while (0)
 
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+	if (unlikely(in == NULL)) \
+		return; \
+	if (len > RTE_TRACE_BLOB_LEN_MAX) \
+		len = RTE_TRACE_BLOB_LEN_MAX; \
+	__rte_trace_point_emit(len, uint8_t); \
+	memcpy(mem, in, len); \
+	memset(RTE_PTR_ADD(mem, len), 0, RTE_TRACE_BLOB_LEN_MAX - len); \
+	mem = RTE_PTR_ADD(mem, RTE_TRACE_BLOB_LEN_MAX); \
+} while (0)
+
 #else
 
 #define __rte_trace_point_emit_header_generic(t) RTE_SET_USED(t)
 #define __rte_trace_point_emit_header_fp(t) RTE_SET_USED(t)
 #define __rte_trace_point_emit(in, type) RTE_SET_USED(in)
 #define rte_trace_point_emit_string(in) RTE_SET_USED(in)
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+	RTE_SET_USED(in); \
+	RTE_SET_USED(len); \
+} while (0)
+
 
 #endif /* ALLOW_EXPERIMENTAL_API */
 #endif /* _RTE_TRACE_POINT_REGISTER_H_ */
lib/eal/include/rte_trace_point_register.h +9 -0
index a32f4d731b..a9682d3f22 100644
@@ -47,6 +47,15 @@ do { \
 		RTE_STR(in)"[32]", "string_bounded_t"); \
 } while (0)
 
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+	RTE_SET_USED(in); \
+	__rte_trace_point_emit(len, uint8_t); \
+	__rte_trace_point_emit_field(RTE_TRACE_BLOB_LEN_MAX, \
+		RTE_STR(in)"[" RTE_STR(RTE_TRACE_BLOB_LEN_MAX)"]", \
+		RTE_STR(uint8_t)); \
+} while (0)
+
 #ifdef __cplusplus
 }
 #endif
Signature · 1 line
2.25.1
#125 lore raw

Re: [PATCH v8 1/6] eal: trace: add trace point emit for blob

Quoted 9 lines · Ankur Dwivedi

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

Quoted 6 lines

This patch also adds test case for emit blob tracepoint function.

I came accross this patch while looking at CI failures. Giving my two cents.

Quoted 5 lines
lib/eal/include/rte_eal_trace.h +0 -0
index 5ef4398230..6f5c022558 100644

lib/eal/include/rte_eal_trace.h RTE_TRACE_POINT( · line 152

Quoted 10 lines
lib/eal/include/rte_eal_trace.h +6 -0
@@ -143,6 +143,12 @@ RTE_TRACE_POINT(
        rte_trace_point_emit_string(func);
 )
 
+RTE_TRACE_POINT(
+       rte_eal_trace_generic_blob,
+       RTE_TRACE_POINT_ARGS(const void *in, uint8_t len),
+       rte_trace_point_emit_blob(in, len);
+)
+
 #define RTE_EAL_TRACE_GENERIC_FUNC rte_eal_trace_generic_func(__func__)

This new tracepoint is exported as a public API.
So its underlying symbol __rte_eal_trace_generic_blob (part of the inlined implementation) is visible to applications:

#define __RTE_TRACE_POINT(_mode, _tp, _args, ...) \
extern rte_trace_point_t __##_tp; \
static __rte_always_inline void \
_tp _args \

{ \
        __rte_trace_point_emit_header_##_mode(&__##_tp); \
        __VA_ARGS__ \
}

__rte_eal_trace_generic_blob must be exported as a versionned symbol (i.e. listed in EAL version.map).

Signature · 1 line
David Marchand
#126 lore raw

RE: [EXT] Re: [PATCH v8 1/6] eal: trace: add trace point emit for blob

Quoted 44 lines
Quoted 9 lines · Ankur Dwivedi

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

Quoted 6 lines

This patch also adds test case for emit blob tracepoint function.

I came accross this patch while looking at CI failures. Giving my two cents.

Quoted 6 lines
(quoted diff) +0 -0

b/lib/eal/include/rte_eal_trace.h index 5ef4398230..6f5c022558 100644

lib/eal/include/rte_eal_trace.h +0 -0
@@ -143,6 +143,12 @@ RTE_TRACE_POINT(
        rte_trace_point_emit_string(func);

lib/eal/include/rte_eal_trace.h RTE_TRACE_POINT( · line 153

Quoted 10 lines
lib/eal/include/rte_eal_trace.h +6 -0
 )
 
+RTE_TRACE_POINT(
+       rte_eal_trace_generic_blob,
+       RTE_TRACE_POINT_ARGS(const void *in, uint8_t len),
+       rte_trace_point_emit_blob(in, len);
+)
+
 #define RTE_EAL_TRACE_GENERIC_FUNC
 rte_eal_trace_generic_func(__func__)

This new tracepoint is exported as a public API.
So its underlying symbol __rte_eal_trace_generic_blob (part of the inlined implementation) is visible to applications:

Quoted 8 lines

#define __RTE_TRACE_POINT(_mode, _tp, _args, ...) \ extern

rte_trace_point_t __##_tp; \ static __rte_always_inline void \ _tp _args \ { \
       __rte_trace_point_emit_header_##_mode(&__##_tp); \
       __VA_ARGS__ \
}

__rte_eal_trace_generic_blob must be exported as a versionned symbol (i.e. listed in EAL version.map).

Yes, as rte_eal_trace_generic_blob is a generic trace point called by the test app, it needs to be exported. Will add it in next patch series.

Quoted 4 lines

--
David Marchand

#127 lore raw

PATCH v8 2/6 ethdev: add trace points for ethdev (part one)

In reply to Ankur Dwivedi

Adds trace points for ethdev functions.

The rte_ethdev_trace.h is removed. The file ethdev_trace.h is added as an internal header. ethdev_trace.h contains internal slow path and fast path tracepoints. The public fast path tracepoints are present in rte_ethdev_trace_fp.h header.

---
 lib/ethdev/ethdev_private.c      |   7 +
 lib/ethdev/ethdev_trace.h        | 642 +++++++++++++++++++++++++++++++
 lib/ethdev/ethdev_trace_points.c | 195 +++++++++-
 lib/ethdev/meson.build           |   2 +-
 lib/ethdev/rte_ethdev.c          | 386 ++++++++++++++++---
 lib/ethdev/rte_ethdev_trace.h    |  95 -----
 lib/ethdev/rte_ethdev_trace_fp.h |  36 ++
 7 files changed, 1206 insertions(+), 157 deletions(-)
 create mode 100644 lib/ethdev/ethdev_trace.h
 delete mode 100644 lib/ethdev/rte_ethdev_trace.h
lib/ethdev/ethdev_private.c +7 -0
index 48090c879a..14ec8c6ccf 100644
@@ -5,6 +5,7 @@
 #include <rte_debug.h>
 
 #include "rte_ethdev.h"
+#include "rte_ethdev_trace_fp.h"
 #include "ethdev_driver.h"
 #include "ethdev_private.h"
 
@@ -297,6 +298,9 @@ rte_eth_call_rx_callbacks(uint16_t port_id, uint16_t queue_id,
 		cb = cb->next;
 	}
 
+	rte_eth_trace_call_rx_callbacks(port_id, queue_id, (void **)rx_pkts,
+					nb_rx, nb_pkts);
+
 	return nb_rx;
 }
 
@@ -312,6 +316,9 @@ rte_eth_call_tx_callbacks(uint16_t port_id, uint16_t queue_id,
 		cb = cb->next;
 	}
 
+	rte_eth_trace_call_tx_callbacks(port_id, queue_id, (void **)tx_pkts,
+					nb_pkts);
+
 	return nb_pkts;
 }
 
lib/ethdev/ethdev_trace.h new file +642 -0

642 lines not on this page · raw message

lib/ethdev/ethdev_trace_points.c +194 -1

204 lines not on this page · raw message

lib/ethdev/meson.build +1 -1
index 39250b5da1..7835c96601 100644
@@ -22,7 +22,6 @@ sources = files(
 headers = files(
         'rte_cman.h',
         'rte_ethdev.h',
-        'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
         'rte_dev_info.h',
         'rte_flow.h',
@@ -41,6 +40,7 @@ indirect_headers += files(
 driver_sdk_headers += files(
         'ethdev_driver.h',
         'ethdev_pci.h',
+        'ethdev_trace.h',
         'ethdev_vdev.h',
 )
 
lib/ethdev/rte_ethdev.c +326 -60

832 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace.h deleted +0 -95

95 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +36 -0
index 40084d1929..186271c9ff 100644
@@ -37,6 +37,42 @@ RTE_TRACE_POINT_FP(
 	rte_trace_point_emit_u16(nb_pkts);
 )
 
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_call_rx_callbacks,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		void **rx_pkts, uint16_t nb_rx, uint16_t nb_pkts),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(rx_pkts);
+	rte_trace_point_emit_u16(nb_rx);
+	rte_trace_point_emit_u16(nb_pkts);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_call_tx_callbacks,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		void **tx_pkts, uint16_t nb_pkts),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(tx_pkts);
+	rte_trace_point_emit_u16(nb_pkts);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_tx_buffer_drop_callback,
+	RTE_TRACE_POINT_ARGS(void **pkts, uint16_t unsent),
+	rte_trace_point_emit_ptr(pkts);
+	rte_trace_point_emit_u16(unsent);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_tx_buffer_count_callback,
+	RTE_TRACE_POINT_ARGS(void **pkts, uint16_t unsent, uint64_t count),
+	rte_trace_point_emit_ptr(pkts);
+	rte_trace_point_emit_u16(unsent);
+	rte_trace_point_emit_u64(count);
+)
+
 #ifdef __cplusplus
 }
 #endif
Signature · 1 line
2.25.1
#128 lore raw

PATCH v8 3/6 ethdev: add trace points for ethdev (part two)

In reply to Ankur Dwivedi

Adds trace points for remaining ethdev functions.

---
 lib/ethdev/ethdev_trace.h        | 893 +++++++++++++++++++++++++++++++
 lib/ethdev/ethdev_trace_points.c | 252 +++++++++
 lib/ethdev/rte_ethdev.c          | 486 ++++++++++++++---
 lib/ethdev/rte_ethdev_cman.c     |  29 +-
 4 files changed, 1581 insertions(+), 79 deletions(-)
lib/ethdev/ethdev_trace.h +893 -0
index a5058f97ea..9039446b5f 100644
@@ -592,6 +592,815 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_int(ret);
 )
 
+RTE_TRACE_POINT(
+	rte_ethdev_trace_info_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_dev_info *dev_info),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_string(dev_info->driver_name);
+	rte_trace_point_emit_u16(dev_info->min_mtu);
+	rte_trace_point_emit_u16(dev_info->max_mtu);
+	rte_trace_point_emit_u32(dev_info->min_rx_bufsize);
+	rte_trace_point_emit_u32(dev_info->max_rx_pktlen);
+	rte_trace_point_emit_u16(dev_info->max_rx_queues);
+	rte_trace_point_emit_u16(dev_info->max_tx_queues);
+	rte_trace_point_emit_u32(dev_info->max_mac_addrs);
+	rte_trace_point_emit_u64(dev_info->rx_offload_capa);
+	rte_trace_point_emit_u64(dev_info->tx_offload_capa);
+	rte_trace_point_emit_u64(dev_info->rx_queue_offload_capa);
+	rte_trace_point_emit_u64(dev_info->tx_queue_offload_capa);
+	rte_trace_point_emit_u16(dev_info->reta_size);
+	rte_trace_point_emit_u8(dev_info->hash_key_size);
+	rte_trace_point_emit_u64(dev_info->flow_type_rss_offloads);
+	rte_trace_point_emit_u16(dev_info->rx_desc_lim.nb_max);
+	rte_trace_point_emit_u16(dev_info->rx_desc_lim.nb_min);
+	rte_trace_point_emit_u16(dev_info->rx_desc_lim.nb_align);
+	rte_trace_point_emit_u16(dev_info->tx_desc_lim.nb_max);
+	rte_trace_point_emit_u16(dev_info->tx_desc_lim.nb_min);
+	rte_trace_point_emit_u16(dev_info->tx_desc_lim.nb_align);
+	rte_trace_point_emit_u32(dev_info->speed_capa);
+	rte_trace_point_emit_u16(dev_info->nb_rx_queues);
+	rte_trace_point_emit_u16(dev_info->nb_tx_queues);
+	rte_trace_point_emit_u64(dev_info->dev_capa);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_conf_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_conf *dev_conf),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(dev_conf);
+	rte_trace_point_emit_u32(dev_conf->link_speeds);
+	rte_trace_point_emit_u64(dev_conf->rxmode.offloads);
+	rte_trace_point_emit_u64(dev_conf->txmode.offloads);
+	rte_trace_point_emit_u32(dev_conf->lpbk_mode);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_get_supported_ptypes,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int supported_num, int num,
+		uint32_t ptypes),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(supported_num);
+	rte_trace_point_emit_int(num);
+	rte_trace_point_emit_u32(ptypes);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_set_ptypes,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int supported_num,
+		unsigned int num, uint32_t set_ptypes),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(supported_num);
+	rte_trace_point_emit_u32(num);
+	rte_trace_point_emit_u32(set_ptypes);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_macaddrs_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, unsigned int num),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(num);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_set_mtu,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t mtu, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(mtu);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_vlan_filter,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t vlan_id, int on,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(vlan_id);
+	rte_trace_point_emit_int(on);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_set_vlan_strip_on_queue,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, int on),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(rx_queue_id);
+	rte_trace_point_emit_int(on);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_set_vlan_ether_type,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, enum rte_vlan_type vlan_type,
+		uint16_t tag_type, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(vlan_type);
+	rte_trace_point_emit_u16(tag_type);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_set_vlan_offload,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int offload_mask, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(offload_mask);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_get_vlan_offload,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_set_vlan_pvid,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t pvid, int on, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(pvid);
+	rte_trace_point_emit_int(on);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_flow_ctrl_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_fc_conf *fc_conf, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(fc_conf);
+	rte_trace_point_emit_u32(fc_conf->high_water);
+	rte_trace_point_emit_u32(fc_conf->low_water);
+	rte_trace_point_emit_u16(fc_conf->pause_time);
+	rte_trace_point_emit_u16(fc_conf->send_xon);
+	rte_trace_point_emit_int(fc_conf->mode);
+	rte_trace_point_emit_u8(fc_conf->mac_ctrl_frame_fwd);
+	rte_trace_point_emit_u8(fc_conf->autoneg);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_flow_ctrl_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_fc_conf *fc_conf, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(fc_conf->high_water);
+	rte_trace_point_emit_u32(fc_conf->low_water);
+	rte_trace_point_emit_u16(fc_conf->pause_time);
+	rte_trace_point_emit_u16(fc_conf->send_xon);
+	rte_trace_point_emit_int(fc_conf->mode);
+	rte_trace_point_emit_u8(fc_conf->mac_ctrl_frame_fwd);
+	rte_trace_point_emit_u8(fc_conf->autoneg);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_priority_flow_ctrl_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_pfc_conf *pfc_conf, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(pfc_conf->fc.high_water);
+	rte_trace_point_emit_u32(pfc_conf->fc.low_water);
+	rte_trace_point_emit_u16(pfc_conf->fc.pause_time);
+	rte_trace_point_emit_u16(pfc_conf->fc.send_xon);
+	rte_trace_point_emit_int(pfc_conf->fc.mode);
+	rte_trace_point_emit_u8(pfc_conf->fc.mac_ctrl_frame_fwd);
+	rte_trace_point_emit_u8(pfc_conf->fc.autoneg);
+	rte_trace_point_emit_u8(pfc_conf->priority);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_priority_flow_ctrl_queue_info_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_pfc_queue_info *pfc_queue_info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(pfc_queue_info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_priority_flow_ctrl_queue_configure,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_pfc_queue_conf *pfc_queue_conf, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(pfc_queue_conf);
+	rte_trace_point_emit_int(pfc_queue_conf->mode);
+	rte_trace_point_emit_u16(pfc_queue_conf->rx_pause.tx_qid);
+	rte_trace_point_emit_u16(pfc_queue_conf->tx_pause.rx_qid);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_rss_reta_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_rss_reta_entry64 *reta_conf,
+		uint16_t reta_size, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(reta_conf);
+	rte_trace_point_emit_u16(reta_size);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_rss_reta_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_rss_reta_entry64 *reta_conf,
+		uint16_t reta_size, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(reta_conf);
+	rte_trace_point_emit_u16(reta_size);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_rss_hash_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_rss_conf *rss_conf, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(rss_conf->rss_key);
+	rte_trace_point_emit_u8(rss_conf->rss_key_len);
+	rte_trace_point_emit_u64(rss_conf->rss_hf);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_rss_hash_conf_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_rss_conf *rss_conf, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(rss_conf->rss_key);
+	rte_trace_point_emit_u8(rss_conf->rss_key_len);
+	rte_trace_point_emit_u64(rss_conf->rss_hf);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_udp_tunnel_port_add,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_udp_tunnel *tunnel_udp, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(tunnel_udp->udp_port);
+	rte_trace_point_emit_u8(tunnel_udp->prot_type);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_udp_tunnel_port_delete,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_udp_tunnel *tunnel_udp, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(tunnel_udp->udp_port);
+	rte_trace_point_emit_u8(tunnel_udp->prot_type);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_led_on,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_led_off,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_fec_get_capability,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_fec_capa *speed_fec_capa,
+		unsigned int num, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(speed_fec_capa);
+	rte_trace_point_emit_u32(speed_fec_capa->speed);
+	rte_trace_point_emit_u32(speed_fec_capa->capa);
+	rte_trace_point_emit_u32(num);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_fec_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint32_t *fec_capa,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(fec_capa);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_fec_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t fec_capa, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(fec_capa);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_mac_addr_add,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_ether_addr *addr, uint32_t pool, int ret),
+	uint8_t len = RTE_ETHER_ADDR_LEN;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(addr);
+	rte_trace_point_emit_blob(addr->addr_bytes, len);
+	rte_trace_point_emit_u32(pool);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_mac_addr_remove,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_ether_addr *addr),
+	uint8_t len = RTE_ETHER_ADDR_LEN;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(addr);
+	rte_trace_point_emit_blob(addr->addr_bytes, len);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_default_mac_addr_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_ether_addr *addr),
+	uint8_t len = RTE_ETHER_ADDR_LEN;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(addr);
+	rte_trace_point_emit_blob(addr->addr_bytes, len);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_uc_hash_table_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint8_t on, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u8(on);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_uc_all_hash_table_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint8_t on, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u8(on);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_set_queue_rate_limit,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_idx,
+		uint16_t tx_rate, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_idx);
+	rte_trace_point_emit_u16(tx_rate);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_avail_thresh_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		uint8_t avail_thresh, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_u8(avail_thresh);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_avail_thresh_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_callback_register,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, enum rte_eth_event_type event,
+		rte_eth_dev_cb_fn cb_fn, const void *cb_arg, uint16_t next_port,
+		uint16_t last_port),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(event);
+	rte_trace_point_emit_ptr(cb_fn);
+	rte_trace_point_emit_ptr(cb_arg);
+	rte_trace_point_emit_u16(next_port);
+	rte_trace_point_emit_u16(last_port);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_callback_unregister,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, enum rte_eth_event_type event,
+		rte_eth_dev_cb_fn cb_fn, const void *cb_arg, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(event);
+	rte_trace_point_emit_ptr(cb_fn);
+	rte_trace_point_emit_ptr(cb_arg);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_rx_intr_ctl,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t qid, int epfd, int op,
+		const void *data, int rc),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(qid);
+	rte_trace_point_emit_int(epfd);
+	rte_trace_point_emit_int(op);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_rx_intr_ctl_q_get_fd,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int fd),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_int(fd);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_rx_intr_ctl_q,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int epfd,
+		int op, const void *data, int rc),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_int(epfd);
+	rte_trace_point_emit_int(op);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_add_rx_callback,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		rte_rx_callback_fn fn, void *user_param,
+		const struct rte_eth_rxtx_callback *cb),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(fn);
+	rte_trace_point_emit_ptr(user_param);
+	rte_trace_point_emit_ptr(cb);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_add_first_rx_callback,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		rte_rx_callback_fn fn, const void *user_param,
+		const struct rte_eth_rxtx_callback *cb),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(fn);
+	rte_trace_point_emit_ptr(user_param);
+	rte_trace_point_emit_ptr(cb);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_add_tx_callback,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		rte_tx_callback_fn fn, const void *user_param,
+		const struct rte_eth_rxtx_callback *cb),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(fn);
+	rte_trace_point_emit_ptr(user_param);
+	rte_trace_point_emit_ptr(cb);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_remove_rx_callback,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		const struct rte_eth_rxtx_callback *user_cb, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(user_cb);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_remove_tx_callback,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		const struct rte_eth_rxtx_callback *user_cb, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(user_cb);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_queue_info_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		const struct rte_eth_rxq_info *qinfo),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(qinfo->mp);
+	rte_trace_point_emit_u8(qinfo->conf.rx_drop_en);
+	rte_trace_point_emit_u64(qinfo->conf.offloads);
+	rte_trace_point_emit_u8(qinfo->scattered_rx);
+	rte_trace_point_emit_u8(qinfo->queue_state);
+	rte_trace_point_emit_u16(qinfo->nb_desc);
+	rte_trace_point_emit_u16(qinfo->rx_buf_size);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_tx_queue_info_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		const struct rte_eth_txq_info *qinfo),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_u16(qinfo->nb_desc);
+	rte_trace_point_emit_u8(qinfo->queue_state);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_burst_mode_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		const struct rte_eth_burst_mode *mode, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(mode);
+	rte_trace_point_emit_u64(mode->flags);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_tx_burst_mode_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		const struct rte_eth_burst_mode *mode, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(mode);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_get_monitor_addr,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		const struct rte_power_monitor_cond *pmc, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(pmc);
+	rte_trace_point_emit_ptr(pmc->addr);
+	rte_trace_point_emit_u8(pmc->size);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_set_mc_addr_list,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(mc_addr_set);
+	rte_trace_point_emit_u32(nb_mc_addr);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_timesync_enable,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_timesync_disable,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_timesync_write_time,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct timespec *time,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(time);
+	rte_trace_point_emit_size_t(time->tv_sec);
+	rte_trace_point_emit_long(time->tv_nsec);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_read_clock,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *clk, int ret),
+	uint64_t clk_v = *clk;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(clk);
+	rte_trace_point_emit_u64(clk_v);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_get_reg_info,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_dev_reg_info *info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(info);
+	rte_trace_point_emit_ptr(info->data);
+	rte_trace_point_emit_u32(info->offset);
+	rte_trace_point_emit_u32(info->length);
+	rte_trace_point_emit_u32(info->width);
+	rte_trace_point_emit_u32(info->version);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_get_eeprom_length,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_get_eeprom,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_dev_eeprom_info *info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(info);
+	rte_trace_point_emit_ptr(info->data);
+	rte_trace_point_emit_u32(info->offset);
+	rte_trace_point_emit_u32(info->length);
+	rte_trace_point_emit_u32(info->magic);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_set_eeprom,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_dev_eeprom_info *info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(info->data);
+	rte_trace_point_emit_u32(info->offset);
+	rte_trace_point_emit_u32(info->length);
+	rte_trace_point_emit_u32(info->magic);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_get_module_info,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_dev_module_info *modinfo, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(modinfo);
+	rte_trace_point_emit_u32(modinfo->type);
+	rte_trace_point_emit_u32(modinfo->eeprom_len);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_get_module_eeprom,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_dev_eeprom_info *info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_get_dcb_info,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_dcb_info *dcb_info, int ret),
+	uint8_t num_user_priorities = RTE_ETH_DCB_NUM_USER_PRIORITIES;
+	uint8_t num_tcs = RTE_ETH_DCB_NUM_TCS;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(dcb_info);
+	rte_trace_point_emit_u8(dcb_info->nb_tcs);
+	rte_trace_point_emit_blob(dcb_info->prio_tc, num_user_priorities);
+	rte_trace_point_emit_blob(dcb_info->tc_bws, num_tcs);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_adjust_nb_rx_tx_desc,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id),
+	rte_trace_point_emit_u16(port_id);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_hairpin_capability_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_hairpin_cap *cap, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(cap);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_pool_ops_supported,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *pool, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_string(pool);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_representor_info_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_representor_info *info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_rx_metadata_negotiate,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *features,
+		uint64_t features_val, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(features);
+	rte_trace_point_emit_u64(features_val);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_ip_reassembly_capability_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_ip_reassembly_params *capa, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(capa);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_ip_reassembly_conf_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_ip_reassembly_params *conf, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_ip_reassembly_conf_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_ip_reassembly_params *conf, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u32(conf->timeout_ms);
+	rte_trace_point_emit_u16(conf->max_frags);
+	rte_trace_point_emit_u16(conf->flags);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_buffer_split_get_supported_hdr_ptypes,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int supported_num,
+		uint32_t ptypes),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(supported_num);
+	rte_trace_point_emit_u32(ptypes);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_cman_info_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_cman_info *info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(info);
+	rte_trace_point_emit_u64(info->modes_supported);
+	rte_trace_point_emit_u64(info->objs_supported);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_cman_config_init,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_cman_config *config, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(config);
+	rte_trace_point_emit_int(config->obj);
+	rte_trace_point_emit_int(config->mode);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_cman_config_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_cman_config *config, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(config);
+	rte_trace_point_emit_int(config->obj);
+	rte_trace_point_emit_int(config->mode);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_eth_trace_cman_config_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_eth_cman_config *config, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(config);
+	rte_trace_point_emit_int(config->obj);
+	rte_trace_point_emit_int(config->mode);
+	rte_trace_point_emit_int(ret);
+)
+
 /* Fast path trace points */
 
 /* Called in loop in examples/qos_sched and examples/distributor */
@@ -635,6 +1444,90 @@ RTE_TRACE_POINT_FP(
 	rte_trace_point_emit_string(ret);
 )
 
+/* Called in loop in examples/bond and examples/ethtool */
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_macaddr_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_ether_addr *mac_addr),
+	uint8_t len = RTE_ETHER_ADDR_LEN;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(mac_addr);
+	rte_trace_point_emit_blob(mac_addr->addr_bytes, len);
+)
+
+/* Called in loop in examples/ip_pipeline */
+RTE_TRACE_POINT_FP(
+	rte_ethdev_trace_get_mtu,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t mtu),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(mtu);
+)
+
+/* Called in loop in examples/l3fwd-power */
+RTE_TRACE_POINT_FP(
+	rte_ethdev_trace_rx_intr_enable,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_int(ret);
+)
+
+/* Called in loop in examples/l3fwd-power */
+RTE_TRACE_POINT_FP(
+	rte_ethdev_trace_rx_intr_disable,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_int(ret);
+)
+
+/* Called in loop in examples/ptpclient */
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_timesync_read_rx_timestamp,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct timespec *timestamp,
+		uint32_t flags, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(timestamp);
+	rte_trace_point_emit_size_t(timestamp->tv_sec);
+	rte_trace_point_emit_long(timestamp->tv_nsec);
+	rte_trace_point_emit_u32(flags);
+	rte_trace_point_emit_int(ret);
+)
+
+/* Called in loop in examples/ptpclient */
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_timesync_read_tx_timestamp,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct timespec *timestamp,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(timestamp);
+	rte_trace_point_emit_size_t(timestamp->tv_sec);
+	rte_trace_point_emit_long(timestamp->tv_nsec);
+	rte_trace_point_emit_int(ret);
+)
+
+/* Called in loop in examples/ptpclient */
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_timesync_read_time,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct timespec *time,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(time);
+	rte_trace_point_emit_size_t(time->tv_sec);
+	rte_trace_point_emit_long(time->tv_nsec);
+	rte_trace_point_emit_int(ret);
+)
+
+/* Called in loop in examples/ptpclient */
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_timesync_adjust_time,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int64_t delta, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_i64(delta);
+	rte_trace_point_emit_int(ret);
+)
+
 #ifdef __cplusplus
 }
 #endif
lib/ethdev/ethdev_trace_points.c +252 -0

255 lines not on this page · raw message

lib/ethdev/rte_ethdev.c +411 -75

1,231 lines not on this page · raw message

lib/ethdev/rte_ethdev_cman.c +25 -4
index 4a1bdd7bd0..a9c4637521 100644
@@ -8,12 +8,14 @@
 #include "rte_ethdev.h"
 #include "ethdev_driver.h"
 #include "ethdev_private.h"
+#include "ethdev_trace.h"
 
 /* Get congestion management information for a port */
 int
 rte_eth_cman_info_get(uint16_t port_id, struct rte_eth_cman_info *info)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -29,7 +31,11 @@ rte_eth_cman_info_get(uint16_t port_id, struct rte_eth_cman_info *info)
 	}
 
 	memset(info, 0, sizeof(struct rte_eth_cman_info));
-	return eth_err(port_id, (*dev->dev_ops->cman_info_get)(dev, info));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_info_get)(dev, info));
+
+	rte_eth_trace_cman_info_get(port_id, info, ret);
+
+	return ret;
 }
 
 /* Initialize congestion management structure with default values */
@@ -37,6 +43,7 @@ int
 rte_eth_cman_config_init(uint16_t port_id, struct rte_eth_cman_config *config)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -52,7 +59,11 @@ rte_eth_cman_config_init(uint16_t port_id, struct rte_eth_cman_config *config)
 	}
 
 	memset(config, 0, sizeof(struct rte_eth_cman_config));
-	return eth_err(port_id, (*dev->dev_ops->cman_config_init)(dev, config));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_config_init)(dev, config));
+
+	rte_eth_trace_cman_config_init(port_id, config, ret);
+
+	return ret;
 }
 
 /* Configure congestion management on a port */
@@ -60,6 +71,7 @@ int
 rte_eth_cman_config_set(uint16_t port_id, const struct rte_eth_cman_config *config)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -74,7 +86,11 @@ rte_eth_cman_config_set(uint16_t port_id, const struct rte_eth_cman_config *conf
 		return -ENOTSUP;
 	}
 
-	return eth_err(port_id, (*dev->dev_ops->cman_config_set)(dev, config));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_config_set)(dev, config));
+
+	rte_eth_trace_cman_config_set(port_id, config, ret);
+
+	return ret;
 }
 
 /* Retrieve congestion management configuration of a port */
@@ -82,6 +98,7 @@ int
 rte_eth_cman_config_get(uint16_t port_id, struct rte_eth_cman_config *config)
 {
 	struct rte_eth_dev *dev;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
@@ -97,5 +114,9 @@ rte_eth_cman_config_get(uint16_t port_id, struct rte_eth_cman_config *config)
 	}
 
 	memset(config, 0, sizeof(struct rte_eth_cman_config));
-	return eth_err(port_id, (*dev->dev_ops->cman_config_get)(dev, config));
+	ret = eth_err(port_id, (*dev->dev_ops->cman_config_get)(dev, config));
+
+	rte_eth_trace_cman_config_get(port_id, config, ret);
+
+	return ret;
 }
Signature · 1 line
2.25.1
#129 lore raw

PATCH v8 4/6 ethdev: add trace points for flow

In reply to Ankur Dwivedi

Adds trace points for rte_flow specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace.h        | 502 +++++++++++++++++++++++++++++++
 lib/ethdev/ethdev_trace_points.c | 117 +++++++
 lib/ethdev/rte_flow.c            | 356 +++++++++++++++++-----
 3 files changed, 896 insertions(+), 79 deletions(-)
lib/ethdev/ethdev_trace.h +502 -0
index 9039446b5f..0604c0290e 100644
@@ -1401,6 +1401,277 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_int(ret);
 )
 
+RTE_TRACE_POINT(
+	rte_flow_trace_dynf_metadata_register,
+	RTE_TRACE_POINT_ARGS(int offset, uint64_t flag),
+	rte_trace_point_emit_int(offset);
+	rte_trace_point_emit_u64(flag);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_validate,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_attr *attr,
+		const struct rte_flow_item *pattern,
+		const struct rte_flow_action *actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flush,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_conv,
+	RTE_TRACE_POINT_ARGS(enum rte_flow_conv_op op, const void *dst,
+		size_t size, const void *src, int ret),
+	rte_trace_point_emit_int(op);
+	rte_trace_point_emit_ptr(dst);
+	rte_trace_point_emit_size_t(size);
+	rte_trace_point_emit_ptr(src);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_copy,
+	RTE_TRACE_POINT_ARGS(struct rte_flow_desc *fd, size_t len,
+		const struct rte_flow_attr *attr,
+		const struct rte_flow_item *items,
+		const struct rte_flow_action *actions, int ret),
+	rte_trace_point_emit_ptr(fd);
+	rte_trace_point_emit_size_t(len);
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_int(items->type);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_int(actions->type);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_decap_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_tunnel *tunnel,
+		struct rte_flow_action **actions,
+		const uint32_t *num_of_actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(tunnel);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(num_of_actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_match,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_tunnel *tunnel,
+		struct rte_flow_item **items,
+		const uint32_t *num_of_items, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(tunnel);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_ptr(num_of_items);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_action_decap_release,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_action *actions, uint32_t num_of_actions,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_u32(num_of_actions);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_tunnel_item_release,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_item *items, uint32_t num_of_items,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(items);
+	rte_trace_point_emit_u32(num_of_items);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flex_item_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_item_flex_conf *conf,
+		const struct rte_flow_item_flex_handle *handle),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_int(conf->tunnel);
+	rte_trace_point_emit_int(conf->nb_samples);
+	rte_trace_point_emit_int(conf->nb_inputs);
+	rte_trace_point_emit_int(conf->nb_outputs);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_flex_item_release,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_item_flex_handle *handle, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_info_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_port_info *port_info,
+		const struct rte_flow_queue_info *queue_info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(port_info);
+	rte_trace_point_emit_u32(port_info->max_nb_queues);
+	rte_trace_point_emit_u32(port_info->max_nb_counters);
+	rte_trace_point_emit_u32(port_info->max_nb_aging_objects);
+	rte_trace_point_emit_u32(port_info->max_nb_meters);
+	rte_trace_point_emit_u32(port_info->max_nb_conn_tracks);
+	rte_trace_point_emit_u32(port_info->supported_flags);
+	rte_trace_point_emit_ptr(queue_info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_configure,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_port_attr *port_attr,
+		uint16_t nb_queue,
+		const struct rte_flow_queue_attr **queue_attr, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(port_attr);
+	rte_trace_point_emit_u32(port_attr->nb_counters);
+	rte_trace_point_emit_u32(port_attr->nb_aging_objects);
+	rte_trace_point_emit_u32(port_attr->nb_meters);
+	rte_trace_point_emit_u32(port_attr->nb_conn_tracks);
+	rte_trace_point_emit_u32(port_attr->flags);
+	rte_trace_point_emit_u16(nb_queue);
+	rte_trace_point_emit_ptr(queue_attr);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_pattern_template_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_pattern_template_attr *template_attr,
+		const struct rte_flow_item *pattern, const void *tmplate),
+	uint8_t relaxed_matching = template_attr->relaxed_matching;
+	uint8_t ingress = template_attr->ingress;
+	uint8_t egress = template_attr->egress;
+	uint8_t transfer = template_attr->transfer;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_attr);
+	rte_trace_point_emit_u8(relaxed_matching);
+	rte_trace_point_emit_u8(ingress);
+	rte_trace_point_emit_u8(egress);
+	rte_trace_point_emit_u8(transfer);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(tmplate);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_pattern_template_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_pattern_template *pattern_template,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(pattern_template);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_actions_template_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_actions_template_attr *template_attr,
+		const struct rte_flow_action *actions,
+		const struct rte_flow_action *masks, const void *tmplate),
+	uint8_t ingress = template_attr->ingress;
+	uint8_t egress = template_attr->egress;
+	uint8_t transfer = template_attr->transfer;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_attr);
+	rte_trace_point_emit_u8(ingress);
+	rte_trace_point_emit_u8(egress);
+	rte_trace_point_emit_u8(transfer);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(masks);
+	rte_trace_point_emit_ptr(tmplate);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_actions_template_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_actions_template *actions_template,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(actions_template);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_template_table_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_template_table_attr *table_attr,
+		struct rte_flow_pattern_template **pattern_templates,
+		uint8_t nb_pattern_templates,
+		struct rte_flow_actions_template **actions_templates,
+		uint8_t nb_actions_templates,
+		const struct rte_flow_template_table *table),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(table_attr);
+	rte_trace_point_emit_u32(table_attr->nb_flows);
+	rte_trace_point_emit_ptr(pattern_templates);
+	rte_trace_point_emit_u8(nb_pattern_templates);
+	rte_trace_point_emit_ptr(actions_templates);
+	rte_trace_point_emit_u8(nb_actions_templates);
+	rte_trace_point_emit_ptr(table);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_template_table_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_template_table *template_table, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(template_table);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_async_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow *flow, const void *user_data, int ret),
+	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(flow);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_flow_trace_push,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_int(ret);
+)
+
 /* Fast path trace points */
 
 /* Called in loop in examples/qos_sched and examples/distributor */
@@ -1528,6 +1799,237 @@ RTE_TRACE_POINT_FP(
 	rte_trace_point_emit_int(ret);
 )
 
+/* Called in loop in app/test-flow-perf */
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_flow_attr *attr,
+		const struct rte_flow_item *pattern,
+		const struct rte_flow_action *actions,
+		const struct rte_flow *flow),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(attr->group);
+	rte_trace_point_emit_u32(attr->priority);
+	rte_trace_point_emit_ptr(pattern);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_ptr(flow);
+)
+
+/* Called in loop in app/test-flow-perf */
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_flow *flow,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(flow);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_flow *flow,
+		const struct rte_flow_action *action, const void *data,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(flow);
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_int(action->type);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_isolate,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int set, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(set);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_aged_flows,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, void **contexts,
+		uint32_t nb_contexts, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(contexts);
+	rte_trace_point_emit_u32(nb_contexts);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_q_aged_flows,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		void **contexts, uint32_t nb_contexts, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_ptr(contexts);
+	rte_trace_point_emit_u32(nb_contexts);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_action_handle_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_indir_action_conf *conf,
+		const struct rte_flow_action *action,
+		const struct rte_flow_action_handle *handle),
+	uint8_t ingress = conf->ingress;
+	uint8_t egress = conf->egress;
+	uint8_t transfer = conf->transfer;
+
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(conf);
+	rte_trace_point_emit_u8(ingress);
+	rte_trace_point_emit_u8(egress);
+	rte_trace_point_emit_u8(transfer);
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_int(action->type);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_action_handle_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_action_handle *handle, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_action_handle_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_action_handle *handle,
+		const void *update, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_ptr(update);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_action_handle_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_flow_action_handle *handle,
+		const void *data, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(handle);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_get_restore_info,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_mbuf *m,
+		const struct rte_flow_restore_info *info, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(m);
+	rte_trace_point_emit_ptr(info);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_pick_transfer_proxy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint16_t *proxy_port_id,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(proxy_port_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_create,
+	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,
+		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_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_pull,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_result *res, uint16_t n_res, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(queue_id);
+	rte_trace_point_emit_ptr(res);
+	rte_trace_point_emit_u16(n_res);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_action_handle_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_indir_action_conf *indir_action_conf,
+		const struct rte_flow_action *action,
+		const void *user_data,
+		const struct rte_flow_action_handle *handle),
+	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(indir_action_conf);
+	rte_trace_point_emit_ptr(action);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_ptr(handle);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_action_handle_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_action_handle *action_handle,
+		const void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_action_handle_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_action_handle *action_handle,
+		const void *update, const void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(update);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_flow_trace_async_action_handle_query,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
+		const struct rte_flow_op_attr *op_attr,
+		const struct rte_flow_action_handle *action_handle,
+		const void *data, const void *user_data, int ret),
+	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(action_handle);
+	rte_trace_point_emit_ptr(data);
+	rte_trace_point_emit_ptr(user_data);
+	rte_trace_point_emit_int(ret);
+)
+
 #ifdef __cplusplus
 }
 #endif
lib/ethdev/ethdev_trace_points.c +117 -0

120 lines not on this page · raw message

lib/ethdev/rte_flow.c +277 -79

668 lines not on this page · raw message

Signature · 1 line
2.25.1
#130 lore raw

PATCH v8 5/6 ethdev: add trace points for mtr

In reply to Ankur Dwivedi

Adds trace points for rte_mtr specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace.h        | 223 +++++++++++++++++++++++++++++++
 lib/ethdev/ethdev_trace_points.c |  63 +++++++++
 lib/ethdev/rte_mtr.c             | 156 ++++++++++++++++++---
 3 files changed, 421 insertions(+), 21 deletions(-)
lib/ethdev/ethdev_trace.h +223 -0
index 0604c0290e..5285a04c67 100644
@@ -19,6 +19,7 @@ extern "C" {
 #include <rte_trace_point.h>
 
 #include "rte_ethdev.h"
+#include "rte_mtr.h"
 
 RTE_TRACE_POINT(
 	rte_ethdev_trace_configure,
@@ -1672,6 +1673,192 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_int(ret);
 )
 
+RTE_TRACE_POINT(
+	rte_mtr_trace_capabilities_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_mtr_capabilities *cap, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(cap);
+	rte_trace_point_emit_u32(cap->n_max);
+	rte_trace_point_emit_u32(cap->n_shared_max);
+	rte_trace_point_emit_int(cap->identical);
+	rte_trace_point_emit_int(cap->shared_identical);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_profile_add,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		uint32_t meter_profile_id,
+		const struct rte_mtr_meter_profile *profile, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(meter_profile_id);
+	rte_trace_point_emit_int(profile->alg);
+	rte_trace_point_emit_int(profile->packet_mode);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_profile_delete,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		uint32_t meter_profile_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(meter_profile_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_profile_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		uint32_t meter_profile_id, const void *ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(meter_profile_id);
+	rte_trace_point_emit_ptr(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_policy_validate,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int i,
+		const struct rte_flow_action *actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(i);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_int(actions->type);
+	rte_trace_point_emit_ptr(actions->conf);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_policy_add,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, int i,
+		const struct rte_flow_action *actions, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(i);
+	rte_trace_point_emit_u32(policy_id);
+	rte_trace_point_emit_ptr(actions);
+	rte_trace_point_emit_int(actions->type);
+	rte_trace_point_emit_ptr(actions->conf);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_policy_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id,
+		const void *ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(policy_id);
+	rte_trace_point_emit_ptr(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_enable,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_disable,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_profile_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id,
+		uint32_t meter_profile_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_u32(meter_profile_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_policy_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id,
+		uint32_t meter_policy_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_u32(meter_policy_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_dscp_table_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id,
+		enum rte_color *dscp_table, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_ptr(dscp_table);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_meter_vlan_table_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id,
+		const enum rte_color *vlan_table, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_ptr(vlan_table);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_color_in_protocol_set,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id,
+		enum rte_mtr_color_in_protocol proto, uint32_t priority,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_int(proto);
+	rte_trace_point_emit_u32(priority);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_color_in_protocol_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_color_in_protocol_priority_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id,
+		enum rte_mtr_color_in_protocol proto, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_int(proto);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_stats_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id,
+		uint64_t stats_mask, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_u64(stats_mask);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_mtr_trace_stats_read,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id,
+		const struct rte_mtr_stats *stats, uint64_t stats_mask,
+		int clear, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_ptr(stats);
+	rte_trace_point_emit_u64(stats_mask);
+	rte_trace_point_emit_int(clear);
+	rte_trace_point_emit_int(ret);
+)
+
 /* Fast path trace points */
 
 /* Called in loop in examples/qos_sched and examples/distributor */
@@ -2030,6 +2217,42 @@ RTE_TRACE_POINT_FP(
 	rte_trace_point_emit_int(ret);
 )
 
+/* Called in loop in app/test-flow-perf */
+RTE_TRACE_POINT_FP(
+	rte_mtr_trace_create,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id,
+		const struct rte_mtr_params *params, int shared, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_ptr(params);
+	rte_trace_point_emit_u32(params->meter_profile_id);
+	rte_trace_point_emit_int(params->use_prev_mtr_color);
+	rte_trace_point_emit_int(params->meter_enable);
+	rte_trace_point_emit_u64(params->stats_mask);
+	rte_trace_point_emit_u32(params->meter_policy_id);
+	rte_trace_point_emit_int(params->default_input_color);
+	rte_trace_point_emit_int(shared);
+	rte_trace_point_emit_int(ret);
+)
+
+/* Called in loop in app/test-flow-perf */
+RTE_TRACE_POINT_FP(
+	rte_mtr_trace_destroy,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(mtr_id);
+	rte_trace_point_emit_int(ret);
+)
+
+/* Called in loop in app/test-flow-perf */
+RTE_TRACE_POINT_FP(
+	rte_mtr_trace_meter_policy_delete,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(policy_id);
+	rte_trace_point_emit_int(ret);
+)
+
 #ifdef __cplusplus
 }
 #endif
lib/ethdev/ethdev_trace_points.c +63 -0

66 lines not on this page · raw message

lib/ethdev/rte_mtr.c +135 -21

307 lines not on this page · raw message

Signature · 1 line
2.25.1
#131 lore raw

PATCH v8 6/6 ethdev: add trace points for tm

In reply to Ankur Dwivedi

Adds trace points for rte_tm specific functions in ethdev lib.

---
 lib/ethdev/ethdev_trace.h        | 332 +++++++++++++++++++++++++++++++
 lib/ethdev/ethdev_trace_points.c |  90 +++++++++
 lib/ethdev/rte_tm.c              | 225 ++++++++++++++++++---
 3 files changed, 618 insertions(+), 29 deletions(-)
lib/ethdev/ethdev_trace.h +332 -0
index 5285a04c67..ffad9fd872 100644
@@ -20,6 +20,7 @@ extern "C" {
 
 #include "rte_ethdev.h"
 #include "rte_mtr.h"
+#include "rte_tm.h"
 
 RTE_TRACE_POINT(
 	rte_ethdev_trace_configure,
@@ -1859,6 +1860,337 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_int(ret);
 )
 
+RTE_TRACE_POINT(
+	rte_tm_trace_get_number_of_leaf_nodes,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t n_leaf_nodes),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(n_leaf_nodes);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_type_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, int is_leaf,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_int(is_leaf);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_capabilities_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id,
+		const struct rte_tm_capabilities *cap, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_ptr(cap);
+	rte_trace_point_emit_u32(cap->n_nodes_max);
+	rte_trace_point_emit_u32(cap->n_levels_max);
+	rte_trace_point_emit_int(cap->non_leaf_nodes_identical);
+	rte_trace_point_emit_int(cap->leaf_nodes_identical);
+	rte_trace_point_emit_u32(cap->shaper_n_max);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_level_capabilities_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t level_id,
+		const struct rte_tm_level_capabilities *cap, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(level_id);
+	rte_trace_point_emit_ptr(cap);
+	rte_trace_point_emit_u32(cap->n_nodes_max);
+	rte_trace_point_emit_u32(cap->n_nodes_nonleaf_max);
+	rte_trace_point_emit_u32(cap->n_nodes_leaf_max);
+	rte_trace_point_emit_u32(cap->non_leaf_nodes_identical);
+	rte_trace_point_emit_u32(cap->leaf_nodes_identical);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_capabilities_get,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		const struct rte_tm_node_capabilities *cap, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_ptr(cap);
+	rte_trace_point_emit_int(cap->shaper_private_supported);
+	rte_trace_point_emit_int(cap->shaper_private_dual_rate_supported);
+	rte_trace_point_emit_int(cap->shaper_private_packet_mode_supported);
+	rte_trace_point_emit_int(cap->shaper_private_byte_mode_supported);
+	rte_trace_point_emit_u32(cap->shaper_shared_n_max);
+	rte_trace_point_emit_u64(cap->stats_mask);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_wred_profile_add,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id,
+		const struct rte_tm_wred_params *profile, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(wred_profile_id);
+	rte_trace_point_emit_ptr(profile);
+	rte_trace_point_emit_int(profile->packet_mode);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_wred_profile_delete,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(wred_profile_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_shared_wred_context_add_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_wred_context_id,
+		uint32_t wred_profile_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(shared_wred_context_id);
+	rte_trace_point_emit_u32(wred_profile_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_shared_wred_context_delete,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_wred_context_id,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(shared_wred_context_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_shaper_profile_add,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id,
+		const struct rte_tm_shaper_params *profile, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(shaper_profile_id);
+	rte_trace_point_emit_ptr(profile);
+	rte_trace_point_emit_u64(profile->committed.rate);
+	rte_trace_point_emit_u64(profile->committed.size);
+	rte_trace_point_emit_u64(profile->peak.rate);
+	rte_trace_point_emit_u64(profile->peak.size);
+	rte_trace_point_emit_i32(profile->pkt_length_adjust);
+	rte_trace_point_emit_int(profile->packet_mode);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_shaper_profile_delete,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(shaper_profile_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_shared_shaper_add_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_shaper_id,
+		uint32_t shaper_profile_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(shared_shaper_id);
+	rte_trace_point_emit_u32(shaper_profile_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_shared_shaper_delete,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_shaper_id,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(shared_shaper_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_add,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		uint32_t parent_node_id, uint32_t priority,
+		uint32_t weight, uint32_t level_id,
+		const struct rte_tm_node_params *params, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_u32(parent_node_id);
+	rte_trace_point_emit_u32(priority);
+	rte_trace_point_emit_u32(weight);
+	rte_trace_point_emit_u32(level_id);
+	rte_trace_point_emit_ptr(params);
+	rte_trace_point_emit_u32(params->shaper_profile_id);
+	rte_trace_point_emit_u32(params->n_shared_shapers);
+	rte_trace_point_emit_u64(params->stats_mask);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_delete,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_suspend,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_resume,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_hierarchy_commit,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int clear_on_fail, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(clear_on_fail);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_parent_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		uint32_t parent_node_id, uint32_t priority,
+		uint32_t weight, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_u32(parent_node_id);
+	rte_trace_point_emit_u32(priority);
+	rte_trace_point_emit_u32(weight);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_shaper_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		uint32_t shaper_profile_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_u32(shaper_profile_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_shared_shaper_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		uint32_t shared_shaper_id, int add, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_u32(shared_shaper_id);
+	rte_trace_point_emit_int(add);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_stats_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		uint64_t stats_mask, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_u64(stats_mask);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_wfq_weight_mode_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		const int *wfq_weight_mode, uint32_t n_sp_priorities,
+		int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_ptr(wfq_weight_mode);
+	rte_trace_point_emit_u32(n_sp_priorities);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_cman_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		enum rte_tm_cman_mode cman, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_int(cman);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_wred_context_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		uint32_t wred_profile_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_u32(wred_profile_id);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_shared_wred_context_update,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		uint32_t shared_wred_context_id, int add, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_u32(shared_wred_context_id);
+	rte_trace_point_emit_int(add);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_node_stats_read,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id,
+		const struct rte_tm_node_stats *stats,
+		uint64_t stats_mask, int clear, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u32(node_id);
+	rte_trace_point_emit_ptr(stats);
+	rte_trace_point_emit_u64(stats->n_pkts);
+	rte_trace_point_emit_u64(stats->n_bytes);
+	rte_trace_point_emit_u64(stats_mask);
+	rte_trace_point_emit_int(clear);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_mark_vlan_dei,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green,
+		int mark_yellow, int mark_red, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(mark_green);
+	rte_trace_point_emit_int(mark_yellow);
+	rte_trace_point_emit_int(mark_red);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_mark_ip_ecn,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green,
+		int mark_yellow, int mark_red, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(mark_green);
+	rte_trace_point_emit_int(mark_yellow);
+	rte_trace_point_emit_int(mark_red);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_tm_trace_mark_ip_dscp,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green,
+		int mark_yellow, int mark_red, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_int(mark_green);
+	rte_trace_point_emit_int(mark_yellow);
+	rte_trace_point_emit_int(mark_red);
+	rte_trace_point_emit_int(ret);
+)
+
 /* Fast path trace points */
 
 /* Called in loop in examples/qos_sched and examples/distributor */
lib/ethdev/ethdev_trace_points.c +90 -0

93 lines not on this page · raw message

lib/ethdev/rte_tm.c +196 -29

439 lines not on this page · raw message

Signature · 1 line
2.25.1
#132 lore raw

v9 cover add trace points in ethdev library

In reply to Ankur Dwivedi

This series adds trace points for functions in the ethdev library. The trace points are added in ethdev, flow, mtr and tm files.

v9:
- Added __rte_eal_trace_generic_blob in lib/eal/version.map file.

v8:
- Resolved review comments on ethdev patch.
- The file rte_ethdev_trace.h and rte_ethdev_trace_fp_burst.h(added in this patch series) is removed. The file ethdev_trace.h is added as an internal header. It contains internal slow path and fastpath tracepoints. The rte_ethdev_trace_fp.h contains public fastpath tracepoints.
- In patch (2/6) removed extra call to rte_eth_trace_find_next with RTE_MAX_ETHPORTS.
- In patch (2/6), added parent argument in rte_eth_trace_find_next_of().
- In patches (2/6 and 4/6), provided appropriate data type to bit fields in following tracepoints:
rte_eth_trace_rx_hairpin_queue_setup, rte_eth_trace_tx_hairpin_queue_setup, rte_eth_trace_link_get_nowait, rte_eth_trace_link_to_str, rte_eth_trace_link_get, rte_flow_trace_pattern_template_create, rte_flow_trace_actions_template_create and rte_flow_trace_action_handle_create.
- Tracepoints moved from fastpath to slowpath in ethdev, mtr and tm.
- Moved few flow related tracepoints to fastpath as suggested in review comments.
- Added const to the pointer parameters in tracepoints.
- The following tracepoints are moved to the end of the function to capture return values:
rte_eth_trace_link_speed_to_str, rte_flow_trace_conv, rte_mtr_trace_meter_policy_validate, rte_mtr_trace_meter_policy_add, rte_mtr_trace_meter_policy_delete, rte_eth_find_next_sibling and rte_eth_trace_speed_bitflag.
- Removed tracepoints from version.map file.
- Formatting changes.

v7:
- Resolves build failure.
- Changes in rte_trace_point_emit_blob() function in rte_trace_point.h and rte_trace_point_register.h.

v6:
- Resolves compilation error with 32 bit build.
- Resolves a bug found in v5 in the trace autotest application where the traces where not getting generated after the first blob test case. The trace size needs to be known at trace point register, so a dynamic length array cannot be implemented with current implementation. So changing the metadata of blob to make the array as 64 bytes. The length will denote the blob length(passed by the application). The trailing unused fields will be set to zero if length is less than 64.

For example, the following is the ctf metadata created to display a mac addr array in rte_eth_trace_macaddr_get():

   struct {
      ...
      uint8_t len;
      uint8_t mac_addr_addr_bytes[64];

};
- Minor changes in the subject of patches (2/6) and (3/6).

v5:
- The rte_trace_point_emit_char_array function is renamed to rte_trace_point_emit_blob. With this function an array of any length upto 65535 bytes can be captured.
For example, the following is the ctf metadata created to display a mac addr array in rte_eth_trace_macaddr_get():

   struct {
      ...
      uint16_t len;
      uint8_t mac_addr_addr_bytes[len];

};
- Added additional test cases for rte_eal_trace_generic_blob test case.
- Capturing of return value of a function is added to tracepoint for flow, mtr and tm patches.
- In ehdev patch (1/6), removed extra line. Also added rx_pkts and tx_pkts pointer in trace point.

v4:
- Adds tracepoint function to emit char array. Also adds the test case.
- Resolved review comments on "ethdev: add trace point" patch. This patch is divided into 2 patches to minimize per patch size.
- From the earlier version (v3), few tracepoints in ethdev, flow, mtr, tm are made as fast path tracepoints. For the tracepoint which i was unsure, i have made it as fastpath. All the fast path tracepoints can be found in rte_ethdev_trace_fp.h and rte_ethdev_trace_fp_burst.h. All the slow path tracepoints can be found in rte_ethdev_trace.h.
- Capturing of return value is added to tracepoint in ethdev. For flow, mtr and tm these changes are still yet to bde done. Will do it in the next versions.
- Moved the trace functions from INTERNAL to EXPERIMENTAL in version.map.

v3:
- Moved the trace functions from EXPERIMENTAL to INTERNAL in version.map.
- Moved trace functions call to the end, in ethdev and flow trace.
- Added code to print the input value of features in rte_eth_trace_rx_metadata_negotiate().
- Added code to capture return value in flow trace.

Ankur Dwivedi (6):
eal: trace: add trace point emit for blob
ethdev: add trace points for ethdev (part one)
ethdev: add trace points for ethdev (part two)
ethdev: add trace points for flow
ethdev: add trace points for mtr
ethdev: add trace points for tm

 app/test/test_trace.c                      |   11 +
 doc/guides/prog_guide/trace_lib.rst        |   12 +
 lib/eal/common/eal_common_trace_points.c   |    2 +
 lib/eal/include/rte_eal_trace.h            |    6 +
 lib/eal/include/rte_trace_point.h          |   31 +
 lib/eal/include/rte_trace_point_register.h |    9 +
 lib/eal/version.map                        |    1 +
 lib/ethdev/ethdev_private.c                |    7 +
 lib/ethdev/ethdev_trace.h                  | 2592 ++++++++++++++++++++
 lib/ethdev/ethdev_trace_points.c           |  717 +++++-
 lib/ethdev/meson.build                     |    2 +-
 lib/ethdev/rte_ethdev.c                    |  872 ++++++-
 lib/ethdev/rte_ethdev_cman.c               |   29 +-
 lib/ethdev/rte_ethdev_trace.h              |   95 -
 lib/ethdev/rte_ethdev_trace_fp.h           |   36 +
 lib/ethdev/rte_flow.c                      |  356 ++-
 lib/ethdev/rte_mtr.c                       |  156 +-
 lib/ethdev/rte_tm.c                        |  225 +-
 18 files changed, 4794 insertions(+), 365 deletions(-)
 create mode 100644 lib/ethdev/ethdev_trace.h
 delete mode 100644 lib/ethdev/rte_ethdev_trace.h
Signature · 1 line
2.25.1
#133 lore raw

PATCH v9 1/6 eal: trace: add trace point emit for blob

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

This patch also adds test case for emit blob tracepoint function.

---
 app/test/test_trace.c                      | 11 ++++++++
 doc/guides/prog_guide/trace_lib.rst        | 12 +++++++++
 lib/eal/common/eal_common_trace_points.c   |  2 ++
 lib/eal/include/rte_eal_trace.h            |  6 +++++
 lib/eal/include/rte_trace_point.h          | 31 ++++++++++++++++++++++
 lib/eal/include/rte_trace_point_register.h |  9 +++++++
 lib/eal/version.map                        |  1 +
 7 files changed, 72 insertions(+)
app/test/test_trace.c +11 -0
index 6bedf14024..ad4a394a29 100644
@@ -4,6 +4,7 @@
 
 #include <rte_eal_trace.h>
 #include <rte_lcore.h>
+#include <rte_random.h>
 #include <rte_trace.h>
 
 #include "test.h"
@@ -177,7 +178,12 @@ test_fp_trace_points(void)
 static int
 test_generic_trace_points(void)
 {
+	uint8_t arr[RTE_TRACE_BLOB_LEN_MAX];
 	int tmp;
+	int i;
+
+	for (i = 0; i < RTE_TRACE_BLOB_LEN_MAX; i++)
+		arr[i] = i;
 
 	rte_eal_trace_generic_void();
 	rte_eal_trace_generic_u64(0x10000000000000);
@@ -195,6 +201,11 @@ test_generic_trace_points(void)
 	rte_eal_trace_generic_ptr(&tmp);
 	rte_eal_trace_generic_str("my string");
 	rte_eal_trace_generic_size_t(sizeof(void *));
+	rte_eal_trace_generic_blob(arr, 0);
+	rte_eal_trace_generic_blob(arr, 17);
+	rte_eal_trace_generic_blob(arr, RTE_TRACE_BLOB_LEN_MAX);
+	rte_eal_trace_generic_blob(arr, rte_rand() %
+					RTE_TRACE_BLOB_LEN_MAX);
 	RTE_EAL_TRACE_GENERIC_FUNC;
 
 	return TEST_SUCCESS;
doc/guides/prog_guide/trace_lib.rst +12 -0
index 9a8f38073d..3e0ea5835c 100644
@@ -352,3 +352,15 @@ event ID.
 The ``packet.header`` and ``packet.context`` will be written in the slow path
 at the time of trace memory creation. The ``trace.header`` and trace payload
 will be emitted when the tracepoint function is invoked.
+
+Limitations
+-----------
+
+- The ``rte_trace_point_emit_blob()`` function can capture a maximum blob of
+  length ``RTE_TRACE_BLOB_LEN_MAX`` bytes. The application can call
+  ``rte_trace_point_emit_blob()`` multiple times with length less than or equal to
+  ``RTE_TRACE_BLOB_LEN_MAX``, if it needs to capture more than ``RTE_TRACE_BLOB_LEN_MAX``
+  bytes.
+- If the length passed to the ``rte_trace_point_emit_blob()`` is less than
+  ``RTE_TRACE_BLOB_LEN_MAX``, then the trailing ``(RTE_TRACE_BLOB_LEN_MAX - len)``
+  bytes in the trace are set to zero.
lib/eal/common/eal_common_trace_points.c +2 -0
index 0b0b254615..051f89809c 100644
@@ -40,6 +40,8 @@ RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_size_t,
 	lib.eal.generic.size_t)
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_func,
 	lib.eal.generic.func)
+RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_blob,
+	lib.eal.generic.blob)
 
 RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set,
 	lib.eal.alarm.set)
lib/eal/include/rte_eal_trace.h +6 -0
index 5ef4398230..6f5c022558 100644
@@ -143,6 +143,12 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_string(func);
 )
 
+RTE_TRACE_POINT(
+	rte_eal_trace_generic_blob,
+	RTE_TRACE_POINT_ARGS(const void *in, uint8_t len),
+	rte_trace_point_emit_blob(in, len);
+)
+
 #define RTE_EAL_TRACE_GENERIC_FUNC rte_eal_trace_generic_func(__func__)
 
 /* Interrupt */
lib/eal/include/rte_trace_point.h +31 -0
index 0f8700974f..4d6b5700dd 100644
@@ -144,6 +144,16 @@ _tp _args \
 #define rte_trace_point_emit_ptr(val)
 /** Tracepoint function payload for string datatype */
 #define rte_trace_point_emit_string(val)
+/**
+ * Tracepoint function to capture a blob.
+ *
+ * @param val
+ *   Pointer to the array to be captured.
+ * @param len
+ *   Length to be captured. The maximum supported length is
+ *   RTE_TRACE_BLOB_LEN_MAX bytes.
+ */
+#define rte_trace_point_emit_blob(val, len)
 
 #endif /* __DOXYGEN__ */
 
@@ -152,6 +162,9 @@ _tp _args \
 /** @internal Macro to define event header size. */
 #define __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t)
 
+/** Macro to define maximum emit length of blob. */
+#define RTE_TRACE_BLOB_LEN_MAX 64
+
 /**
  * Enable recording events of the given tracepoint in the trace buffer.
  *
@@ -374,12 +387,30 @@ do { \
 	mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX); \
 } while (0)
 
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+	if (unlikely(in == NULL)) \
+		return; \
+	if (len > RTE_TRACE_BLOB_LEN_MAX) \
+		len = RTE_TRACE_BLOB_LEN_MAX; \
+	__rte_trace_point_emit(len, uint8_t); \
+	memcpy(mem, in, len); \
+	memset(RTE_PTR_ADD(mem, len), 0, RTE_TRACE_BLOB_LEN_MAX - len); \
+	mem = RTE_PTR_ADD(mem, RTE_TRACE_BLOB_LEN_MAX); \
+} while (0)
+
 #else
 
 #define __rte_trace_point_emit_header_generic(t) RTE_SET_USED(t)
 #define __rte_trace_point_emit_header_fp(t) RTE_SET_USED(t)
 #define __rte_trace_point_emit(in, type) RTE_SET_USED(in)
 #define rte_trace_point_emit_string(in) RTE_SET_USED(in)
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+	RTE_SET_USED(in); \
+	RTE_SET_USED(len); \
+} while (0)
+
 
 #endif /* ALLOW_EXPERIMENTAL_API */
 #endif /* _RTE_TRACE_POINT_REGISTER_H_ */
lib/eal/include/rte_trace_point_register.h +9 -0
index a32f4d731b..a9682d3f22 100644
@@ -47,6 +47,15 @@ do { \
 		RTE_STR(in)"[32]", "string_bounded_t"); \
 } while (0)
 
+#define rte_trace_point_emit_blob(in, len) \
+do { \
+	RTE_SET_USED(in); \
+	__rte_trace_point_emit(len, uint8_t); \
+	__rte_trace_point_emit_field(RTE_TRACE_BLOB_LEN_MAX, \
+		RTE_STR(in)"[" RTE_STR(RTE_TRACE_BLOB_LEN_MAX)"]", \
+		RTE_STR(uint8_t)); \
+} while (0)
+
 #ifdef __cplusplus
 }
 #endif
lib/eal/version.map +1 -0
index 6523102157..21aa1b8ce3 100644
@@ -442,6 +442,7 @@ EXPERIMENTAL {
 
 	# added in 23.03
 	rte_thread_set_name;
+	__rte_eal_trace_generic_blob;
 };
 
 INTERNAL {
Signature · 1 line
2.25.1
Acked-by on v9 1/6
#134 lore raw

Re: [PATCH v9 1/6] eal: trace: add trace point emit for blob

Quoted 8 lines · Ankur Dwivedi

Adds a trace point emit function for capturing a blob. The blob captures the length passed by the application followed by the array.

The maximum blob bytes which can be captured is bounded by RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is 64 bytes. If the length is less than 64 the remaining trailing bytes are set to zero.

Quoted 6 lines

This patch also adds test case for emit blob tracepoint function.

#135 lore raw

PATCH v9 2/6 ethdev: add trace points for ethdev (part one)

In reply to Ankur Dwivedi

Adds trace points for ethdev functions.

The rte_ethdev_trace.h is removed. The file ethdev_trace.h is added as an internal header. ethdev_trace.h contains internal slow path and fast path tracepoints. The public fast path tracepoints are present in rte_ethdev_trace_fp.h header.

---
 lib/ethdev/ethdev_private.c      |   7 +
 lib/ethdev/ethdev_trace.h        | 642 +++++++++++++++++++++++++++++++
 lib/ethdev/ethdev_trace_points.c | 195 +++++++++-
 lib/ethdev/meson.build           |   2 +-
 lib/ethdev/rte_ethdev.c          | 386 ++++++++++++++++---
 lib/ethdev/rte_ethdev_trace.h    |  95 -----
 lib/ethdev/rte_ethdev_trace_fp.h |  36 ++
 7 files changed, 1206 insertions(+), 157 deletions(-)
 create mode 100644 lib/ethdev/ethdev_trace.h
 delete mode 100644 lib/ethdev/rte_ethdev_trace.h
lib/ethdev/ethdev_private.c +7 -0
index 48090c879a..14ec8c6ccf 100644
@@ -5,6 +5,7 @@
 #include <rte_debug.h>
 
 #include "rte_ethdev.h"
+#include "rte_ethdev_trace_fp.h"
 #include "ethdev_driver.h"
 #include "ethdev_private.h"
 
@@ -297,6 +298,9 @@ rte_eth_call_rx_callbacks(uint16_t port_id, uint16_t queue_id,
 		cb = cb->next;
 	}
 
+	rte_eth_trace_call_rx_callbacks(port_id, queue_id, (void **)rx_pkts,
+					nb_rx, nb_pkts);
+
 	return nb_rx;
 }
 
@@ -312,6 +316,9 @@ rte_eth_call_tx_callbacks(uint16_t port_id, uint16_t queue_id,
 		cb = cb->next;
 	}
 
+	rte_eth_trace_call_tx_callbacks(port_id, queue_id, (void **)tx_pkts,
+					nb_pkts);
+
 	return nb_pkts;
 }
 
lib/ethdev/ethdev_trace.h new file +642 -0

642 lines not on this page · raw message

lib/ethdev/ethdev_trace_points.c +194 -1

204 lines not on this page · raw message

lib/ethdev/meson.build +1 -1
index 39250b5da1..7835c96601 100644
@@ -22,7 +22,6 @@ sources = files(
 headers = files(
         'rte_cman.h',
         'rte_ethdev.h',
-        'rte_ethdev_trace.h',
         'rte_ethdev_trace_fp.h',
         'rte_dev_info.h',
         'rte_flow.h',
@@ -41,6 +40,7 @@ indirect_headers += files(
 driver_sdk_headers += files(
         'ethdev_driver.h',
         'ethdev_pci.h',
+        'ethdev_trace.h',
         'ethdev_vdev.h',
 )
 
lib/ethdev/rte_ethdev.c +326 -60

832 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace.h deleted +0 -95

95 lines not on this page · raw message

lib/ethdev/rte_ethdev_trace_fp.h +36 -0
index 40084d1929..186271c9ff 100644
@@ -37,6 +37,42 @@ RTE_TRACE_POINT_FP(
 	rte_trace_point_emit_u16(nb_pkts);
 )
 
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_call_rx_callbacks,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		void **rx_pkts, uint16_t nb_rx, uint16_t nb_pkts),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(rx_pkts);
+	rte_trace_point_emit_u16(nb_rx);
+	rte_trace_point_emit_u16(nb_pkts);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_call_tx_callbacks,
+	RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
+		void **tx_pkts, uint16_t nb_pkts),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_ptr(tx_pkts);
+	rte_trace_point_emit_u16(nb_pkts);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_tx_buffer_drop_callback,
+	RTE_TRACE_POINT_ARGS(void **pkts, uint16_t unsent),
+	rte_trace_point_emit_ptr(pkts);
+	rte_trace_point_emit_u16(unsent);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_eth_trace_tx_buffer_count_callback,
+	RTE_TRACE_POINT_ARGS(void **pkts, uint16_t unsent, uint64_t count),
+	rte_trace_point_emit_ptr(pkts);
+	rte_trace_point_emit_u16(unsent);
+	rte_trace_point_emit_u64(count);
+)
+
 #ifdef __cplusplus
 }
 #endif
Signature · 1 line
2.25.1
Reviewed-by on v9 2/6
#136 lore raw

Re: [PATCH v9 2/6] ethdev: add trace points for ethdev (part one)

Quoted 9 lines · Ankur Dwivedi

Adds trace points for ethdev functions.

The rte_ethdev_trace.h is removed. The file ethdev_trace.h is added as an internal header. ethdev_trace.h contains internal slow path and fast path tracepoints. The public fast path tracepoints are present in rte_ethdev_trace_fp.h header.

<...>

Quoted 9 lines
lib/ethdev/ethdev_trace.h new file +9 -0
+RTE_TRACE_POINT(
+	rte_ethdev_trace_owner_set,
+	RTE_TRACE_POINT_ARGS(const uint16_t port_id,
+		const struct rte_eth_dev_owner *owner, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u64(owner->id);
+	rte_trace_point_emit_string(owner->name);
+	rte_trace_point_emit_int(ret);
+)

lib/ethdev/ethdev_trace.h line 139

Quoted 10 lines
lib/ethdev/ethdev_trace.h new file +10 -0
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_owner_unset,
+	RTE_TRACE_POINT_ARGS(const uint16_t port_id,
+		const uint64_t owner_id, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u64(owner_id);
+	rte_trace_point_emit_int(ret);
+)
+

'const' qualifier is not needed for basic types, can you please fix if there will be a new version.

#137 lore raw

RE: [EXT] Re: [PATCH v9 2/6] ethdev: add trace points for ethdev (part one)

Quoted 37 lines

Subject: [EXT] Re: [PATCH v9 2/6] ethdev: add trace points for ethdev (part one)

External Email

----------------------------------------------------------------------

Quoted 9 lines · Ankur Dwivedi

Adds trace points for ethdev functions.

The rte_ethdev_trace.h is removed. The file ethdev_trace.h is added as an internal header. ethdev_trace.h contains internal slow path and fast path tracepoints. The public fast path tracepoints are present in rte_ethdev_trace_fp.h header.

<...>

Quoted 14 lines
lib/ethdev/ethdev_trace.h new file +14 -0
+RTE_TRACE_POINT(
+	rte_ethdev_trace_owner_set,
+	RTE_TRACE_POINT_ARGS(const uint16_t port_id,
+		const struct rte_eth_dev_owner *owner, int ret),
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u64(owner->id);
+	rte_trace_point_emit_string(owner->name);
+	rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+	rte_ethdev_trace_owner_unset,
+	RTE_TRACE_POINT_ARGS(const uint16_t port_id,
+		const uint64_t owner_id, int ret),
Quoted 8 lines

lib/ethdev/ethdev_trace.h line 130

Quoted 5 lines
lib/ethdev/ethdev_trace.h new file +5 -0
+	rte_trace_point_emit_u16(port_id);
+	rte_trace_point_emit_u64(owner_id);
+	rte_trace_point_emit_int(ret);
+)
+

'const' qualifier is not needed for basic types, can you please fix if there will be a new version.

Ok. Will fix this in next version.