ethdev: optimize activation of fast-path tracepoints
PATCH 1/1 ethdev: optimize activation of fast-path tracepoints
From: Adel Belkhiri <[email protected]>
Split the tracepoints rte_ethdev_trace_rx_burst and rte_eth_trace_call_rx_callbacks into two separate ones for empty and non-empty calls to avoid saturating quickly the trace buffer.
--- .mailmap | 1 + lib/ethdev/ethdev_private.c | 8 ++++++-- lib/ethdev/ethdev_trace_points.c | 14 ++++++++++---- lib/ethdev/rte_ethdev.h | 5 ++++- lib/ethdev/rte_ethdev_trace_fp.h | 23 +++++++++++++++++++++-- lib/ethdev/version.map | 3 ++- 6 files changed, 44 insertions(+), 10 deletions(-)
.mailmap +1 -0
@@ -16,6 +16,7 @@ Abraham Tovar <[email protected]> Adam Bynes <[email protected]> Adam Dybkowski <[email protected]> Adam Ludkiewicz <[email protected]> +Adel Belkhiri <[email protected]> Adham Masarwah <[email protected]> <[email protected]> Adrian Moreno <[email protected]> Adrian Pielech <[email protected]>
lib/ethdev/ethdev_private.c +6 -2
@@ -298,8 +298,12 @@ 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); +if (unlikely (nb_rx >0 )) +rte_eth_trace_call_rx_callbacks_nonempty (port_id, queue_id, (void **)rx_pkts, + nb_rx, nb_pkts); +else +rte_eth_trace_call_rx_callbacks_empty (port_id, queue_id, (void **)rx_pkts, + nb_pkts);return nb_rx; }
lib/ethdev/ethdev_trace_points.c +10 -4
@@ -25,14 +25,20 @@ RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_stop,RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_close, lib.ethdev.close) -RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_rx_burst, - lib.ethdev.rx.burst) +RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_rx_burst_empty, + lib.ethdev.rx.burst.empty) + +RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_rx_burst_nonempty, + lib.ethdev.rx.burst.nonempty)RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_tx_burst, lib.ethdev.tx.burst) -RTE_TRACE_POINT_REGISTER (rte_eth_trace_call_rx_callbacks, - lib.ethdev.call_rx_callbacks) +RTE_TRACE_POINT_REGISTER (rte_eth_trace_call_rx_callbacks_empty, + lib.ethdev.call_rx_callbacks.empty) + +RTE_TRACE_POINT_REGISTER (rte_eth_trace_call_rx_callbacks_nonempty, + lib.ethdev.call_rx_callbacks.nonempty)RTE_TRACE_POINT_REGISTER (rte_eth_trace_call_tx_callbacks, lib.ethdev.call_tx_callbacks)
lib/ethdev/rte_ethdev.h +4 -1
@@ -6132,7 +6132,10 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, }#endif -rte_ethdev_trace_rx_burst (port_id, queue_id, (void **)rx_pkts, nb_rx); +if (unlikely (nb_rx >0 )) +rte_ethdev_trace_rx_burst_nonempty (port_id, queue_id, (void **)rx_pkts, nb_rx); +else +rte_ethdev_trace_rx_burst_empty (port_id, queue_id, (void **)rx_pkts);return nb_rx; }
lib/ethdev/rte_ethdev_trace_fp.h +21 -2
@@ -18,7 +18,16 @@ extern "C" {#include <rte_trace_point.h> RTE_TRACE_POINT_FP ( - rte_ethdev_trace_rx_burst, + rte_ethdev_trace_rx_burst_empty, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + void **pkt_tbl), + rte_trace_point_emit_u16(port_id); +rte_trace_point_emit_u16 (queue_id); +rte_trace_point_emit_ptr (pkt_tbl); +) + +RTE_TRACE_POINT_FP ( + rte_ethdev_trace_rx_burst_nonempty, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, void **pkt_tbl, uint16_t nb_rx), rte_trace_point_emit_u16(port_id);
@@ -38,7 +47,17 @@ RTE_TRACE_POINT_FP( )RTE_TRACE_POINT_FP ( - rte_eth_trace_call_rx_callbacks, + rte_eth_trace_call_rx_callbacks_empty, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + void **rx_pkts, 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_pkts); +) + +RTE_TRACE_POINT_FP ( + rte_eth_trace_call_rx_callbacks_nonempty, 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);
lib/ethdev/version.map +2 -1
@@ -207,7 +207,8 @@ EXPERIMENTAL { rte_flow_dev_dump; # added in 20.05 - __rte_ethdev_trace_rx_burst; + __rte_ethdev_trace_rx_burst_empty; + __rte_ethdev_trace_rx_burst_nonempty; __rte_ethdev_trace_tx_burst; rte_flow_get_aged_flows;
Signature · 1 line
2.34.1
lib/ethdev/version.map EXPERIMENTAL { · line 211
Quoted 8 lines
+++ b/lib/ethdev/version.map
lib/ethdev/version.map +2
-1@@ -207,7 +207,8 @@ EXPERIMENTAL { rte_flow_dev_dump; # added in 20.05 - __rte_ethdev_trace_rx_burst; + __rte_ethdev_trace_rx_burst_empty; + __rte_ethdev_trace_rx_burst_nonempty;
These two should be moved down below "# added in 24.11" (which is not yet there, so should be added too).
And I don't know why __rte_eth_trace_call_rx_callbacks is not in the version.map file, but I suppose these should be added too:
+ __rte_eth_trace_call_rx_callbacks_empty
+ __rte_eth_trace_call_rx_callbacks_nonempty
Everything else looks good.
With version.map corrected,
lib/ethdev/ethdev_private.c rte_eth_call_rx_callbacks(uint16_t port_id, uint16_t queue_id, · line 301
Quoted 13 lines · Adel Belkhiri
From: Adel Belkhiri <[email protected]>
Split the tracepoints
rte_ethdev_trace_rx_burstandrte_eth_trace_call_rx_callbacksinto two separate ones for empty and non-empty calls to avoid saturating quickly the trace buffer.Signed-off-by Adel Belkhiri <[email protected]>---
lib/ethdev/ethdev_private.c +1
-1- nb_rx, nb_pkts); +if (unlikely (nb_rx >0 ))
You may consider unlikely(nb_rx)
Quoted 4 lines
rte_flow_dev_dump; # added in 20.05-
__rte_ethdev_trace_rx_burst;
Removal of a public symbol breaks the ABI. The good news is that 24.11 can break the ABI.
IMO, It is OK to break this ABI.
Also need to update "Removed items" in doc/guides/rel_notes/release_24_11.rst
Quoted 8 lines
lib/ethdev/version.map +2
-1+ __rte_ethdev_trace_rx_burst_empty; + __rte_ethdev_trace_rx_burst_nonempty; __rte_ethdev_trace_tx_burst; rte_flow_get_aged_flows; --2.34.1
Quoted 8 lines · Jerin Jacob
Quoted 4 lines
rte_flow_dev_dump; # added in 20.05-
__rte_ethdev_trace_rx_burst;Removal of a public symbol breaks the ABI. The good news is that 24.11 can break the ABI.
IMO, It is OK to break this ABI.
This symbol is in the experimental ABI.
And in general, I think we should keep the trace symbols as experimental.
Signature · 1 line
David Marchand
Quoted 7 lines · David Marchand
Quoted 5 lines · Jerin Jacob
Quoted 4 lines
rte_flow_dev_dump; # added in 20.05-
__rte_ethdev_trace_rx_burst;
Quoted 6 lines
Quoted 3 lines
Removal of a public symbol breaks the ABI. The good news is that 24.11 can break the ABI.
IMO, It is OK to break this ABI.This symbol is in the experimental ABI.
And in general, I think we should keep the trace symbols as experimental.
Ack.
So I think, we need to update only "Removed items" in doc/guides/rel_notes/release_24_11.rst
Quoted 5 lines
--
David Marchand
PATCH v3 1/1 ethdev: optimize the activation of fast-path tracepoints
In reply to Adel BelkhiriFrom: Adel Belkhiri <[email protected]>
Split the tracepoints rte_ethdev_trace_rx_burst and rte_eth_trace_call_rx_callbacks into two separate ones for empty and non-empty calls to avoid saturating quickly the trace buffer.
--- .mailmap | 1 + doc/guides/rel_notes/release_24_11.rst | 2 ++ lib/ethdev/ethdev_private.c | 8 ++++++-- lib/ethdev/ethdev_trace_points.c | 14 ++++++++++---- lib/ethdev/rte_ethdev.h | 5 ++++- lib/ethdev/rte_ethdev_trace_fp.h | 23 +++++++++++++++++++++-- lib/ethdev/version.map | 7 ++++++- 7 files changed, 50 insertions(+), 10 deletions(-)
.mailmap +1 -0
@@ -16,6 +16,7 @@ Abraham Tovar <[email protected]> Adam Bynes <[email protected]> Adam Dybkowski <[email protected]> Adam Ludkiewicz <[email protected]> +Adel Belkhiri <[email protected]> Adham Masarwah <[email protected]> <[email protected]> Adrian Moreno <[email protected]> Adrian Pielech <[email protected]>
doc/guides/rel_notes/release_24_11.rst +2 -0
@@ -68,6 +68,8 @@ Removed Items Also, make sure to start the actual text at the margin. ======================================================= +* ethdev: Removed the __rte_ethdev_trace_rx_burst symbol, as the corresponding + tracepoint was split into two separate ones for empty and non-empty calls. API Changes -----------
lib/ethdev/ethdev_private.c +6 -2
@@ -298,8 +298,12 @@ 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); +if (unlikely (nb_rx)) +rte_eth_trace_call_rx_callbacks_nonempty (port_id, queue_id, (void **)rx_pkts, + nb_rx, nb_pkts); +else +rte_eth_trace_call_rx_callbacks_empty (port_id, queue_id, (void **)rx_pkts, + nb_pkts);return nb_rx; }
lib/ethdev/ethdev_trace_points.c +10 -4
@@ -25,14 +25,20 @@ RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_stop,RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_close, lib.ethdev.close) -RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_rx_burst, - lib.ethdev.rx.burst) +RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_rx_burst_empty, + lib.ethdev.rx.burst.empty) + +RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_rx_burst_nonempty, + lib.ethdev.rx.burst.nonempty)RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_tx_burst, lib.ethdev.tx.burst) -RTE_TRACE_POINT_REGISTER (rte_eth_trace_call_rx_callbacks, - lib.ethdev.call_rx_callbacks) +RTE_TRACE_POINT_REGISTER (rte_eth_trace_call_rx_callbacks_empty, + lib.ethdev.call_rx_callbacks.empty) + +RTE_TRACE_POINT_REGISTER (rte_eth_trace_call_rx_callbacks_nonempty, + lib.ethdev.call_rx_callbacks.nonempty)RTE_TRACE_POINT_REGISTER (rte_eth_trace_call_tx_callbacks, lib.ethdev.call_tx_callbacks)
lib/ethdev/rte_ethdev.h +4 -1
@@ -6132,7 +6132,10 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, }#endif -rte_ethdev_trace_rx_burst (port_id, queue_id, (void **)rx_pkts, nb_rx); +if (unlikely (nb_rx)) +rte_ethdev_trace_rx_burst_nonempty (port_id, queue_id, (void **)rx_pkts, nb_rx); +else +rte_ethdev_trace_rx_burst_empty (port_id, queue_id, (void **)rx_pkts);return nb_rx; }
lib/ethdev/rte_ethdev_trace_fp.h +21 -2
@@ -18,7 +18,16 @@ extern "C" {#include <rte_trace_point.h> RTE_TRACE_POINT_FP ( - rte_ethdev_trace_rx_burst, + rte_ethdev_trace_rx_burst_empty, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + void **pkt_tbl), + rte_trace_point_emit_u16(port_id); +rte_trace_point_emit_u16 (queue_id); +rte_trace_point_emit_ptr (pkt_tbl); +) + +RTE_TRACE_POINT_FP ( + rte_ethdev_trace_rx_burst_nonempty, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, void **pkt_tbl, uint16_t nb_rx), rte_trace_point_emit_u16(port_id);
@@ -38,7 +47,17 @@ RTE_TRACE_POINT_FP( )RTE_TRACE_POINT_FP ( - rte_eth_trace_call_rx_callbacks, + rte_eth_trace_call_rx_callbacks_empty, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + void **rx_pkts, 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_pkts); +) + +RTE_TRACE_POINT_FP ( + rte_eth_trace_call_rx_callbacks_nonempty, 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);
lib/ethdev/version.map +6 -1
@@ -207,7 +207,6 @@ EXPERIMENTAL { rte_flow_dev_dump; # added in 20.05 - __rte_ethdev_trace_rx_burst; __rte_ethdev_trace_tx_burst; rte_flow_get_aged_flows;
@@ -325,6 +324,12 @@ EXPERIMENTAL { rte_flow_template_table_resizable; rte_flow_template_table_resize; rte_flow_template_table_resize_complete; + + # added in 24.11 + __rte_ethdev_trace_rx_burst_empty; + __rte_ethdev_trace_rx_burst_nonempty; + __rte_eth_trace_call_rx_callbacks_empty; + __rte_eth_trace_call_rx_callbacks_nonempty; }; INTERNAL {
Signature · 1 line
2.34.1
Re: [PATCH v3] ethdev: optimize the activation of fast-path tracepoints
Quoted 9 lines · Adel Belkhiri
From: Adel Belkhiri <[email protected]>
Split the tracepoints
rte_ethdev_trace_rx_burstandrte_eth_trace_call_rx_callbacksinto two separate ones for empty and non-empty calls to avoid saturating quickly the trace buffer.Signed-off-by Adel Belkhiri <[email protected]>
Ferruh Yigit
AppliedRe: [PATCH v3] ethdev: optimize the activation of fast-path tracepoints
Quoted 4 lines · Jerin Jacob
Quoted 3 lines · Adel Belkhiri
From: Adel Belkhiri <[email protected]>
Quoted 9 lines
Quoted 6 lines
Split the tracepoints
rte_ethdev_trace_rx_burstandrte_eth_trace_call_rx_callbacksinto two separate ones for empty and non-empty calls to avoid saturating quickly the trace buffer.Signed-off-by Adel Belkhiri <[email protected]>Acked-by Jerin Jacob <[email protected]>
Applied to dpdk-next-net/main, thanks.
Re: [PATCH v3] ethdev: optimize the activation of fast-path tracepoints
Thanks to all of you. Much appreciated!
Quoted 18 lines · Ferruh Yigit
Quoted 1 line · Jerin Jacob
On Thu, Sep 19, 2024 at 12:16 AM Adel Belkhiri <[email protected]>
Quoted 12 lines · wrote:
Quoted 9 lines
From: Adel Belkhiri <[email protected]>
Split the tracepoints
rte_ethdev_trace_rx_burstandrte_eth_trace_call_rx_callbacksinto two separate ones for empty and non-empty calls to avoid saturating quickly the trace buffer.Signed-off-by Adel Belkhiri <[email protected]>Acked-by Jerin Jacob <[email protected]>Applied to dpdk-next-net/main, thanks.
Re: [PATCH v3] ethdev: optimize the activation of fast-path tracepoints
In reply to Adel BelkhiriRecheck-request: iol-marvell-Functional
putting in a ci lab retest for the failures on this series.