Hi Ankur Dwivedi, This patch has been merged into the DPDK23.03. At present, we have failed to test the fuzz case error display global-buffer-overflow. Could you please hava a look at it , also submitted a Bugzilla ticket: https://bugs.dpdk.org/show_bug.cgi?id=1162.
Regards, Li, Weiyuan > -----Original Message----- > From: Ankur Dwivedi <adwiv...@marvell.com> > Sent: Thursday, February 9, 2023 1:12 AM > To: dev@dpdk.org > Cc: tho...@monjalon.net; david.march...@redhat.com; m...@ashroe.eu; > or...@nvidia.com; ferruh.yi...@amd.com; ch...@att.com; > humi...@huawei.com; linvi...@tuxdriver.com; Loftus, Ciara > <ciara.lof...@intel.com>; Zhang, Qi Z <qi.z.zh...@intel.com>; > m...@semihalf.com; m...@semihalf.com; shaib...@amazon.com; > evge...@amazon.com; igo...@amazon.com; cha...@amd.com; > irussk...@marvell.com; Shepard Siegel <shepard.sie...@atomicrules.com>; > Czeck, Ed <ed.cz...@atomicrules.com>; john.mil...@atomicrules.com; > ajit.khapa...@broadcom.com; somnath.ko...@broadcom.com; > jer...@marvell.com; mcze...@marvell.com; sthot...@marvell.com; > sriniva...@marvell.com; hka...@marvell.com; rahul.lakkire...@chelsio.com; > Daley, John <johnd...@cisco.com>; hyon...@cisco.com; > liudongdo...@huawei.com; yisen.zhu...@huawei.com; > xuanziya...@huawei.com; cloud.wangxiao...@huawei.com; > zhouguoy...@huawei.com; Su, Simei <simei...@intel.com>; Wu, Wenjun1 > <wenjun1...@intel.com>; Yang, Qiming <qiming.y...@intel.com>; Zhang, > Yuying <yuying.zh...@intel.com>; Xing, Beilei <beilei.x...@intel.com>; > Wang, Xiao W <xiao.w.w...@intel.com>; Wu, Jingjing > <jingjing...@intel.com>; Guo, Junfeng <junfeng....@intel.com>; Xu, > Rosen <rosen...@intel.com>; ndabilpu...@marvell.com; > kirankum...@marvell.com; sk...@marvell.com; skotesh...@marvell.com; > lir...@marvell.com; z...@semihalf.com; rad...@marvell.com; > vbu...@marvell.com; sed...@marvell.com; ma...@nvidia.com; > viachesl...@nvidia.com; lon...@microsoft.com; spin...@cesnet.cz; > chaoyong...@corigine.com; niklas.soderl...@corigine.com; > hemant.agra...@nxp.com; sachin.sax...@oss.nxp.com; g.si...@nxp.com; > apeksha.gu...@nxp.com; sachin.sax...@nxp.com; abo...@pensando.io; > rm...@marvell.com; shsha...@marvell.com; dsinghra...@marvell.com; > andrew.rybche...@oktetlabs.ru; jiawe...@trustnetic.com; > jianw...@trustnetic.com; Behrens, Jochen <jbehr...@vmware.com>; > maxime.coque...@redhat.com; Xia, Chenbo <chenbo....@intel.com>; > Webster, Steven <steven.webs...@windriver.com>; Peters, Matt > <matt.pet...@windriver.com>; Richardson, Bruce > <bruce.richard...@intel.com>; mtetsu...@gmail.com; gr...@u256.net; > Singh, Jasvinder <jasvinder.si...@intel.com>; Dumitrescu, Cristian > <cristian.dumitre...@intel.com>; jgraj...@cisco.com; > m...@smartsharesystems.com; Ankur Dwivedi <adwiv...@marvell.com> > Subject: [PATCH v11 2/6] ethdev: add trace points for ethdev (part one) > > 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. > > Signed-off-by: Ankur Dwivedi <adwiv...@marvell.com> > Acked-by: Sunil Kumar Kori <sk...@marvell.com> > Reviewed-by: Ferruh Yigit <ferruh.yi...@amd.com> > --- > lib/ethdev/ethdev_private.c | 7 + > lib/ethdev/ethdev_trace.h | 635 > +++++++++++++++++++++++++++++++ > lib/ethdev/ethdev_trace_points.c | 195 +++++++++- > lib/ethdev/meson.build | 2 +- > lib/ethdev/rte_ethdev.c | 387 ++++++++++++++++--- > lib/ethdev/rte_ethdev_trace.h | 95 ----- > lib/ethdev/rte_ethdev_trace_fp.h | 36 ++ > 7 files changed, 1200 insertions(+), 157 deletions(-) > create mode 100644 lib/ethdev/ethdev_trace.h > delete mode 100644 lib/ethdev/rte_ethdev_trace.h > > diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c > index 48090c879a..14ec8c6ccf 100644 > --- a/lib/ethdev/ethdev_private.c > +++ b/lib/ethdev/ethdev_private.c > @@ -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; > } > > diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h > new file mode 100644 > index 0000000000..d88ad60ec8 > --- /dev/null > +++ b/lib/ethdev/ethdev_trace.h > @@ -0,0 +1,635 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2023 Marvell International Ltd. > + */ > + > +#ifndef _RTE_ETHDEV_TRACE_H_ > +#define _RTE_ETHDEV_TRACE_H_ > + > +/** > + * @file > + * > + * API for ethdev trace support > + */ > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +#include <dev_driver.h> > +#include <rte_trace_point.h> > + > +#include "rte_ethdev.h" > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_configure, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t nb_rx_q, > + uint16_t nb_tx_q, const struct rte_eth_conf *dev_conf, int > rc), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(nb_rx_q); > + rte_trace_point_emit_u16(nb_tx_q); > + rte_trace_point_emit_u32(dev_conf->link_speeds); > + rte_trace_point_emit_u32(dev_conf->rxmode.mq_mode); > + rte_trace_point_emit_u32(dev_conf->rxmode.mtu); > + rte_trace_point_emit_u64(dev_conf->rxmode.offloads); > + rte_trace_point_emit_u32(dev_conf->txmode.mq_mode); > + rte_trace_point_emit_u64(dev_conf->txmode.offloads); > + rte_trace_point_emit_u32(dev_conf->lpbk_mode); > + rte_trace_point_emit_int(rc); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_rxq_setup, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, > + uint16_t nb_rx_desc, void *mp, > + const struct rte_eth_rxconf *rx_conf, int rc), > + 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(mp); > + rte_trace_point_emit_u8(rx_conf->rx_thresh.pthresh); > + rte_trace_point_emit_u8(rx_conf->rx_thresh.hthresh); > + rte_trace_point_emit_u8(rx_conf->rx_thresh.wthresh); > + rte_trace_point_emit_u8(rx_conf->rx_drop_en); > + rte_trace_point_emit_u8(rx_conf->rx_deferred_start); > + rte_trace_point_emit_u64(rx_conf->offloads); > + rte_trace_point_emit_int(rc); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_txq_setup, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > + uint16_t nb_tx_desc, const struct rte_eth_txconf *tx_conf), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_u16(nb_tx_desc); > + rte_trace_point_emit_u8(tx_conf->tx_thresh.pthresh); > + rte_trace_point_emit_u8(tx_conf->tx_thresh.hthresh); > + rte_trace_point_emit_u8(tx_conf->tx_thresh.wthresh); > + rte_trace_point_emit_u8(tx_conf->tx_deferred_start); > + rte_trace_point_emit_u16(tx_conf->tx_free_thresh); > + rte_trace_point_emit_u64(tx_conf->offloads); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_start, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_stop, > + 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_close, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_iterator_init, > + RTE_TRACE_POINT_ARGS(const char *devargs), > + rte_trace_point_emit_string(devargs); > +) > + > +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_string(iter->bus_str); > + rte_trace_point_emit_string(iter->cls_str); > + rte_trace_point_emit_u16(id); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_iterator_cleanup, > + RTE_TRACE_POINT_ARGS(const struct rte_dev_iterator *iter), > + rte_trace_point_emit_string(iter->bus_str); > + rte_trace_point_emit_string(iter->cls_str); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_owner_new, > + RTE_TRACE_POINT_ARGS(uint64_t owner_id), > + rte_trace_point_emit_u64(owner_id); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_owner_set, > + RTE_TRACE_POINT_ARGS(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(uint16_t port_id, 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); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_owner_delete, > + RTE_TRACE_POINT_ARGS(uint64_t owner_id, int ret), > + rte_trace_point_emit_u64(owner_id); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_socket_id, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int socket_id), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(socket_id); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_rx_queue_start, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, > int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(rx_queue_id); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_rx_queue_stop, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, > int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(rx_queue_id); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_tx_queue_start, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_tx_queue_stop, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_speed_bitflag, > + RTE_TRACE_POINT_ARGS(uint32_t speed, int duplex, uint32_t ret), > + rte_trace_point_emit_u32(speed); > + rte_trace_point_emit_int(duplex); > + rte_trace_point_emit_u32(ret); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_rx_offload_name, > + RTE_TRACE_POINT_ARGS(uint64_t offload, const char *name), > + rte_trace_point_emit_u64(offload); > + rte_trace_point_emit_string(name); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_tx_offload_name, > + RTE_TRACE_POINT_ARGS(uint64_t offload, const char *name), > + rte_trace_point_emit_u64(offload); > + rte_trace_point_emit_string(name); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_capability_name, > + RTE_TRACE_POINT_ARGS(uint64_t capability, const char *name), > + rte_trace_point_emit_u64(capability); > + rte_trace_point_emit_string(name); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_set_link_up, > + 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_link_down, > + 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_reset, > + 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_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), > + uint16_t peer_count = conf->peer_count; > + uint8_t tx_explicit = conf->tx_explicit; > + uint8_t manual_bind = conf->manual_bind; > + uint8_t use_locked_device_memory = conf- > >use_locked_device_memory; > + uint8_t use_rte_memory = conf->use_rte_memory; > + uint8_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_u16(peer_count); > + rte_trace_point_emit_u8(tx_explicit); > + rte_trace_point_emit_u8(manual_bind); > + rte_trace_point_emit_u8(use_locked_device_memory); > + rte_trace_point_emit_u8(use_rte_memory); > + rte_trace_point_emit_u8(force_memory); > + rte_trace_point_emit_int(ret); > +) > + > +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), > + uint16_t peer_count = conf->peer_count; > + uint8_t tx_explicit = conf->tx_explicit; > + uint8_t manual_bind = conf->manual_bind; > + uint8_t use_locked_device_memory = conf- > >use_locked_device_memory; > + uint8_t use_rte_memory = conf->use_rte_memory; > + uint8_t force_memory = conf->force_memory; > + > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_u16(nb_tx_desc); > + rte_trace_point_emit_u16(peer_count); > + rte_trace_point_emit_u8(tx_explicit); > + rte_trace_point_emit_u8(manual_bind); > + rte_trace_point_emit_u8(use_locked_device_memory); > + rte_trace_point_emit_u8(use_rte_memory); > + rte_trace_point_emit_u8(force_memory); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_hairpin_bind, > + RTE_TRACE_POINT_ARGS(uint16_t tx_port, uint16_t rx_port, int ret), > + rte_trace_point_emit_u16(tx_port); > + rte_trace_point_emit_u16(rx_port); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_hairpin_unbind, > + RTE_TRACE_POINT_ARGS(uint16_t tx_port, uint16_t rx_port, int ret), > + rte_trace_point_emit_u16(tx_port); > + rte_trace_point_emit_u16(rx_port); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_tx_buffer_set_err_callback, > + RTE_TRACE_POINT_ARGS(const struct rte_eth_dev_tx_buffer > *buffer), > + rte_trace_point_emit_ptr(buffer->error_callback); > + rte_trace_point_emit_ptr(buffer->error_userdata); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_promiscuous_enable, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int promiscuous, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(promiscuous); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_promiscuous_disable, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int promiscuous, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(promiscuous); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_allmulticast_enable, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int all_multicast, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(all_multicast); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_allmulticast_disable, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int all_multicast, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(all_multicast); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_set_rx_queue_stats_mapping, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, > + uint8_t stat_idx, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(rx_queue_id); > + rte_trace_point_emit_u8(stat_idx); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_set_tx_queue_stats_mapping, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > + uint8_t stat_idx, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_u8(stat_idx); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_fw_version_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *fw_version, > + size_t fw_size, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_string(fw_version); > + rte_trace_point_emit_size_t(fw_size); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_find_next, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_find_next_of, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_device > *parent), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_string(parent->name); > + rte_trace_point_emit_string(parent->bus_info); > + rte_trace_point_emit_int(parent->numa_node); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_find_next_sibling, > + RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t > ref_port_id, > + uint16_t ret), > + rte_trace_point_emit_u16(port_id_start); > + rte_trace_point_emit_u16(ref_port_id); > + rte_trace_point_emit_u16(ret); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_is_valid_port, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int is_valid), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(is_valid); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_find_next_owned_by, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t owner_id), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u64(owner_id); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_owner_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + const struct rte_eth_dev_owner *owner), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u64(owner->id); > + rte_trace_point_emit_string(owner->name); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_get_sec_ctx, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const void *ctx), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(ctx); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_count_avail, > + RTE_TRACE_POINT_ARGS(uint16_t count), > + rte_trace_point_emit_u16(count); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_count_total, > + RTE_TRACE_POINT_ARGS(uint16_t count), > + rte_trace_point_emit_u16(count); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_get_name_by_port, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *name), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_string(name); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_get_port_by_name, > + RTE_TRACE_POINT_ARGS(const char *name, uint16_t port_id), > + rte_trace_point_emit_string(name); > + rte_trace_point_emit_u16(port_id); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_is_removed, > + 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_hairpin_get_peer_ports, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const 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); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_tx_buffer_init, > + RTE_TRACE_POINT_ARGS(const struct rte_eth_dev_tx_buffer > *buffer, > + uint16_t size, int ret), > + rte_trace_point_emit_ptr(buffer); > + rte_trace_point_emit_u16(size); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_tx_done_cleanup, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + uint32_t free_cnt, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(queue_id); > + rte_trace_point_emit_u32(free_cnt); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_promiscuous_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int promiscuous), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(promiscuous); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_allmulticast_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int all_multicast), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(all_multicast); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_link_get_nowait, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_eth_link > *link), > + uint8_t link_duplex = link->link_duplex; > + uint8_t link_autoneg = link->link_autoneg; > + uint8_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_u8(link_duplex); > + rte_trace_point_emit_u8(link_autoneg); > + rte_trace_point_emit_u8(link_status); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_link_to_str, > + RTE_TRACE_POINT_ARGS(size_t len, const struct rte_eth_link *link, > + char *str, int ret), > + uint8_t link_duplex = link->link_duplex; > + uint8_t link_autoneg = link->link_autoneg; > + uint8_t link_status = link->link_status; > + > + rte_trace_point_emit_size_t(len); > + rte_trace_point_emit_u32(link->link_speed); > + rte_trace_point_emit_u8(link_duplex); > + rte_trace_point_emit_u8(link_autoneg); > + rte_trace_point_emit_u8(link_status); > + rte_trace_point_emit_string(str); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_stats_reset, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_xstats_get_id_by_name, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *xstat_name, > + uint64_t id), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_string(xstat_name); > + rte_trace_point_emit_u64(id); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_xstats_get_names_by_id, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + const struct rte_eth_xstat_name *xstats_names, uint64_t > ids), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_string(xstats_names->name); > + rte_trace_point_emit_u64(ids); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_xstats_get_names, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int i, > + 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_int(i); > + rte_trace_point_emit_string(xstats_names.name); > + rte_trace_point_emit_u32(size); > + rte_trace_point_emit_int(cnt_used_entries); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_xstats_get_by_id, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, > + const uint64_t *values, unsigned int size), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(ids); > + rte_trace_point_emit_ptr(values); > + rte_trace_point_emit_u32(size); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_xstats_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_xstat > xstats), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u64(xstats.id); > + rte_trace_point_emit_u64(xstats.value); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_xstats_reset, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(ret); > +) > + > +/* Fast path trace points */ > + > +/* Called in loop in examples/qos_sched and examples/distributor */ > +RTE_TRACE_POINT_FP( > + rte_eth_trace_stats_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + const struct rte_eth_stats *stats, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u64(stats->rx_nombuf); > + rte_trace_point_emit_u64(stats->ipackets); > + rte_trace_point_emit_u64(stats->opackets); > + rte_trace_point_emit_u64(stats->ibytes); > + rte_trace_point_emit_u64(stats->obytes); > + rte_trace_point_emit_u64(stats->imissed); > + rte_trace_point_emit_u64(stats->ierrors); > + rte_trace_point_emit_u64(stats->oerrors); > + rte_trace_point_emit_int(ret); > +) > + > +/* Called in loop in examples/ip_pipeline */ > +RTE_TRACE_POINT_FP( > + rte_eth_trace_link_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_eth_link > *link), > + uint8_t link_duplex = link->link_duplex; > + uint8_t link_autoneg = link->link_autoneg; > + uint8_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_u8(link_duplex); > + rte_trace_point_emit_u8(link_autoneg); > + rte_trace_point_emit_u8(link_status); > +) > + > +/* Called in loop in examples/ip_pipeline */ > +RTE_TRACE_POINT_FP( > + rte_eth_trace_link_speed_to_str, > + RTE_TRACE_POINT_ARGS(uint32_t link_speed, const char *ret), > + rte_trace_point_emit_u32(link_speed); > + rte_trace_point_emit_string(ret); > +) > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* _RTE_ETHDEV_TRACE_H_ */ > diff --git a/lib/ethdev/ethdev_trace_points.c > b/lib/ethdev/ethdev_trace_points.c > index 2919409a15..3e58c679c3 100644 > --- a/lib/ethdev/ethdev_trace_points.c > +++ b/lib/ethdev/ethdev_trace_points.c > @@ -4,7 +4,8 @@ > > #include <rte_trace_point_register.h> > > -#include <rte_ethdev_trace.h> > +#include <ethdev_trace.h> > +#include <rte_ethdev_trace_fp.h> > > RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_configure, > lib.ethdev.configure) > @@ -29,3 +30,195 @@ > RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_burst, > > 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_tx_callbacks, > + lib.ethdev.call_tx_callbacks) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_iterator_init, > + lib.ethdev.iterator_init) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_iterator_next, > + lib.ethdev.iterator_next) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_iterator_cleanup, > + lib.ethdev.iterator_cleanup) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_find_next, > + lib.ethdev.find_next) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_find_next_of, > + lib.ethdev.find_next_of) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_find_next_sibling, > + lib.ethdev.find_next_sibling) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_valid_port, > + lib.ethdev.is_valid_port) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_find_next_owned_by, > + lib.ethdev.find_next_owned_by) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_owner_new, > + lib.ethdev.owner_new) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_owner_set, > + lib.ethdev.owner_set) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_owner_unset, > + lib.ethdev.owner_unset) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_owner_delete, > + lib.ethdev.owner_delete) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_owner_get, > + lib.ethdev.owner_get) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_socket_id, > + lib.ethdev.socket_id) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_sec_ctx, > + lib.ethdev.get_sec_ctx) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_count_avail, > + lib.ethdev.count_avail) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_count_total, > + lib.ethdev.count_total) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_name_by_port, > + lib.ethdev.get_name_by_port) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_port_by_name, > + lib.ethdev.get_port_by_name) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_queue_start, > + lib.ethdev.rx_queue_start) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_queue_stop, > + lib.ethdev.rx_queue_stop) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_tx_queue_start, > + lib.ethdev.tx_queue_start) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_tx_queue_stop, > + lib.ethdev.tx_queue_stop) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_speed_bitflag, > + lib.ethdev.speed_bitflag) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_offload_name, > + lib.ethdev.rx_offload_name) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_tx_offload_name, > + lib.ethdev.tx_offload_name) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_capability_name, > + lib.ethdev.capability_name) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_up, > + lib.ethdev.set_link_up) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_down, > + lib.ethdev.set_link_down) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_reset, > + lib.ethdev.reset) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_removed, > + lib.ethdev.is_removed) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_hairpin_queue_setup, > + lib.ethdev.rx_hairpin_queue_setup) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_hairpin_queue_setup, > + lib.ethdev.tx_hairpin_queue_setup) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_bind, > + lib.ethdev.hairpin_bind) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_unbind, > + lib.ethdev.hairpin_unbind) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_get_peer_ports, > + lib.ethdev.hairpin_get_peer_ports) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_buffer_drop_callback, > + lib.ethdev.tx_buffer_drop_callback) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_buffer_count_callback, > + lib.ethdev.tx_buffer_count_callback) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_buffer_set_err_callback, > + lib.ethdev.tx_buffer_set_err_callback) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_buffer_init, > + lib.ethdev.tx_buffer_init) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_done_cleanup, > + lib.ethdev.tx_done_cleanup) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_enable, > + lib.ethdev.promiscuous_enable) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_disable, > + lib.ethdev.promiscuous_disable) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_get, > + lib.ethdev.promiscuous_get) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_enable, > + lib.ethdev.allmulticast_enable) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_disable, > + lib.ethdev.allmulticast_disable) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_get, > + lib.ethdev.allmulticast_get) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_link_get, > + lib.ethdev.link_get) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_link_get_nowait, > + lib.ethdev.link_get_nowait) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_link_speed_to_str, > + lib.ethdev.link_speed_to_str) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_link_to_str, > + lib.ethdev.link_to_str) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_stats_get, > + lib.ethdev.stats_get) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_stats_reset, > + lib.ethdev.stats_reset) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get_id_by_name, > + lib.ethdev.xstats_get_id_by_name) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get_names_by_id, > + lib.ethdev.xstats_get_names_by_id) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get_names, > + lib.ethdev.xstats_get_names) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get_by_id, > + lib.ethdev.xstats_get_by_id) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get, > + lib.ethdev.xstats_get) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_reset, > + lib.ethdev.xstats_reset) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_tx_queue_stats_ma > pping, > + lib.ethdev.set_tx_queue_stats_mapping) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_ma > pping, > + lib.ethdev.set_rx_queue_stats_mapping) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_fw_version_get, > + lib.ethdev.fw_version_get) > diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build > index 39250b5da1..7835c96601 100644 > --- a/lib/ethdev/meson.build > +++ b/lib/ethdev/meson.build > @@ -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', > ) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index d25db35f7f..6aaae66b83 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -27,11 +27,12 @@ > #include <rte_ether.h> > #include <rte_telemetry.h> > > -#include "rte_ethdev_trace.h" > #include "rte_ethdev.h" > +#include "rte_ethdev_trace_fp.h" > #include "ethdev_driver.h" > #include "ethdev_profile.h" > #include "ethdev_private.h" > +#include "ethdev_trace.h" > #include "sff_telemetry.h" > > struct rte_eth_dev rte_eth_devices[RTE_MAX_ETHPORTS]; > @@ -259,6 +260,9 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, > const char *devargs_str) > end: > iter->cls = rte_class_find_by_name("eth"); > rte_devargs_reset(&devargs); > + > + rte_eth_trace_iterator_init(devargs_str); > + > return 0; > > error: > @@ -297,8 +301,13 @@ 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) { > + uint16_t id = eth_dev_to_id(iter->class_device); > + > + rte_eth_trace_iterator_next(iter, id); > + > + return id; /* match */ > + } > } while (iter->bus != NULL); /* need to try next rte_device */ > > /* No more ethdev port to iterate. */ > @@ -316,6 +325,9 @@ 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); > + > 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)); > @@ -331,6 +343,8 @@ rte_eth_find_next(uint16_t port_id) > if (port_id >= RTE_MAX_ETHPORTS) > return RTE_MAX_ETHPORTS; > > + rte_eth_trace_find_next(port_id); > + > return port_id; > } > > @@ -351,15 +365,23 @@ rte_eth_find_next_of(uint16_t port_id, const > struct rte_device *parent) > rte_eth_devices[port_id].device != parent) > port_id = rte_eth_find_next(port_id + 1); > > + rte_eth_trace_find_next_of(port_id, parent); > + > return port_id; > } > > uint16_t > rte_eth_find_next_sibling(uint16_t port_id, uint16_t ref_port_id) > { > + uint16_t ret; > + > RTE_ETH_VALID_PORTID_OR_ERR_RET(ref_port_id, > RTE_MAX_ETHPORTS); > - return rte_eth_find_next_of(port_id, > + ret = rte_eth_find_next_of(port_id, > rte_eth_devices[ref_port_id].device); > + > + rte_eth_trace_find_next_sibling(port_id, ref_port_id, ret); > + > + return ret; > } > > static bool > @@ -371,11 +393,17 @@ eth_dev_is_allocated(const struct rte_eth_dev > *ethdev) > int > rte_eth_dev_is_valid_port(uint16_t port_id) > { > + int is_valid; > + > if (port_id >= RTE_MAX_ETHPORTS || > (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)) > - return 0; > + is_valid = 0; > else > - return 1; > + is_valid = 1; > + > + rte_ethdev_trace_is_valid_port(port_id, is_valid); > + > + return is_valid; > } > > static int > @@ -395,6 +423,8 @@ rte_eth_find_next_owned_by(uint16_t port_id, > const uint64_t owner_id) > rte_eth_devices[port_id].data->owner.id != > owner_id) > port_id = rte_eth_find_next(port_id + 1); > > + rte_eth_trace_find_next_owned_by(port_id, owner_id); > + > return port_id; > } > > @@ -413,6 +443,9 @@ rte_eth_dev_owner_new(uint64_t *owner_id) > *owner_id = eth_dev_shared_data->next_owner_id++; > > rte_spinlock_unlock(ð_dev_shared_data->ownership_lock); > + > + rte_ethdev_trace_owner_new(*owner_id); > + > return 0; > } > > @@ -476,6 +509,9 @@ rte_eth_dev_owner_set(const uint16_t port_id, > ret = eth_dev_owner_set(port_id, RTE_ETH_DEV_NO_OWNER, > owner); > > rte_spinlock_unlock(ð_dev_shared_data->ownership_lock); > + > + rte_ethdev_trace_owner_set(port_id, owner, ret); > + > return ret; > } > > @@ -493,6 +529,9 @@ rte_eth_dev_owner_unset(const uint16_t port_id, > const uint64_t owner_id) > ret = eth_dev_owner_set(port_id, owner_id, &new_owner); > > rte_spinlock_unlock(ð_dev_shared_data->ownership_lock); > + > + rte_ethdev_trace_owner_unset(port_id, owner_id, ret); > + > return ret; > } > > @@ -526,6 +565,8 @@ rte_eth_dev_owner_delete(const uint64_t owner_id) > > rte_spinlock_unlock(ð_dev_shared_data->ownership_lock); > > + rte_ethdev_trace_owner_delete(owner_id, ret); > + > return ret; > } > > @@ -555,6 +596,8 @@ rte_eth_dev_owner_get(const uint16_t port_id, > struct rte_eth_dev_owner *owner) > rte_memcpy(owner, ðdev->data->owner, sizeof(*owner)); > rte_spinlock_unlock(ð_dev_shared_data->ownership_lock); > > + rte_ethdev_trace_owner_get(port_id, owner); > + > return 0; > } > > @@ -570,14 +613,23 @@ rte_eth_dev_socket_id(uint16_t port_id) > if (socket_id == SOCKET_ID_ANY) > rte_errno = 0; > } > + > + rte_ethdev_trace_socket_id(port_id, socket_id); > + > return socket_id; > } > > void * > rte_eth_dev_get_sec_ctx(uint16_t port_id) > { > + void *ctx; > + > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL); > - return rte_eth_devices[port_id].security_ctx; > + ctx = rte_eth_devices[port_id].security_ctx; > + > + rte_ethdev_trace_get_sec_ctx(port_id, ctx); > + > + return ctx; > } > > uint16_t > @@ -591,6 +643,8 @@ rte_eth_dev_count_avail(void) > RTE_ETH_FOREACH_DEV(p) > count++; > > + rte_ethdev_trace_count_avail(count); > + > return count; > } > > @@ -602,6 +656,8 @@ rte_eth_dev_count_total(void) > RTE_ETH_FOREACH_VALID_DEV(port) > count++; > > + rte_ethdev_trace_count_total(count); > + > return count; > } > > @@ -622,6 +678,9 @@ rte_eth_dev_get_name_by_port(uint16_t port_id, > char *name) > * because it might be overwritten by VDEV PMD */ > tmp = eth_dev_shared_data->data[port_id].name; > strcpy(name, tmp); > + > + rte_ethdev_trace_get_name_by_port(port_id, name); > + > return 0; > } > > @@ -644,6 +703,9 @@ rte_eth_dev_get_port_by_name(const char *name, > uint16_t *port_id) > RTE_ETH_FOREACH_VALID_DEV(pid) > if (!strcmp(name, eth_dev_shared_data->data[pid].name)) { > *port_id = pid; > + > + rte_ethdev_trace_get_port_by_name(name, > *port_id); > + > return 0; > } > > @@ -745,7 +807,11 @@ rte_eth_dev_rx_queue_start(uint16_t port_id, > uint16_t rx_queue_id) > return 0; > } > > - return eth_err(port_id, dev->dev_ops->rx_queue_start(dev, > rx_queue_id)); > + ret = eth_err(port_id, dev->dev_ops->rx_queue_start(dev, > rx_queue_id)); > + > + rte_ethdev_trace_rx_queue_start(port_id, rx_queue_id, ret); > + > + return ret; > } > > int > @@ -778,7 +844,11 @@ rte_eth_dev_rx_queue_stop(uint16_t port_id, > uint16_t rx_queue_id) > return 0; > } > > - return eth_err(port_id, dev->dev_ops->rx_queue_stop(dev, > rx_queue_id)); > + ret = eth_err(port_id, dev->dev_ops->rx_queue_stop(dev, > rx_queue_id)); > + > + rte_ethdev_trace_rx_queue_stop(port_id, rx_queue_id, ret); > + > + return ret; > } > > int > @@ -818,7 +888,11 @@ rte_eth_dev_tx_queue_start(uint16_t port_id, > uint16_t tx_queue_id) > return 0; > } > > - return eth_err(port_id, dev->dev_ops->tx_queue_start(dev, > tx_queue_id)); > + ret = eth_err(port_id, dev->dev_ops->tx_queue_start(dev, > tx_queue_id)); > + > + rte_ethdev_trace_tx_queue_start(port_id, tx_queue_id, ret); > + > + return ret; > } > > int > @@ -851,42 +925,65 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, > uint16_t tx_queue_id) > return 0; > } > > - return eth_err(port_id, dev->dev_ops->tx_queue_stop(dev, > tx_queue_id)); > + ret = eth_err(port_id, dev->dev_ops->tx_queue_stop(dev, > tx_queue_id)); > + > + rte_ethdev_trace_tx_queue_stop(port_id, tx_queue_id, ret); > + > + return ret; > } > > uint32_t > rte_eth_speed_bitflag(uint32_t speed, int duplex) > { > + uint32_t ret; > + > switch (speed) { > case RTE_ETH_SPEED_NUM_10M: > - return duplex ? RTE_ETH_LINK_SPEED_10M : > RTE_ETH_LINK_SPEED_10M_HD; > + ret = duplex ? RTE_ETH_LINK_SPEED_10M : > RTE_ETH_LINK_SPEED_10M_HD; > + break; > case RTE_ETH_SPEED_NUM_100M: > - return duplex ? RTE_ETH_LINK_SPEED_100M : > RTE_ETH_LINK_SPEED_100M_HD; > + ret = duplex ? RTE_ETH_LINK_SPEED_100M : > RTE_ETH_LINK_SPEED_100M_HD; > + break; > case RTE_ETH_SPEED_NUM_1G: > - return RTE_ETH_LINK_SPEED_1G; > + ret = RTE_ETH_LINK_SPEED_1G; > + break; > case RTE_ETH_SPEED_NUM_2_5G: > - return RTE_ETH_LINK_SPEED_2_5G; > + ret = RTE_ETH_LINK_SPEED_2_5G; > + break; > case RTE_ETH_SPEED_NUM_5G: > - return RTE_ETH_LINK_SPEED_5G; > + ret = RTE_ETH_LINK_SPEED_5G; > + break; > case RTE_ETH_SPEED_NUM_10G: > - return RTE_ETH_LINK_SPEED_10G; > + ret = RTE_ETH_LINK_SPEED_10G; > + break; > case RTE_ETH_SPEED_NUM_20G: > - return RTE_ETH_LINK_SPEED_20G; > + ret = RTE_ETH_LINK_SPEED_20G; > + break; > case RTE_ETH_SPEED_NUM_25G: > - return RTE_ETH_LINK_SPEED_25G; > + ret = RTE_ETH_LINK_SPEED_25G; > + break; > case RTE_ETH_SPEED_NUM_40G: > - return RTE_ETH_LINK_SPEED_40G; > + ret = RTE_ETH_LINK_SPEED_40G; > + break; > case RTE_ETH_SPEED_NUM_50G: > - return RTE_ETH_LINK_SPEED_50G; > + ret = RTE_ETH_LINK_SPEED_50G; > + break; > case RTE_ETH_SPEED_NUM_56G: > - return RTE_ETH_LINK_SPEED_56G; > + ret = RTE_ETH_LINK_SPEED_56G; > + break; > case RTE_ETH_SPEED_NUM_100G: > - return RTE_ETH_LINK_SPEED_100G; > + ret = RTE_ETH_LINK_SPEED_100G; > + break; > case RTE_ETH_SPEED_NUM_200G: > - return RTE_ETH_LINK_SPEED_200G; > + ret = RTE_ETH_LINK_SPEED_200G; > + break; > default: > - return 0; > + ret = 0; > } > + > + rte_eth_trace_speed_bitflag(speed, duplex, ret); > + > + return ret; > } > > const char * > @@ -902,6 +999,8 @@ rte_eth_dev_rx_offload_name(uint64_t offload) > } > } > > + rte_ethdev_trace_rx_offload_name(offload, name); > + > return name; > } > > @@ -918,6 +1017,8 @@ rte_eth_dev_tx_offload_name(uint64_t offload) > } > } > > + rte_ethdev_trace_tx_offload_name(offload, name); > + > return name; > } > > @@ -934,6 +1035,8 @@ rte_eth_dev_capability_name(uint64_t capability) > } > } > > + rte_ethdev_trace_capability_name(capability, name); > + > return name; > } > > @@ -1554,26 +1657,36 @@ int > rte_eth_dev_set_link_up(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]; > > if (*dev->dev_ops->dev_set_link_up == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->dev_set_link_up)(dev)); > + ret = eth_err(port_id, (*dev->dev_ops->dev_set_link_up)(dev)); > + > + rte_ethdev_trace_set_link_up(port_id, ret); > + > + return ret; > } > > int > rte_eth_dev_set_link_down(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]; > > if (*dev->dev_ops->dev_set_link_down == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops- > >dev_set_link_down)(dev)); > + ret = eth_err(port_id, (*dev->dev_ops->dev_set_link_down)(dev)); > + > + rte_ethdev_trace_set_link_down(port_id, ret); > + > + return ret; > } > > int > @@ -1628,9 +1741,11 @@ rte_eth_dev_reset(uint16_t port_id) > "Failed to stop device (port %u) before reset: %s - > ignore\n", > port_id, rte_strerror(-ret)); > } > - ret = dev->dev_ops->dev_reset(dev); > + ret = eth_err(port_id, dev->dev_ops->dev_reset(dev)); > > - return eth_err(port_id, ret); > + rte_ethdev_trace_reset(port_id, ret); > + > + return ret; > } > > int > @@ -1653,6 +1768,8 @@ rte_eth_dev_is_removed(uint16_t port_id) > /* Device is physically removed. */ > dev->state = RTE_ETH_DEV_REMOVED; > > + rte_ethdev_trace_is_removed(port_id, ret); > + > return ret; > } > > @@ -2151,7 +2268,12 @@ rte_eth_rx_hairpin_queue_setup(uint16_t > port_id, uint16_t rx_queue_id, > if (ret == 0) > dev->data->rx_queue_state[rx_queue_id] = > RTE_ETH_QUEUE_STATE_HAIRPIN; > - return eth_err(port_id, ret); > + ret = eth_err(port_id, ret); > + > + rte_eth_trace_rx_hairpin_queue_setup(port_id, rx_queue_id, > nb_rx_desc, > + conf, ret); > + > + return ret; > } > > int > @@ -2340,7 +2462,12 @@ rte_eth_tx_hairpin_queue_setup(uint16_t > port_id, uint16_t tx_queue_id, > if (ret == 0) > dev->data->tx_queue_state[tx_queue_id] = > RTE_ETH_QUEUE_STATE_HAIRPIN; > - return eth_err(port_id, ret); > + ret = eth_err(port_id, ret); > + > + rte_eth_trace_tx_hairpin_queue_setup(port_id, tx_queue_id, > nb_tx_desc, > + conf, ret); > + > + return ret; > } > > int > @@ -2365,6 +2492,8 @@ rte_eth_hairpin_bind(uint16_t tx_port, uint16_t > rx_port) > " to Rx %d (%d - all ports)\n", > tx_port, rx_port, RTE_MAX_ETHPORTS); > > + rte_eth_trace_hairpin_bind(tx_port, rx_port, ret); > + > return ret; > } > > @@ -2390,6 +2519,8 @@ rte_eth_hairpin_unbind(uint16_t tx_port, uint16_t > rx_port) > " from Rx %d (%d - all ports)\n", > tx_port, rx_port, RTE_MAX_ETHPORTS); > > + rte_eth_trace_hairpin_unbind(tx_port, rx_port, ret); > + > return ret; > } > > @@ -2426,6 +2557,9 @@ rte_eth_hairpin_get_peer_ports(uint16_t port_id, > uint16_t *peer_ports, > RTE_ETHDEV_LOG(ERR, "Failed to get %d hairpin peer %s > ports\n", > port_id, direction ? "Rx" : "Tx"); > > + rte_eth_trace_hairpin_get_peer_ports(port_id, peer_ports, len, > + direction, ret); > + > return ret; > } > > @@ -2434,6 +2568,8 @@ rte_eth_tx_buffer_drop_callback(struct rte_mbuf > **pkts, uint16_t unsent, > void *userdata __rte_unused) > { > rte_pktmbuf_free_bulk(pkts, unsent); > + > + rte_eth_trace_tx_buffer_drop_callback((void **)pkts, unsent); > } > > void > @@ -2444,6 +2580,8 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf > **pkts, uint16_t unsent, > > rte_pktmbuf_free_bulk(pkts, unsent); > *count += unsent; > + > + rte_eth_trace_tx_buffer_count_callback((void **)pkts, unsent, > *count); > } > > int > @@ -2458,6 +2596,9 @@ rte_eth_tx_buffer_set_err_callback(struct > rte_eth_dev_tx_buffer *buffer, > > buffer->error_callback = cbfn; > buffer->error_userdata = userdata; > + > + rte_eth_trace_tx_buffer_set_err_callback(buffer); > + > return 0; > } > > @@ -2477,6 +2618,8 @@ rte_eth_tx_buffer_init(struct > rte_eth_dev_tx_buffer *buffer, uint16_t size) > buffer, rte_eth_tx_buffer_drop_callback, NULL); > } > > + rte_eth_trace_tx_buffer_init(buffer, size, ret); > + > return ret; > } > > @@ -2495,7 +2638,11 @@ 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); > + > + rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt, ret); > + > + return ret; > } > > int > @@ -2516,7 +2663,12 @@ rte_eth_promiscuous_enable(uint16_t port_id) > diag = (*dev->dev_ops->promiscuous_enable)(dev); > dev->data->promiscuous = (diag == 0) ? 1 : 0; > > - return eth_err(port_id, diag); > + diag = eth_err(port_id, diag); > + > + rte_eth_trace_promiscuous_enable(port_id, dev->data- > >promiscuous, > + diag); > + > + return diag; > } > > int > @@ -2539,7 +2691,12 @@ rte_eth_promiscuous_disable(uint16_t port_id) > if (diag != 0) > dev->data->promiscuous = 1; > > - return eth_err(port_id, diag); > + diag = eth_err(port_id, diag); > + > + rte_eth_trace_promiscuous_disable(port_id, dev->data- > >promiscuous, > + diag); > + > + return diag; > } > > int > @@ -2550,6 +2707,8 @@ rte_eth_promiscuous_get(uint16_t port_id) > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > > + rte_eth_trace_promiscuous_get(port_id, dev->data->promiscuous); > + > return dev->data->promiscuous; > } > > @@ -2570,7 +2729,12 @@ rte_eth_allmulticast_enable(uint16_t port_id) > diag = (*dev->dev_ops->allmulticast_enable)(dev); > dev->data->all_multicast = (diag == 0) ? 1 : 0; > > - return eth_err(port_id, diag); > + diag = eth_err(port_id, diag); > + > + rte_eth_trace_allmulticast_enable(port_id, dev->data->all_multicast, > + diag); > + > + return diag; > } > > int > @@ -2592,7 +2756,12 @@ rte_eth_allmulticast_disable(uint16_t port_id) > if (diag != 0) > dev->data->all_multicast = 1; > > - return eth_err(port_id, diag); > + diag = eth_err(port_id, diag); > + > + rte_eth_trace_allmulticast_disable(port_id, dev->data->all_multicast, > + diag); > + > + return diag; > } > > int > @@ -2603,6 +2772,8 @@ rte_eth_allmulticast_get(uint16_t port_id) > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > > + rte_eth_trace_allmulticast_get(port_id, dev->data->all_multicast); > + > return dev->data->all_multicast; > } > > @@ -2629,6 +2800,8 @@ rte_eth_link_get(uint16_t port_id, struct > rte_eth_link *eth_link) > *eth_link = dev->data->dev_link; > } > > + rte_eth_trace_link_get(port_id, eth_link); > + > return 0; > } > > @@ -2655,35 +2828,76 @@ rte_eth_link_get_nowait(uint16_t port_id, struct > rte_eth_link *eth_link) > *eth_link = dev->data->dev_link; > } > > + rte_eth_trace_link_get_nowait(port_id, eth_link); > + > return 0; > } > > const char * > rte_eth_link_speed_to_str(uint32_t link_speed) > { > + const char *ret; > + > switch (link_speed) { > - case RTE_ETH_SPEED_NUM_NONE: return "None"; > - case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; > - case RTE_ETH_SPEED_NUM_100M: return "100 Mbps"; > - case RTE_ETH_SPEED_NUM_1G: return "1 Gbps"; > - case RTE_ETH_SPEED_NUM_2_5G: return "2.5 Gbps"; > - case RTE_ETH_SPEED_NUM_5G: return "5 Gbps"; > - case RTE_ETH_SPEED_NUM_10G: return "10 Gbps"; > - case RTE_ETH_SPEED_NUM_20G: return "20 Gbps"; > - case RTE_ETH_SPEED_NUM_25G: return "25 Gbps"; > - case RTE_ETH_SPEED_NUM_40G: return "40 Gbps"; > - case RTE_ETH_SPEED_NUM_50G: return "50 Gbps"; > - case RTE_ETH_SPEED_NUM_56G: return "56 Gbps"; > - case RTE_ETH_SPEED_NUM_100G: return "100 Gbps"; > - case RTE_ETH_SPEED_NUM_200G: return "200 Gbps"; > - case RTE_ETH_SPEED_NUM_UNKNOWN: return "Unknown"; > - default: return "Invalid"; > + case RTE_ETH_SPEED_NUM_NONE: > + ret = "None"; > + break; > + case RTE_ETH_SPEED_NUM_10M: > + ret = "10 Mbps"; > + break; > + case RTE_ETH_SPEED_NUM_100M: > + ret = "100 Mbps"; > + break; > + case RTE_ETH_SPEED_NUM_1G: > + ret = "1 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_2_5G: > + ret = "2.5 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_5G: > + ret = "5 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_10G: > + ret = "10 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_20G: > + ret = "20 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_25G: > + ret = "25 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_40G: > + ret = "40 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_50G: > + ret = "50 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_56G: > + ret = "56 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_100G: > + ret = "100 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_200G: > + ret = "200 Gbps"; > + break; > + case RTE_ETH_SPEED_NUM_UNKNOWN: > + ret = "Unknown"; > + break; > + default: > + ret = "Invalid"; > } > + > + rte_eth_trace_link_speed_to_str(link_speed, ret); > + > + return ret; > } > > int > rte_eth_link_to_str(char *str, size_t len, const struct rte_eth_link > *eth_link) > { > + int ret; > + > if (str == NULL) { > RTE_ETHDEV_LOG(ERR, "Cannot convert link to NULL > string\n"); > return -EINVAL; > @@ -2701,20 +2915,25 @@ rte_eth_link_to_str(char *str, size_t len, const > struct rte_eth_link *eth_link) > } > > if (eth_link->link_status == RTE_ETH_LINK_DOWN) > - return snprintf(str, len, "Link down"); > + ret = snprintf(str, len, "Link down"); > else > - return snprintf(str, len, "Link up at %s %s %s", > + ret = snprintf(str, len, "Link up at %s %s %s", > rte_eth_link_speed_to_str(eth_link->link_speed), > (eth_link->link_duplex == > RTE_ETH_LINK_FULL_DUPLEX) ? > "FDX" : "HDX", > (eth_link->link_autoneg == > RTE_ETH_LINK_AUTONEG) ? > "Autoneg" : "Fixed"); > + > + rte_eth_trace_link_to_str(len, eth_link, str, ret); > + > + return ret; > } > > 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 +2949,11 @@ 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)); > + > + rte_eth_trace_stats_get(port_id, stats, ret); > + > + return ret; > } > > int > @@ -2750,6 +2973,8 @@ rte_eth_stats_reset(uint16_t port_id) > > dev->data->rx_mbuf_alloc_failed = 0; > > + rte_eth_trace_stats_reset(port_id); > + > return 0; > } > > @@ -2833,6 +3058,10 @@ rte_eth_xstats_get_id_by_name(uint16_t port_id, > const char *xstat_name, > for (idx_xstat = 0; idx_xstat < cnt_xstats; idx_xstat++) { > if (!strcmp(xstats_names[idx_xstat].name, xstat_name)) { > *id = idx_xstat; > + > + rte_eth_trace_xstats_get_id_by_name(port_id, > + xstat_name, *id); > + > return 0; > }; > } > @@ -2986,6 +3215,9 @@ rte_eth_xstats_get_names_by_id(uint16_t port_id, > return -1; > } > xstats_names[i] = xstats_names_copy[ids[i]]; > + > + rte_eth_trace_xstats_get_names_by_id(port_id, > &xstats_names[i], > + ids[i]); > } > > free(xstats_names_copy); > @@ -3001,6 +3233,7 @@ rte_eth_xstats_get_names(uint16_t port_id, > int cnt_used_entries; > int cnt_expected_entries; > int cnt_driver_entries; > + int i; > > cnt_expected_entries = eth_dev_get_xstats_count(port_id); > if (xstats_names == NULL || cnt_expected_entries < 0 || > @@ -3025,6 +3258,10 @@ rte_eth_xstats_get_names(uint16_t port_id, > cnt_used_entries += cnt_driver_entries; > } > > + for (i = 0; i < cnt_used_entries; i++) > + rte_eth_trace_xstats_get_names(port_id, i, xstats_names[i], > + size, cnt_used_entries); > + > return cnt_used_entries; > } > > @@ -3174,6 +3411,9 @@ rte_eth_xstats_get_by_id(uint16_t port_id, const > uint64_t *ids, > } > values[i] = xstats[ids[i]].value; > } > + > + rte_eth_trace_xstats_get_by_id(port_id, ids, values, size); > + > return size; > } > > @@ -3221,6 +3461,9 @@ rte_eth_xstats_get(uint16_t port_id, struct > rte_eth_xstat *xstats, > for ( ; i < count + xcount; i++) > xstats[i].id += count; > > + for (i = 0; i < n; i++) > + rte_eth_trace_xstats_get(port_id, xstats[i]); > + > return count + xcount; > } > > @@ -3234,8 +3477,13 @@ rte_eth_xstats_reset(uint16_t port_id) > 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) { > + int ret = eth_err(port_id, (*dev->dev_ops- > >xstats_reset)(dev)); > + > + rte_eth_trace_xstats_reset(port_id, ret); > + > + return ret; > + } > > /* fallback to default */ > return rte_eth_stats_reset(port_id); > @@ -3268,24 +3516,39 @@ int > rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t > tx_queue_id, > 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); > + > + return ret; > } > > int > rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t > rx_queue_id, > 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, > rx_queue_id, > stat_idx, STAT_QMAP_RX)); > + > + rte_ethdev_trace_set_rx_queue_stats_mapping(port_id, > rx_queue_id, > + stat_idx, ret); > + > + return ret; > } > > int > rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t > fw_size) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -3299,8 +3562,12 @@ rte_eth_dev_fw_version_get(uint16_t port_id, > char *fw_version, size_t fw_size) > > if (*dev->dev_ops->fw_version_get == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->fw_version_get)(dev, > + ret = eth_err(port_id, (*dev->dev_ops->fw_version_get)(dev, > fw_version, fw_size)); > + > + rte_ethdev_trace_fw_version_get(port_id, fw_version, fw_size, > ret); > + > + return ret; > } > > int > diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h > deleted file mode 100644 > index 1491c815c3..0000000000 > --- a/lib/ethdev/rte_ethdev_trace.h > +++ /dev/null > @@ -1,95 +0,0 @@ > -/* SPDX-License-Identifier: BSD-3-Clause > - * Copyright(C) 2020 Marvell International Ltd. > - */ > - > -#ifndef _RTE_ETHDEV_TRACE_H_ > -#define _RTE_ETHDEV_TRACE_H_ > - > -/** > - * @file > - * > - * API for ethdev trace support > - */ > - > -#ifdef __cplusplus > -extern "C" { > -#endif > - > -#include <rte_trace_point.h> > - > -#include "rte_ethdev.h" > - > -RTE_TRACE_POINT( > - rte_ethdev_trace_configure, > - RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t nb_rx_q, > - uint16_t nb_tx_q, const struct rte_eth_conf *dev_conf, int > rc), > - rte_trace_point_emit_u16(port_id); > - rte_trace_point_emit_u16(nb_rx_q); > - rte_trace_point_emit_u16(nb_tx_q); > - rte_trace_point_emit_u32(dev_conf->link_speeds); > - rte_trace_point_emit_u32(dev_conf->rxmode.mq_mode); > - rte_trace_point_emit_u32(dev_conf->rxmode.mtu); > - rte_trace_point_emit_u64(dev_conf->rxmode.offloads); > - rte_trace_point_emit_u32(dev_conf->txmode.mq_mode); > - rte_trace_point_emit_u64(dev_conf->txmode.offloads); > - rte_trace_point_emit_u32(dev_conf->lpbk_mode); > - rte_trace_point_emit_int(rc); > -) > - > -RTE_TRACE_POINT( > - rte_ethdev_trace_rxq_setup, > - RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, > - uint16_t nb_rx_desc, void *mp, > - const struct rte_eth_rxconf *rx_conf, int rc), > - 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(mp); > - rte_trace_point_emit_u8(rx_conf->rx_thresh.pthresh); > - rte_trace_point_emit_u8(rx_conf->rx_thresh.hthresh); > - rte_trace_point_emit_u8(rx_conf->rx_thresh.wthresh); > - rte_trace_point_emit_u8(rx_conf->rx_drop_en); > - rte_trace_point_emit_u8(rx_conf->rx_deferred_start); > - rte_trace_point_emit_u64(rx_conf->offloads); > - rte_trace_point_emit_int(rc); > -) > - > -RTE_TRACE_POINT( > - rte_ethdev_trace_txq_setup, > - RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > - uint16_t nb_tx_desc, const struct rte_eth_txconf *tx_conf), > - rte_trace_point_emit_u16(port_id); > - rte_trace_point_emit_u16(tx_queue_id); > - rte_trace_point_emit_u16(nb_tx_desc); > - rte_trace_point_emit_u8(tx_conf->tx_thresh.pthresh); > - rte_trace_point_emit_u8(tx_conf->tx_thresh.hthresh); > - rte_trace_point_emit_u8(tx_conf->tx_thresh.wthresh); > - rte_trace_point_emit_u8(tx_conf->tx_deferred_start); > - rte_trace_point_emit_u16(tx_conf->tx_free_thresh); > - rte_trace_point_emit_u64(tx_conf->offloads); > -) > - > -RTE_TRACE_POINT( > - rte_ethdev_trace_start, > - RTE_TRACE_POINT_ARGS(uint16_t port_id), > - rte_trace_point_emit_u16(port_id); > -) > - > -RTE_TRACE_POINT( > - rte_ethdev_trace_stop, > - 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_close, > - RTE_TRACE_POINT_ARGS(uint16_t port_id), > - rte_trace_point_emit_u16(port_id); > -) > - > -#ifdef __cplusplus > -} > -#endif > - > -#endif /* _RTE_ETHDEV_TRACE_H_ */ > diff --git a/lib/ethdev/rte_ethdev_trace_fp.h > b/lib/ethdev/rte_ethdev_trace_fp.h > index 40084d1929..186271c9ff 100644 > --- a/lib/ethdev/rte_ethdev_trace_fp.h > +++ b/lib/ethdev/rte_ethdev_trace_fp.h > @@ -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 > -- > 2.25.1