Skip to content

Commit

Permalink
ethdev: optimize the activation of fast-path tracepoints
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Adel Belkhiri <adel.belkhiri@polymtl.ca>
Acked-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
adel-belkhiri authored and ferruhy committed Sep 22, 2024
1 parent 8d53753 commit edd8438
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 10 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Abraham Tovar <abrahamx.tovar@intel.com>
Adam Bynes <adambynes@outlook.com>
Adam Dybkowski <adamx.dybkowski@intel.com>
Adam Ludkiewicz <adam.ludkiewicz@intel.com>
Adel Belkhiri <adel.belkhiri@polymtl.ca>
Adham Masarwah <adham@nvidia.com> <adham@mellanox.com>
Adrian Moreno <amorenoz@redhat.com>
Adrian Pielech <adrian.pielech@intel.com>
Expand Down
3 changes: 3 additions & 0 deletions doc/guides/rel_notes/release_24_11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ 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
-----------
Expand Down
8 changes: 6 additions & 2 deletions lib/ethdev/ethdev_private.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
14 changes: 10 additions & 4 deletions lib/ethdev/ethdev_trace_points.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion lib/ethdev/rte_ethdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
23 changes: 21 additions & 2 deletions lib/ethdev/rte_ethdev_trace_fp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion lib/ethdev/version.map
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit edd8438

Please sign in to comment.