* [PATCH 0/6] add trace points in ethdev library @ 2022-08-04 13:44 Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 1/6] ethdev: add trace points Ankur Dwivedi ` (6 more replies) 0 siblings, 7 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-08-04 13:44 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi This series adds trace points for functions in the ethdev library. The trace points are added in ethdev, flow, mtr, tm and ethdev_driver files. Apart from the tracepoints, check-trace-func function is added in checkpatch script. The function checks if any new api is added in ethdev library, then it must have a tracepoint. Otherwise an error will be returned by checkpatch. Adding the ethdev library maintainers and all networking driver maintainers in the cc list of this patch series, for review. Ankur Dwivedi (6): ethdev: add trace points ethdev: add trace points for flow ethdev: add trace points for mtr ethdev: add trace points for tm ethdev: add trace points for driver devtools: add trace function check in checkpatch devtools/check-symbol-change.sh | 76 +- devtools/check-trace-func.py | 52 + devtools/check-trace-func.sh | 50 + devtools/checkpatches.sh | 9 + devtools/common-func.sh | 77 + lib/ethdev/ethdev_driver.c | 29 + lib/ethdev/ethdev_private.c | 5 + lib/ethdev/ethdev_trace_points.c | 768 ++++++++++ lib/ethdev/rte_ethdev.c | 150 ++ lib/ethdev/rte_ethdev_trace.h | 2246 ++++++++++++++++++++++++++++++ lib/ethdev/rte_flow.c | 54 + lib/ethdev/rte_mtr.c | 27 + lib/ethdev/rte_tm.c | 40 + lib/ethdev/version.map | 257 ++++ 14 files changed, 3766 insertions(+), 74 deletions(-) create mode 100755 devtools/check-trace-func.py create mode 100755 devtools/check-trace-func.sh create mode 100644 devtools/common-func.sh -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH 1/6] ethdev: add trace points 2022-08-04 13:44 [PATCH 0/6] add trace points in ethdev library Ankur Dwivedi @ 2022-08-04 13:44 ` Ankur Dwivedi 2022-09-12 11:00 ` Andrew Rybchenko 2022-08-04 13:44 ` [PATCH 2/6] ethdev: add trace points for flow Ankur Dwivedi ` (5 subsequent siblings) 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2022-08-04 13:44 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Add trace points for ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_private.c | 5 + lib/ethdev/ethdev_trace_points.c | 438 +++++++++++ lib/ethdev/rte_ethdev.c | 150 ++++ lib/ethdev/rte_ethdev_trace.h | 1182 ++++++++++++++++++++++++++++++ lib/ethdev/version.map | 147 ++++ 5 files changed, 1922 insertions(+) diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index 48090c879a..e483145816 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.h" #include "ethdev_driver.h" #include "ethdev_private.h" @@ -291,6 +292,8 @@ rte_eth_call_rx_callbacks(uint16_t port_id, uint16_t queue_id, { const struct rte_eth_rxtx_callback *cb = opaque; + rte_eth_trace_call_rx_callbacks(port_id, queue_id, rx_pkts, nb_rx, + nb_pkts, opaque); while (cb != NULL) { nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx, nb_pkts, cb->param); @@ -306,6 +309,8 @@ rte_eth_call_tx_callbacks(uint16_t port_id, uint16_t queue_id, { const struct rte_eth_rxtx_callback *cb = opaque; + rte_eth_trace_call_tx_callbacks(port_id, queue_id, tx_pkts, nb_pkts, + opaque); while (cb != NULL) { nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts, cb->param); diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2919409a15..2e80401771 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -29,3 +29,441 @@ 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_add_first_rx_callback, + lib.ethdev.add_first_rx_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_rx_callback, + lib.ethdev.add_rx_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_tx_callback, + lib.ethdev.add_tx_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_disable, + lib.ethdev.allmulticast_disable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_enable, + lib.ethdev.allmulticast_enable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_get, + lib.ethdev.allmulticast_get) + +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_ethdev_trace_set_mtu, + lib.ethdev.set_mtu) + +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_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_default_mac_addr_set, + lib.ethdev.default_mac_addr_set) + +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_fw_version_get, + lib.ethdev.fw_version_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_dcb_info, + lib.ethdev.get_dcb_info) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom, + lib.ethdev.get_eeprom) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom_length, + lib.ethdev.get_eeprom_length) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_mtu, + lib.ethdev.get_mtu) + +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_get_reg_info, + lib.ethdev.get_reg_info) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_sec_ctx, + lib.ethdev.get_sec_ctx) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_supported_ptypes, + lib.ethdev.get_supported_ptypes) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_vlan_offload, + lib.ethdev.get_vlan_offload) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_info_get, + lib.ethdev.info_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_removed, + lib.ethdev.is_removed) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_valid_port, + lib.ethdev.is_valid_port) + +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_pool_ops_supported, + lib.ethdev.pool_ops_supported) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_set, + lib.ethdev.priority_flow_ctrl_set) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_reset, + lib.ethdev.reset) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_conf_get, + lib.ethdev.rss_hash_conf_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_update, + lib.ethdev.rss_hash_update) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_query, + lib.ethdev.rss_reta_query) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_update, + lib.ethdev.rss_reta_update) + +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, + lib.ethdev.rx_intr_ctl_q) + +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_disable, + lib.ethdev.rx_intr_disable) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_enable, + lib.ethdev.rx_intr_enable) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_offload_name, + lib.ethdev.rx_offload_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_set_eeprom, + lib.ethdev.set_eeprom) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_down, + lib.ethdev.set_link_down) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_up, + lib.ethdev.set_link_up) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_mc_addr_list, + lib.ethdev.set_mc_addr_list) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_ptypes, + lib.ethdev.set_ptypes) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + lib.ethdev.set_rx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_tx_queue_stats_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +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_set_vlan_pvid, + lib.ethdev.set_vlan_pvid) + +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_socket_id, + lib.ethdev.socket_id) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_tx_offload_name, + lib.ethdev.tx_offload_name) + +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_ethdev_trace_uc_all_hash_table_set, + lib.ethdev.uc_all_hash_table_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_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_ethdev_trace_vlan_filter, + lib.ethdev.vlan_filter) + +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_owned_by, + lib.ethdev.find_next_owned_by) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_find_next_sibling, + lib.ethdev.find_next_sibling) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_iterator_cleanup, + lib.ethdev.iterator_cleanup) + +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_led_off, + lib.ethdev.led_off) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_led_on, + lib.ethdev.led_on) + +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_macaddr_get, + lib.ethdev.macaddr_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_disable, + lib.ethdev.promiscuous_disable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_enable, + lib.ethdev.promiscuous_enable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_get, + lib.ethdev.promiscuous_get) + +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_burst_mode_get, + lib.ethdev.rx_burst_mode_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_info_get, + lib.ethdev.rx_queue_info_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_setup, + lib.ethdev.rx_queue_setup) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_set_queue_rate_limit, + lib.ethdev.set_queue_rate_limit) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_speed_bitflag, + lib.ethdev.speed_bitflag) + +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_timesync_adjust_time, + lib.ethdev.timesync_adjust_time) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_disable, + lib.ethdev.timesync_disable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_enable, + lib.ethdev.timesync_enable) + +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_time, + lib.ethdev.timesync_read_time) + +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_write_time, + lib.ethdev.timesync_write_time) + +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_drop_callback, + lib.ethdev.tx_buffer_drop_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_buffer_init, + lib.ethdev.tx_buffer_init) + +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_burst_mode_get, + lib.ethdev.tx_burst_mode_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_done_cleanup, + lib.ethdev.tx_done_cleanup) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_queue_info_get, + lib.ethdev.tx_queue_info_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_queue_setup, + lib.ethdev.tx_queue_setup) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get, + lib.ethdev.xstats_get) + +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_id_by_name, + lib.ethdev.xstats_get_id_by_name) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get_names, + lib.ethdev.xstats_get_names) + +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_reset, + lib.ethdev.xstats_reset) + +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_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_get_module_eeprom, + lib.ethdev.get_module_eeprom) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_module_info, + lib.ethdev.get_module_info) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_read_clock, + lib.ethdev.read_clock) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_hairpin_capability_get, + lib.ethdev.hairpin_capability_get) + +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_get_peer_ports, + lib.ethdev.hairpin_get_peer_ports) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_unbind, + lib.ethdev.hairpin_unbind) + +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_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_eth_trace_get_monitor_addr, + lib.ethdev.get_monitor_addr) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_representor_info_get, + lib.ethdev.representor_info_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_capability_name, + lib.ethdev.capability_name) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_conf_get, + lib.ethdev.conf_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_macaddrs_get, + lib.ethdev.macaddrs_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_metadata_negotiate, + lib.ethdev.rx_metadata_negotiate) + +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_priority_flow_ctrl_queue_info_get, + lib.ethdev.priority_flow_ctrl_queue_info_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priv_dump, + lib.ethdev.priv_dump) + +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_rx_avail_thresh_query, + lib.ethdev.rx_avail_thresh_query) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set, + lib.ethdev.rx_avail_thresh_set) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 1979dc0850..a6fb370b22 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -167,6 +167,7 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str) char *cls_str = NULL; int str_size; + rte_eth_trace_iterator_init(iter, devargs_str); if (iter == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot initialize NULL iterator\n"); return -EINVAL; @@ -273,6 +274,7 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str) uint16_t rte_eth_iterator_next(struct rte_dev_iterator *iter) { + rte_eth_trace_iterator_next(iter); if (iter == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot get next device from NULL iterator\n"); @@ -308,6 +310,7 @@ rte_eth_iterator_next(struct rte_dev_iterator *iter) void rte_eth_iterator_cleanup(struct rte_dev_iterator *iter) { + rte_eth_trace_iterator_cleanup(iter); if (iter == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot do clean up from NULL iterator\n"); return; @@ -323,6 +326,7 @@ 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); while (port_id < RTE_MAX_ETHPORTS && rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED) port_id++; @@ -345,6 +349,7 @@ rte_eth_find_next(uint16_t port_id) uint16_t rte_eth_find_next_of(uint16_t port_id, const struct rte_device *parent) { + rte_eth_trace_find_next_of(port_id, parent); port_id = rte_eth_find_next(port_id); while (port_id < RTE_MAX_ETHPORTS && rte_eth_devices[port_id].device != parent) @@ -356,6 +361,7 @@ rte_eth_find_next_of(uint16_t port_id, const struct rte_device *parent) uint16_t rte_eth_find_next_sibling(uint16_t port_id, uint16_t ref_port_id) { + rte_eth_trace_find_next_sibling(port_id, ref_port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(ref_port_id, RTE_MAX_ETHPORTS); return rte_eth_find_next_of(port_id, rte_eth_devices[ref_port_id].device); @@ -370,6 +376,7 @@ eth_dev_is_allocated(const struct rte_eth_dev *ethdev) int rte_eth_dev_is_valid_port(uint16_t port_id) { + rte_ethdev_trace_is_valid_port(port_id); if (port_id >= RTE_MAX_ETHPORTS || (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)) return 0; @@ -389,6 +396,7 @@ eth_is_valid_owner_id(uint64_t owner_id) uint64_t rte_eth_find_next_owned_by(uint16_t port_id, const uint64_t owner_id) { + rte_eth_trace_find_next_owned_by(port_id, owner_id); port_id = rte_eth_find_next(port_id); while (port_id < RTE_MAX_ETHPORTS && rte_eth_devices[port_id].data->owner.id != owner_id) @@ -412,6 +420,7 @@ 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; } @@ -468,6 +477,7 @@ rte_eth_dev_owner_set(const uint16_t port_id, { int ret; + rte_ethdev_trace_owner_set(port_id, owner); eth_dev_shared_data_prepare(); rte_spinlock_lock(ð_dev_shared_data->ownership_lock); @@ -485,6 +495,7 @@ rte_eth_dev_owner_unset(const uint16_t port_id, const uint64_t owner_id) {.id = RTE_ETH_DEV_NO_OWNER, .name = ""}; int ret; + rte_ethdev_trace_owner_unset(port_id, owner_id); eth_dev_shared_data_prepare(); rte_spinlock_lock(ð_dev_shared_data->ownership_lock); @@ -525,6 +536,7 @@ 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; } @@ -554,12 +566,14 @@ 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; } int rte_eth_dev_socket_id(uint16_t port_id) { + rte_ethdev_trace_socket_id(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return rte_eth_devices[port_id].data->numa_node; } @@ -567,6 +581,7 @@ rte_eth_dev_socket_id(uint16_t port_id) void * rte_eth_dev_get_sec_ctx(uint16_t port_id) { + rte_ethdev_trace_get_sec_ctx(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL); return rte_eth_devices[port_id].security_ctx; } @@ -582,6 +597,7 @@ rte_eth_dev_count_avail(void) RTE_ETH_FOREACH_DEV(p) count++; + rte_ethdev_trace_count_avail(count); return count; } @@ -593,6 +609,7 @@ rte_eth_dev_count_total(void) RTE_ETH_FOREACH_VALID_DEV(port) count++; + rte_ethdev_trace_count_total(count); return count; } @@ -613,6 +630,7 @@ 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; } @@ -635,6 +653,7 @@ 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; } @@ -705,6 +724,7 @@ rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_rx_queue_start(port_id, rx_queue_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -744,6 +764,7 @@ rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_rx_queue_stop(port_id, rx_queue_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -776,6 +797,7 @@ rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_tx_queue_start(port_id, tx_queue_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -815,6 +837,7 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_tx_queue_stop(port_id, tx_queue_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -844,6 +867,7 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex) { + rte_eth_trace_speed_bitflag(speed, duplex); switch (speed) { case RTE_ETH_SPEED_NUM_10M: return duplex ? RTE_ETH_LINK_SPEED_10M : RTE_ETH_LINK_SPEED_10M_HD; @@ -889,6 +913,7 @@ rte_eth_dev_rx_offload_name(uint64_t offload) } } + rte_ethdev_trace_rx_offload_name(offload, name); return name; } @@ -905,6 +930,7 @@ rte_eth_dev_tx_offload_name(uint64_t offload) } } + rte_ethdev_trace_tx_offload_name(offload, name); return name; } @@ -921,6 +947,7 @@ rte_eth_dev_capability_name(uint64_t capability) } } + rte_ethdev_trace_capability_name(capability, name); return name; } @@ -1538,6 +1565,7 @@ rte_eth_dev_set_link_up(uint16_t port_id) { struct rte_eth_dev *dev; + rte_ethdev_trace_set_link_up(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1550,6 +1578,7 @@ rte_eth_dev_set_link_down(uint16_t port_id) { struct rte_eth_dev *dev; + rte_ethdev_trace_set_link_down(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1596,6 +1625,7 @@ rte_eth_dev_reset(uint16_t port_id) struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_reset(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1631,6 +1661,7 @@ 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; } @@ -1910,6 +1941,8 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, int i; int count; + rte_eth_trace_rx_hairpin_queue_setup(port_id, rx_queue_id, nb_rx_desc, + conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1985,6 +2018,8 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; + rte_eth_trace_tx_queue_setup(port_id, tx_queue_id, nb_tx_desc, + socket_id, tx_conf); if (tx_queue_id >= dev->data->nb_tx_queues) { RTE_ETHDEV_LOG(ERR, "Invalid Tx queue_id=%u\n", tx_queue_id); return -EINVAL; @@ -2076,6 +2111,7 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, int count; int ret; + rte_eth_trace_tx_hairpin_queue_setup(port_id, tx_queue_id, nb_tx_desc, conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2144,6 +2180,7 @@ rte_eth_hairpin_bind(uint16_t tx_port, uint16_t rx_port) struct rte_eth_dev *dev; int ret; + rte_eth_trace_hairpin_bind(tx_port, rx_port); RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port, -ENODEV); dev = &rte_eth_devices[tx_port]; @@ -2168,6 +2205,7 @@ rte_eth_hairpin_unbind(uint16_t tx_port, uint16_t rx_port) struct rte_eth_dev *dev; int ret; + rte_eth_trace_hairpin_unbind(tx_port, rx_port); RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port, -ENODEV); dev = &rte_eth_devices[tx_port]; @@ -2193,6 +2231,7 @@ rte_eth_hairpin_get_peer_ports(uint16_t port_id, uint16_t *peer_ports, struct rte_eth_dev *dev; int ret; + rte_eth_trace_hairpin_get_peer_ports(port_id, peer_ports, len, direction); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2226,6 +2265,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); rte_pktmbuf_free_bulk(pkts, unsent); } @@ -2237,12 +2277,14 @@ 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(pkts, unsent, *count); } int rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer, buffer_tx_error_fn cbfn, void *userdata) { + rte_eth_trace_tx_buffer_set_err_callback(buffer, cbfn, userdata); if (buffer == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot set Tx buffer error callback to NULL buffer\n"); @@ -2259,6 +2301,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size) { int ret = 0; + rte_eth_trace_tx_buffer_init(buffer, size); if (buffer == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot initialize NULL buffer\n"); return -EINVAL; @@ -2279,6 +2322,7 @@ rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt) struct rte_eth_dev *dev; int ret; + rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2296,6 +2340,7 @@ rte_eth_promiscuous_enable(uint16_t port_id) struct rte_eth_dev *dev; int diag = 0; + rte_eth_trace_promiscuous_enable(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2316,6 +2361,7 @@ rte_eth_promiscuous_disable(uint16_t port_id) struct rte_eth_dev *dev; int diag = 0; + rte_eth_trace_promiscuous_disable(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2337,6 +2383,7 @@ rte_eth_promiscuous_get(uint16_t port_id) { struct rte_eth_dev *dev; + rte_eth_trace_promiscuous_get(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2349,6 +2396,7 @@ rte_eth_allmulticast_enable(uint16_t port_id) struct rte_eth_dev *dev; int diag; + rte_eth_trace_allmulticast_enable(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2368,6 +2416,7 @@ rte_eth_allmulticast_disable(uint16_t port_id) struct rte_eth_dev *dev; int diag; + rte_eth_trace_allmulticast_disable(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2388,6 +2437,7 @@ rte_eth_allmulticast_get(uint16_t port_id) { struct rte_eth_dev *dev; + rte_eth_trace_allmulticast_get(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2416,6 +2466,7 @@ 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; } @@ -2441,12 +2492,14 @@ 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) { + rte_eth_trace_link_speed_to_str(link_speed); switch (link_speed) { case RTE_ETH_SPEED_NUM_NONE: return "None"; case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; @@ -2470,6 +2523,7 @@ rte_eth_link_speed_to_str(uint32_t link_speed) int rte_eth_link_to_str(char *str, size_t len, const struct rte_eth_link *eth_link) { + rte_eth_trace_link_to_str(str, len, eth_link); if (str == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot convert link to NULL string\n"); return -EINVAL; @@ -2502,6 +2556,7 @@ rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats) { struct rte_eth_dev *dev; + rte_eth_trace_stats_get(port_id, stats); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2524,6 +2579,7 @@ rte_eth_stats_reset(uint16_t port_id) struct rte_eth_dev *dev; int ret; + rte_eth_trace_stats_reset(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -2598,6 +2654,7 @@ rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, return -ENOMEM; } + rte_eth_trace_xstats_get_id_by_name(port_id, xstat_name, id); /* Get count */ cnt_xstats = rte_eth_xstats_get_names_by_id(port_id, NULL, 0, NULL); if (cnt_xstats < 0) { @@ -2770,6 +2827,8 @@ 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); @@ -2809,6 +2868,7 @@ rte_eth_xstats_get_names(uint16_t port_id, cnt_used_entries += cnt_driver_entries; } + rte_eth_trace_xstats_get_names(port_id, xstats_names, size, cnt_used_entries); return cnt_used_entries; } @@ -2884,6 +2944,7 @@ rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; + rte_eth_trace_xstats_get_by_id(port_id, ids, values, size); ret = eth_dev_get_xstats_count(port_id); if (ret < 0) return ret; @@ -3005,6 +3066,8 @@ 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], i); return count + xcount; } @@ -3017,6 +3080,7 @@ rte_eth_xstats_reset(uint16_t port_id) RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; + rte_eth_trace_xstats_reset(port_id); /* implemented by the driver */ if (dev->dev_ops->xstats_reset != NULL) return eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev)); @@ -3051,6 +3115,8 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) { + rte_ethdev_trace_set_tx_queue_stats_mapping(port_id, tx_queue_id, + stat_idx); return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id, tx_queue_id, stat_idx, STAT_QMAP_TX)); @@ -3060,6 +3126,8 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) { + rte_ethdev_trace_set_rx_queue_stats_mapping(port_id, rx_queue_id, + stat_idx); return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id, rx_queue_id, stat_idx, STAT_QMAP_RX)); @@ -3070,6 +3138,7 @@ rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size) { struct rte_eth_dev *dev; + rte_ethdev_trace_fw_version_get(port_id, fw_version, fw_size); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3141,6 +3210,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); return 0; } @@ -3149,6 +3219,7 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) { struct rte_eth_dev *dev; + rte_ethdev_trace_conf_get(port_id, dev_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3172,6 +3243,7 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, struct rte_eth_dev *dev; const uint32_t *all_ptypes; + rte_ethdev_trace_get_supported_ptypes(port_id, ptype_mask, ptypes, num); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3217,6 +3289,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, unsigned int i, j; int ret; + rte_ethdev_trace_set_ptypes(port_id, ptype_mask, set_ptypes, num); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3296,6 +3369,7 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; + rte_eth_trace_macaddrs_get(port_id, ma, num); if (ma == NULL) { RTE_ETHDEV_LOG(ERR, "%s: invalid parameters\n", __func__); return -EINVAL; @@ -3318,6 +3392,7 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) { struct rte_eth_dev *dev; + rte_eth_trace_macaddr_get(port_id, mac_addr); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3348,6 +3423,7 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + rte_ethdev_trace_get_mtu(port_id, *mtu); return 0; } @@ -3389,6 +3465,7 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; + rte_ethdev_trace_set_mtu(port_id, mtu, ret); return eth_err(port_id, ret); } @@ -3398,6 +3475,7 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3440,6 +3518,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3461,6 +3540,7 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3481,6 +3561,7 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) uint64_t dev_offloads; uint64_t new_offloads; + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3583,6 +3664,7 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); return ret; } @@ -3591,6 +3673,7 @@ rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { struct rte_eth_dev *dev; + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3603,6 +3686,7 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3623,6 +3707,7 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3648,6 +3733,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3735,6 +3821,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, pfc_queue_info); if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); @@ -3750,6 +3837,8 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3865,6 +3954,7 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3912,6 +4002,7 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3941,6 +4032,7 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, enum rte_eth_rx_mq_mode mq_mode; int ret; + rte_ethdev_trace_rss_hash_update(port_id, rss_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3982,6 +4074,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4003,6 +4096,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4029,6 +4123,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4054,6 +4149,7 @@ rte_eth_led_on(uint16_t port_id) { struct rte_eth_dev *dev; + rte_eth_trace_led_on(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4066,6 +4162,7 @@ rte_eth_led_off(uint16_t port_id) { struct rte_eth_dev *dev; + rte_eth_trace_led_off(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4081,6 +4178,7 @@ rte_eth_fec_get_capability(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4102,6 +4200,7 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) { struct rte_eth_dev *dev; + rte_eth_trace_fec_get(port_id, fec_capa); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4121,6 +4220,7 @@ rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) { struct rte_eth_dev *dev; + rte_eth_trace_fec_set(port_id, fec_capa); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4163,6 +4263,7 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, uint64_t pool_mask; int ret; + rte_ethdev_trace_mac_addr_add(port_id, addr, pool); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4221,6 +4322,7 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) struct rte_eth_dev *dev; int index; + rte_ethdev_trace_mac_addr_remove(port_id, addr); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4260,6 +4362,7 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_default_mac_addr_set(port_id, addr); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4322,6 +4425,7 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, int ret; struct rte_eth_dev *dev; + rte_ethdev_trace_uc_hash_table_set(port_id, addr, on); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4379,6 +4483,7 @@ rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { struct rte_eth_dev *dev; + rte_ethdev_trace_uc_all_hash_table_set(port_id, on); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4395,6 +4500,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, struct rte_eth_link link; int ret; + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4428,6 +4534,7 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, { struct rte_eth_dev *dev; + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4462,6 +4569,7 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*queue_id >= dev->data->nb_rx_queues) *queue_id = 0; + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id); RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_avail_thresh_query, -ENOTSUP); return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, avail_thresh)); @@ -4493,6 +4601,7 @@ rte_eth_dev_callback_register(uint16_t port_id, uint16_t next_port; uint16_t last_port; + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg); if (cb_fn == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot register ethdev port %u callback from NULL\n", @@ -4560,6 +4669,7 @@ rte_eth_dev_callback_unregister(uint16_t port_id, uint16_t next_port; uint16_t last_port; + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg); if (cb_fn == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot unregister ethdev port %u callback from NULL\n", @@ -4619,6 +4729,7 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) uint16_t qid; int rc; + rte_ethdev_trace_rx_intr_ctl(port_id, epfd, op, data); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4679,6 +4790,7 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); return fd; } @@ -4691,6 +4803,7 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, struct rte_intr_handle *intr_handle; int rc; + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4729,6 +4842,7 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_rx_intr_enable(port_id, queue_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4747,6 +4861,7 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_rx_intr_disable(port_id, queue_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4769,6 +4884,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, #endif struct rte_eth_dev *dev; + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param); /* check input parameters */ if (!rte_eth_dev_is_valid_port(port_id) || fn == NULL || queue_id >= rte_eth_devices[port_id].data->nb_rx_queues) { @@ -4824,6 +4940,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_errno = ENOTSUP; return NULL; #endif + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param); /* check input parameters */ if (!rte_eth_dev_is_valid_port(port_id) || fn == NULL || queue_id >= rte_eth_devices[port_id].data->nb_rx_queues) { @@ -4865,6 +4982,7 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, #endif struct rte_eth_dev *dev; + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param); /* check input parameters */ if (!rte_eth_dev_is_valid_port(port_id) || fn == NULL || queue_id >= rte_eth_devices[port_id].data->nb_tx_queues) { @@ -4932,6 +5050,7 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback **prev_cb; int ret = -EINVAL; + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb); rte_spinlock_lock(ð_dev_rx_cb_lock); prev_cb = &dev->post_rx_burst_cbs[queue_id]; for (; *prev_cb != NULL; prev_cb = &cb->next) { @@ -4966,6 +5085,7 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *cb; struct rte_eth_rxtx_callback **prev_cb; + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb); rte_spinlock_lock(ð_dev_tx_cb_lock); prev_cb = &dev->pre_tx_burst_cbs[queue_id]; for (; *prev_cb != NULL; prev_cb = &cb->next) { @@ -5024,6 +5144,7 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); return 0; } @@ -5069,6 +5190,7 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); return 0; } @@ -5078,6 +5200,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, { struct rte_eth_dev *dev; + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5105,6 +5228,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, { struct rte_eth_dev *dev; + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5132,6 +5256,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, { struct rte_eth_dev *dev; + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5159,6 +5284,7 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5172,6 +5298,7 @@ rte_eth_timesync_enable(uint16_t port_id) { struct rte_eth_dev *dev; + rte_eth_trace_timesync_enable(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5184,6 +5311,7 @@ rte_eth_timesync_disable(uint16_t port_id) { struct rte_eth_dev *dev; + rte_eth_trace_timesync_disable(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5197,6 +5325,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, { struct rte_eth_dev *dev; + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5218,6 +5347,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, { struct rte_eth_dev *dev; + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5238,6 +5368,7 @@ rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { struct rte_eth_dev *dev; + rte_eth_trace_timesync_adjust_time(port_id, delta); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5250,6 +5381,7 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + rte_eth_trace_timesync_read_time(port_id, timestamp); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5270,6 +5402,7 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; + rte_eth_trace_timesync_write_time(port_id, timestamp); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5290,6 +5423,7 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) { struct rte_eth_dev *dev; + rte_eth_trace_read_clock(port_id, clock); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5308,6 +5442,7 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) { struct rte_eth_dev *dev; + rte_ethdev_trace_get_reg_info(port_id, info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5327,6 +5462,7 @@ rte_eth_dev_get_eeprom_length(uint16_t port_id) { struct rte_eth_dev *dev; + rte_ethdev_trace_get_eeprom_length(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5339,6 +5475,7 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; + rte_ethdev_trace_get_eeprom(port_id, info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5358,6 +5495,7 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; + rte_ethdev_trace_set_eeprom(port_id, info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5378,6 +5516,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_get_module_info(port_id, modinfo); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5398,6 +5537,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_get_module_eeprom(port_id, info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5432,6 +5572,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_get_dcb_info(port_id, dcb_info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5481,6 +5622,7 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id, *nb_rx_desc, *nb_tx_desc); return 0; } @@ -5490,6 +5632,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_hairpin_capability_get(port_id, cap); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5510,6 +5653,7 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) { struct rte_eth_dev *dev; + rte_ethdev_trace_pool_ops_supported(port_id, pool); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5772,6 +5916,7 @@ rte_eth_representor_info_get(uint16_t port_id, { struct rte_eth_dev *dev; + rte_eth_trace_representor_info_get(port_id, info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5784,6 +5929,7 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) { struct rte_eth_dev *dev; + rte_eth_trace_rx_metadata_negotiate(port_id, features); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5810,6 +5956,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, { struct rte_eth_dev *dev; + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5840,6 +5987,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, { struct rte_eth_dev *dev; + rte_eth_trace_ip_reassembly_conf_get(port_id, conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5869,6 +6017,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, { struct rte_eth_dev *dev; + rte_eth_trace_ip_reassembly_conf_set(port_id, conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5905,6 +6054,7 @@ rte_eth_dev_priv_dump(uint16_t port_id, FILE *file) { struct rte_eth_dev *dev; + rte_ethdev_trace_priv_dump(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 1491c815c3..de728d355d 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -88,6 +88,1188 @@ RTE_TRACE_POINT( rte_trace_point_emit_u16(port_id); ) +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, void *user_param), + 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( + 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), + 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( + rte_eth_trace_add_tx_callback, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + rte_tx_callback_fn fn, void *user_param), + 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( + rte_eth_trace_allmulticast_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_allmulticast_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_allmulticast_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_call_rx_callbacks, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **rx_pkts, uint16_t nb_rx, + uint16_t nb_pkts, void *opaque), + 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_emit_ptr(opaque); +) + +RTE_TRACE_POINT( + rte_eth_trace_call_tx_callbacks, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **tx_pkts, uint16_t nb_pkts, + void *opaque), + 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_emit_ptr(opaque); +) + +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_adjust_nb_rx_tx_desc, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t nb_rx_desc, + uint16_t nb_tx_desc), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(nb_rx_desc); + rte_trace_point_emit_u16(nb_tx_desc); +) + +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, void *cb_arg), + 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( + 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, void *cb_arg), + 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( + rte_ethdev_trace_default_mac_addr_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_flow_ctrl_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf *fc_conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(fc_conf); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_flow_ctrl_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf *fc_conf), + 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( + rte_ethdev_trace_fw_version_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, char *fw_version, size_t fw_size), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(fw_version); + rte_trace_point_emit_size_t(fw_size); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_dcb_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info *dcb_info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(dcb_info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_eeprom_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_eeprom_length, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + 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); +) + +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, 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_get_reg_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_reg_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_sec_ctx, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_supported_ptypes, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, + uint32_t *ptypes, int num), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(ptype_mask); + rte_trace_point_emit_ptr(ptypes); + rte_trace_point_emit_int(num); +) + +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_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_u32(dev_info->if_index); + 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_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_u16(dev_info->nb_rx_queues); + rte_trace_point_emit_u16(dev_info->nb_tx_queues); +) + +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_ethdev_trace_is_valid_port, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_mac_addr_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, + uint32_t pool), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); + rte_trace_point_emit_u32(pool); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_mac_addr_remove, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_pool_ops_supported, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *pool), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pool); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_priority_flow_ctrl_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf), + 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( + rte_ethdev_trace_reset, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rss_hash_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf *rss_conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(rss_conf); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rss_hash_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf *rss_conf), + 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( + rte_ethdev_trace_rss_reta_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(reta_conf); + rte_trace_point_emit_u16(reta_size); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rss_reta_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(reta_conf->mask); + rte_trace_point_emit_u16(reta_size); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rx_intr_ctl, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int epfd, int op, void *data), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(epfd); + rte_trace_point_emit_int(op); + rte_trace_point_emit_ptr(data); +) + +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, void *data), + 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( + 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_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rx_intr_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); +) + +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_rx_queue_start, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(rx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rx_queue_stop, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(rx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_eeprom_info *info), + 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( + rte_ethdev_trace_set_link_down, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_link_up, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_mc_addr_list, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_ether_addr *mc_addr_set, + uint32_t nb_mc_addr), + 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( + rte_ethdev_trace_set_ptypes, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, + uint32_t *set_ptypes, unsigned int num), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(ptype_mask); + rte_trace_point_emit_ptr(set_ptypes); + rte_trace_point_emit_u32(num); +) + +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), + 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( + 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), + 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( + 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(vlan_type); + rte_trace_point_emit_u16(tag_type); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_vlan_offload, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int offload_mask), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(offload_mask); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_vlan_pvid, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t pvid, int on), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(pvid); + rte_trace_point_emit_int(on); +) + +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_socket_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +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_tx_queue_start, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(tx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_tx_queue_stop, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(tx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_uc_all_hash_table_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint8_t on), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u8(on); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_uc_hash_table_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, + uint8_t on), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); + rte_trace_point_emit_u8(on); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_udp_tunnel_port_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp), + 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( + rte_ethdev_trace_udp_tunnel_port_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp), + 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( + rte_ethdev_trace_vlan_filter, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t vlan_id, int on), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(vlan_id); + rte_trace_point_emit_int(on); +) + +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_start, + const struct rte_device *parent), + rte_trace_point_emit_u16(port_id_start); + rte_trace_point_emit_ptr(parent); +) + +RTE_TRACE_POINT( + rte_eth_trace_find_next_owned_by, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const uint64_t owner_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(owner_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_find_next_sibling, + RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t ref_port_id), + rte_trace_point_emit_u16(port_id_start); + rte_trace_point_emit_u16(ref_port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_cleanup, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), + rte_trace_point_emit_ptr(iter); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_init, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter, const char *devargs), + rte_trace_point_emit_ptr(iter); + rte_trace_point_emit_ptr(devargs); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_next, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), + rte_trace_point_emit_ptr(iter); +) + +RTE_TRACE_POINT( + rte_eth_trace_led_off, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_led_on, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(link->link_speed); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_get_nowait, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(link->link_speed); +) + +RTE_TRACE_POINT( + rte_eth_trace_macaddr_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *mac_addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(mac_addr); +) + +RTE_TRACE_POINT( + rte_eth_trace_promiscuous_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_promiscuous_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_promiscuous_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(user_cb); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(user_cb); +) + +RTE_TRACE_POINT( + rte_eth_trace_rx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_eth_burst_mode *mode), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(mode); +) + +RTE_TRACE_POINT( + rte_eth_trace_rx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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->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_rx_queue_setup, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, + uint16_t nb_rx_desc, unsigned int socket_id, + const struct rte_eth_rxconf *rx_conf, + struct rte_mempool *mb_pool), + 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_u32(socket_id); + rte_trace_point_emit_ptr(rx_conf); + rte_trace_point_emit_ptr(mb_pool); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_idx); + rte_trace_point_emit_u16(tx_rate); +) + +RTE_TRACE_POINT( + rte_eth_trace_speed_bitflag, + RTE_TRACE_POINT_ARGS(uint32_t speed, int duplex), + rte_trace_point_emit_u32(speed); + rte_trace_point_emit_int(duplex); +) + +RTE_TRACE_POINT( + rte_eth_trace_stats_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats *stats), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(stats); +) + +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_timesync_adjust_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int64_t delta), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_i64(delta); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_read_rx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct timespec *timestamp, uint32_t flags), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(timestamp); + rte_trace_point_emit_u32(flags); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_read_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *time), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(time); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_read_tx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct timespec *timestamp), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(timestamp); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_write_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct timespec *time), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(time); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_buffer_count_callback, + RTE_TRACE_POINT_ARGS(struct rte_mbuf **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); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_buffer_drop_callback, + RTE_TRACE_POINT_ARGS(struct rte_mbuf **pkts, uint16_t unsent), + rte_trace_point_emit_ptr(pkts); + rte_trace_point_emit_u16(unsent); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_buffer_init, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev_tx_buffer *buffer, uint16_t size), + rte_trace_point_emit_ptr(buffer); + rte_trace_point_emit_u16(size); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_buffer_set_err_callback, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev_tx_buffer *buffer, + buffer_tx_error_fn callback, void *userdata), + rte_trace_point_emit_ptr(buffer); + rte_trace_point_emit_ptr(callback); + rte_trace_point_emit_ptr(userdata); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_eth_burst_mode *mode), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(mode); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_u32(free_cnt); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_tx_queue_setup, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, + uint16_t nb_tx_desc, unsigned int socket_id, + 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_u32(socket_id); + rte_trace_point_emit_ptr(tx_conf); +) + +RTE_TRACE_POINT( + 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); +) + +RTE_TRACE_POINT( + rte_eth_trace_xstats_get_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, + 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_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_ptr(id); +) + +RTE_TRACE_POINT( + 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); +) + +RTE_TRACE_POINT( + rte_eth_trace_xstats_get_names_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_reset, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_owner_delete, + RTE_TRACE_POINT_ARGS(const 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_owner_get, + RTE_TRACE_POINT_ARGS(const uint16_t port_id, + 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_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(const 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_owner_unset, + RTE_TRACE_POINT_ARGS(const uint16_t port_id, + const uint64_t owner_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(owner_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_module_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_dev_eeprom_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_module_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_dev_module_info *modinfo), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(modinfo); +) + +RTE_TRACE_POINT( + rte_eth_trace_read_clock, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t *clk), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(clk); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_hairpin_capability_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_hairpin_cap *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +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), + 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( + 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), + 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_ptr(conf); +) + +RTE_TRACE_POINT( + rte_eth_trace_hairpin_bind, + RTE_TRACE_POINT_ARGS(uint16_t tx_port, uint16_t rx_port), + rte_trace_point_emit_u16(tx_port); + rte_trace_point_emit_u16(rx_port); +) + +RTE_TRACE_POINT( + 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), + 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( + rte_eth_trace_hairpin_unbind, + RTE_TRACE_POINT_ARGS(uint16_t tx_port, uint16_t rx_port), + rte_trace_point_emit_u16(tx_port); + rte_trace_point_emit_u16(rx_port); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_speed_to_str, + RTE_TRACE_POINT_ARGS(uint32_t link_speed), + rte_trace_point_emit_u32(link_speed); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_to_str, + RTE_TRACE_POINT_ARGS(char *str, size_t len, + const struct rte_eth_link *eth_link), + rte_trace_point_emit_ptr(str); + rte_trace_point_emit_size_t(len); + rte_trace_point_emit_ptr(eth_link); +) + +RTE_TRACE_POINT( + rte_eth_trace_fec_get_capability, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_fec_capa *speed_fec_capa, + unsigned int num), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(speed_fec_capa); + rte_trace_point_emit_u32(num); +) + +RTE_TRACE_POINT( + rte_eth_trace_fec_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t *fec_capa), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(fec_capa); +) + +RTE_TRACE_POINT( + rte_eth_trace_fec_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t fec_capa), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(fec_capa); +) + +RTE_TRACE_POINT( + rte_eth_trace_get_monitor_addr, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_power_monitor_cond *pmc), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pmc); +) + +RTE_TRACE_POINT( + rte_eth_trace_representor_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_representor_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +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_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_conf *dev_conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(dev_conf); +) + +RTE_TRACE_POINT( + rte_eth_trace_macaddrs_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *ma, + unsigned int num), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(ma); + rte_trace_point_emit_u32(num); +) + +RTE_TRACE_POINT( + rte_eth_trace_rx_metadata_negotiate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t *features), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(features); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_priority_flow_ctrl_queue_configure, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_pfc_queue_conf *pfc_queue_conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pfc_queue_conf); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_priority_flow_ctrl_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_pfc_queue_info *pfc_queue_info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pfc_queue_info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_priv_dump, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_ip_reassembly_capability_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_ip_reassembly_params *capa), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(capa); +) + +RTE_TRACE_POINT( + rte_eth_trace_ip_reassembly_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_ip_reassembly_params *conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); +) + +RTE_TRACE_POINT( + rte_eth_trace_rx_avail_thresh_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_u8(avail_thresh); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index d46f31b63f..79bf947042 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -285,6 +285,153 @@ EXPERIMENTAL { rte_mtr_color_in_protocol_priority_get; rte_mtr_color_in_protocol_set; rte_mtr_meter_vlan_table_update; + + # added in 22.11 + __rte_eth_trace_add_first_rx_callback; + __rte_eth_trace_add_rx_callback; + __rte_eth_trace_add_tx_callback; + __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_ethdev_trace_count_avail; + __rte_ethdev_trace_count_total; + __rte_ethdev_trace_set_mtu; + __rte_ethdev_trace_adjust_nb_rx_tx_desc; + __rte_ethdev_trace_callback_register; + __rte_ethdev_trace_callback_unregister; + __rte_ethdev_trace_default_mac_addr_set; + __rte_ethdev_trace_flow_ctrl_get; + __rte_ethdev_trace_flow_ctrl_set; + __rte_ethdev_trace_fw_version_get; + __rte_ethdev_trace_get_dcb_info; + __rte_ethdev_trace_get_eeprom; + __rte_ethdev_trace_get_eeprom_length; + __rte_ethdev_trace_get_mtu; + __rte_ethdev_trace_get_name_by_port; + __rte_ethdev_trace_get_port_by_name; + __rte_ethdev_trace_get_reg_info; + __rte_ethdev_trace_get_sec_ctx; + __rte_ethdev_trace_get_supported_ptypes; + __rte_ethdev_trace_get_vlan_offload; + __rte_ethdev_trace_info_get; + __rte_ethdev_trace_is_removed; + __rte_ethdev_trace_is_valid_port; + __rte_ethdev_trace_mac_addr_add; + __rte_ethdev_trace_mac_addr_remove; + __rte_ethdev_trace_pool_ops_supported; + __rte_ethdev_trace_priority_flow_ctrl_set; + __rte_ethdev_trace_reset; + __rte_ethdev_trace_rss_hash_conf_get; + __rte_ethdev_trace_rss_hash_update; + __rte_ethdev_trace_rss_reta_query; + __rte_ethdev_trace_rss_reta_update; + __rte_ethdev_trace_rx_intr_ctl; + __rte_ethdev_trace_rx_intr_ctl_q; + __rte_ethdev_trace_rx_intr_ctl_q_get_fd; + __rte_ethdev_trace_rx_intr_disable; + __rte_ethdev_trace_rx_intr_enable; + __rte_ethdev_trace_rx_offload_name; + __rte_ethdev_trace_rx_queue_start; + __rte_ethdev_trace_rx_queue_stop; + __rte_ethdev_trace_set_eeprom; + __rte_ethdev_trace_set_link_down; + __rte_ethdev_trace_set_link_up; + __rte_ethdev_trace_set_mc_addr_list; + __rte_ethdev_trace_set_ptypes; + __rte_ethdev_trace_set_rx_queue_stats_mapping; + __rte_ethdev_trace_set_tx_queue_stats_mapping; + __rte_ethdev_trace_set_vlan_ether_type; + __rte_ethdev_trace_set_vlan_offload; + __rte_ethdev_trace_set_vlan_pvid; + __rte_ethdev_trace_set_vlan_strip_on_queue; + __rte_ethdev_trace_socket_id; + __rte_ethdev_trace_tx_offload_name; + __rte_ethdev_trace_tx_queue_start; + __rte_ethdev_trace_tx_queue_stop; + __rte_ethdev_trace_uc_all_hash_table_set; + __rte_ethdev_trace_uc_hash_table_set; + __rte_ethdev_trace_udp_tunnel_port_add; + __rte_ethdev_trace_udp_tunnel_port_delete; + __rte_ethdev_trace_vlan_filter; + __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_iterator_cleanup; + __rte_eth_trace_iterator_init; + __rte_eth_trace_iterator_next; + __rte_eth_trace_led_off; + __rte_eth_trace_led_on; + __rte_eth_trace_link_get; + __rte_eth_trace_link_get_nowait; + __rte_eth_trace_macaddr_get; + __rte_eth_trace_promiscuous_disable; + __rte_eth_trace_promiscuous_enable; + __rte_eth_trace_promiscuous_get; + __rte_eth_trace_remove_rx_callback; + __rte_eth_trace_remove_tx_callback; + __rte_eth_trace_rx_burst_mode_get; + __rte_eth_trace_rx_queue_info_get; + __rte_eth_trace_rx_queue_setup; + __rte_eth_trace_set_queue_rate_limit; + __rte_eth_trace_speed_bitflag; + __rte_eth_trace_stats_get; + __rte_eth_trace_stats_reset; + __rte_eth_trace_timesync_adjust_time; + __rte_eth_trace_timesync_disable; + __rte_eth_trace_timesync_enable; + __rte_eth_trace_timesync_read_rx_timestamp; + __rte_eth_trace_timesync_read_time; + __rte_eth_trace_timesync_read_tx_timestamp; + __rte_eth_trace_timesync_write_time; + __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_burst_mode_get; + __rte_eth_trace_tx_done_cleanup; + __rte_eth_trace_tx_queue_info_get; + __rte_eth_trace_tx_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_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_get_module_eeprom; + __rte_ethdev_trace_get_module_info; + __rte_ethdev_trace_hairpin_capability_get; + __rte_eth_trace_rx_hairpin_queue_setup; + __rte_eth_trace_tx_hairpin_queue_setup; + __rte_eth_trace_hairpin_bind; + __rte_eth_trace_hairpin_get_peer_ports; + __rte_eth_trace_hairpin_unbind; + __rte_eth_trace_link_speed_to_str; + __rte_eth_trace_link_to_str; + __rte_eth_trace_fec_get_capability; + __rte_eth_trace_fec_get; + __rte_eth_trace_fec_set; + __rte_eth_trace_get_monitor_addr; + __rte_eth_trace_representor_info_get; + __rte_ethdev_trace_capability_name; + __rte_ethdev_trace_conf_get; + __rte_eth_trace_macaddrs_get; + __rte_eth_trace_rx_metadata_negotiate; + __rte_ethdev_trace_priority_flow_ctrl_queue_configure; + __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; + __rte_ethdev_trace_priv_dump; + __rte_eth_trace_ip_reassembly_capability_get; + __rte_eth_trace_ip_reassembly_conf_get; + __rte_eth_trace_ip_reassembly_conf_set; + __rte_eth_trace_rx_avail_thresh_query; + __rte_eth_trace_rx_avail_thresh_set; }; INTERNAL { -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH 1/6] ethdev: add trace points 2022-08-04 13:44 ` [PATCH 1/6] ethdev: add trace points Ankur Dwivedi @ 2022-09-12 11:00 ` Andrew Rybchenko 2022-09-13 6:48 ` [EXT] " Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Andrew Rybchenko @ 2022-09-12 11:00 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On 8/4/22 16:44, Ankur Dwivedi wrote: > Add trace points for ethdev functions. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- [snip] > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 1979dc0850..a6fb370b22 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c [snip] > @@ -525,6 +536,7 @@ 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); I'm wondering why trace is sometimes added in the middle of the function, but in the majority of cases it is added as the first or the last action. Is there any logical/guidelines behind it? > return ret; > } > [snip] > diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h > index 1491c815c3..de728d355d 100644 > --- a/lib/ethdev/rte_ethdev_trace.h > +++ b/lib/ethdev/rte_ethdev_trace.h [snip] > +RTE_TRACE_POINT( Shouldn't it be RTE_TRACE_POINT_FP? Isn't it fast path? > + rte_eth_trace_call_rx_callbacks, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + struct rte_mbuf **rx_pkts, uint16_t nb_rx, > + uint16_t nb_pkts, void *opaque), > + 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_emit_ptr(opaque); > +) > + > +RTE_TRACE_POINT( same here > + rte_eth_trace_call_tx_callbacks, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + struct rte_mbuf **tx_pkts, uint16_t nb_pkts, > + void *opaque), > + 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_emit_ptr(opaque); > +) > + [snip] > +RTE_TRACE_POINT( > + rte_ethdev_trace_info_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_u32(dev_info->if_index); > + 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_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_u16(dev_info->nb_rx_queues); > + rte_trace_point_emit_u16(dev_info->nb_tx_queues); How to make a choice which information should be included above? > +) > + [snip] ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH 1/6] ethdev: add trace points 2022-09-12 11:00 ` Andrew Rybchenko @ 2022-09-13 6:48 ` Ankur Dwivedi 2022-09-13 7:18 ` Andrew Rybchenko 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2022-09-13 6:48 UTC (permalink / raw) To: Andrew Rybchenko, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia Hi Andrew, >-----Original Message----- >From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >Sent: Monday, September 12, 2022 4:30 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >jgrajcia@cisco.com >Subject: [EXT] Re: [PATCH 1/6] ethdev: add trace points > >External Email > >---------------------------------------------------------------------- >On 8/4/22 16:44, Ankur Dwivedi wrote: >> Add trace points for ethdev functions. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> --- > >[snip] > >> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index >> 1979dc0850..a6fb370b22 100644 >> --- a/lib/ethdev/rte_ethdev.c >> +++ b/lib/ethdev/rte_ethdev.c > >[snip] > >> @@ -525,6 +536,7 @@ 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); > >I'm wondering why trace is sometimes added in the middle of the function, >but in the majority of cases it is added as the first or the last action. Is there >any logical/guidelines behind it? In this case for printing the return value the trace was added at the end. I can change it if not required. The logic which I used was to log at least the input arguments of a function and in some cases also log important information(according to me) if possible.For example in rte_eth_tx_buffer_count_callback() I was also logging the count at the end. Similar logic in rte_eth_link_get_nowait(). Please let me know your views. > >> return ret; >> } >> > >[snip] > >> diff --git a/lib/ethdev/rte_ethdev_trace.h >> b/lib/ethdev/rte_ethdev_trace.h index 1491c815c3..de728d355d 100644 >> --- a/lib/ethdev/rte_ethdev_trace.h >> +++ b/lib/ethdev/rte_ethdev_trace.h > >[snip] > >> +RTE_TRACE_POINT( > >Shouldn't it be RTE_TRACE_POINT_FP? Isn't it fast path? Yes it is fastpath. Will make it as fastpath in v2. > >> + rte_eth_trace_call_rx_callbacks, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >> + struct rte_mbuf **rx_pkts, uint16_t nb_rx, >> + uint16_t nb_pkts, void *opaque), >> + 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_emit_ptr(opaque); >> +) >> + >> +RTE_TRACE_POINT( > >same here Yes it is fastpath. Will make it as fastpath in v2. > >> + rte_eth_trace_call_tx_callbacks, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >> + struct rte_mbuf **tx_pkts, uint16_t nb_pkts, >> + void *opaque), >> + 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_emit_ptr(opaque); >> +) >> + > >[snip] > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_info_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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_u32(dev_info->if_index); >> + 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_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_u16(dev_info->nb_rx_queues); >> + rte_trace_point_emit_u16(dev_info->nb_tx_queues); > >How to make a choice which information should be included above? In this case dev_info information is logged which might be of interest. > >> +) >> + > >[snip] ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH 1/6] ethdev: add trace points 2022-09-13 6:48 ` [EXT] " Ankur Dwivedi @ 2022-09-13 7:18 ` Andrew Rybchenko 2022-09-26 15:03 ` Andrew Rybchenko 0 siblings, 1 reply; 172+ messages in thread From: Andrew Rybchenko @ 2022-09-13 7:18 UTC (permalink / raw) To: Ankur Dwivedi, dev, Jerin Jacob Kollanukkaran Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On 9/13/22 09:48, Ankur Dwivedi wrote: > Hi Andrew, > >> -----Original Message----- >> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >> Sent: Monday, September 12, 2022 4:30 PM >> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >> ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >> linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >> mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >> evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >> Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >> hyonkim@cisco.com; liudongdong3@huawei.com; >> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >> Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda >> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi >> <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla >> <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >> Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >> viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >> spinler@cesnet.cz; chaoyong.he@corigine.com; >> niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >> sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >> sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody >> <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >> Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >> jianwang@trustnetic.com; jbehrens@vmware.com; >> maxime.coquelin@redhat.com; chenbo.xia@intel.com; >> steven.webster@windriver.com; matt.peters@windriver.com; >> bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >> jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >> jgrajcia@cisco.com >> Subject: [EXT] Re: [PATCH 1/6] ethdev: add trace points >> >> External Email >> >> ---------------------------------------------------------------------- >> On 8/4/22 16:44, Ankur Dwivedi wrote: >>> Add trace points for ethdev functions. >>> >>> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >>> --- >> >> [snip] >> >>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index >>> 1979dc0850..a6fb370b22 100644 >>> --- a/lib/ethdev/rte_ethdev.c >>> +++ b/lib/ethdev/rte_ethdev.c >> >> [snip] >> >>> @@ -525,6 +536,7 @@ 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); >> >> I'm wondering why trace is sometimes added in the middle of the function, >> but in the majority of cases it is added as the first or the last action. Is there >> any logical/guidelines behind it? > In this case for printing the return value the trace was added at the end. I can change it if not required. > The logic which I used was to log at least the input arguments of a function and in some cases also log important information(according to me) if possible.For example in rte_eth_tx_buffer_count_callback() I was also logging the count at the end. Similar logic in rte_eth_link_get_nowait(). > Please let me know your views. The answer depends on purposes of tracing. I guess that the main goal is to understand what the application does. So, tracing without logging the result does not sound really useful. What's the point to see that application has tried to enable promiscuous mode without knowing the result if the attempt is successful or not? If failures are critical for the application functionality, hopefully it will result in error logging which could be used together with tracing to understand what happens. If so, it drives us to tracing nearby the end of the function when the function really has tried to do something. If there is no branching there we'll have some tracing of failures as well, but we definitely need to see the result in the trace point. I almost have no experience with tracing, so my thoughts could be wrong. ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH 1/6] ethdev: add trace points 2022-09-13 7:18 ` Andrew Rybchenko @ 2022-09-26 15:03 ` Andrew Rybchenko 2022-09-28 4:02 ` Jerin Jacob 0 siblings, 1 reply; 172+ messages in thread From: Andrew Rybchenko @ 2022-09-26 15:03 UTC (permalink / raw) To: Ankur Dwivedi, dev, Jerin Jacob Kollanukkaran Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia @Jerin, I'd like to know what do you think about my question/thoughts below. On 9/13/22 10:18, Andrew Rybchenko wrote: > On 9/13/22 09:48, Ankur Dwivedi wrote: >> Hi Andrew, >> >>> -----Original Message----- >>> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >>> Sent: Monday, September 12, 2022 4:30 PM >>> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >>> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >>> ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >>> linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >>> mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >>> evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >>> Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >>> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >>> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >>> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >>> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >>> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >>> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >>> hyonkim@cisco.com; liudongdong3@huawei.com; >>> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >>> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >>> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >>> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >>> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >>> Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda >>> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >>> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi >>> <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla >>> <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >>> Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >>> viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >>> spinler@cesnet.cz; chaoyong.he@corigine.com; >>> niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >>> sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >>> sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody >>> <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >>> Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >>> jianwang@trustnetic.com; jbehrens@vmware.com; >>> maxime.coquelin@redhat.com; chenbo.xia@intel.com; >>> steven.webster@windriver.com; matt.peters@windriver.com; >>> bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >>> jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >>> jgrajcia@cisco.com >>> Subject: [EXT] Re: [PATCH 1/6] ethdev: add trace points >>> >>> External Email >>> >>> ---------------------------------------------------------------------- >>> On 8/4/22 16:44, Ankur Dwivedi wrote: >>>> Add trace points for ethdev functions. >>>> >>>> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >>>> --- >>> >>> [snip] >>> >>>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index >>>> 1979dc0850..a6fb370b22 100644 >>>> --- a/lib/ethdev/rte_ethdev.c >>>> +++ b/lib/ethdev/rte_ethdev.c >>> >>> [snip] >>> >>>> @@ -525,6 +536,7 @@ 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); >>> >>> I'm wondering why trace is sometimes added in the middle of the >>> function, >>> but in the majority of cases it is added as the first or the last >>> action. Is there >>> any logical/guidelines behind it? >> In this case for printing the return value the trace was added at the >> end. I can change it if not required. >> The logic which I used was to log at least the input arguments of a >> function and in some cases also log important information(according to >> me) if possible.For example in rte_eth_tx_buffer_count_callback() I >> was also logging the count at the end. Similar logic in >> rte_eth_link_get_nowait(). >> Please let me know your views. > > The answer depends on purposes of tracing. I guess that the > main goal is to understand what the application does. So, > tracing without logging the result does not sound really > useful. What's the point to see that application has tried > to enable promiscuous mode without knowing the result if > the attempt is successful or not? If failures are critical > for the application functionality, hopefully it will > result in error logging which could be used together with > tracing to understand what happens. > > If so, it drives us to tracing nearby the end of the function > when the function really has tried to do something. If there is > no branching there we'll have some tracing of failures as well, > but we definitely need to see the result in the trace point. > > I almost have no experience with tracing, so my thoughts > could be wrong. Meanwhile I've updated the patch series as "Requested Changes" since some fixes were promissed in v2. ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH 1/6] ethdev: add trace points 2022-09-26 15:03 ` Andrew Rybchenko @ 2022-09-28 4:02 ` Jerin Jacob 0 siblings, 0 replies; 172+ messages in thread From: Jerin Jacob @ 2022-09-28 4:02 UTC (permalink / raw) To: Andrew Rybchenko Cc: Ankur Dwivedi, dev, Jerin Jacob Kollanukkaran, thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia > @Jerin, I'd like to know what do you think about my question/thoughts below @Andrew Rybchenko see below. > > On 9/13/22 10:18, Andrew Rybchenko wrote: > > On 9/13/22 09:48, Ankur Dwivedi wrote: > >> Hi Andrew, > >> > >>> -----Original Message----- > >>> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> > >>> Sent: Monday, September 12, 2022 4:30 PM > >>> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org > >>> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; > >>> ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; > >>> linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; > >>> mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; > >>> evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor > >>> Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; > >>> ed.czeck@atomicrules.com; john.miller@atomicrules.com; > >>> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob > >>> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] > >>> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; > >>> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra > >>> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; > >>> hyonkim@cisco.com; liudongdong3@huawei.com; > >>> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; > >>> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; > >>> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; > >>> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; > >>> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin > >>> Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > >>> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha > >>> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi > >>> <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla > >>> <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; > >>> Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; > >>> viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; > >>> spinler@cesnet.cz; chaoyong.he@corigine.com; > >>> niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; > >>> sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; > >>> sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody > >>> <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra > >>> Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; > >>> jianwang@trustnetic.com; jbehrens@vmware.com; > >>> maxime.coquelin@redhat.com; chenbo.xia@intel.com; > >>> steven.webster@windriver.com; matt.peters@windriver.com; > >>> bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; > >>> jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; > >>> jgrajcia@cisco.com > >>> Subject: [EXT] Re: [PATCH 1/6] ethdev: add trace points > >>> > >>> External Email > >>> > >>> ---------------------------------------------------------------------- > >>> On 8/4/22 16:44, Ankur Dwivedi wrote: > >>>> Add trace points for ethdev functions. > >>>> > >>>> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > >>>> --- > >>> > >>> [snip] > >>> > >>>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index > >>>> 1979dc0850..a6fb370b22 100644 > >>>> --- a/lib/ethdev/rte_ethdev.c > >>>> +++ b/lib/ethdev/rte_ethdev.c > >>> > >>> [snip] > >>> > >>>> @@ -525,6 +536,7 @@ 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); > >>> > >>> I'm wondering why trace is sometimes added in the middle of the > >>> function, > >>> but in the majority of cases it is added as the first or the last > >>> action. Is there > >>> any logical/guidelines behind it? > >> In this case for printing the return value the trace was added at the > >> end. I can change it if not required. > >> The logic which I used was to log at least the input arguments of a > >> function and in some cases also log important information(according to > >> me) if possible.For example in rte_eth_tx_buffer_count_callback() I > >> was also logging the count at the end. Similar logic in > >> rte_eth_link_get_nowait(). > >> Please let me know your views. > > > > The answer depends on purposes of tracing. I guess that the > > main goal is to understand what the application does. So, > > tracing without logging the result does not sound really > > useful. What's the point to see that application has tried > > to enable promiscuous mode without knowing the result if > > the attempt is successful or not? If failures are critical > > for the application functionality, hopefully it will > > result in error logging which could be used together with > > tracing to understand what happens. > > > > If so, it drives us to tracing nearby the end of the function > > when the function really has tried to do something. If there is > > no branching there we'll have some tracing of failures as well, > > but we definitely need to see the result in the trace point. Yes. It make sense to include the result. For example, rte_malloc etc we are already adding the result so the consumer of trace can get better view. > > > > I almost have no experience with tracing, so my thoughts > > could be wrong. > > Meanwhile I've updated the patch series as "Requested Changes" > since some fixes were promissed in v2. ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH 2/6] ethdev: add trace points for flow 2022-08-04 13:44 [PATCH 0/6] add trace points in ethdev library Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 1/6] ethdev: add trace points Ankur Dwivedi @ 2022-08-04 13:44 ` Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 3/6] ethdev: add trace points for mtr Ankur Dwivedi ` (4 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-08-04 13:44 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 117 +++++++++ lib/ethdev/rte_ethdev_trace.h | 405 +++++++++++++++++++++++++++++++ lib/ethdev/rte_flow.c | 54 +++++ lib/ethdev/version.map | 39 +++ 4 files changed, 615 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2e80401771..a8b974564c 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -467,3 +467,120 @@ RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_query, RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set, lib.ethdev.rx_avail_thresh_set) + +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_error_set, + lib.ethdev.flow.error_set) + +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_dev_dump, + lib.ethdev.flow.dev_dump) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_aged_flows, + lib.ethdev.flow.get_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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index de728d355d..94d4b955b6 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -1270,6 +1270,411 @@ RTE_TRACE_POINT( rte_trace_point_emit_u8(avail_thresh); ) +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), + 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_ptr(actions); +) + +RTE_TRACE_POINT( + 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), + 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( + rte_flow_trace_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_error_set, + RTE_TRACE_POINT_ARGS(struct rte_flow_error *err_p, + int code, enum rte_flow_error_type type, + const void *cause, const char *message), + rte_trace_point_emit_ptr(err_p); + rte_trace_point_emit_int(code); + rte_trace_point_emit_int(type); + rte_trace_point_emit_ptr(cause); + rte_trace_point_emit_string(message); +) + +RTE_TRACE_POINT( + rte_flow_trace_flush, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_flow_trace_isolate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int set), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(set); +) + +RTE_TRACE_POINT( + rte_flow_trace_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow, + const struct rte_flow_action *action, void *data), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(flow); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_ptr(data); +) + +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), + 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( + 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_dev_dump, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_get_aged_flows, + RTE_TRACE_POINT_ARGS(uint16_t port_id, void **contexts, + uint32_t nb_contexts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(contexts); + rte_trace_point_emit_u32(nb_contexts); +) + +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), + 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( + 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), + 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( + rte_flow_trace_get_restore_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_mbuf *m, + struct rte_flow_restore_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(m); + rte_trace_point_emit_ptr(info); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_u32(num_of_actions); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(items); + rte_trace_point_emit_u32(num_of_items); +) + +RTE_TRACE_POINT( + 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); + rte_trace_point_emit_ptr(action); +) + +RTE_TRACE_POINT( + rte_flow_trace_action_handle_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_action_handle *handle), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + rte_flow_trace_action_handle_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_action_handle *handle, + const void *update), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(handle); + rte_trace_point_emit_ptr(update); +) + +RTE_TRACE_POINT( + rte_flow_trace_action_handle_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_action_handle *handle, + void *data), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(handle); + rte_trace_point_emit_ptr(data); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + rte_flow_trace_pick_transfer_proxy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t *proxy_port_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(proxy_port_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(port_info); + rte_trace_point_emit_ptr(queue_info); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(port_attr); + rte_trace_point_emit_u16(nb_queue); + rte_trace_point_emit_ptr(queue_attr); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_attr); + rte_trace_point_emit_ptr(pattern); +) + +RTE_TRACE_POINT( + rte_flow_trace_pattern_template_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_pattern_template *pattern_template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pattern_template); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_attr); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_ptr(masks); +) + +RTE_TRACE_POINT( + rte_flow_trace_actions_template_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_actions_template *actions_template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions_template); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(table_attr); + 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( + rte_flow_trace_template_table_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_template_table *template_table), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_table); +) + +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), + 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( + 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), + 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( + rte_flow_trace_push, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); +) + +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), + 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( + 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), + 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( + 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), + 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( + 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), + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 501be9d602..e349d112f9 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -13,6 +13,7 @@ #include <rte_string_fns.h> #include <rte_mbuf_dyn.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" #include "rte_flow_driver.h" #include "rte_flow.h" @@ -284,6 +285,7 @@ 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: @@ -357,6 +359,7 @@ rte_flow_validate(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; int ret; + rte_flow_trace_validate(port_id, attr, pattern, actions); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->validate)) { @@ -382,6 +385,7 @@ rte_flow_create(uint16_t port_id, struct rte_flow *flow; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_create(port_id, attr, pattern, actions); if (unlikely(!ops)) return NULL; if (likely(!!ops->create)) { @@ -407,6 +411,7 @@ rte_flow_destroy(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_destroy(port_id, flow); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->destroy)) { @@ -429,6 +434,7 @@ rte_flow_flush(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_flush(port_id); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->flush)) { @@ -454,6 +460,7 @@ rte_flow_query(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_query(port_id, flow, action, data); if (!ops) return -rte_errno; if (likely(!!ops->query)) { @@ -477,6 +484,7 @@ rte_flow_isolate(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_isolate(port_id, set); if (!ops) return -rte_errno; if (likely(!!ops->isolate)) { @@ -506,6 +514,7 @@ rte_flow_error_set(struct rte_flow_error *error, }; } rte_errno = code; + rte_flow_trace_error_set(error, code, type, cause, message); return -code; } @@ -1004,6 +1013,7 @@ 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; @@ -1069,6 +1079,7 @@ rte_flow_copy(struct rte_flow_desc *desc, size_t len, RTE_BUILD_BUG_ON(sizeof(struct rte_flow_desc) < sizeof(struct rte_flow_conv_rule)); + rte_flow_trace_copy(desc, len, attr, items, actions); if (dst_size && (&dst->pattern != &desc->items || &dst->actions != &desc->actions || @@ -1099,6 +1110,7 @@ rte_flow_dev_dump(uint16_t port_id, struct rte_flow *flow, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_dev_dump(port_id, flow); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->dev_dump)) { @@ -1120,6 +1132,7 @@ rte_flow_get_aged_flows(uint16_t port_id, void **contexts, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_get_aged_flows(port_id, contexts, nb_contexts); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->get_aged_flows)) { @@ -1142,6 +1155,7 @@ rte_flow_action_handle_create(uint16_t port_id, struct rte_flow_action_handle *handle; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_action_handle_create(port_id, conf, action); if (unlikely(!ops)) return NULL; if (unlikely(!ops->action_handle_create)) { @@ -1165,6 +1179,7 @@ rte_flow_action_handle_destroy(uint16_t port_id, int ret; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_action_handle_destroy(port_id, handle); if (unlikely(!ops)) return -rte_errno; if (unlikely(!ops->action_handle_destroy)) @@ -1185,6 +1200,7 @@ rte_flow_action_handle_update(uint16_t port_id, int ret; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_action_handle_update(port_id, handle, update); if (unlikely(!ops)) return -rte_errno; if (unlikely(!ops->action_handle_update)) @@ -1205,6 +1221,7 @@ rte_flow_action_handle_query(uint16_t port_id, int ret; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_action_handle_query(port_id, handle, data); if (unlikely(!ops)) return -rte_errno; if (unlikely(!ops->action_handle_query)) @@ -1226,6 +1243,7 @@ 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); + rte_flow_trace_tunnel_decap_set(port_id, tunnel, actions, num_of_actions); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_decap_set)) { @@ -1249,6 +1267,7 @@ 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); + rte_flow_trace_tunnel_match(port_id, tunnel, items, num_of_items); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_match)) { @@ -1271,6 +1290,7 @@ 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); + rte_flow_trace_get_restore_info(port_id, m, restore_info); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->get_restore_info)) { @@ -1293,6 +1313,7 @@ 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); + rte_flow_trace_tunnel_action_decap_release(port_id, actions, num_of_actions); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_action_decap_release)) { @@ -1316,6 +1337,7 @@ 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); + rte_flow_trace_tunnel_item_release(port_id, items, num_of_items); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_item_release)) { @@ -1336,6 +1358,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; + rte_flow_trace_pick_transfer_proxy(port_id, proxy_port_id); if (unlikely(ops == NULL)) return -rte_errno; @@ -1360,6 +1383,7 @@ rte_flow_flex_item_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_item_flex_handle *handle; + rte_flow_trace_flex_item_create(port_id, conf); if (unlikely(!ops)) return NULL; if (unlikely(!ops->flex_item_create)) { @@ -1383,6 +1407,7 @@ rte_flow_flex_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); + rte_flow_trace_flex_item_release(port_id, handle); if (unlikely(!ops || !ops->flex_item_release)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1400,6 +1425,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); + rte_flow_trace_info_get(port_id, port_info, queue_info); if (unlikely(!ops)) return -rte_errno; if (dev->data->dev_configured == 0) { @@ -1433,6 +1459,7 @@ rte_flow_configure(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_configure(port_id, port_attr, nb_queue, queue_attr); if (unlikely(!ops)) return -rte_errno; if (dev->data->dev_configured == 0) { @@ -1476,6 +1503,8 @@ rte_flow_pattern_template_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_pattern_template *template; + rte_flow_trace_pattern_template_create(port_id, template_attr, + pattern); if (unlikely(!ops)) return NULL; if (dev->data->flow_configured == 0) { @@ -1526,6 +1555,7 @@ 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); + rte_flow_trace_pattern_template_destroy(port_id, pattern_template); if (unlikely(!ops)) return -rte_errno; if (unlikely(pattern_template == NULL)) @@ -1553,6 +1583,8 @@ rte_flow_actions_template_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_actions_template *template; + rte_flow_trace_actions_template_create(port_id, template_attr, actions, + masks); if (unlikely(!ops)) return NULL; if (dev->data->flow_configured == 0) { @@ -1612,6 +1644,7 @@ 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); + rte_flow_trace_actions_template_destroy(port_id, actions_template); if (unlikely(!ops)) return -rte_errno; if (unlikely(actions_template == NULL)) @@ -1641,6 +1674,11 @@ rte_flow_template_table_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_template_table *table; + rte_flow_trace_template_table_create(port_id, table_attr, + pattern_templates, + nb_pattern_templates, + actions_templates, + nb_actions_templates); if (unlikely(!ops)) return NULL; if (dev->data->flow_configured == 0) { @@ -1702,6 +1740,7 @@ 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); + rte_flow_trace_template_table_destroy(port_id, template_table); if (unlikely(!ops)) return -rte_errno; if (unlikely(template_table == NULL)) @@ -1734,6 +1773,9 @@ rte_flow_async_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow *flow; + rte_flow_trace_async_create(port_id, queue_id, op_attr, template_table, + pattern, pattern_template_index, actions, + actions_template_index, user_data); flow = ops->async_create(dev, queue_id, op_attr, template_table, pattern, pattern_template_index, @@ -1755,6 +1797,8 @@ 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); + rte_flow_trace_async_destroy(port_id, queue_id, op_attr, flow, + user_data); return flow_err(port_id, ops->async_destroy(dev, queue_id, op_attr, flow, @@ -1770,6 +1814,7 @@ 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); + rte_flow_trace_push(port_id, queue_id); return flow_err(port_id, ops->push(dev, queue_id, error), error); @@ -1786,6 +1831,7 @@ rte_flow_pull(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_pull(port_id, queue_id, res, n_res); ret = ops->pull(dev, queue_id, res, n_res, error); return ret ? ret : flow_err(port_id, ret, error); } @@ -1803,6 +1849,9 @@ rte_flow_async_action_handle_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_action_handle *handle; + rte_flow_trace_async_action_handle_create(port_id, queue_id, op_attr, + indir_action_conf, action, + user_data); handle = ops->async_action_handle_create(dev, queue_id, op_attr, indir_action_conf, action, user_data, error); if (handle == NULL) @@ -1822,6 +1871,8 @@ rte_flow_async_action_handle_destroy(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_async_action_handle_destroy(port_id, queue_id, op_attr, + action_handle, user_data); ret = ops->async_action_handle_destroy(dev, queue_id, op_attr, action_handle, user_data, error); return flow_err(port_id, ret, error); @@ -1840,6 +1891,9 @@ rte_flow_async_action_handle_update(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_async_action_handle_update(port_id, queue_id, op_attr, + action_handle, update, + user_data); ret = ops->async_action_handle_update(dev, queue_id, op_attr, action_handle, update, user_data, error); return flow_err(port_id, ret, error); diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 79bf947042..848ec442f1 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -432,6 +432,45 @@ EXPERIMENTAL { __rte_eth_trace_ip_reassembly_conf_set; __rte_eth_trace_rx_avail_thresh_query; __rte_eth_trace_rx_avail_thresh_set; + __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_dev_dump; + __rte_flow_trace_dynf_metadata_register; + __rte_flow_trace_error_set; + __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.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH 3/6] ethdev: add trace points for mtr 2022-08-04 13:44 [PATCH 0/6] add trace points in ethdev library Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 1/6] ethdev: add trace points Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 2/6] ethdev: add trace points for flow Ankur Dwivedi @ 2022-08-04 13:44 ` Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 4/6] ethdev: add trace points for tm Ankur Dwivedi ` (3 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-08-04 13:44 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 57 ++++++++++ lib/ethdev/rte_ethdev_trace.h | 176 +++++++++++++++++++++++++++++++ lib/ethdev/rte_mtr.c | 27 +++++ lib/ethdev/version.map | 19 ++++ 4 files changed, 279 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index a8b974564c..673a0be13b 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -584,3 +584,60 @@ RTE_TRACE_POINT_REGISTER(rte_flow_trace_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_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_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_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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 94d4b955b6..c07b5b3fb6 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1675,6 +1676,181 @@ RTE_TRACE_POINT( rte_trace_point_emit_ptr(user_data); ) +RTE_TRACE_POINT( + rte_mtr_trace_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_mtr_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +RTE_TRACE_POINT( + rte_mtr_trace_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + struct rte_mtr_params *params, int shared), + 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( + rte_mtr_trace_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(dscp_table); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id, + struct rte_mtr_meter_profile *profile), + 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( + rte_mtr_trace_meter_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(meter_profile_id); +) + +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), + 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( + rte_mtr_trace_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + struct rte_mtr_stats *stats, uint64_t *stats_mask, + int clear), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_ptr(stats_mask); + rte_trace_point_emit_int(clear); +) + +RTE_TRACE_POINT( + rte_mtr_trace_stats_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + uint64_t stats_mask), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_u64(stats_mask); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_policy_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + 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( + rte_mtr_trace_meter_policy_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(policy_id); +) + +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), + 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( + rte_mtr_trace_meter_policy_validate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_int(actions->type); + rte_trace_point_emit_ptr(actions->conf); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_vlan_table_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + enum rte_color *vlan_table), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(vlan_table); +) + +RTE_TRACE_POINT( + rte_mtr_trace_color_in_protocol_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_int(proto); +) + +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), + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index c460e4f4e0..ff7265cd21 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -6,6 +6,7 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -63,6 +64,7 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_capabilities_get(port_id, cap); return RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); } @@ -75,6 +77,7 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile); return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); } @@ -86,6 +89,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id); return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); } @@ -97,6 +101,10 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_validate(port_id, policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); } @@ -109,6 +117,11 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_add(port_id, policy_id, + policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); } @@ -120,6 +133,7 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_delete(port_id, policy_id); return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); } @@ -133,6 +147,7 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_create(port_id, mtr_id, params, shared); return RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); } @@ -144,6 +159,7 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_destroy(port_id, mtr_id); return RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); } @@ -155,6 +171,7 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_enable(port_id, mtr_id); return RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); } @@ -166,6 +183,7 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_disable(port_id, mtr_id); return RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); } @@ -178,6 +196,7 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id); return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); } @@ -190,6 +209,7 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id); return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); } @@ -202,6 +222,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table); return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, dscp_table, error); } @@ -214,6 +235,7 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table); return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, vlan_table, error); } @@ -227,6 +249,7 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority); return RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); } @@ -239,6 +262,7 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id); return RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); } @@ -252,6 +276,7 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto); return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); } @@ -264,6 +289,7 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask); return RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); } @@ -278,6 +304,7 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_stats_read(port_id, mtr_id, stats, stats_mask, clear); return RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 848ec442f1..2e282bb457 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -471,6 +471,25 @@ 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_update; + __rte_mtr_trace_meter_policy_validate; + __rte_mtr_trace_meter_profile_add; + __rte_mtr_trace_meter_profile_delete; + __rte_mtr_trace_meter_profile_update; + __rte_mtr_trace_meter_vlan_table_update; + __rte_mtr_trace_stats_read; + __rte_mtr_trace_stats_update; }; INTERNAL { -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH 4/6] ethdev: add trace points for tm 2022-08-04 13:44 [PATCH 0/6] add trace points in ethdev library Ankur Dwivedi ` (2 preceding siblings ...) 2022-08-04 13:44 ` [PATCH 3/6] ethdev: add trace points for mtr Ankur Dwivedi @ 2022-08-04 13:44 ` Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 5/6] ethdev: add trace points for driver Ankur Dwivedi ` (2 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-08-04 13:44 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 90 ++++++++++ lib/ethdev/rte_ethdev_trace.h | 283 +++++++++++++++++++++++++++++++ lib/ethdev/rte_tm.c | 40 +++++ lib/ethdev/version.map | 30 ++++ 4 files changed, 443 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 673a0be13b..341901d031 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -641,3 +641,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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index c07b5b3fb6..aa34a6a5e9 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1851,6 +1852,288 @@ RTE_TRACE_POINT( rte_trace_point_emit_u32(priority); ) +RTE_TRACE_POINT( + rte_tm_trace_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_tm_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +RTE_TRACE_POINT( + rte_tm_trace_get_number_of_leaf_nodes, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t n_leaf_nodes, + struct rte_tm_error *error), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(n_leaf_nodes); + rte_trace_point_emit_int(error->type); + rte_trace_point_emit_string(error->message); +) + +RTE_TRACE_POINT( + rte_tm_trace_hierarchy_commit, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int clear_on_fail), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(clear_on_fail); +) + +RTE_TRACE_POINT( + rte_tm_trace_level_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t level_id, + struct rte_tm_level_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(level_id); + rte_trace_point_emit_ptr(cap); +) + +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), + 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( + rte_tm_trace_mark_ip_ecn, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red), + 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( + rte_tm_trace_mark_vlan_dei, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red), + 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( + 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, + struct rte_tm_node_params *params), + 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( + rte_tm_trace_node_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + struct rte_tm_node_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(cap); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_int(cman); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +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), + 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( + rte_tm_trace_node_resume, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +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), + 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( + 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), + 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( + 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), + 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( + rte_tm_trace_node_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + struct rte_tm_node_stats *stats, + uint64_t *stats_mask, int clear), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_ptr(stats_mask); + rte_trace_point_emit_int(clear); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_u64(stats_mask); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_suspend, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_type_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + int *is_leaf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(is_leaf); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_wfq_weight_mode_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + int *wfq_weight_mode, uint32_t n_sp_priorities), + 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( + rte_tm_trace_node_wred_context_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t wred_profile_id), + 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( + rte_tm_trace_shaper_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id, + struct rte_tm_shaper_params *profile), + 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( + rte_tm_trace_shaper_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shaper_profile_id); +) + +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), + 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( + rte_tm_trace_shared_shaper_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_shaper_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_shaper_id); +) + +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), + 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( + rte_tm_trace_shared_wred_context_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_wred_context_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_wred_context_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_wred_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id, + struct rte_tm_wred_params *profile), + 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( + rte_tm_trace_wred_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(wred_profile_id); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..b0b43eacc0 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -6,6 +6,7 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +80,7 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes, error); return 0; } @@ -90,6 +92,7 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_type_get(port_id, node_id, is_leaf); return RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); } @@ -100,6 +103,7 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_capabilities_get(port_id, cap); return RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); } @@ -111,6 +115,7 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_level_capabilities_get(port_id, level_id, cap); return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); } @@ -122,6 +127,7 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_capabilities_get(port_id, node_id, cap); return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); } @@ -133,6 +139,7 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile); return RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); } @@ -143,6 +150,7 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id); return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); } @@ -154,6 +162,8 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_wred_context_add_update(port_id, shared_wred_context_id, + wred_profile_id); return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); } @@ -164,6 +174,7 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_wred_context_delete(port_id, shared_wred_context_id); return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); } @@ -175,6 +186,7 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile); return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); } @@ -185,6 +197,7 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id); return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); } @@ -196,6 +209,8 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id); return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); } @@ -206,6 +221,7 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id); return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); } @@ -221,6 +237,8 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params); return RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); @@ -232,6 +250,7 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_delete(port_id, node_id); return RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); } @@ -242,6 +261,7 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_suspend(port_id, node_id); return RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); } @@ -252,6 +272,7 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_resume(port_id, node_id); return RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); } @@ -262,6 +283,7 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail); return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); } @@ -275,6 +297,8 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight); return RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); } @@ -286,6 +310,7 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id); return RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); } @@ -298,6 +323,8 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shared_shaper_update(port_id, node_id, shared_shaper_id, + add); return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); } @@ -309,6 +336,7 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask); return RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); } @@ -321,6 +349,8 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, wfq_weight_mode, + n_sp_priorities); return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); } @@ -332,6 +362,7 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_cman_update(port_id, node_id, cman); return RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); } @@ -343,6 +374,7 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id); return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); } @@ -355,6 +387,9 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add); return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); } @@ -368,6 +403,8 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_stats_read(port_id, node_id, stats, stats_mask, + clear); return RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); } @@ -380,6 +417,7 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); } @@ -392,6 +430,7 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); } @@ -404,6 +443,7 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 2e282bb457..ee4012789f 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -490,6 +490,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 { -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH 5/6] ethdev: add trace points for driver 2022-08-04 13:44 [PATCH 0/6] add trace points in ethdev library Ankur Dwivedi ` (3 preceding siblings ...) 2022-08-04 13:44 ` [PATCH 4/6] ethdev: add trace points for tm Ankur Dwivedi @ 2022-08-04 13:44 ` Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 6/6] devtools: add trace function check in checkpatch Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 0/4] add trace points in ethdev library Ankur Dwivedi 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-08-04 13:44 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for ethdev driver specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_driver.c | 29 +++++ lib/ethdev/ethdev_trace_points.c | 66 ++++++++++ lib/ethdev/rte_ethdev_trace.h | 200 +++++++++++++++++++++++++++++++ lib/ethdev/version.map | 22 ++++ 4 files changed, 317 insertions(+) diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c index a285f213f0..74ec57f5fe 100644 --- a/lib/ethdev/ethdev_driver.c +++ b/lib/ethdev/ethdev_driver.c @@ -5,6 +5,7 @@ #include <rte_kvargs.h> #include <rte_malloc.h> +#include "rte_ethdev_trace.h" #include "ethdev_driver.h" #include "ethdev_private.h" @@ -113,6 +114,7 @@ rte_eth_dev_allocate(const char *name) unlock: rte_spinlock_unlock(ð_dev_shared_data->ownership_lock); + rte_ethdev_trace_allocate(name, eth_dev); return eth_dev; } @@ -121,6 +123,7 @@ rte_eth_dev_allocated(const char *name) { struct rte_eth_dev *ethdev; + rte_ethdev_trace_allocated(name); eth_dev_shared_data_prepare(); rte_spinlock_lock(ð_dev_shared_data->ownership_lock); @@ -162,6 +165,7 @@ rte_eth_dev_attach_secondary(const char *name) } rte_spinlock_unlock(ð_dev_shared_data->ownership_lock); + rte_ethdev_trace_attach_secondary(name, eth_dev); return eth_dev; } @@ -173,6 +177,7 @@ rte_eth_dev_callback_process(struct rte_eth_dev *dev, struct rte_eth_dev_callback dev_cb; int rc = 0; + rte_ethdev_trace_callback_process(dev, event, ret_param); rte_spinlock_lock(ð_dev_cb_lock); TAILQ_FOREACH(cb_lst, &(dev->link_intr_cbs), next) { if (cb_lst->cb_fn == NULL || cb_lst->event != event) @@ -195,6 +200,7 @@ rte_eth_dev_callback_process(struct rte_eth_dev *dev, void rte_eth_dev_probing_finish(struct rte_eth_dev *dev) { + rte_ethdev_trace_probing_finish(dev); if (dev == NULL) return; @@ -214,6 +220,7 @@ rte_eth_dev_probing_finish(struct rte_eth_dev *dev) int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) { + rte_ethdev_trace_release_port(eth_dev); if (eth_dev == NULL) return -EINVAL; @@ -264,6 +271,9 @@ rte_eth_dev_create(struct rte_device *device, const char *name, struct rte_eth_dev *ethdev; int retval; + rte_ethdev_trace_create(device, name, priv_data_size, + ethdev_bus_specific_init, bus_init_params, + ethdev_init, init_params); RTE_FUNC_PTR_OR_ERR_RET(*ethdev_init, -EINVAL); if (rte_eal_process_type() == RTE_PROC_PRIMARY) { @@ -324,6 +334,7 @@ rte_eth_dev_destroy(struct rte_eth_dev *ethdev, { int ret; + rte_ethdev_trace_destroy(ethdev, ethdev_uninit); ethdev = rte_eth_dev_allocated(ethdev->data->name); if (!ethdev) return -ENODEV; @@ -342,6 +353,7 @@ rte_eth_dev_get_by_name(const char *name) { uint16_t pid; + rte_ethdev_trace_get_by_name(name); if (rte_eth_dev_get_port_by_name(name, &pid)) return NULL; @@ -351,6 +363,7 @@ rte_eth_dev_get_by_name(const char *name) int rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id) { + rte_ethdev_trace_is_rx_hairpin_queue(dev, queue_id); if (dev->data->rx_queue_state[queue_id] == RTE_ETH_QUEUE_STATE_HAIRPIN) return 1; return 0; @@ -359,6 +372,7 @@ rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id) int rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id) { + rte_ethdev_trace_is_tx_hairpin_queue(dev, queue_id); if (dev->data->tx_queue_state[queue_id] == RTE_ETH_QUEUE_STATE_HAIRPIN) return 1; return 0; @@ -367,6 +381,7 @@ rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id) void rte_eth_dev_internal_reset(struct rte_eth_dev *dev) { + rte_ethdev_trace_internal_reset(dev, dev->data->dev_started); if (dev->data->dev_started) { RTE_ETHDEV_LOG(ERR, "Port %u must be stopped to allow reset\n", dev->data->port_id); @@ -451,6 +466,7 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da) unsigned int i; int result = 0; + rte_eth_trace_devargs_parse(dargs, eth_da); memset(eth_da, 0, sizeof(*eth_da)); result = eth_dev_devargs_tokenise(&args, dargs); @@ -495,6 +511,7 @@ rte_eth_dma_zone_free(const struct rte_eth_dev *dev, const char *ring_name, const struct rte_memzone *mz; int rc = 0; + rte_eth_trace_dma_zone_free(dev, ring_name, queue_id); rc = eth_dev_dma_mzone_name(z_name, sizeof(z_name), dev->data->port_id, queue_id, ring_name); if (rc >= RTE_MEMZONE_NAMESIZE) { @@ -520,6 +537,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, const struct rte_memzone *mz; int rc; + rte_eth_trace_dma_zone_reserve(dev, ring_name, queue_id, size, align, socket_id); rc = eth_dev_dma_mzone_name(z_name, sizeof(z_name), dev->data->port_id, queue_id, ring_name); if (rc >= RTE_MEMZONE_NAMESIZE) { @@ -553,6 +571,8 @@ rte_eth_hairpin_queue_peer_bind(uint16_t cur_port, uint16_t cur_queue, { struct rte_eth_dev *dev; + rte_eth_trace_hairpin_queue_peer_bind(cur_port, cur_queue, peer_info, + direction); if (peer_info == NULL) return -EINVAL; @@ -571,6 +591,7 @@ rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue, { struct rte_eth_dev *dev; + rte_eth_trace_hairpin_queue_peer_unbind(cur_port, cur_queue, direction); /* No need to check the validity again. */ dev = &rte_eth_devices[cur_port]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->hairpin_queue_peer_unbind, @@ -588,6 +609,8 @@ rte_eth_hairpin_queue_peer_update(uint16_t peer_port, uint16_t peer_queue, { struct rte_eth_dev *dev; + rte_eth_trace_hairpin_queue_peer_update(peer_port, peer_queue, cur_info, + peer_info, direction); /* Current queue information is not mandatory. */ if (peer_info == NULL) return -EINVAL; @@ -626,6 +649,8 @@ rte_eth_ip_reassembly_dynfield_register(int *field_offset, int *flag_offset) if (flag_offset != NULL) *flag_offset = offset; + rte_eth_trace_ip_reassembly_dynfield_register(*field_offset, + *flag_offset); return 0; } @@ -729,6 +754,8 @@ rte_eth_representor_id_get(uint16_t port_id, } out: free(info); + rte_eth_trace_representor_id_get(port_id, type, controller, pf, + representor_port, *repr_id); return ret; } @@ -745,6 +772,7 @@ rte_eth_switch_domain_alloc(uint16_t *domain_id) eth_dev_switch_domains[i].state = RTE_ETH_SWITCH_DOMAIN_ALLOCATED; *domain_id = i; + rte_eth_trace_switch_domain_alloc(*domain_id); return 0; } } @@ -755,6 +783,7 @@ rte_eth_switch_domain_alloc(uint16_t *domain_id) int rte_eth_switch_domain_free(uint16_t domain_id) { + rte_eth_trace_switch_domain_free(domain_id); if (domain_id == RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID || domain_id >= RTE_MAX_ETHPORTS) return -EINVAL; diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 341901d031..61539f379c 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -731,3 +731,69 @@ RTE_TRACE_POINT_REGISTER(rte_tm_trace_wred_profile_add, RTE_TRACE_POINT_REGISTER(rte_tm_trace_wred_profile_delete, lib.ethdev.tm.wred_profile_delete) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_allocate, + lib.ethdev.allocate) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_allocated, + lib.ethdev.allocated) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_attach_secondary, + lib.ethdev.attach_secondary) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_callback_process, + lib.ethdev.callback_process) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_create, + lib.ethdev_create) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_destroy, + lib.ethdev.destroy) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_by_name, + lib.ethdev.get_by_name) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_rx_hairpin_queue, + lib.ethdev.is_rx_hairpin_queue) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_tx_hairpin_queue, + lib.ethdev.is_tx_hairpin_queue) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_probing_finish, + lib.ethdev.probing_finish) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_release_port, + lib.ethdev.release_port) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_internal_reset, + lib.ethdev.internal_reset) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_devargs_parse, + lib.ethdev.devargs_parse) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_dma_zone_free, + lib.ethdev.dma_zone_free) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_dma_zone_reserve, + lib.ethdev.dma_zone_reserve) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_queue_peer_bind, + lib.ethdev.hairpin_queue_peer_bind) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_queue_peer_unbind, + lib.ethdev.hairpin_queue_peer_unbind) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_queue_peer_update, + lib.ethdev.hairpin_queue_peer_update) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_ip_reassembly_dynfield_register, + lib.ethdev.ip_reassembly_dynfield_register) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_representor_id_get, + lib.ethdev.representor_id_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_switch_domain_alloc, + lib.ethdev.switch_domain_alloc) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_switch_domain_free, + lib.ethdev.switch_domain_free) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index aa34a6a5e9..a3c0b6fa76 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -17,6 +17,7 @@ extern "C" { #include <rte_trace_point.h> +#include "ethdev_driver.h" #include "rte_ethdev.h" #include "rte_mtr.h" #include "rte_tm.h" @@ -2134,6 +2135,205 @@ RTE_TRACE_POINT( rte_trace_point_emit_u32(wred_profile_id); ) +RTE_TRACE_POINT( + rte_ethdev_trace_allocate, + RTE_TRACE_POINT_ARGS(const char *name, struct rte_eth_dev *eth_dev), + rte_trace_point_emit_string(name); + rte_trace_point_emit_u16(eth_dev->data->nb_rx_queues); + rte_trace_point_emit_u16(eth_dev->data->nb_tx_queues); + rte_trace_point_emit_u16(eth_dev->data->mtu); + rte_trace_point_emit_u16(eth_dev->data->port_id); + rte_trace_point_emit_int(eth_dev->state); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_allocated, + RTE_TRACE_POINT_ARGS(const char *name), + rte_trace_point_emit_string(name); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_attach_secondary, + RTE_TRACE_POINT_ARGS(const char *name, struct rte_eth_dev *eth_dev), + rte_trace_point_emit_string(name); + rte_trace_point_emit_u16(eth_dev->data->nb_rx_queues); + rte_trace_point_emit_u16(eth_dev->data->nb_tx_queues); + rte_trace_point_emit_u16(eth_dev->data->mtu); + rte_trace_point_emit_u16(eth_dev->data->port_id); + rte_trace_point_emit_int(eth_dev->state); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_callback_process, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev *dev, + enum rte_eth_event_type event, + void *ret_param), + rte_trace_point_emit_ptr(dev); + rte_trace_point_emit_int(event); + rte_trace_point_emit_ptr(ret_param); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_create, + RTE_TRACE_POINT_ARGS(struct rte_device *device, const char *name, + size_t priv_data_size, + ethdev_bus_specific_init bus_specific_init, + void *bus_init_params, ethdev_init_t ethdev_init, + void *init_params), + rte_trace_point_emit_ptr(device); + rte_trace_point_emit_string(name); + rte_trace_point_emit_size_t(priv_data_size); + rte_trace_point_emit_ptr(bus_specific_init); + rte_trace_point_emit_ptr(bus_init_params); + rte_trace_point_emit_ptr(ethdev_init); + rte_trace_point_emit_ptr(init_params); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_destroy, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev *ethdev, ethdev_uninit_t ethdev_uninit), + rte_trace_point_emit_ptr(ethdev); + rte_trace_point_emit_ptr(ethdev_uninit); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_by_name, + RTE_TRACE_POINT_ARGS(const char *name), + rte_trace_point_emit_string(name); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_is_rx_hairpin_queue, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev *dev, uint16_t queue_id), + rte_trace_point_emit_ptr(dev); + rte_trace_point_emit_u16(queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_is_tx_hairpin_queue, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev *dev, uint16_t queue_id), + rte_trace_point_emit_ptr(dev); + rte_trace_point_emit_u16(queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_probing_finish, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev *dev), + rte_trace_point_emit_ptr(dev); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_release_port, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev *eth_dev), + rte_trace_point_emit_ptr(eth_dev); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_internal_reset, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev *dev, + uint8_t dev_started), + rte_trace_point_emit_ptr(dev); + rte_trace_point_emit_u8(dev_started); +) + +RTE_TRACE_POINT( + rte_eth_trace_devargs_parse, + RTE_TRACE_POINT_ARGS(const char *devargs, struct rte_eth_devargs *eth_devargs), + rte_trace_point_emit_string(devargs); + rte_trace_point_emit_ptr(eth_devargs); + rte_trace_point_emit_u16(eth_devargs->nb_mh_controllers); + rte_trace_point_emit_u16(eth_devargs->nb_ports); + rte_trace_point_emit_u16(eth_devargs->nb_representor_ports); +) + +RTE_TRACE_POINT( + rte_eth_trace_dma_zone_free, + RTE_TRACE_POINT_ARGS(const struct rte_eth_dev *eth_dev, const char *name, + uint16_t queue_id), + rte_trace_point_emit_ptr(eth_dev); + rte_trace_point_emit_string(name); + rte_trace_point_emit_u16(queue_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_dma_zone_reserve, + RTE_TRACE_POINT_ARGS(const struct rte_eth_dev *eth_dev, const char *name, + uint16_t queue_id, size_t size, unsigned int align, + int socket_id), + rte_trace_point_emit_ptr(eth_dev); + rte_trace_point_emit_string(name); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_size_t(size); + rte_trace_point_emit_u32(align); + rte_trace_point_emit_int(socket_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_hairpin_queue_peer_bind, + RTE_TRACE_POINT_ARGS(uint16_t cur_port, uint16_t cur_queue, + struct rte_hairpin_peer_info *peer_info, + uint32_t direction), + rte_trace_point_emit_u16(cur_port); + rte_trace_point_emit_u16(cur_queue); + rte_trace_point_emit_ptr(peer_info); + rte_trace_point_emit_u32(direction); +) + +RTE_TRACE_POINT( + rte_eth_trace_hairpin_queue_peer_unbind, + RTE_TRACE_POINT_ARGS(uint16_t cur_port, uint16_t cur_queue, + uint32_t direction), + rte_trace_point_emit_u16(cur_port); + rte_trace_point_emit_u16(cur_queue); + rte_trace_point_emit_u32(direction); +) + +RTE_TRACE_POINT( + rte_eth_trace_hairpin_queue_peer_update, + RTE_TRACE_POINT_ARGS(uint16_t peer_port, uint16_t peer_queue, + struct rte_hairpin_peer_info *cur_info, + struct rte_hairpin_peer_info *peer_info, + uint32_t direction), + rte_trace_point_emit_u16(peer_port); + rte_trace_point_emit_u16(peer_queue); + rte_trace_point_emit_ptr(cur_info); + rte_trace_point_emit_ptr(peer_info); + rte_trace_point_emit_u32(direction); +) + +RTE_TRACE_POINT( + rte_eth_trace_ip_reassembly_dynfield_register, + RTE_TRACE_POINT_ARGS(int field_offset, int flag_offset), + rte_trace_point_emit_int(field_offset); + rte_trace_point_emit_int(flag_offset); +) + +RTE_TRACE_POINT( + rte_eth_trace_representor_id_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + enum rte_eth_representor_type type, + int controller, int pf, int representor_port, + uint16_t repr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(type); + rte_trace_point_emit_int(controller); + rte_trace_point_emit_int(pf); + rte_trace_point_emit_int(representor_port); + rte_trace_point_emit_u16(repr_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_switch_domain_alloc, + RTE_TRACE_POINT_ARGS(uint16_t domain_id), + rte_trace_point_emit_u16(domain_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_switch_domain_free, + RTE_TRACE_POINT_ARGS(uint16_t domain_id), + rte_trace_point_emit_u16(domain_id); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index ee4012789f..ee3ff4793d 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -520,6 +520,28 @@ EXPERIMENTAL { __rte_tm_trace_shared_wred_context_delete; __rte_tm_trace_wred_profile_add; __rte_tm_trace_wred_profile_delete; + __rte_ethdev_trace_allocate; + __rte_ethdev_trace_allocated; + __rte_ethdev_trace_attach_secondary; + __rte_ethdev_trace_callback_process; + __rte_ethdev_trace_create; + __rte_ethdev_trace_destroy; + __rte_ethdev_trace_get_by_name; + __rte_ethdev_trace_is_rx_hairpin_queue; + __rte_ethdev_trace_is_tx_hairpin_queue; + __rte_ethdev_trace_probing_finish; + __rte_ethdev_trace_release_port; + __rte_ethdev_trace_internal_reset; + __rte_eth_trace_devargs_parse; + __rte_eth_trace_dma_zone_free; + __rte_eth_trace_dma_zone_reserve; + __rte_eth_trace_hairpin_queue_peer_bind; + __rte_eth_trace_hairpin_queue_peer_unbind; + __rte_eth_trace_hairpin_queue_peer_update; + __rte_eth_trace_ip_reassembly_dynfield_register; + __rte_eth_trace_representor_id_get; + __rte_eth_trace_switch_domain_alloc; + __rte_eth_trace_switch_domain_free; }; INTERNAL { -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH 6/6] devtools: add trace function check in checkpatch 2022-08-04 13:44 [PATCH 0/6] add trace points in ethdev library Ankur Dwivedi ` (4 preceding siblings ...) 2022-08-04 13:44 ` [PATCH 5/6] ethdev: add trace points for driver Ankur Dwivedi @ 2022-08-04 13:44 ` Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 0/4] add trace points in ethdev library Ankur Dwivedi 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-08-04 13:44 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi, tduszynski This patch adds a check in checkpatch tool, to check if trace function is added in any new function added in ethdev library. It uses the existing build_map_changes() function and version.map file to create a list of newly added functions. The definition of these functions are checked if they contain trace calls or not. The checkpatch return error if the trace calls are not present. Cc: tduszynski@marvell.com Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- devtools/check-symbol-change.sh | 76 +------------------------------- devtools/check-trace-func.py | 52 ++++++++++++++++++++++ devtools/check-trace-func.sh | 50 +++++++++++++++++++++ devtools/checkpatches.sh | 9 ++++ devtools/common-func.sh | 77 +++++++++++++++++++++++++++++++++ 5 files changed, 190 insertions(+), 74 deletions(-) create mode 100755 devtools/check-trace-func.py create mode 100755 devtools/check-trace-func.sh create mode 100644 devtools/common-func.sh diff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh index 8992214ac8..4bdd0d727a 100755 --- a/devtools/check-symbol-change.sh +++ b/devtools/check-symbol-change.sh @@ -2,80 +2,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Neil Horman <nhorman@tuxdriver.com> -build_map_changes() -{ - local fname="$1" - local mapdb="$2" - - cat "$fname" | awk ' - # Initialize our variables - BEGIN {map="";sym="";ar="";sec=""; in_sec=0; in_map=0} - - # Anything that starts with + or -, followed by an a - # and ends in the string .map is the name of our map file - # This may appear multiple times in a patch if multiple - # map files are altered, and all section/symbol names - # appearing between a triggering of this rule and the - # next trigger of this rule are associated with this file - /[-+] [ab]\/.*\.map/ {map=$2; in_map=1; next} - - # The previous rule catches all .map files, anything else - # indicates we left the map chunk. - /[-+] [ab]\// {in_map=0} - - # Triggering this rule, which starts a line and ends it - # with a { identifies a versioned section. The section name is - # the rest of the line with the + and { symbols removed. - # Triggering this rule sets in_sec to 1, which actives the - # symbol rule below - /^.*{/ { - gsub("+", ""); - if (in_map == 1) { - sec=$(NF-1); in_sec=1; - } - } - - # This rule identifies the end of a section, and disables the - # symbol rule - /.*}/ {in_sec=0} - - # This rule matches on a + followed by any characters except a : - # (which denotes a global vs local segment), and ends with a ;. - # The semicolon is removed and the symbol is printed with its - # association file name and version section, along with an - # indicator that the symbol is a new addition. Note this rule - # only works if we have found a version section in the rule - # above (hence the in_sec check) And found a map file (the - # in_map check). If we are not in a map chunk, do nothing. If - # we are in a map chunk but not a section chunk, record it as - # unknown. - /^+[^}].*[^:*];/ {gsub(";","");sym=$2; - if (in_map == 1) { - if (in_sec == 1) { - print map " " sym " " sec " add" - } else { - print map " " sym " unknown add" - } - } - } - - # This is the same rule as above, but the rule matches on a - # leading - rather than a +, denoting that the symbol is being - # removed. - /^-[^}].*[^:*];/ {gsub(";","");sym=$2; - if (in_map == 1) { - if (in_sec == 1) { - print map " " sym " " sec " del" - } else { - print map " " sym " unknown del" - } - } - }' > "$mapdb" - - sort -u "$mapdb" > "$mapdb.2" - mv -f "$mapdb.2" "$mapdb" - -} +selfdir=$(dirname $(readlink -f $0)) +. $selfdir/common-func.sh is_stable_section() { [ "$1" != 'EXPERIMENTAL' ] && [ "$1" != 'INTERNAL' ] diff --git a/devtools/check-trace-func.py b/devtools/check-trace-func.py new file mode 100755 index 0000000000..d38d8616cd --- /dev/null +++ b/devtools/check-trace-func.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (C) 2022 Marvell. + +import sys + +patch = sys.argv[1] +fn = sys.argv[2] + +with open(patch, 'r') as fr: + fstr = fr.read() + +def find_fn_def(): + found = 0 + tmp = 0 + idx = 0 + while found == 0: + idx = fstr.find("+"+fn+"(", idx) + if (idx != -1): + tmp = fstr.find(')', idx) + if (fstr[tmp + 1] == ';'): + idx = tmp + continue + else: + found = 1 + else: + break + return idx + +def find_trace(index): + fp = fstr.find("{", index) + sp = fstr.find("}", fp) + fd = fstr[fp:sp] + + i = fd.find("_trace_") + if (i != -1): + return 0 + else: + return 1 + + +def __main(): + ret=0 + index = find_fn_def() + if (index != -1): + # If function definition is present, + # check if trace call is present + ret = find_trace(index) + return ret + +if __name__ == "__main__": + sys.exit(__main()) diff --git a/devtools/check-trace-func.sh b/devtools/check-trace-func.sh new file mode 100755 index 0000000000..777b9a03e0 --- /dev/null +++ b/devtools/check-trace-func.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (C) 2022 Marvell. + +selfdir=$(dirname $(readlink -f $0)) +. $selfdir/common-func.sh + +libdir="ethdev" +check_for_trace_call() +{ + mapdb="$2" + ret=0 + + while read -r mname symname secname ar; do + libp=0 + libname=$(echo $mname | awk 'BEGIN {FS="/"};{print $3}') + + for i in $libdir; do + if [ $i = $libname ]; then + libp=1 + break + fi + done + + if [ $libp -eq 1 ] && [ "$ar" = "add" ]; then + if [ "$secname" = "EXPERIMENTAL" ]; then + # Check if new API is added with trace function call + if ! devtools/check-trace-func.py $1 $symname; then + ret=1 + echo -n "ERROR: Function $symname " + echo "is added without trace call" + fi + fi + fi + done < "$mapdb" + + return $ret +} + +clean_and_exit_on_sig() +{ + rm -rf "$mapfile" +} + +trap clean_and_exit_on_sig EXIT + +mapfile=$(mktemp -t dpdk.mapdb.XXXXXX) + +build_map_changes "$1" "$mapfile" +check_for_trace_call "$1" "$mapfile" diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 1edc5810ad..35c47b3e85 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -10,6 +10,7 @@ . $(dirname $(readlink -f $0))/load-devel-config VALIDATE_NEW_API=$(dirname $(readlink -f $0))/check-symbol-change.sh +VALIDATE_TRACE_FUNC=$(dirname $(readlink -f $0))/check-trace-func.sh # Enable codespell by default. This can be overwritten from a config file. # Codespell can also be enabled by setting DPDK_CHECKPATCH_CODESPELL to a valid path @@ -338,6 +339,14 @@ check () { # <patch> <commit> <title> ret=1 fi + ! $verbose || printf '\nChecking API additions with trace function call :\n' + report=$($VALIDATE_TRACE_FUNC "$tmpinput") + if [ $? -ne 0 ] ; then + $headline_printed || print_headline "$3" + printf '%s\n' "$report" + ret=1 + fi + if [ "$tmpinput" != "$1" ]; then rm -f "$tmpinput" trap - INT diff --git a/devtools/common-func.sh b/devtools/common-func.sh new file mode 100644 index 0000000000..c88e949890 --- /dev/null +++ b/devtools/common-func.sh @@ -0,0 +1,77 @@ +#!/bin/sh +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Neil Horman <nhorman@tuxdriver.com> + +build_map_changes() +{ + local fname="$1" + local mapdb="$2" + + cat "$fname" | awk ' + # Initialize our variables + BEGIN {map="";sym="";ar="";sec=""; in_sec=0; in_map=0} + + # Anything that starts with + or -, followed by an a + # and ends in the string .map is the name of our map file + # This may appear multiple times in a patch if multiple + # map files are altered, and all section/symbol names + # appearing between a triggering of this rule and the + # next trigger of this rule are associated with this file + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1; next} + + # The previous rule catches all .map files, anything else + # indicates we left the map chunk. + /[-+] [ab]\// {in_map=0} + + # Triggering this rule, which starts a line and ends it + # with a { identifies a versioned section. The section name is + # the rest of the line with the + and { symbols removed. + # Triggering this rule sets in_sec to 1, which actives the + # symbol rule below + /^.*{/ { + gsub("+", ""); + if (in_map == 1) { + sec=$(NF-1); in_sec=1; + } + } + + # This rule identifies the end of a section, and disables the + # symbol rule + /.*}/ {in_sec=0} + + # This rule matches on a + followed by any characters except a : + # (which denotes a global vs local segment), and ends with a ;. + # The semicolon is removed and the symbol is printed with its + # association file name and version section, along with an + # indicator that the symbol is a new addition. Note this rule + # only works if we have found a version section in the rule + # above (hence the in_sec check) And found a map file (the + # in_map check). If we are not in a map chunk, do nothing. If + # we are in a map chunk but not a section chunk, record it as + # unknown. + /^+[^}].*[^:*];/ {gsub(";","");sym=$2; + if (in_map == 1) { + if (in_sec == 1) { + print map " " sym " " sec " add" + } else { + print map " " sym " unknown add" + } + } + } + + # This is the same rule as above, but the rule matches on a + # leading - rather than a +, denoting that the symbol is being + # removed. + /^-[^}].*[^:*];/ {gsub(";","");sym=$2; + if (in_map == 1) { + if (in_sec == 1) { + print map " " sym " " sec " del" + } else { + print map " " sym " unknown del" + } + } + }' > "$mapdb" + + sort -u "$mapdb" > "$mapdb.2" + mv -f "$mapdb.2" "$mapdb" +} -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v2 0/4] add trace points in ethdev library 2022-08-04 13:44 [PATCH 0/6] add trace points in ethdev library Ankur Dwivedi ` (5 preceding siblings ...) 2022-08-04 13:44 ` [PATCH 6/6] devtools: add trace function check in checkpatch Ankur Dwivedi @ 2022-09-29 10:29 ` Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 1/4] ethdev: add trace points Ankur Dwivedi ` (5 more replies) 6 siblings, 6 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-09-29 10:29 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, 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. v2: - Made rte_eth_trace_call_rx_callbacks and rte_eth_trace_call_tx_callbacks as fastpath trace functions. - Moved some trace functions call to the end to capture return value and data. - Removed rte_eth_trace_tx_queue_setup as it is not required. rte_ethdev_trace_txq_setup() is already present in rte_eth_tx_queue_setup(). - Removed trace in ethdev_driver.c - Removed trace function check patch. Ankur Dwivedi (4): ethdev: add trace points ethdev: add trace points for flow ethdev: add trace points for mtr ethdev: add trace points for tm lib/ethdev/ethdev_private.c | 3 + lib/ethdev/ethdev_trace_points.c | 699 ++++++++++ lib/ethdev/rte_ethdev.c | 148 +++ lib/ethdev/rte_ethdev_trace.h | 2062 ++++++++++++++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 19 + lib/ethdev/rte_flow.c | 54 + lib/ethdev/rte_mtr.c | 27 + lib/ethdev/rte_tm.c | 40 + lib/ethdev/version.map | 232 ++++ 9 files changed, 3284 insertions(+) -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v2 1/4] ethdev: add trace points 2022-09-29 10:29 ` [PATCH v2 0/4] add trace points in ethdev library Ankur Dwivedi @ 2022-09-29 10:29 ` Ankur Dwivedi 2022-10-06 7:09 ` Andrew Rybchenko 2022-09-29 10:29 ` [PATCH v2 2/4] ethdev: add trace points for flow Ankur Dwivedi ` (4 subsequent siblings) 5 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2022-09-29 10:29 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Add trace points for ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_private.c | 3 + lib/ethdev/ethdev_trace_points.c | 435 +++++++++++ lib/ethdev/rte_ethdev.c | 148 ++++ lib/ethdev/rte_ethdev_trace.h | 1185 ++++++++++++++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 19 + lib/ethdev/version.map | 144 ++++ 6 files changed, 1934 insertions(+) diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index 48090c879a..08e7f49fd8 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.h" #include "ethdev_driver.h" #include "ethdev_private.h" @@ -297,6 +298,7 @@ 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, nb_rx, nb_pkts); return nb_rx; } @@ -312,6 +314,7 @@ 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, nb_pkts); return nb_pkts; } diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2919409a15..2c06b47b7f 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -29,3 +29,438 @@ 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_add_first_rx_callback, + lib.ethdev.add_first_rx_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_rx_callback, + lib.ethdev.add_rx_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_tx_callback, + lib.ethdev.add_tx_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_disable, + lib.ethdev.allmulticast_disable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_enable, + lib.ethdev.allmulticast_enable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_get, + lib.ethdev.allmulticast_get) + +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_ethdev_trace_set_mtu, + lib.ethdev.set_mtu) + +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_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_default_mac_addr_set, + lib.ethdev.default_mac_addr_set) + +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_fw_version_get, + lib.ethdev.fw_version_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_dcb_info, + lib.ethdev.get_dcb_info) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom, + lib.ethdev.get_eeprom) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom_length, + lib.ethdev.get_eeprom_length) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_mtu, + lib.ethdev.get_mtu) + +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_get_reg_info, + lib.ethdev.get_reg_info) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_sec_ctx, + lib.ethdev.get_sec_ctx) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_supported_ptypes, + lib.ethdev.get_supported_ptypes) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_vlan_offload, + lib.ethdev.get_vlan_offload) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_info_get, + lib.ethdev.info_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_removed, + lib.ethdev.is_removed) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_valid_port, + lib.ethdev.is_valid_port) + +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_pool_ops_supported, + lib.ethdev.pool_ops_supported) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_set, + lib.ethdev.priority_flow_ctrl_set) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_reset, + lib.ethdev.reset) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_conf_get, + lib.ethdev.rss_hash_conf_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_update, + lib.ethdev.rss_hash_update) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_query, + lib.ethdev.rss_reta_query) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_update, + lib.ethdev.rss_reta_update) + +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, + lib.ethdev.rx_intr_ctl_q) + +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_disable, + lib.ethdev.rx_intr_disable) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_enable, + lib.ethdev.rx_intr_enable) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_offload_name, + lib.ethdev.rx_offload_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_set_eeprom, + lib.ethdev.set_eeprom) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_down, + lib.ethdev.set_link_down) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_up, + lib.ethdev.set_link_up) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_mc_addr_list, + lib.ethdev.set_mc_addr_list) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_ptypes, + lib.ethdev.set_ptypes) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + lib.ethdev.set_rx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_tx_queue_stats_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +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_set_vlan_pvid, + lib.ethdev.set_vlan_pvid) + +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_socket_id, + lib.ethdev.socket_id) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_tx_offload_name, + lib.ethdev.tx_offload_name) + +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_ethdev_trace_uc_all_hash_table_set, + lib.ethdev.uc_all_hash_table_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_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_ethdev_trace_vlan_filter, + lib.ethdev.vlan_filter) + +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_owned_by, + lib.ethdev.find_next_owned_by) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_find_next_sibling, + lib.ethdev.find_next_sibling) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_iterator_cleanup, + lib.ethdev.iterator_cleanup) + +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_led_off, + lib.ethdev.led_off) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_led_on, + lib.ethdev.led_on) + +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_macaddr_get, + lib.ethdev.macaddr_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_disable, + lib.ethdev.promiscuous_disable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_enable, + lib.ethdev.promiscuous_enable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_get, + lib.ethdev.promiscuous_get) + +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_burst_mode_get, + lib.ethdev.rx_burst_mode_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_info_get, + lib.ethdev.rx_queue_info_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_setup, + lib.ethdev.rx_queue_setup) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_set_queue_rate_limit, + lib.ethdev.set_queue_rate_limit) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_speed_bitflag, + lib.ethdev.speed_bitflag) + +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_timesync_adjust_time, + lib.ethdev.timesync_adjust_time) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_disable, + lib.ethdev.timesync_disable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_enable, + lib.ethdev.timesync_enable) + +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_time, + lib.ethdev.timesync_read_time) + +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_write_time, + lib.ethdev.timesync_write_time) + +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_drop_callback, + lib.ethdev.tx_buffer_drop_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_buffer_init, + lib.ethdev.tx_buffer_init) + +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_burst_mode_get, + lib.ethdev.tx_burst_mode_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_done_cleanup, + lib.ethdev.tx_done_cleanup) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_queue_info_get, + lib.ethdev.tx_queue_info_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get, + lib.ethdev.xstats_get) + +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_id_by_name, + lib.ethdev.xstats_get_id_by_name) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get_names, + lib.ethdev.xstats_get_names) + +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_reset, + lib.ethdev.xstats_reset) + +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_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_get_module_eeprom, + lib.ethdev.get_module_eeprom) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_module_info, + lib.ethdev.get_module_info) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_read_clock, + lib.ethdev.read_clock) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_hairpin_capability_get, + lib.ethdev.hairpin_capability_get) + +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_get_peer_ports, + lib.ethdev.hairpin_get_peer_ports) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_unbind, + lib.ethdev.hairpin_unbind) + +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_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_eth_trace_get_monitor_addr, + lib.ethdev.get_monitor_addr) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_representor_info_get, + lib.ethdev.representor_info_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_capability_name, + lib.ethdev.capability_name) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_conf_get, + lib.ethdev.conf_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_macaddrs_get, + lib.ethdev.macaddrs_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_metadata_negotiate, + lib.ethdev.rx_metadata_negotiate) + +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_priority_flow_ctrl_queue_info_get, + lib.ethdev.priority_flow_ctrl_queue_info_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priv_dump, + lib.ethdev.priv_dump) + +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_rx_avail_thresh_query, + lib.ethdev.rx_avail_thresh_query) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set, + lib.ethdev.rx_avail_thresh_set) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 0c2c1088c0..10ca500b5d 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -168,6 +168,7 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str) char *cls_str = NULL; int str_size; + rte_eth_trace_iterator_init(iter, devargs_str); if (iter == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot initialize NULL iterator\n"); return -EINVAL; @@ -274,6 +275,7 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str) uint16_t rte_eth_iterator_next(struct rte_dev_iterator *iter) { + rte_eth_trace_iterator_next(iter); if (iter == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot get next device from NULL iterator\n"); @@ -309,6 +311,7 @@ rte_eth_iterator_next(struct rte_dev_iterator *iter) void rte_eth_iterator_cleanup(struct rte_dev_iterator *iter) { + rte_eth_trace_iterator_cleanup(iter); if (iter == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot do clean up from NULL iterator\n"); return; @@ -331,6 +334,7 @@ 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,12 +355,14 @@ 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) { + rte_eth_trace_find_next_sibling(port_id, ref_port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(ref_port_id, RTE_MAX_ETHPORTS); return rte_eth_find_next_of(port_id, rte_eth_devices[ref_port_id].device); @@ -371,6 +377,7 @@ eth_dev_is_allocated(const struct rte_eth_dev *ethdev) int rte_eth_dev_is_valid_port(uint16_t port_id) { + rte_ethdev_trace_is_valid_port(port_id); if (port_id >= RTE_MAX_ETHPORTS || (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)) return 0; @@ -395,6 +402,7 @@ 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 +421,7 @@ 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 +485,7 @@ 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 +503,7 @@ 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 +537,7 @@ 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,12 +567,14 @@ 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; } int rte_eth_dev_socket_id(uint16_t port_id) { + rte_ethdev_trace_socket_id(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return rte_eth_devices[port_id].data->numa_node; } @@ -568,6 +582,7 @@ rte_eth_dev_socket_id(uint16_t port_id) void * rte_eth_dev_get_sec_ctx(uint16_t port_id) { + rte_ethdev_trace_get_sec_ctx(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL); return rte_eth_devices[port_id].security_ctx; } @@ -583,6 +598,7 @@ rte_eth_dev_count_avail(void) RTE_ETH_FOREACH_DEV(p) count++; + rte_ethdev_trace_count_avail(count); return count; } @@ -594,6 +610,7 @@ rte_eth_dev_count_total(void) RTE_ETH_FOREACH_VALID_DEV(port) count++; + rte_ethdev_trace_count_total(count); return count; } @@ -614,6 +631,7 @@ 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; } @@ -636,6 +654,7 @@ 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; } @@ -737,6 +756,7 @@ rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) return 0; } + rte_ethdev_trace_rx_queue_start(port_id, rx_queue_id); return eth_err(port_id, dev->dev_ops->rx_queue_start(dev, rx_queue_id)); } @@ -770,6 +790,7 @@ rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) return 0; } + rte_ethdev_trace_rx_queue_stop(port_id, rx_queue_id); return eth_err(port_id, dev->dev_ops->rx_queue_stop(dev, rx_queue_id)); } @@ -810,6 +831,7 @@ rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) return 0; } + rte_ethdev_trace_tx_queue_start(port_id, tx_queue_id); return eth_err(port_id, dev->dev_ops->tx_queue_start(dev, tx_queue_id)); } @@ -843,12 +865,14 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) return 0; } + rte_ethdev_trace_tx_queue_stop(port_id, tx_queue_id); return eth_err(port_id, dev->dev_ops->tx_queue_stop(dev, tx_queue_id)); } uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex) { + rte_eth_trace_speed_bitflag(speed, duplex); switch (speed) { case RTE_ETH_SPEED_NUM_10M: return duplex ? RTE_ETH_LINK_SPEED_10M : RTE_ETH_LINK_SPEED_10M_HD; @@ -894,6 +918,7 @@ rte_eth_dev_rx_offload_name(uint64_t offload) } } + rte_ethdev_trace_rx_offload_name(offload, name); return name; } @@ -910,6 +935,7 @@ rte_eth_dev_tx_offload_name(uint64_t offload) } } + rte_ethdev_trace_tx_offload_name(offload, name); return name; } @@ -926,6 +952,7 @@ rte_eth_dev_capability_name(uint64_t capability) } } + rte_ethdev_trace_capability_name(capability, name); return name; } @@ -1547,6 +1574,7 @@ rte_eth_dev_set_link_up(uint16_t port_id) { struct rte_eth_dev *dev; + rte_ethdev_trace_set_link_up(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1560,6 +1588,7 @@ rte_eth_dev_set_link_down(uint16_t port_id) { struct rte_eth_dev *dev; + rte_ethdev_trace_set_link_down(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1621,6 +1650,7 @@ rte_eth_dev_reset(uint16_t port_id) port_id, rte_strerror(-ret)); } ret = dev->dev_ops->dev_reset(dev); + rte_ethdev_trace_reset(port_id, ret); return eth_err(port_id, ret); } @@ -1645,6 +1675,7 @@ 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; } @@ -1984,6 +2015,8 @@ 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; + rte_eth_trace_rx_hairpin_queue_setup(port_id, rx_queue_id, nb_rx_desc, + conf, ret); return eth_err(port_id, ret); } @@ -2151,6 +2184,7 @@ 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; + rte_eth_trace_tx_hairpin_queue_setup(port_id, tx_queue_id, nb_tx_desc, conf, ret); return eth_err(port_id, ret); } @@ -2176,6 +2210,7 @@ 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; } @@ -2201,6 +2236,7 @@ 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; } @@ -2237,6 +2273,7 @@ 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; } @@ -2244,6 +2281,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); rte_pktmbuf_free_bulk(pkts, unsent); } @@ -2255,12 +2293,14 @@ 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(pkts, unsent, *count); } int rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer, buffer_tx_error_fn cbfn, void *userdata) { + rte_eth_trace_tx_buffer_set_err_callback(buffer, cbfn, userdata); if (buffer == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot set Tx buffer error callback to NULL buffer\n"); @@ -2288,6 +2328,7 @@ 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; } @@ -2306,6 +2347,7 @@ 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); + rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt, ret); return eth_err(port_id, ret); } @@ -2327,6 +2369,7 @@ rte_eth_promiscuous_enable(uint16_t port_id) diag = (*dev->dev_ops->promiscuous_enable)(dev); dev->data->promiscuous = (diag == 0) ? 1 : 0; + rte_eth_trace_promiscuous_enable(port_id, dev->data->promiscuous); return eth_err(port_id, diag); } @@ -2350,6 +2393,7 @@ rte_eth_promiscuous_disable(uint16_t port_id) if (diag != 0) dev->data->promiscuous = 1; + rte_eth_trace_promiscuous_disable(port_id, dev->data->promiscuous); return eth_err(port_id, diag); } @@ -2361,6 +2405,7 @@ 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; } @@ -2381,6 +2426,7 @@ rte_eth_allmulticast_enable(uint16_t port_id) diag = (*dev->dev_ops->allmulticast_enable)(dev); dev->data->all_multicast = (diag == 0) ? 1 : 0; + rte_eth_trace_allmulticast_enable(port_id, dev->data->all_multicast); return eth_err(port_id, diag); } @@ -2403,6 +2449,7 @@ rte_eth_allmulticast_disable(uint16_t port_id) if (diag != 0) dev->data->all_multicast = 1; + rte_eth_trace_allmulticast_disable(port_id, dev->data->all_multicast); return eth_err(port_id, diag); } @@ -2414,6 +2461,7 @@ 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; } @@ -2440,6 +2488,7 @@ 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; } @@ -2466,12 +2515,14 @@ 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) { + rte_eth_trace_link_speed_to_str(link_speed); switch (link_speed) { case RTE_ETH_SPEED_NUM_NONE: return "None"; case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; @@ -2495,6 +2546,7 @@ rte_eth_link_speed_to_str(uint32_t link_speed) int rte_eth_link_to_str(char *str, size_t len, const struct rte_eth_link *eth_link) { + rte_eth_trace_link_to_str(str, len, eth_link); if (str == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot convert link to NULL string\n"); return -EINVAL; @@ -2541,6 +2593,7 @@ 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; + rte_eth_trace_stats_get(port_id, stats); return eth_err(port_id, (*dev->dev_ops->stats_get)(dev, stats)); } @@ -2561,6 +2614,7 @@ rte_eth_stats_reset(uint16_t port_id) dev->data->rx_mbuf_alloc_failed = 0; + rte_eth_trace_stats_reset(port_id); return 0; } @@ -2625,6 +2679,7 @@ rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, return -ENOMEM; } + rte_eth_trace_xstats_get_id_by_name(port_id, xstat_name, id); /* Get count */ cnt_xstats = rte_eth_xstats_get_names_by_id(port_id, NULL, 0, NULL); if (cnt_xstats < 0) { @@ -2797,6 +2852,8 @@ 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); @@ -2836,6 +2893,7 @@ rte_eth_xstats_get_names(uint16_t port_id, cnt_used_entries += cnt_driver_entries; } + rte_eth_trace_xstats_get_names(port_id, xstats_names, size, cnt_used_entries); return cnt_used_entries; } @@ -2985,6 +3043,7 @@ 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; } @@ -3032,6 +3091,8 @@ 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], i); return count + xcount; } @@ -3044,6 +3105,7 @@ rte_eth_xstats_reset(uint16_t port_id) RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; + rte_eth_trace_xstats_reset(port_id); /* implemented by the driver */ if (dev->dev_ops->xstats_reset != NULL) return eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev)); @@ -3079,6 +3141,8 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) { + rte_ethdev_trace_set_tx_queue_stats_mapping(port_id, tx_queue_id, + stat_idx); return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id, tx_queue_id, stat_idx, STAT_QMAP_TX)); @@ -3088,6 +3152,8 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) { + rte_ethdev_trace_set_rx_queue_stats_mapping(port_id, rx_queue_id, + stat_idx); return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id, rx_queue_id, stat_idx, STAT_QMAP_RX)); @@ -3098,6 +3164,7 @@ rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size) { struct rte_eth_dev *dev; + rte_ethdev_trace_fw_version_get(port_id, fw_version, fw_size); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3171,6 +3238,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); return 0; } @@ -3191,6 +3259,7 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct rte_eth_conf)); + rte_ethdev_trace_conf_get(port_id, dev_conf); return 0; } @@ -3226,6 +3295,7 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, j++; } + rte_ethdev_trace_get_supported_ptypes(port_id, ptype_mask, ptypes, num, j); return j; } @@ -3248,6 +3318,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, unsigned int i, j; int ret; + rte_ethdev_trace_set_ptypes(port_id, ptype_mask, set_ptypes, num); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3341,6 +3412,7 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, num = RTE_MIN(dev_info.max_mac_addrs, num); memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); + rte_eth_trace_macaddrs_get(port_id, ma, num); return num; } @@ -3349,6 +3421,7 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) { struct rte_eth_dev *dev; + rte_eth_trace_macaddr_get(port_id, mac_addr); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3379,6 +3452,7 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + rte_ethdev_trace_get_mtu(port_id, *mtu); return 0; } @@ -3421,6 +3495,7 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; + rte_ethdev_trace_set_mtu(port_id, mtu, ret); return eth_err(port_id, ret); } @@ -3464,6 +3539,7 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) vfc->ids[vidx] &= ~RTE_BIT64(vbit); } + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); return eth_err(port_id, ret); } @@ -3473,6 +3549,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3495,6 +3572,7 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3593,6 +3671,7 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) dev->data->dev_conf.rxmode.offloads = orig_offloads; } + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); return eth_err(port_id, ret); } @@ -3619,6 +3698,7 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); return ret; } @@ -3627,6 +3707,7 @@ rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { struct rte_eth_dev *dev; + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3640,6 +3721,7 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3661,6 +3743,7 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3687,6 +3770,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3774,6 +3858,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, pfc_queue_info); if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); @@ -3789,6 +3874,8 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3904,6 +3991,7 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3952,6 +4040,7 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -3982,6 +4071,7 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, enum rte_eth_rx_mq_mode mq_mode; int ret; + rte_ethdev_trace_rss_hash_update(port_id, rss_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4024,6 +4114,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4046,6 +4137,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4073,6 +4165,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4099,6 +4192,7 @@ rte_eth_led_on(uint16_t port_id) { struct rte_eth_dev *dev; + rte_eth_trace_led_on(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4112,6 +4206,7 @@ rte_eth_led_off(uint16_t port_id) { struct rte_eth_dev *dev; + rte_eth_trace_led_off(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4142,6 +4237,7 @@ rte_eth_fec_get_capability(uint16_t port_id, return -ENOTSUP; ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, num); + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); return ret; } @@ -4150,6 +4246,7 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) { struct rte_eth_dev *dev; + rte_eth_trace_fec_get(port_id, fec_capa); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4170,6 +4267,7 @@ rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) { struct rte_eth_dev *dev; + rte_eth_trace_fec_set(port_id, fec_capa); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4213,6 +4311,7 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, uint64_t pool_mask; int ret; + rte_ethdev_trace_mac_addr_add(port_id, addr, pool); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4272,6 +4371,7 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) struct rte_eth_dev *dev; int index; + rte_ethdev_trace_mac_addr_remove(port_id, addr); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4312,6 +4412,7 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_default_mac_addr_set(port_id, addr); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4375,6 +4476,7 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, int ret; struct rte_eth_dev *dev; + rte_ethdev_trace_uc_hash_table_set(port_id, addr, on); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4433,6 +4535,7 @@ rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { struct rte_eth_dev *dev; + rte_ethdev_trace_uc_all_hash_table_set(port_id, on); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4450,6 +4553,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, struct rte_eth_link link; int ret; + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4484,6 +4588,7 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, { struct rte_eth_dev *dev; + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4521,6 +4626,7 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) return -ENOTSUP; + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id); return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, avail_thresh)); } @@ -4551,6 +4657,7 @@ rte_eth_dev_callback_register(uint16_t port_id, uint16_t next_port; uint16_t last_port; + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg); if (cb_fn == NULL) { RTE_ETHDEV_LOG(ERR, "Cannot register ethdev port %u callback from NULL\n", @@ -4665,6 +4772,7 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, ret); return ret; } @@ -4677,6 +4785,7 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) uint16_t qid; int rc; + rte_ethdev_trace_rx_intr_ctl(port_id, epfd, op, data); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4737,6 +4846,7 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); return fd; } @@ -4749,6 +4859,7 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, struct rte_intr_handle *intr_handle; int rc; + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4787,6 +4898,7 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_rx_intr_enable(port_id, queue_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4806,6 +4918,7 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, struct rte_eth_dev *dev; int ret; + rte_ethdev_trace_rx_intr_disable(port_id, queue_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4873,6 +4986,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, cb); return cb; } @@ -4912,6 +5026,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, cb, __ATOMIC_RELEASE); rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param, cb); return cb; } @@ -4971,6 +5086,7 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, cb); return cb; } @@ -5005,6 +5121,7 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); return ret; } @@ -5039,6 +5156,7 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); return ret; } @@ -5085,6 +5203,7 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); return 0; } @@ -5131,6 +5250,7 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); return 0; } @@ -5140,6 +5260,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, { struct rte_eth_dev *dev; + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5168,6 +5289,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, { struct rte_eth_dev *dev; + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5196,6 +5318,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, { struct rte_eth_dev *dev; + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5224,6 +5347,7 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5238,6 +5362,7 @@ rte_eth_timesync_enable(uint16_t port_id) { struct rte_eth_dev *dev; + rte_eth_trace_timesync_enable(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5251,6 +5376,7 @@ rte_eth_timesync_disable(uint16_t port_id) { struct rte_eth_dev *dev; + rte_eth_trace_timesync_disable(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5265,6 +5391,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, { struct rte_eth_dev *dev; + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5287,6 +5414,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, { struct rte_eth_dev *dev; + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5308,6 +5436,7 @@ rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { struct rte_eth_dev *dev; + rte_eth_trace_timesync_adjust_time(port_id, delta); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5321,6 +5450,7 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + rte_eth_trace_timesync_read_time(port_id, timestamp); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5342,6 +5472,7 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; + rte_eth_trace_timesync_write_time(port_id, timestamp); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5363,6 +5494,7 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) { struct rte_eth_dev *dev; + rte_eth_trace_read_clock(port_id, clock); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5382,6 +5514,7 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) { struct rte_eth_dev *dev; + rte_ethdev_trace_get_reg_info(port_id, info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5402,6 +5535,7 @@ rte_eth_dev_get_eeprom_length(uint16_t port_id) { struct rte_eth_dev *dev; + rte_ethdev_trace_get_eeprom_length(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5415,6 +5549,7 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; + rte_ethdev_trace_get_eeprom(port_id, info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5435,6 +5570,7 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; + rte_ethdev_trace_set_eeprom(port_id, info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5456,6 +5592,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_get_module_info(port_id, modinfo); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5477,6 +5614,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_get_module_eeprom(port_id, info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5512,6 +5650,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_get_dcb_info(port_id, dcb_info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5562,6 +5701,7 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id, *nb_rx_desc, *nb_tx_desc); return 0; } @@ -5571,6 +5711,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, { struct rte_eth_dev *dev; + rte_ethdev_trace_hairpin_capability_get(port_id, cap); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5592,6 +5733,7 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) { struct rte_eth_dev *dev; + rte_ethdev_trace_pool_ops_supported(port_id, pool); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5854,6 +5996,7 @@ rte_eth_representor_info_get(uint16_t port_id, { struct rte_eth_dev *dev; + rte_eth_trace_representor_info_get(port_id, info); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5867,6 +6010,7 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) { struct rte_eth_dev *dev; + rte_eth_trace_rx_metadata_negotiate(port_id, features); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5894,6 +6038,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, { struct rte_eth_dev *dev; + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5924,6 +6069,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, { struct rte_eth_dev *dev; + rte_eth_trace_ip_reassembly_conf_get(port_id, conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5953,6 +6099,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, { struct rte_eth_dev *dev; + rte_eth_trace_ip_reassembly_conf_set(port_id, conf); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5989,6 +6136,7 @@ rte_eth_dev_priv_dump(uint16_t port_id, FILE *file) { struct rte_eth_dev *dev; + rte_ethdev_trace_priv_dump(port_id); RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 1491c815c3..be0383c839 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -88,6 +88,1191 @@ RTE_TRACE_POINT( rte_trace_point_emit_u16(port_id); ) +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, void *user_param, + 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_rx_callback, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + rte_rx_callback_fn fn, void *user_param, + 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, void *user_param, + 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_allmulticast_disable, + 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_allmulticast_enable, + 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_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_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_adjust_nb_rx_tx_desc, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t nb_rx_desc, + uint16_t nb_tx_desc), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(nb_rx_desc); + rte_trace_point_emit_u16(nb_tx_desc); +) + +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, void *cb_arg), + 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( + 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, 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_default_mac_addr_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_flow_ctrl_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf *fc_conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(fc_conf); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_flow_ctrl_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf *fc_conf), + 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( + rte_ethdev_trace_fw_version_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, char *fw_version, size_t fw_size), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(fw_version); + rte_trace_point_emit_size_t(fw_size); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_dcb_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info *dcb_info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(dcb_info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_eeprom_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_eeprom_length, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + 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); +) + +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, 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_get_reg_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_reg_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_sec_ctx, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_supported_ptypes, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, + uint32_t *ptypes, int num, int j), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(ptype_mask); + rte_trace_point_emit_ptr(ptypes); + rte_trace_point_emit_int(num); + rte_trace_point_emit_int(j); +) + +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_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_u32(dev_info->if_index); + 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_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_u16(dev_info->nb_rx_queues); + rte_trace_point_emit_u16(dev_info->nb_tx_queues); +) + +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_ethdev_trace_is_valid_port, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_mac_addr_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, + uint32_t pool), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); + rte_trace_point_emit_u32(pool); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_mac_addr_remove, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_pool_ops_supported, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *pool), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pool); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_priority_flow_ctrl_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf), + 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( + 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_ethdev_trace_rss_hash_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf *rss_conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(rss_conf); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rss_hash_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf *rss_conf), + 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( + rte_ethdev_trace_rss_reta_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(reta_conf); + rte_trace_point_emit_u16(reta_size); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rss_reta_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(reta_conf->mask); + rte_trace_point_emit_u16(reta_size); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rx_intr_ctl, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int epfd, int op, void *data), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(epfd); + rte_trace_point_emit_int(op); + rte_trace_point_emit_ptr(data); +) + +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, void *data), + 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( + 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_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rx_intr_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); +) + +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_rx_queue_start, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(rx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rx_queue_stop, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(rx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_eeprom_info *info), + 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( + rte_ethdev_trace_set_link_down, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_link_up, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_mc_addr_list, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_ether_addr *mc_addr_set, + uint32_t nb_mc_addr), + 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( + rte_ethdev_trace_set_ptypes, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, + uint32_t *set_ptypes, unsigned int num), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(ptype_mask); + rte_trace_point_emit_ptr(set_ptypes); + rte_trace_point_emit_u32(num); +) + +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), + 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( + 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), + 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( + 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(vlan_type); + rte_trace_point_emit_u16(tag_type); +) + +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_set_vlan_pvid, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t pvid, int on), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(pvid); + rte_trace_point_emit_int(on); +) + +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_socket_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +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_tx_queue_start, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(tx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_tx_queue_stop, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(tx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_uc_all_hash_table_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint8_t on), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u8(on); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_uc_hash_table_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, + uint8_t on), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); + rte_trace_point_emit_u8(on); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_udp_tunnel_port_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp), + 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( + rte_ethdev_trace_udp_tunnel_port_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp), + 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( + 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_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_start, + const struct rte_device *parent), + rte_trace_point_emit_u16(port_id_start); + rte_trace_point_emit_ptr(parent); +) + +RTE_TRACE_POINT( + rte_eth_trace_find_next_owned_by, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const uint64_t owner_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(owner_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_find_next_sibling, + RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t ref_port_id), + rte_trace_point_emit_u16(port_id_start); + rte_trace_point_emit_u16(ref_port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_cleanup, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), + rte_trace_point_emit_ptr(iter); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_init, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter, const char *devargs), + rte_trace_point_emit_ptr(iter); + rte_trace_point_emit_ptr(devargs); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_next, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), + rte_trace_point_emit_ptr(iter); +) + +RTE_TRACE_POINT( + rte_eth_trace_led_off, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_led_on, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(link->link_speed); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_get_nowait, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(link->link_speed); +) + +RTE_TRACE_POINT( + rte_eth_trace_macaddr_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *mac_addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(mac_addr); +) + +RTE_TRACE_POINT( + rte_eth_trace_promiscuous_disable, + 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_promiscuous_enable, + 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_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_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_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_eth_burst_mode *mode), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(mode); +) + +RTE_TRACE_POINT( + rte_eth_trace_rx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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->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_rx_queue_setup, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, + uint16_t nb_rx_desc, unsigned int socket_id, + const struct rte_eth_rxconf *rx_conf, + struct rte_mempool *mb_pool), + 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_u32(socket_id); + rte_trace_point_emit_ptr(rx_conf); + rte_trace_point_emit_ptr(mb_pool); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_idx); + rte_trace_point_emit_u16(tx_rate); +) + +RTE_TRACE_POINT( + rte_eth_trace_speed_bitflag, + RTE_TRACE_POINT_ARGS(uint32_t speed, int duplex), + rte_trace_point_emit_u32(speed); + rte_trace_point_emit_int(duplex); +) + +RTE_TRACE_POINT( + rte_eth_trace_stats_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats *stats), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_u64(stats->rx_nombuf); +) + +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_timesync_adjust_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int64_t delta), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_i64(delta); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_read_rx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *timestamp, + uint32_t flags), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(timestamp); + rte_trace_point_emit_u32(flags); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_read_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *time), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(time); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_read_tx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *timestamp), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(timestamp); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_write_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct timespec *time), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(time); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_buffer_count_callback, + RTE_TRACE_POINT_ARGS(struct rte_mbuf **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); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_buffer_drop_callback, + RTE_TRACE_POINT_ARGS(struct rte_mbuf **pkts, uint16_t unsent), + rte_trace_point_emit_ptr(pkts); + rte_trace_point_emit_u16(unsent); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_buffer_init, + RTE_TRACE_POINT_ARGS(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_buffer_set_err_callback, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev_tx_buffer *buffer, + buffer_tx_error_fn callback, void *userdata), + rte_trace_point_emit_ptr(buffer); + rte_trace_point_emit_ptr(callback); + rte_trace_point_emit_ptr(userdata); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_eth_burst_mode *mode), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(mode); +) + +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_tx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_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); +) + +RTE_TRACE_POINT( + rte_eth_trace_xstats_get_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, + 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_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_ptr(id); +) + +RTE_TRACE_POINT( + 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); +) + +RTE_TRACE_POINT( + rte_eth_trace_xstats_get_names_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_reset, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_owner_delete, + RTE_TRACE_POINT_ARGS(const 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_owner_get, + RTE_TRACE_POINT_ARGS(const uint16_t port_id, + 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_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(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), + 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_get_module_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_dev_eeprom_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_module_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_dev_module_info *modinfo), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(modinfo); +) + +RTE_TRACE_POINT( + rte_eth_trace_read_clock, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t *clk), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(clk); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_hairpin_capability_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_hairpin_cap *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +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), + 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_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), + 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_ptr(conf); + 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_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); +) + +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_link_speed_to_str, + RTE_TRACE_POINT_ARGS(uint32_t link_speed), + rte_trace_point_emit_u32(link_speed); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_to_str, + RTE_TRACE_POINT_ARGS(char *str, size_t len, + const struct rte_eth_link *eth_link), + rte_trace_point_emit_ptr(str); + rte_trace_point_emit_size_t(len); + rte_trace_point_emit_ptr(eth_link); +) + +RTE_TRACE_POINT( + rte_eth_trace_fec_get_capability, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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(num); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_eth_trace_fec_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t *fec_capa), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(fec_capa); +) + +RTE_TRACE_POINT( + rte_eth_trace_fec_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t fec_capa), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(fec_capa); +) + +RTE_TRACE_POINT( + rte_eth_trace_get_monitor_addr, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_power_monitor_cond *pmc), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pmc); +) + +RTE_TRACE_POINT( + rte_eth_trace_representor_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_representor_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +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_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_eth_trace_macaddrs_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *ma, + unsigned int num), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(ma); + rte_trace_point_emit_u32(num); +) + +RTE_TRACE_POINT( + rte_eth_trace_rx_metadata_negotiate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t *features), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(features); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_priority_flow_ctrl_queue_configure, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_pfc_queue_conf *pfc_queue_conf), + 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( + rte_ethdev_trace_priority_flow_ctrl_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_pfc_queue_info *pfc_queue_info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pfc_queue_info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_priv_dump, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_ip_reassembly_capability_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_ip_reassembly_params *capa), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(capa); +) + +RTE_TRACE_POINT( + rte_eth_trace_ip_reassembly_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_ip_reassembly_params *conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); +) + +RTE_TRACE_POINT( + rte_eth_trace_rx_avail_thresh_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_u8(avail_thresh); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 40084d1929..ba3fdd04a2 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -37,6 +37,25 @@ 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, + 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_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, + uint16_t nb_pkts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_u16(nb_pkts); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 3def7bfd24..e3d603cc9a 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -288,6 +288,150 @@ EXPERIMENTAL { # added in 22.11 rte_flow_async_action_handle_query; + __rte_eth_trace_add_first_rx_callback; + __rte_eth_trace_add_rx_callback; + __rte_eth_trace_add_tx_callback; + __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_ethdev_trace_count_avail; + __rte_ethdev_trace_count_total; + __rte_ethdev_trace_set_mtu; + __rte_ethdev_trace_adjust_nb_rx_tx_desc; + __rte_ethdev_trace_callback_register; + __rte_ethdev_trace_callback_unregister; + __rte_ethdev_trace_default_mac_addr_set; + __rte_ethdev_trace_flow_ctrl_get; + __rte_ethdev_trace_flow_ctrl_set; + __rte_ethdev_trace_fw_version_get; + __rte_ethdev_trace_get_dcb_info; + __rte_ethdev_trace_get_eeprom; + __rte_ethdev_trace_get_eeprom_length; + __rte_ethdev_trace_get_mtu; + __rte_ethdev_trace_get_name_by_port; + __rte_ethdev_trace_get_port_by_name; + __rte_ethdev_trace_get_reg_info; + __rte_ethdev_trace_get_sec_ctx; + __rte_ethdev_trace_get_supported_ptypes; + __rte_ethdev_trace_get_vlan_offload; + __rte_ethdev_trace_info_get; + __rte_ethdev_trace_is_removed; + __rte_ethdev_trace_is_valid_port; + __rte_ethdev_trace_mac_addr_add; + __rte_ethdev_trace_mac_addr_remove; + __rte_ethdev_trace_pool_ops_supported; + __rte_ethdev_trace_priority_flow_ctrl_set; + __rte_ethdev_trace_reset; + __rte_ethdev_trace_rss_hash_conf_get; + __rte_ethdev_trace_rss_hash_update; + __rte_ethdev_trace_rss_reta_query; + __rte_ethdev_trace_rss_reta_update; + __rte_ethdev_trace_rx_intr_ctl; + __rte_ethdev_trace_rx_intr_ctl_q; + __rte_ethdev_trace_rx_intr_ctl_q_get_fd; + __rte_ethdev_trace_rx_intr_disable; + __rte_ethdev_trace_rx_intr_enable; + __rte_ethdev_trace_rx_offload_name; + __rte_ethdev_trace_rx_queue_start; + __rte_ethdev_trace_rx_queue_stop; + __rte_ethdev_trace_set_eeprom; + __rte_ethdev_trace_set_link_down; + __rte_ethdev_trace_set_link_up; + __rte_ethdev_trace_set_mc_addr_list; + __rte_ethdev_trace_set_ptypes; + __rte_ethdev_trace_set_rx_queue_stats_mapping; + __rte_ethdev_trace_set_tx_queue_stats_mapping; + __rte_ethdev_trace_set_vlan_ether_type; + __rte_ethdev_trace_set_vlan_offload; + __rte_ethdev_trace_set_vlan_pvid; + __rte_ethdev_trace_set_vlan_strip_on_queue; + __rte_ethdev_trace_socket_id; + __rte_ethdev_trace_tx_offload_name; + __rte_ethdev_trace_tx_queue_start; + __rte_ethdev_trace_tx_queue_stop; + __rte_ethdev_trace_uc_all_hash_table_set; + __rte_ethdev_trace_uc_hash_table_set; + __rte_ethdev_trace_udp_tunnel_port_add; + __rte_ethdev_trace_udp_tunnel_port_delete; + __rte_ethdev_trace_vlan_filter; + __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_iterator_cleanup; + __rte_eth_trace_iterator_init; + __rte_eth_trace_iterator_next; + __rte_eth_trace_led_off; + __rte_eth_trace_led_on; + __rte_eth_trace_link_get; + __rte_eth_trace_link_get_nowait; + __rte_eth_trace_macaddr_get; + __rte_eth_trace_promiscuous_disable; + __rte_eth_trace_promiscuous_enable; + __rte_eth_trace_promiscuous_get; + __rte_eth_trace_remove_rx_callback; + __rte_eth_trace_remove_tx_callback; + __rte_eth_trace_rx_burst_mode_get; + __rte_eth_trace_rx_queue_info_get; + __rte_eth_trace_rx_queue_setup; + __rte_eth_trace_set_queue_rate_limit; + __rte_eth_trace_speed_bitflag; + __rte_eth_trace_stats_get; + __rte_eth_trace_stats_reset; + __rte_eth_trace_timesync_adjust_time; + __rte_eth_trace_timesync_disable; + __rte_eth_trace_timesync_enable; + __rte_eth_trace_timesync_read_rx_timestamp; + __rte_eth_trace_timesync_read_time; + __rte_eth_trace_timesync_read_tx_timestamp; + __rte_eth_trace_timesync_write_time; + __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_burst_mode_get; + __rte_eth_trace_tx_done_cleanup; + __rte_eth_trace_tx_queue_info_get; + __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_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_get_module_eeprom; + __rte_ethdev_trace_get_module_info; + __rte_ethdev_trace_hairpin_capability_get; + __rte_eth_trace_rx_hairpin_queue_setup; + __rte_eth_trace_tx_hairpin_queue_setup; + __rte_eth_trace_hairpin_bind; + __rte_eth_trace_hairpin_get_peer_ports; + __rte_eth_trace_hairpin_unbind; + __rte_eth_trace_link_speed_to_str; + __rte_eth_trace_link_to_str; + __rte_eth_trace_fec_get_capability; + __rte_eth_trace_fec_get; + __rte_eth_trace_fec_set; + __rte_eth_trace_get_monitor_addr; + __rte_eth_trace_representor_info_get; + __rte_ethdev_trace_capability_name; + __rte_ethdev_trace_conf_get; + __rte_eth_trace_macaddrs_get; + __rte_eth_trace_rx_metadata_negotiate; + __rte_ethdev_trace_priority_flow_ctrl_queue_configure; + __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; + __rte_ethdev_trace_priv_dump; + __rte_eth_trace_ip_reassembly_capability_get; + __rte_eth_trace_ip_reassembly_conf_get; + __rte_eth_trace_ip_reassembly_conf_set; + __rte_eth_trace_rx_avail_thresh_query; + __rte_eth_trace_rx_avail_thresh_set; }; INTERNAL { -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v2 1/4] ethdev: add trace points 2022-09-29 10:29 ` [PATCH v2 1/4] ethdev: add trace points Ankur Dwivedi @ 2022-10-06 7:09 ` Andrew Rybchenko 2022-10-06 7:24 ` [EXT] " Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Andrew Rybchenko @ 2022-10-06 7:09 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On 9/29/22 13:29, Ankur Dwivedi wrote: > Add trace points for ethdev functions. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> [snip] > @@ -5867,6 +6010,7 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) > { > struct rte_eth_dev *dev; > > + rte_eth_trace_rx_metadata_negotiate(port_id, features); features are in/out, so it would be interesting to values, not just pointer and both values: input and output. > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > [snip] > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > index 3def7bfd24..e3d603cc9a 100644 > --- a/lib/ethdev/version.map > +++ b/lib/ethdev/version.map > @@ -288,6 +288,150 @@ EXPERIMENTAL { > > # added in 22.11 > rte_flow_async_action_handle_query; > + __rte_eth_trace_add_first_rx_callback; Why is it in EXPERIMENTAL section, but not INTERNAL? [snip] > INTERNAL ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points 2022-10-06 7:09 ` Andrew Rybchenko @ 2022-10-06 7:24 ` Ankur Dwivedi 2022-10-06 7:27 ` Andrew Rybchenko 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-06 7:24 UTC (permalink / raw) To: Andrew Rybchenko, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia Hi Andrew, >-----Original Message----- >From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >Sent: Thursday, October 6, 2022 12:40 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >jgrajcia@cisco.com >Subject: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points > >External Email > >---------------------------------------------------------------------- >On 9/29/22 13:29, Ankur Dwivedi wrote: >> Add trace points for ethdev functions. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > >[snip] > >> @@ -5867,6 +6010,7 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, >uint64_t *features) >> { >> struct rte_eth_dev *dev; >> >> + rte_eth_trace_rx_metadata_negotiate(port_id, features); > >features are in/out, so it would be interesting to values, not just pointer and >both values: input and output. [Ankur] Will add a emit line to display the uint64_t input value of features. > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> > >[snip] > >> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index >> 3def7bfd24..e3d603cc9a 100644 >> --- a/lib/ethdev/version.map >> +++ b/lib/ethdev/version.map >> @@ -288,6 +288,150 @@ EXPERIMENTAL { >> >> # added in 22.11 >> rte_flow_async_action_handle_query; >> + __rte_eth_trace_add_first_rx_callback; > >Why is it in EXPERIMENTAL section, but not INTERNAL? [Ankur] Because the functions for which trace is added are not internal functions. > >[snip] > >> INTERNAL ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points 2022-10-06 7:24 ` [EXT] " Ankur Dwivedi @ 2022-10-06 7:27 ` Andrew Rybchenko 2022-10-06 7:43 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Andrew Rybchenko @ 2022-10-06 7:27 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On 10/6/22 10:24, Ankur Dwivedi wrote: > Hi Andrew, > >> -----Original Message----- >> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >> Sent: Thursday, October 6, 2022 12:40 PM >> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >> ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >> linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >> mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >> evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >> Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >> hyonkim@cisco.com; liudongdong3@huawei.com; >> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >> Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda >> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi >> <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla >> <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >> Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >> viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >> spinler@cesnet.cz; chaoyong.he@corigine.com; >> niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >> sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >> sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody >> <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >> Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >> jianwang@trustnetic.com; jbehrens@vmware.com; >> maxime.coquelin@redhat.com; chenbo.xia@intel.com; >> steven.webster@windriver.com; matt.peters@windriver.com; >> bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >> jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >> jgrajcia@cisco.com >> Subject: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points >> >> External Email >> >> ---------------------------------------------------------------------- >> On 9/29/22 13:29, Ankur Dwivedi wrote: >>> Add trace points for ethdev functions. >>> >>> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> >> [snip] >> >>> @@ -5867,6 +6010,7 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, >> uint64_t *features) >>> { >>> struct rte_eth_dev *dev; >>> >>> + rte_eth_trace_rx_metadata_negotiate(port_id, features); >> >> features are in/out, so it would be interesting to values, not just pointer and >> both values: input and output. > [Ankur] Will add a emit line to display the uint64_t input value of features. What about output? >> >>> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >>> dev = &rte_eth_devices[port_id]; >>> >> >> [snip] >> >>> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index >>> 3def7bfd24..e3d603cc9a 100644 >>> --- a/lib/ethdev/version.map >>> +++ b/lib/ethdev/version.map >>> @@ -288,6 +288,150 @@ EXPERIMENTAL { >>> >>> # added in 22.11 >>> rte_flow_async_action_handle_query; >>> + __rte_eth_trace_add_first_rx_callback; >> >> Why is it in EXPERIMENTAL section, but not INTERNAL? > [Ankur] Because the functions for which trace is added are not internal functions. Sorry, but I don't understand. I agree that tracing of public inline functions must be part of ABI, but why everything else should be a part of ABI? >> >> [snip] >> >>> INTERNAL ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points 2022-10-06 7:27 ` Andrew Rybchenko @ 2022-10-06 7:43 ` Ankur Dwivedi 2022-10-06 7:50 ` Andrew Rybchenko 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-06 7:43 UTC (permalink / raw) To: Andrew Rybchenko, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia >-----Original Message----- >From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >Sent: Thursday, October 6, 2022 12:58 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >jgrajcia@cisco.com >Subject: Re: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points > >On 10/6/22 10:24, Ankur Dwivedi wrote: >> Hi Andrew, >> >>> -----Original Message----- >>> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >>> Sent: Thursday, October 6, 2022 12:40 PM >>> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >>> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >>> ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >>> linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >>> mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >>> evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh >>> <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >>> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >>> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin >Jacob >>> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >>> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >>> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >>> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; >>> johndale@cisco.com; hyonkim@cisco.com; liudongdong3@huawei.com; >>> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >>> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >>> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >>> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >>> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; >>> Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar >>> Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori >>> <skori@marvell.com>; Satha Koteswara Rao Kottidi >>> <skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >>> zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >>> Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara >>> <sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >>> sthemmin@microsoft.com; longli@microsoft.com; spinler@cesnet.cz; >>> chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >>> hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; >g.singh@nxp.com; >>> apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >>> Rasesh Mody <rmody@marvell.com>; Shahed Shaikh >>> <shshaikh@marvell.com>; Devendra Singh Rawat >>> <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >>> jianwang@trustnetic.com; jbehrens@vmware.com; >>> maxime.coquelin@redhat.com; chenbo.xia@intel.com; >>> steven.webster@windriver.com; matt.peters@windriver.com; >>> bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >>> jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >>> jgrajcia@cisco.com >>> Subject: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points >>> >>> External Email >>> >>> --------------------------------------------------------------------- >>> - On 9/29/22 13:29, Ankur Dwivedi wrote: >>>> Add trace points for ethdev functions. >>>> >>>> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >>> >>> [snip] >>> >>>> @@ -5867,6 +6010,7 @@ rte_eth_rx_metadata_negotiate(uint16_t >>>> port_id, >>> uint64_t *features) >>>> { >>>> struct rte_eth_dev *dev; >>>> >>>> + rte_eth_trace_rx_metadata_negotiate(port_id, features); >>> >>> features are in/out, so it would be interesting to values, not just >>> pointer and both values: input and output. >> [Ankur] Will add a emit line to display the uint64_t input value of features. > >What about output? [Ankur] The output is not captured because it calls a callback in the return: return eth_err(port_id, (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); I do not wanted to modify the existing code/logic for trace. > >>> >>>> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >>>> dev = &rte_eth_devices[port_id]; >>>> >>> >>> [snip] >>> >>>> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index >>>> 3def7bfd24..e3d603cc9a 100644 >>>> --- a/lib/ethdev/version.map >>>> +++ b/lib/ethdev/version.map >>>> @@ -288,6 +288,150 @@ EXPERIMENTAL { >>>> >>>> # added in 22.11 >>>> rte_flow_async_action_handle_query; >>>> + __rte_eth_trace_add_first_rx_callback; >>> >>> Why is it in EXPERIMENTAL section, but not INTERNAL? >> [Ankur] Because the functions for which trace is added are not internal >functions. > >Sorry, but I don't understand. I agree that tracing of public inline functions >must be part of ABI, but why everything else should be a part of ABI? [Ankur] I see that there are some already existing trace functions added in EXPERIMENTAL in version.map like __rte_ethdev_trace_configure, __rte_ethdev_trace_rxq_setup. So not sure will it be internal or experimental. But you are right the trace function will not be called as a public api. Should I make the newly added trace as internal then? > >>> >>> [snip] >>> >>>> INTERNAL ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points 2022-10-06 7:43 ` Ankur Dwivedi @ 2022-10-06 7:50 ` Andrew Rybchenko 2022-10-06 7:57 ` David Marchand 0 siblings, 1 reply; 172+ messages in thread From: Andrew Rybchenko @ 2022-10-06 7:50 UTC (permalink / raw) To: Ankur Dwivedi, dev, david.marchand Cc: Thomas Monjalon, Ferruh Yigit, Jerin Jacob Kollanukkaran @David, see small question below. @Thomas, @Ferruh, @Jerin see question below as well. On 10/6/22 10:43, Ankur Dwivedi wrote: > > >> -----Original Message----- >> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >> Sent: Thursday, October 6, 2022 12:58 PM >> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >> ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >> linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >> mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >> evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >> Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >> hyonkim@cisco.com; liudongdong3@huawei.com; >> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >> Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda >> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi >> <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla >> <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >> Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >> viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >> spinler@cesnet.cz; chaoyong.he@corigine.com; >> niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >> sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >> sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody >> <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >> Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >> jianwang@trustnetic.com; jbehrens@vmware.com; >> maxime.coquelin@redhat.com; chenbo.xia@intel.com; >> steven.webster@windriver.com; matt.peters@windriver.com; >> bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >> jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >> jgrajcia@cisco.com >> Subject: Re: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points >> >> On 10/6/22 10:24, Ankur Dwivedi wrote: >>> Hi Andrew, >>> >>>> -----Original Message----- >>>> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >>>> Sent: Thursday, October 6, 2022 12:40 PM >>>> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >>>> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >>>> ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >>>> linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >>>> mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >>>> evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >> Russkikh >>>> <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >>>> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >>>> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin >> Jacob >>>> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >>>> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >>>> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >>>> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; >>>> johndale@cisco.com; hyonkim@cisco.com; liudongdong3@huawei.com; >>>> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >>>> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >>>> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >>>> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >>>> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; >>>> Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar >>>> Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori >>>> <skori@marvell.com>; Satha Koteswara Rao Kottidi >>>> <skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >>>> zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >>>> Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara >>>> <sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >>>> sthemmin@microsoft.com; longli@microsoft.com; spinler@cesnet.cz; >>>> chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >>>> hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; >> g.singh@nxp.com; >>>> apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >>>> Rasesh Mody <rmody@marvell.com>; Shahed Shaikh >>>> <shshaikh@marvell.com>; Devendra Singh Rawat >>>> <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >>>> jianwang@trustnetic.com; jbehrens@vmware.com; >>>> maxime.coquelin@redhat.com; chenbo.xia@intel.com; >>>> steven.webster@windriver.com; matt.peters@windriver.com; >>>> bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >>>> jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >>>> jgrajcia@cisco.com >>>> Subject: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points >>>> >>>> External Email >>>> >>>> --------------------------------------------------------------------- >>>> - On 9/29/22 13:29, Ankur Dwivedi wrote: >>>>> Add trace points for ethdev functions. >>>>> >>>>> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >>>> >>>> [snip] >>>> >>>>> @@ -5867,6 +6010,7 @@ rte_eth_rx_metadata_negotiate(uint16_t >>>>> port_id, >>>> uint64_t *features) >>>>> { >>>>> struct rte_eth_dev *dev; >>>>> >>>>> + rte_eth_trace_rx_metadata_negotiate(port_id, features); >>>> >>>> features are in/out, so it would be interesting to values, not just >>>> pointer and both values: input and output. >>> [Ankur] Will add a emit line to display the uint64_t input value of features. >> >> What about output? > [Ankur] The output is not captured because it calls a callback in the return: > > return eth_err(port_id, (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); > > I do not wanted to modify the existing code/logic for trace. OK, I see the reason now. I'd like to hear opinion of other ethdev maintainers (@Thomas and @Ferruh) and @Jerin. Thoughts? It is just one example from many-many cases. The question is how pedantic should we be with added tracing? >> >>>> >>>>> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >>>>> dev = &rte_eth_devices[port_id]; >>>>> >>>> >>>> [snip] >>>> >>>>> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index >>>>> 3def7bfd24..e3d603cc9a 100644 >>>>> --- a/lib/ethdev/version.map >>>>> +++ b/lib/ethdev/version.map >>>>> @@ -288,6 +288,150 @@ EXPERIMENTAL { >>>>> >>>>> # added in 22.11 >>>>> rte_flow_async_action_handle_query; >>>>> + __rte_eth_trace_add_first_rx_callback; >>>> >>>> Why is it in EXPERIMENTAL section, but not INTERNAL? >>> [Ankur] Because the functions for which trace is added are not internal >> functions. >> >> Sorry, but I don't understand. I agree that tracing of public inline functions >> must be part of ABI, but why everything else should be a part of ABI? > [Ankur] I see that there are some already existing trace functions added in EXPERIMENTAL in version.map like __rte_ethdev_trace_configure, __rte_ethdev_trace_rxq_setup. So not sure will it be internal or experimental. > > But you are right the trace function will not be called as a public api. Should I make the newly added trace as internal then? @David, do I understand correctly that trace points in EXPERIMENTAL is a mistake in majority of cases? >> >>>> >>>> [snip] >>>> >>>>> INTERNAL > ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points 2022-10-06 7:50 ` Andrew Rybchenko @ 2022-10-06 7:57 ` David Marchand 2022-10-12 9:49 ` Jerin Jacob 0 siblings, 1 reply; 172+ messages in thread From: David Marchand @ 2022-10-06 7:57 UTC (permalink / raw) To: Andrew Rybchenko, Jerin Jacob Kollanukkaran Cc: Ankur Dwivedi, dev, Thomas Monjalon, Ferruh Yigit, Ray Kinsella On Thu, Oct 6, 2022 at 9:50 AM Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> wrote: > >>>>> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index > >>>>> 3def7bfd24..e3d603cc9a 100644 > >>>>> --- a/lib/ethdev/version.map > >>>>> +++ b/lib/ethdev/version.map > >>>>> @@ -288,6 +288,150 @@ EXPERIMENTAL { > >>>>> > >>>>> # added in 22.11 > >>>>> rte_flow_async_action_handle_query; > >>>>> + __rte_eth_trace_add_first_rx_callback; > >>>> > >>>> Why is it in EXPERIMENTAL section, but not INTERNAL? > >>> [Ankur] Because the functions for which trace is added are not internal > >> functions. > >> > >> Sorry, but I don't understand. I agree that tracing of public inline functions > >> must be part of ABI, but why everything else should be a part of ABI? > > [Ankur] I see that there are some already existing trace functions added in EXPERIMENTAL in version.map like __rte_ethdev_trace_configure, __rte_ethdev_trace_rxq_setup. So not sure will it be internal or experimental. > > > > But you are right the trace function will not be called as a public api. Should I make the newly added trace as internal then? > > @David, do I understand correctly that trace points in > EXPERIMENTAL is a mistake in majority of cases? The trace point global variables (__rte_trace_foo) are only exposed for inline helpers that might call their associated trace point helper (rte_trace_foo()). An application is not supposed to directly manipulate them. Any tp manipulation should be through the rte_trace_point_* API. Jerin, do you see any other uses for them? If not, I agree we can mark all those INTERNAL. I can send a cleanup post rc1. -- David Marchand ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points 2022-10-06 7:57 ` David Marchand @ 2022-10-12 9:49 ` Jerin Jacob 2022-10-12 9:56 ` David Marchand 0 siblings, 1 reply; 172+ messages in thread From: Jerin Jacob @ 2022-10-12 9:49 UTC (permalink / raw) To: David Marchand Cc: Andrew Rybchenko, Jerin Jacob Kollanukkaran, Ankur Dwivedi, dev, Thomas Monjalon, Ferruh Yigit, Ray Kinsella On Thu, Oct 6, 2022 at 1:27 PM David Marchand <david.marchand@redhat.com> wrote: > > On Thu, Oct 6, 2022 at 9:50 AM Andrew Rybchenko > <andrew.rybchenko@oktetlabs.ru> wrote: > > >>>>> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index > > >>>>> 3def7bfd24..e3d603cc9a 100644 > > >>>>> --- a/lib/ethdev/version.map > > >>>>> +++ b/lib/ethdev/version.map > > >>>>> @@ -288,6 +288,150 @@ EXPERIMENTAL { > > >>>>> > > >>>>> # added in 22.11 > > >>>>> rte_flow_async_action_handle_query; > > >>>>> + __rte_eth_trace_add_first_rx_callback; > > >>>> > > >>>> Why is it in EXPERIMENTAL section, but not INTERNAL? > > >>> [Ankur] Because the functions for which trace is added are not internal > > >> functions. > > >> > > >> Sorry, but I don't understand. I agree that tracing of public inline functions > > >> must be part of ABI, but why everything else should be a part of ABI? > > > [Ankur] I see that there are some already existing trace functions added in EXPERIMENTAL in version.map like __rte_ethdev_trace_configure, __rte_ethdev_trace_rxq_setup. So not sure will it be internal or experimental. > > > > > > But you are right the trace function will not be called as a public api. Should I make the newly added trace as internal then? > > > > @David, do I understand correctly that trace points in > > EXPERIMENTAL is a mistake in majority of cases? > > The trace point global variables (__rte_trace_foo) are only exposed > for inline helpers that might call their associated trace point helper > (rte_trace_foo()). > An application is not supposed to directly manipulate them. > Any tp manipulation should be through the rte_trace_point_* API. > > Jerin, do you see any other uses for them? No. Expect the following ones, which can be used by application directly. __rte_eal_trace_generic_float; __rte_eal_trace_generic_func; __rte_eal_trace_generic_i16; __rte_eal_trace_generic_i32; __rte_eal_trace_generic_i64; __rte_eal_trace_generic_i8; __rte_eal_trace_generic_int; __rte_eal_trace_generic_long; __rte_eal_trace_generic_ptr; __rte_eal_trace_generic_str; __rte_eal_trace_generic_u16; __rte_eal_trace_generic_u32; __rte_eal_trace_generic_u64; __rte_eal_trace_generic_u8; > > If not, I agree we can mark all those INTERNAL. > I can send a cleanup post rc1. Thanks > > > -- > David Marchand > ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v2 1/4] ethdev: add trace points 2022-10-12 9:49 ` Jerin Jacob @ 2022-10-12 9:56 ` David Marchand 0 siblings, 0 replies; 172+ messages in thread From: David Marchand @ 2022-10-12 9:56 UTC (permalink / raw) To: Jerin Jacob Cc: Andrew Rybchenko, Jerin Jacob Kollanukkaran, Ankur Dwivedi, dev, Thomas Monjalon, Ferruh Yigit, Ray Kinsella On Wed, Oct 12, 2022 at 11:50 AM Jerin Jacob <jerinjacobk@gmail.com> wrote: > On Thu, Oct 6, 2022 at 1:27 PM David Marchand <david.marchand@redhat.com> wrote: > > On Thu, Oct 6, 2022 at 9:50 AM Andrew Rybchenko > > <andrew.rybchenko@oktetlabs.ru> wrote: > > > >>>>> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index > > > >>>>> 3def7bfd24..e3d603cc9a 100644 > > > >>>>> --- a/lib/ethdev/version.map > > > >>>>> +++ b/lib/ethdev/version.map > > > >>>>> @@ -288,6 +288,150 @@ EXPERIMENTAL { > > > >>>>> > > > >>>>> # added in 22.11 > > > >>>>> rte_flow_async_action_handle_query; > > > >>>>> + __rte_eth_trace_add_first_rx_callback; > > > >>>> > > > >>>> Why is it in EXPERIMENTAL section, but not INTERNAL? > > > >>> [Ankur] Because the functions for which trace is added are not internal > > > >> functions. > > > >> > > > >> Sorry, but I don't understand. I agree that tracing of public inline functions > > > >> must be part of ABI, but why everything else should be a part of ABI? > > > > [Ankur] I see that there are some already existing trace functions added in EXPERIMENTAL in version.map like __rte_ethdev_trace_configure, __rte_ethdev_trace_rxq_setup. So not sure will it be internal or experimental. > > > > > > > > But you are right the trace function will not be called as a public api. Should I make the newly added trace as internal then? > > > > > > @David, do I understand correctly that trace points in > > > EXPERIMENTAL is a mistake in majority of cases? > > > > The trace point global variables (__rte_trace_foo) are only exposed > > for inline helpers that might call their associated trace point helper > > (rte_trace_foo()). > > An application is not supposed to directly manipulate them. > > Any tp manipulation should be through the rte_trace_point_* API. > > > > Jerin, do you see any other uses for them? > > No. Expect the following ones, which can be used by application directly. > > __rte_eal_trace_generic_float; > __rte_eal_trace_generic_func; > __rte_eal_trace_generic_i16; > __rte_eal_trace_generic_i32; > __rte_eal_trace_generic_i64; > __rte_eal_trace_generic_i8; > __rte_eal_trace_generic_int; > __rte_eal_trace_generic_long; > __rte_eal_trace_generic_ptr; > __rte_eal_trace_generic_str; > __rte_eal_trace_generic_u16; > __rte_eal_trace_generic_u32; > __rte_eal_trace_generic_u64; > __rte_eal_trace_generic_u8; Indeed, that's something I discussed offlist after with Andrew but forgot to put back on the mailing list. As long as the trace point is called from a helper in a header exposed to applications, we can't mark the trace point variable internal. -- David Marchand ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v2 2/4] ethdev: add trace points for flow 2022-09-29 10:29 ` [PATCH v2 0/4] add trace points in ethdev library Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 1/4] ethdev: add trace points Ankur Dwivedi @ 2022-09-29 10:29 ` Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 3/4] ethdev: add trace points for mtr Ankur Dwivedi ` (3 subsequent siblings) 5 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-09-29 10:29 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 117 +++++++++ lib/ethdev/rte_ethdev_trace.h | 418 +++++++++++++++++++++++++++++++ lib/ethdev/rte_flow.c | 54 ++++ lib/ethdev/version.map | 39 +++ 4 files changed, 628 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2c06b47b7f..165be941a1 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -464,3 +464,120 @@ RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_query, RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set, lib.ethdev.rx_avail_thresh_set) + +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_error_set, + lib.ethdev.flow.error_set) + +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_dev_dump, + lib.ethdev.flow.dev_dump) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_aged_flows, + lib.ethdev.flow.get_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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index be0383c839..d3b514372a 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -1273,6 +1273,424 @@ RTE_TRACE_POINT( rte_trace_point_emit_u8(avail_thresh); ) +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_ptr(actions); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + 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), + 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( + rte_flow_trace_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_error_set, + RTE_TRACE_POINT_ARGS(struct rte_flow_error *err_p, + int code, enum rte_flow_error_type type, + const void *cause, const char *message), + rte_trace_point_emit_ptr(err_p); + rte_trace_point_emit_int(code); + rte_trace_point_emit_int(type); + rte_trace_point_emit_ptr(cause); + rte_trace_point_emit_string(message); +) + +RTE_TRACE_POINT( + rte_flow_trace_flush, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_flow_trace_isolate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int set), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(set); +) + +RTE_TRACE_POINT( + rte_flow_trace_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow, + const struct rte_flow_action *action, void *data), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(flow); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_ptr(data); +) + +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), + 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( + 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_dev_dump, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_get_aged_flows, + RTE_TRACE_POINT_ARGS(uint16_t port_id, void **contexts, + uint32_t nb_contexts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(contexts); + rte_trace_point_emit_u32(nb_contexts); +) + +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), + 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( + 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), + 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( + rte_flow_trace_get_restore_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_mbuf *m, + struct rte_flow_restore_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(m); + rte_trace_point_emit_ptr(info); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_u32(num_of_actions); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(items); + rte_trace_point_emit_u32(num_of_items); +) + +RTE_TRACE_POINT( + 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + 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_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( + 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( + 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_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_pick_transfer_proxy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t *proxy_port_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(proxy_port_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(port_info); + rte_trace_point_emit_ptr(queue_info); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(port_attr); + rte_trace_point_emit_u16(nb_queue); + rte_trace_point_emit_ptr(queue_attr); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_attr); + rte_trace_point_emit_ptr(pattern); +) + +RTE_TRACE_POINT( + rte_flow_trace_pattern_template_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_pattern_template *pattern_template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pattern_template); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_attr); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_ptr(masks); +) + +RTE_TRACE_POINT( + rte_flow_trace_actions_template_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_actions_template *actions_template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions_template); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(table_attr); + 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( + rte_flow_trace_template_table_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_template_table *template_table), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_table); +) + +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), + 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( + rte_flow_trace_push, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); +) + +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), + 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( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index af0eb9619c..00fd1e5f54 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -13,6 +13,7 @@ #include <rte_string_fns.h> #include <rte_mbuf_dyn.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" #include "rte_flow_driver.h" #include "rte_flow.h" @@ -280,6 +281,7 @@ 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: @@ -353,6 +355,7 @@ rte_flow_validate(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; int ret; + rte_flow_trace_validate(port_id, attr, pattern, actions); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->validate)) { @@ -378,6 +381,7 @@ rte_flow_create(uint16_t port_id, struct rte_flow *flow; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_create(port_id, attr, pattern, actions); if (unlikely(!ops)) return NULL; if (likely(!!ops->create)) { @@ -403,6 +407,7 @@ rte_flow_destroy(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_destroy(port_id, flow); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->destroy)) { @@ -425,6 +430,7 @@ rte_flow_flush(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_flush(port_id); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->flush)) { @@ -450,6 +456,7 @@ rte_flow_query(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_query(port_id, flow, action, data); if (!ops) return -rte_errno; if (likely(!!ops->query)) { @@ -473,6 +480,7 @@ rte_flow_isolate(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_isolate(port_id, set); if (!ops) return -rte_errno; if (likely(!!ops->isolate)) { @@ -502,6 +510,7 @@ rte_flow_error_set(struct rte_flow_error *error, }; } rte_errno = code; + rte_flow_trace_error_set(error, code, type, cause, message); return -code; } @@ -1000,6 +1009,7 @@ 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; @@ -1084,6 +1094,7 @@ 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; } @@ -1095,6 +1106,7 @@ rte_flow_dev_dump(uint16_t port_id, struct rte_flow *flow, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_dev_dump(port_id, flow); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->dev_dump)) { @@ -1116,6 +1128,7 @@ rte_flow_get_aged_flows(uint16_t port_id, void **contexts, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_get_aged_flows(port_id, contexts, nb_contexts); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->get_aged_flows)) { @@ -1150,6 +1163,7 @@ 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; } @@ -1169,6 +1183,7 @@ 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); + rte_flow_trace_action_handle_destroy(port_id, handle, ret); return flow_err(port_id, ret, error); } @@ -1189,6 +1204,7 @@ 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); + rte_flow_trace_action_handle_update(port_id, handle, update, ret); return flow_err(port_id, ret, error); } @@ -1209,6 +1225,7 @@ 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); + rte_flow_trace_action_handle_query(port_id, handle, data, ret); return flow_err(port_id, ret, error); } @@ -1222,6 +1239,7 @@ 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); + rte_flow_trace_tunnel_decap_set(port_id, tunnel, actions, num_of_actions); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_decap_set)) { @@ -1245,6 +1263,7 @@ 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); + rte_flow_trace_tunnel_match(port_id, tunnel, items, num_of_items); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_match)) { @@ -1267,6 +1286,7 @@ 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); + rte_flow_trace_get_restore_info(port_id, m, restore_info); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->get_restore_info)) { @@ -1289,6 +1309,7 @@ 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); + rte_flow_trace_tunnel_action_decap_release(port_id, actions, num_of_actions); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_action_decap_release)) { @@ -1312,6 +1333,7 @@ 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); + rte_flow_trace_tunnel_item_release(port_id, items, num_of_items); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_item_release)) { @@ -1332,6 +1354,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; + rte_flow_trace_pick_transfer_proxy(port_id, proxy_port_id); if (unlikely(ops == NULL)) return -rte_errno; @@ -1367,6 +1390,7 @@ 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; } @@ -1384,6 +1408,7 @@ 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); + rte_flow_trace_flex_item_release(port_id, handle, ret); return flow_err(port_id, ret, error); } @@ -1396,6 +1421,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); + rte_flow_trace_info_get(port_id, port_info, queue_info); if (unlikely(!ops)) return -rte_errno; if (dev->data->dev_configured == 0) { @@ -1429,6 +1455,7 @@ rte_flow_configure(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_configure(port_id, port_attr, nb_queue, queue_attr); if (unlikely(!ops)) return -rte_errno; if (dev->data->dev_configured == 0) { @@ -1472,6 +1499,8 @@ rte_flow_pattern_template_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_pattern_template *template; + rte_flow_trace_pattern_template_create(port_id, template_attr, + pattern); if (unlikely(!ops)) return NULL; if (dev->data->flow_configured == 0) { @@ -1522,6 +1551,7 @@ 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); + rte_flow_trace_pattern_template_destroy(port_id, pattern_template); if (unlikely(!ops)) return -rte_errno; if (unlikely(pattern_template == NULL)) @@ -1549,6 +1579,8 @@ rte_flow_actions_template_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_actions_template *template; + rte_flow_trace_actions_template_create(port_id, template_attr, actions, + masks); if (unlikely(!ops)) return NULL; if (dev->data->flow_configured == 0) { @@ -1608,6 +1640,7 @@ 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); + rte_flow_trace_actions_template_destroy(port_id, actions_template); if (unlikely(!ops)) return -rte_errno; if (unlikely(actions_template == NULL)) @@ -1637,6 +1670,11 @@ rte_flow_template_table_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_template_table *table; + rte_flow_trace_template_table_create(port_id, table_attr, + pattern_templates, + nb_pattern_templates, + actions_templates, + nb_actions_templates); if (unlikely(!ops)) return NULL; if (dev->data->flow_configured == 0) { @@ -1698,6 +1736,7 @@ 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); + rte_flow_trace_template_table_destroy(port_id, template_table); if (unlikely(!ops)) return -rte_errno; if (unlikely(template_table == NULL)) @@ -1737,6 +1776,9 @@ 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; } @@ -1751,6 +1793,8 @@ 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); + rte_flow_trace_async_destroy(port_id, queue_id, op_attr, flow, + user_data); return flow_err(port_id, ops->async_destroy(dev, queue_id, op_attr, flow, @@ -1766,6 +1810,7 @@ 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); + rte_flow_trace_push(port_id, queue_id); return flow_err(port_id, ops->push(dev, queue_id, error), error); @@ -1783,6 +1828,7 @@ rte_flow_pull(uint16_t port_id, int ret; ret = ops->pull(dev, queue_id, res, n_res, error); + rte_flow_trace_pull(port_id, queue_id, res, n_res, ret); return ret ? ret : flow_err(port_id, ret, error); } @@ -1803,6 +1849,9 @@ 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); return handle; } @@ -1818,6 +1867,8 @@ rte_flow_async_action_handle_destroy(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_async_action_handle_destroy(port_id, queue_id, op_attr, + action_handle, user_data); ret = ops->async_action_handle_destroy(dev, queue_id, op_attr, action_handle, user_data, error); return flow_err(port_id, ret, error); @@ -1838,6 +1889,9 @@ 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); + rte_flow_trace_async_action_handle_update(port_id, queue_id, op_attr, + action_handle, update, + user_data, ret); return flow_err(port_id, ret, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index e3d603cc9a..5aab81dcbd 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -432,6 +432,45 @@ EXPERIMENTAL { __rte_eth_trace_ip_reassembly_conf_set; __rte_eth_trace_rx_avail_thresh_query; __rte_eth_trace_rx_avail_thresh_set; + __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_dev_dump; + __rte_flow_trace_dynf_metadata_register; + __rte_flow_trace_error_set; + __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.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v2 3/4] ethdev: add trace points for mtr 2022-09-29 10:29 ` [PATCH v2 0/4] add trace points in ethdev library Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 1/4] ethdev: add trace points Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 2/4] ethdev: add trace points for flow Ankur Dwivedi @ 2022-09-29 10:29 ` Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 4/4] ethdev: add trace points for tm Ankur Dwivedi ` (2 subsequent siblings) 5 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-09-29 10:29 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 57 ++++++++++ lib/ethdev/rte_ethdev_trace.h | 176 +++++++++++++++++++++++++++++++ lib/ethdev/rte_mtr.c | 27 +++++ lib/ethdev/version.map | 19 ++++ 4 files changed, 279 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 165be941a1..4fe1b10979 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -581,3 +581,60 @@ RTE_TRACE_POINT_REGISTER(rte_flow_trace_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_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_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_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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index d3b514372a..15d541ac0b 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1691,6 +1692,181 @@ 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, + struct rte_mtr_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +RTE_TRACE_POINT( + rte_mtr_trace_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + struct rte_mtr_params *params, int shared), + 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( + rte_mtr_trace_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(dscp_table); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id, + struct rte_mtr_meter_profile *profile), + 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( + rte_mtr_trace_meter_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(meter_profile_id); +) + +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), + 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( + rte_mtr_trace_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + struct rte_mtr_stats *stats, uint64_t *stats_mask, + int clear), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_ptr(stats_mask); + rte_trace_point_emit_int(clear); +) + +RTE_TRACE_POINT( + rte_mtr_trace_stats_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + uint64_t stats_mask), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_u64(stats_mask); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_policy_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + 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( + rte_mtr_trace_meter_policy_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(policy_id); +) + +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), + 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( + rte_mtr_trace_meter_policy_validate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_int(actions->type); + rte_trace_point_emit_ptr(actions->conf); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_vlan_table_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + enum rte_color *vlan_table), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(vlan_table); +) + +RTE_TRACE_POINT( + rte_mtr_trace_color_in_protocol_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_int(proto); +) + +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), + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index c460e4f4e0..ff7265cd21 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -6,6 +6,7 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -63,6 +64,7 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_capabilities_get(port_id, cap); return RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); } @@ -75,6 +77,7 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile); return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); } @@ -86,6 +89,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id); return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); } @@ -97,6 +101,10 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_validate(port_id, policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); } @@ -109,6 +117,11 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_add(port_id, policy_id, + policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); } @@ -120,6 +133,7 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_delete(port_id, policy_id); return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); } @@ -133,6 +147,7 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_create(port_id, mtr_id, params, shared); return RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); } @@ -144,6 +159,7 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_destroy(port_id, mtr_id); return RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); } @@ -155,6 +171,7 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_enable(port_id, mtr_id); return RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); } @@ -166,6 +183,7 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_disable(port_id, mtr_id); return RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); } @@ -178,6 +196,7 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id); return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); } @@ -190,6 +209,7 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id); return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); } @@ -202,6 +222,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table); return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, dscp_table, error); } @@ -214,6 +235,7 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table); return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, vlan_table, error); } @@ -227,6 +249,7 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority); return RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); } @@ -239,6 +262,7 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id); return RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); } @@ -252,6 +276,7 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto); return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); } @@ -264,6 +289,7 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask); return RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); } @@ -278,6 +304,7 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_stats_read(port_id, mtr_id, stats, stats_mask, clear); return RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 5aab81dcbd..767dbfebc5 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -471,6 +471,25 @@ 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_update; + __rte_mtr_trace_meter_policy_validate; + __rte_mtr_trace_meter_profile_add; + __rte_mtr_trace_meter_profile_delete; + __rte_mtr_trace_meter_profile_update; + __rte_mtr_trace_meter_vlan_table_update; + __rte_mtr_trace_stats_read; + __rte_mtr_trace_stats_update; }; INTERNAL { -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v2 4/4] ethdev: add trace points for tm 2022-09-29 10:29 ` [PATCH v2 0/4] add trace points in ethdev library Ankur Dwivedi ` (2 preceding siblings ...) 2022-09-29 10:29 ` [PATCH v2 3/4] ethdev: add trace points for mtr Ankur Dwivedi @ 2022-09-29 10:29 ` Ankur Dwivedi 2022-10-06 7:10 ` [PATCH v2 0/4] add trace points in ethdev library Andrew Rybchenko 2022-10-06 15:18 ` [PATCH v3 " Ankur Dwivedi 5 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-09-29 10:29 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 90 ++++++++++ lib/ethdev/rte_ethdev_trace.h | 283 +++++++++++++++++++++++++++++++ lib/ethdev/rte_tm.c | 40 +++++ lib/ethdev/version.map | 30 ++++ 4 files changed, 443 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 4fe1b10979..9527b413e5 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -638,3 +638,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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 15d541ac0b..306b471e58 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1867,6 +1868,288 @@ RTE_TRACE_POINT( rte_trace_point_emit_u32(priority); ) +RTE_TRACE_POINT( + rte_tm_trace_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_tm_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +RTE_TRACE_POINT( + rte_tm_trace_get_number_of_leaf_nodes, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t n_leaf_nodes, + struct rte_tm_error *error), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(n_leaf_nodes); + rte_trace_point_emit_int(error->type); + rte_trace_point_emit_string(error->message); +) + +RTE_TRACE_POINT( + rte_tm_trace_hierarchy_commit, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int clear_on_fail), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(clear_on_fail); +) + +RTE_TRACE_POINT( + rte_tm_trace_level_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t level_id, + struct rte_tm_level_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(level_id); + rte_trace_point_emit_ptr(cap); +) + +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), + 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( + rte_tm_trace_mark_ip_ecn, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red), + 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( + rte_tm_trace_mark_vlan_dei, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red), + 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( + 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, + struct rte_tm_node_params *params), + 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( + rte_tm_trace_node_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + struct rte_tm_node_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(cap); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_int(cman); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +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), + 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( + rte_tm_trace_node_resume, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +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), + 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( + 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), + 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( + 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), + 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( + rte_tm_trace_node_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + struct rte_tm_node_stats *stats, + uint64_t *stats_mask, int clear), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_ptr(stats_mask); + rte_trace_point_emit_int(clear); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_u64(stats_mask); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_suspend, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_type_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + int *is_leaf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(is_leaf); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_wfq_weight_mode_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + int *wfq_weight_mode, uint32_t n_sp_priorities), + 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( + rte_tm_trace_node_wred_context_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t wred_profile_id), + 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( + rte_tm_trace_shaper_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id, + struct rte_tm_shaper_params *profile), + 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( + rte_tm_trace_shaper_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shaper_profile_id); +) + +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), + 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( + rte_tm_trace_shared_shaper_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_shaper_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_shaper_id); +) + +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), + 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( + rte_tm_trace_shared_wred_context_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_wred_context_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_wred_context_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_wred_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id, + struct rte_tm_wred_params *profile), + 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( + rte_tm_trace_wred_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(wred_profile_id); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..b0b43eacc0 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -6,6 +6,7 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +80,7 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes, error); return 0; } @@ -90,6 +92,7 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_type_get(port_id, node_id, is_leaf); return RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); } @@ -100,6 +103,7 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_capabilities_get(port_id, cap); return RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); } @@ -111,6 +115,7 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_level_capabilities_get(port_id, level_id, cap); return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); } @@ -122,6 +127,7 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_capabilities_get(port_id, node_id, cap); return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); } @@ -133,6 +139,7 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile); return RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); } @@ -143,6 +150,7 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id); return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); } @@ -154,6 +162,8 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_wred_context_add_update(port_id, shared_wred_context_id, + wred_profile_id); return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); } @@ -164,6 +174,7 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_wred_context_delete(port_id, shared_wred_context_id); return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); } @@ -175,6 +186,7 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile); return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); } @@ -185,6 +197,7 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id); return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); } @@ -196,6 +209,8 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id); return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); } @@ -206,6 +221,7 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id); return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); } @@ -221,6 +237,8 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params); return RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); @@ -232,6 +250,7 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_delete(port_id, node_id); return RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); } @@ -242,6 +261,7 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_suspend(port_id, node_id); return RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); } @@ -252,6 +272,7 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_resume(port_id, node_id); return RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); } @@ -262,6 +283,7 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail); return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); } @@ -275,6 +297,8 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight); return RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); } @@ -286,6 +310,7 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id); return RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); } @@ -298,6 +323,8 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shared_shaper_update(port_id, node_id, shared_shaper_id, + add); return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); } @@ -309,6 +336,7 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask); return RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); } @@ -321,6 +349,8 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, wfq_weight_mode, + n_sp_priorities); return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); } @@ -332,6 +362,7 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_cman_update(port_id, node_id, cman); return RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); } @@ -343,6 +374,7 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id); return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); } @@ -355,6 +387,9 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add); return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); } @@ -368,6 +403,8 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_stats_read(port_id, node_id, stats, stats_mask, + clear); return RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); } @@ -380,6 +417,7 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); } @@ -392,6 +430,7 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); } @@ -404,6 +443,7 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 767dbfebc5..b991b05d1e 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -490,6 +490,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 { -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v2 0/4] add trace points in ethdev library 2022-09-29 10:29 ` [PATCH v2 0/4] add trace points in ethdev library Ankur Dwivedi ` (3 preceding siblings ...) 2022-09-29 10:29 ` [PATCH v2 4/4] ethdev: add trace points for tm Ankur Dwivedi @ 2022-10-06 7:10 ` Andrew Rybchenko 2022-10-06 7:26 ` [EXT] " Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 " Ankur Dwivedi 5 siblings, 1 reply; 172+ messages in thread From: Andrew Rybchenko @ 2022-10-06 7:10 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On 9/29/22 13:29, Ankur Dwivedi wrote: > This series adds trace points for functions in the ethdev library. > The trace points are added in ethdev, flow, mtr and tm files. > > v2: > - Made rte_eth_trace_call_rx_callbacks and rte_eth_trace_call_tx_callbacks > as fastpath trace functions. > - Moved some trace functions call to the end to capture return value and > data. Looking at the patch series I still see many-many places where tracing happens on entry point. Intentional? > - Removed rte_eth_trace_tx_queue_setup as it is not required. > rte_ethdev_trace_txq_setup() is already present in > rte_eth_tx_queue_setup(). > - Removed trace in ethdev_driver.c > - Removed trace function check patch. > > Ankur Dwivedi (4): > ethdev: add trace points > ethdev: add trace points for flow > ethdev: add trace points for mtr > ethdev: add trace points for tm > > lib/ethdev/ethdev_private.c | 3 + > lib/ethdev/ethdev_trace_points.c | 699 ++++++++++ > lib/ethdev/rte_ethdev.c | 148 +++ > lib/ethdev/rte_ethdev_trace.h | 2062 ++++++++++++++++++++++++++++++ > lib/ethdev/rte_ethdev_trace_fp.h | 19 + > lib/ethdev/rte_flow.c | 54 + > lib/ethdev/rte_mtr.c | 27 + > lib/ethdev/rte_tm.c | 40 + > lib/ethdev/version.map | 232 ++++ > 9 files changed, 3284 insertions(+) > ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev library 2022-10-06 7:10 ` [PATCH v2 0/4] add trace points in ethdev library Andrew Rybchenko @ 2022-10-06 7:26 ` Ankur Dwivedi 2022-10-06 7:28 ` Andrew Rybchenko 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-06 7:26 UTC (permalink / raw) To: Andrew Rybchenko, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia Hi Andrew, >-----Original Message----- >From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >Sent: Thursday, October 6, 2022 12:40 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >jgrajcia@cisco.com >Subject: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev library > >External Email > >---------------------------------------------------------------------- >On 9/29/22 13:29, Ankur Dwivedi wrote: >> This series adds trace points for functions in the ethdev library. >> The trace points are added in ethdev, flow, mtr and tm files. >> >> v2: >> - Made rte_eth_trace_call_rx_callbacks and rte_eth_trace_call_tx_callbacks >> as fastpath trace functions. >> - Moved some trace functions call to the end to capture return value and >> data. > >Looking at the patch series I still see many-many places where tracing happens >on entry point. Intentional? Yes , because the return values are not there to be captured. > >> - Removed rte_eth_trace_tx_queue_setup as it is not required. >> rte_ethdev_trace_txq_setup() is already present in >> rte_eth_tx_queue_setup(). >> - Removed trace in ethdev_driver.c >> - Removed trace function check patch. >> >> Ankur Dwivedi (4): >> ethdev: add trace points >> ethdev: add trace points for flow >> ethdev: add trace points for mtr >> ethdev: add trace points for tm >> >> lib/ethdev/ethdev_private.c | 3 + >> lib/ethdev/ethdev_trace_points.c | 699 ++++++++++ >> lib/ethdev/rte_ethdev.c | 148 +++ >> lib/ethdev/rte_ethdev_trace.h | 2062 >++++++++++++++++++++++++++++++ >> lib/ethdev/rte_ethdev_trace_fp.h | 19 + >> lib/ethdev/rte_flow.c | 54 + >> lib/ethdev/rte_mtr.c | 27 + >> lib/ethdev/rte_tm.c | 40 + >> lib/ethdev/version.map | 232 ++++ >> 9 files changed, 3284 insertions(+) >> ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev library 2022-10-06 7:26 ` [EXT] " Ankur Dwivedi @ 2022-10-06 7:28 ` Andrew Rybchenko 2022-10-06 7:47 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Andrew Rybchenko @ 2022-10-06 7:28 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On 10/6/22 10:26, Ankur Dwivedi wrote: > Hi Andrew, > >> -----Original Message----- >> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >> Sent: Thursday, October 6, 2022 12:40 PM >> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >> ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >> linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >> mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >> evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >> Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >> hyonkim@cisco.com; liudongdong3@huawei.com; >> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >> Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda >> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi >> <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla >> <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >> Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >> viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >> spinler@cesnet.cz; chaoyong.he@corigine.com; >> niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >> sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >> sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody >> <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >> Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >> jianwang@trustnetic.com; jbehrens@vmware.com; >> maxime.coquelin@redhat.com; chenbo.xia@intel.com; >> steven.webster@windriver.com; matt.peters@windriver.com; >> bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >> jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >> jgrajcia@cisco.com >> Subject: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev library >> >> External Email >> >> ---------------------------------------------------------------------- >> On 9/29/22 13:29, Ankur Dwivedi wrote: >>> This series adds trace points for functions in the ethdev library. >>> The trace points are added in ethdev, flow, mtr and tm files. >>> >>> v2: >>> - Made rte_eth_trace_call_rx_callbacks and rte_eth_trace_call_tx_callbacks >>> as fastpath trace functions. >>> - Moved some trace functions call to the end to capture return value and >>> data. >> >> Looking at the patch series I still see many-many places where tracing happens >> on entry point. Intentional? > Yes , because the return values are not there to be captured. Isn't it the reason to move trace point to have return value there and capture it? >> >>> - Removed rte_eth_trace_tx_queue_setup as it is not required. >>> rte_ethdev_trace_txq_setup() is already present in >>> rte_eth_tx_queue_setup(). >>> - Removed trace in ethdev_driver.c >>> - Removed trace function check patch. >>> >>> Ankur Dwivedi (4): >>> ethdev: add trace points >>> ethdev: add trace points for flow >>> ethdev: add trace points for mtr >>> ethdev: add trace points for tm >>> >>> lib/ethdev/ethdev_private.c | 3 + >>> lib/ethdev/ethdev_trace_points.c | 699 ++++++++++ >>> lib/ethdev/rte_ethdev.c | 148 +++ >>> lib/ethdev/rte_ethdev_trace.h | 2062 >> ++++++++++++++++++++++++++++++ >>> lib/ethdev/rte_ethdev_trace_fp.h | 19 + >>> lib/ethdev/rte_flow.c | 54 + >>> lib/ethdev/rte_mtr.c | 27 + >>> lib/ethdev/rte_tm.c | 40 + >>> lib/ethdev/version.map | 232 ++++ >>> 9 files changed, 3284 insertions(+) >>> > ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev library 2022-10-06 7:28 ` Andrew Rybchenko @ 2022-10-06 7:47 ` Ankur Dwivedi 2022-10-06 12:55 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-06 7:47 UTC (permalink / raw) To: Andrew Rybchenko, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia >-----Original Message----- >From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >Sent: Thursday, October 6, 2022 12:59 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >jgrajcia@cisco.com >Subject: Re: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev library > >On 10/6/22 10:26, Ankur Dwivedi wrote: >> Hi Andrew, >> >>> -----Original Message----- >>> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >>> Sent: Thursday, October 6, 2022 12:40 PM >>> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >>> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >>> ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >>> linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >>> mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >>> evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh >>> <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >>> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >>> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin >Jacob >>> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >>> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >>> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >>> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; >>> johndale@cisco.com; hyonkim@cisco.com; liudongdong3@huawei.com; >>> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >>> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >>> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >>> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >>> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; >>> Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar >>> Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori >>> <skori@marvell.com>; Satha Koteswara Rao Kottidi >>> <skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >>> zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >>> Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara >>> <sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >>> sthemmin@microsoft.com; longli@microsoft.com; spinler@cesnet.cz; >>> chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >>> hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; >g.singh@nxp.com; >>> apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >>> Rasesh Mody <rmody@marvell.com>; Shahed Shaikh >>> <shshaikh@marvell.com>; Devendra Singh Rawat >>> <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >>> jianwang@trustnetic.com; jbehrens@vmware.com; >>> maxime.coquelin@redhat.com; chenbo.xia@intel.com; >>> steven.webster@windriver.com; matt.peters@windriver.com; >>> bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >>> jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >>> jgrajcia@cisco.com >>> Subject: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev library >>> >>> External Email >>> >>> --------------------------------------------------------------------- >>> - On 9/29/22 13:29, Ankur Dwivedi wrote: >>>> This series adds trace points for functions in the ethdev library. >>>> The trace points are added in ethdev, flow, mtr and tm files. >>>> >>>> v2: >>>> - Made rte_eth_trace_call_rx_callbacks and >rte_eth_trace_call_tx_callbacks >>>> as fastpath trace functions. >>>> - Moved some trace functions call to the end to capture return value and >>>> data. >>> >>> Looking at the patch series I still see many-many places where >>> tracing happens on entry point. Intentional? >> Yes , because the return values are not there to be captured. > >Isn't it the reason to move trace point to have return value there and capture >it? [Ankur] For some function the return value was there to be captured. But for some functions the return values are not possible to get unless some more changes are made in code, like the rte_eth_rx_metadata_negotiate() you mentioned in earlier mail. I have not modified the existing code of library, just added trace to capture what can be captured. > >>> >>>> - Removed rte_eth_trace_tx_queue_setup as it is not required. >>>> rte_ethdev_trace_txq_setup() is already present in >>>> rte_eth_tx_queue_setup(). >>>> - Removed trace in ethdev_driver.c >>>> - Removed trace function check patch. >>>> >>>> Ankur Dwivedi (4): >>>> ethdev: add trace points >>>> ethdev: add trace points for flow >>>> ethdev: add trace points for mtr >>>> ethdev: add trace points for tm >>>> >>>> lib/ethdev/ethdev_private.c | 3 + >>>> lib/ethdev/ethdev_trace_points.c | 699 ++++++++++ >>>> lib/ethdev/rte_ethdev.c | 148 +++ >>>> lib/ethdev/rte_ethdev_trace.h | 2062 >>> ++++++++++++++++++++++++++++++ >>>> lib/ethdev/rte_ethdev_trace_fp.h | 19 + >>>> lib/ethdev/rte_flow.c | 54 + >>>> lib/ethdev/rte_mtr.c | 27 + >>>> lib/ethdev/rte_tm.c | 40 + >>>> lib/ethdev/version.map | 232 ++++ >>>> 9 files changed, 3284 insertions(+) >>>> >> ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev library 2022-10-06 7:47 ` Ankur Dwivedi @ 2022-10-06 12:55 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-06 12:55 UTC (permalink / raw) To: Andrew Rybchenko, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia Hi Andrew, >-----Original Message----- >From: Ankur Dwivedi >Sent: Thursday, October 6, 2022 1:18 PM >To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org >Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >jgrajcia@cisco.com >Subject: RE: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev library > > > >>-----Original Message----- >>From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >>Sent: Thursday, October 6, 2022 12:59 PM >>To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >>Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >>ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >>linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >>mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >>evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh >><irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >>ed.czeck@atomicrules.com; john.miller@atomicrules.com; >>ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >>Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >>Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; >johndale@cisco.com; >>hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; >>xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; >>zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; >>qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; >>xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; >>rosen.xu@intel.com; Nithin Kumar Dabilpuram ><ndabilpuram@marvell.com>; >>Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori >><skori@marvell.com>; Satha Koteswara Rao Kottidi >><skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >>zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >>Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara >><sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >>sthemmin@microsoft.com; longli@microsoft.com; spinler@cesnet.cz; >>chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >>hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; >>apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >>Rasesh Mody <rmody@marvell.com>; Shahed Shaikh ><shshaikh@marvell.com>; >>Devendra Singh Rawat <dsinghrawat@marvell.com>; >>jiawenwu@trustnetic.com; jianwang@trustnetic.com; >jbehrens@vmware.com; >>maxime.coquelin@redhat.com; chenbo.xia@intel.com; >>steven.webster@windriver.com; matt.peters@windriver.com; >>bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >>jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >>jgrajcia@cisco.com >>Subject: Re: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev >>library >> >>On 10/6/22 10:26, Ankur Dwivedi wrote: >>> Hi Andrew, >>> >>>> -----Original Message----- >>>> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> >>>> Sent: Thursday, October 6, 2022 12:40 PM >>>> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >>>> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >>>> ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >>>> linville@tuxdriver.com; ciara.loftus@intel.com; >>>> qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; >>>> shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; >>>> chandu@amd.com; Igor >>Russkikh >>>> <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >>>> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >>>> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin >>Jacob >>>> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >>>> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >>>> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >>>> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; >>>> johndale@cisco.com; hyonkim@cisco.com; liudongdong3@huawei.com; >>>> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >>>> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >>>> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >>>> Yuying.Zhang@intel.com; beilei.xing@intel.com; >>>> xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; >>>> rosen.xu@intel.com; Nithin Kumar Dabilpuram >>>> <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda >>>> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; >>>> Satha Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi >>>> <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla >>>> <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >>>> Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >>>> viacheslavo@nvidia.com; sthemmin@microsoft.com; >>>> longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; >>>> niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >>>> sachin.saxena@oss.nxp.com; >>g.singh@nxp.com; >>>> apeksha.gupta@nxp.com; sachin.saxena@nxp.com; >aboyer@pensando.io; >>>> Rasesh Mody <rmody@marvell.com>; Shahed Shaikh >>>> <shshaikh@marvell.com>; Devendra Singh Rawat >>>> <dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >>>> jianwang@trustnetic.com; jbehrens@vmware.com; >>>> maxime.coquelin@redhat.com; chenbo.xia@intel.com; >>>> steven.webster@windriver.com; matt.peters@windriver.com; >>>> bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >>>> jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >>>> jgrajcia@cisco.com >>>> Subject: [EXT] Re: [PATCH v2 0/4] add trace points in ethdev library >>>> >>>> External Email >>>> >>>> -------------------------------------------------------------------- >>>> - >>>> - On 9/29/22 13:29, Ankur Dwivedi wrote: >>>>> This series adds trace points for functions in the ethdev library. >>>>> The trace points are added in ethdev, flow, mtr and tm files. >>>>> >>>>> v2: >>>>> - Made rte_eth_trace_call_rx_callbacks and >>rte_eth_trace_call_tx_callbacks >>>>> as fastpath trace functions. >>>>> - Moved some trace functions call to the end to capture return value >and >>>>> data. >>>> >>>> Looking at the patch series I still see many-many places where >>>> tracing happens on entry point. Intentional? >>> Yes , because the return values are not there to be captured. >> >>Isn't it the reason to move trace point to have return value there and >>capture it? >[Ankur] For some function the return value was there to be captured. But for >some functions the return values are not possible to get unless some more >changes are made in code, like the rte_eth_rx_metadata_negotiate() you >mentioned in earlier mail. I have not modified the existing code of library, just >added trace to capture what can be captured. [Ankur] Identified few more functions for which trace can be shift towards the end of a function. Will send the changes in v3. >> >>>> >>>>> - Removed rte_eth_trace_tx_queue_setup as it is not required. >>>>> rte_ethdev_trace_txq_setup() is already present in >>>>> rte_eth_tx_queue_setup(). >>>>> - Removed trace in ethdev_driver.c >>>>> - Removed trace function check patch. >>>>> >>>>> Ankur Dwivedi (4): >>>>> ethdev: add trace points >>>>> ethdev: add trace points for flow >>>>> ethdev: add trace points for mtr >>>>> ethdev: add trace points for tm >>>>> >>>>> lib/ethdev/ethdev_private.c | 3 + >>>>> lib/ethdev/ethdev_trace_points.c | 699 ++++++++++ >>>>> lib/ethdev/rte_ethdev.c | 148 +++ >>>>> lib/ethdev/rte_ethdev_trace.h | 2062 >>>> ++++++++++++++++++++++++++++++ >>>>> lib/ethdev/rte_ethdev_trace_fp.h | 19 + >>>>> lib/ethdev/rte_flow.c | 54 + >>>>> lib/ethdev/rte_mtr.c | 27 + >>>>> lib/ethdev/rte_tm.c | 40 + >>>>> lib/ethdev/version.map | 232 ++++ >>>>> 9 files changed, 3284 insertions(+) >>>>> >>> ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v3 0/4] add trace points in ethdev library 2022-09-29 10:29 ` [PATCH v2 0/4] add trace points in ethdev library Ankur Dwivedi ` (4 preceding siblings ...) 2022-10-06 7:10 ` [PATCH v2 0/4] add trace points in ethdev library Andrew Rybchenko @ 2022-10-06 15:18 ` Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi ` (4 more replies) 5 siblings, 5 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-06 15:18 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, 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. 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 (4): ethdev: add trace points ethdev: add trace points for flow ethdev: add trace points for mtr ethdev: add trace points for tm lib/ethdev/ethdev_private.c | 3 + lib/ethdev/ethdev_trace_points.c | 699 ++++++++++ lib/ethdev/rte_ethdev.c | 152 +++ lib/ethdev/rte_ethdev_trace.h | 2087 ++++++++++++++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 19 + lib/ethdev/rte_flow.c | 54 + lib/ethdev/rte_mtr.c | 27 + lib/ethdev/rte_tm.c | 40 + lib/ethdev/version.map | 232 ++++ 9 files changed, 3313 insertions(+) -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v3 1/4] ethdev: add trace points 2022-10-06 15:18 ` [PATCH v3 " Ankur Dwivedi @ 2022-10-06 15:18 ` Ankur Dwivedi 2022-10-06 16:03 ` Morten Brørup ` (3 more replies) 2022-10-06 15:18 ` [PATCH v3 2/4] ethdev: add trace points for flow Ankur Dwivedi ` (3 subsequent siblings) 4 siblings, 4 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-06 15:18 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Add trace points for ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_private.c | 3 + lib/ethdev/ethdev_trace_points.c | 435 +++++++++++ lib/ethdev/rte_ethdev.c | 152 ++++ lib/ethdev/rte_ethdev_trace.h | 1194 ++++++++++++++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 19 + lib/ethdev/version.map | 144 ++++ 6 files changed, 1947 insertions(+) diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index 48090c879a..08e7f49fd8 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.h" #include "ethdev_driver.h" #include "ethdev_private.h" @@ -297,6 +298,7 @@ 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, nb_rx, nb_pkts); return nb_rx; } @@ -312,6 +314,7 @@ 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, nb_pkts); return nb_pkts; } diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2919409a15..2c06b47b7f 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -29,3 +29,438 @@ 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_add_first_rx_callback, + lib.ethdev.add_first_rx_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_rx_callback, + lib.ethdev.add_rx_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_tx_callback, + lib.ethdev.add_tx_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_disable, + lib.ethdev.allmulticast_disable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_enable, + lib.ethdev.allmulticast_enable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_get, + lib.ethdev.allmulticast_get) + +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_ethdev_trace_set_mtu, + lib.ethdev.set_mtu) + +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_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_default_mac_addr_set, + lib.ethdev.default_mac_addr_set) + +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_fw_version_get, + lib.ethdev.fw_version_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_dcb_info, + lib.ethdev.get_dcb_info) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom, + lib.ethdev.get_eeprom) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom_length, + lib.ethdev.get_eeprom_length) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_mtu, + lib.ethdev.get_mtu) + +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_get_reg_info, + lib.ethdev.get_reg_info) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_sec_ctx, + lib.ethdev.get_sec_ctx) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_supported_ptypes, + lib.ethdev.get_supported_ptypes) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_vlan_offload, + lib.ethdev.get_vlan_offload) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_info_get, + lib.ethdev.info_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_removed, + lib.ethdev.is_removed) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_valid_port, + lib.ethdev.is_valid_port) + +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_pool_ops_supported, + lib.ethdev.pool_ops_supported) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_set, + lib.ethdev.priority_flow_ctrl_set) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_reset, + lib.ethdev.reset) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_conf_get, + lib.ethdev.rss_hash_conf_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_update, + lib.ethdev.rss_hash_update) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_query, + lib.ethdev.rss_reta_query) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_update, + lib.ethdev.rss_reta_update) + +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, + lib.ethdev.rx_intr_ctl_q) + +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_disable, + lib.ethdev.rx_intr_disable) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_enable, + lib.ethdev.rx_intr_enable) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_offload_name, + lib.ethdev.rx_offload_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_set_eeprom, + lib.ethdev.set_eeprom) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_down, + lib.ethdev.set_link_down) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_up, + lib.ethdev.set_link_up) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_mc_addr_list, + lib.ethdev.set_mc_addr_list) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_ptypes, + lib.ethdev.set_ptypes) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + lib.ethdev.set_rx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_tx_queue_stats_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +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_set_vlan_pvid, + lib.ethdev.set_vlan_pvid) + +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_socket_id, + lib.ethdev.socket_id) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_tx_offload_name, + lib.ethdev.tx_offload_name) + +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_ethdev_trace_uc_all_hash_table_set, + lib.ethdev.uc_all_hash_table_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_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_ethdev_trace_vlan_filter, + lib.ethdev.vlan_filter) + +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_owned_by, + lib.ethdev.find_next_owned_by) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_find_next_sibling, + lib.ethdev.find_next_sibling) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_iterator_cleanup, + lib.ethdev.iterator_cleanup) + +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_led_off, + lib.ethdev.led_off) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_led_on, + lib.ethdev.led_on) + +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_macaddr_get, + lib.ethdev.macaddr_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_disable, + lib.ethdev.promiscuous_disable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_enable, + lib.ethdev.promiscuous_enable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_get, + lib.ethdev.promiscuous_get) + +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_burst_mode_get, + lib.ethdev.rx_burst_mode_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_info_get, + lib.ethdev.rx_queue_info_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_setup, + lib.ethdev.rx_queue_setup) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_set_queue_rate_limit, + lib.ethdev.set_queue_rate_limit) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_speed_bitflag, + lib.ethdev.speed_bitflag) + +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_timesync_adjust_time, + lib.ethdev.timesync_adjust_time) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_disable, + lib.ethdev.timesync_disable) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_enable, + lib.ethdev.timesync_enable) + +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_time, + lib.ethdev.timesync_read_time) + +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_write_time, + lib.ethdev.timesync_write_time) + +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_drop_callback, + lib.ethdev.tx_buffer_drop_callback) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_buffer_init, + lib.ethdev.tx_buffer_init) + +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_burst_mode_get, + lib.ethdev.tx_burst_mode_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_done_cleanup, + lib.ethdev.tx_done_cleanup) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_queue_info_get, + lib.ethdev.tx_queue_info_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get, + lib.ethdev.xstats_get) + +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_id_by_name, + lib.ethdev.xstats_get_id_by_name) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get_names, + lib.ethdev.xstats_get_names) + +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_reset, + lib.ethdev.xstats_reset) + +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_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_get_module_eeprom, + lib.ethdev.get_module_eeprom) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_module_info, + lib.ethdev.get_module_info) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_read_clock, + lib.ethdev.read_clock) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_hairpin_capability_get, + lib.ethdev.hairpin_capability_get) + +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_get_peer_ports, + lib.ethdev.hairpin_get_peer_ports) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_unbind, + lib.ethdev.hairpin_unbind) + +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_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_eth_trace_get_monitor_addr, + lib.ethdev.get_monitor_addr) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_representor_info_get, + lib.ethdev.representor_info_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_capability_name, + lib.ethdev.capability_name) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_conf_get, + lib.ethdev.conf_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_macaddrs_get, + lib.ethdev.macaddrs_get) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_metadata_negotiate, + lib.ethdev.rx_metadata_negotiate) + +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_priority_flow_ctrl_queue_info_get, + lib.ethdev.priority_flow_ctrl_queue_info_get) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priv_dump, + lib.ethdev.priv_dump) + +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_rx_avail_thresh_query, + lib.ethdev.rx_avail_thresh_query) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set, + lib.ethdev.rx_avail_thresh_set) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 01c141a039..f66d3ecd0a 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -182,6 +182,8 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str) memset(iter, 0, sizeof(*iter)); memset(&devargs, 0, sizeof(devargs)); + rte_eth_trace_iterator_init(iter, devargs_str); + /* * The devargs string may use various syntaxes: * - 0000:08:00.0,representor=[1-3] @@ -283,6 +285,8 @@ rte_eth_iterator_next(struct rte_dev_iterator *iter) if (iter->cls == NULL) /* invalid ethdev iterator */ return RTE_MAX_ETHPORTS; + rte_eth_trace_iterator_next(iter); + do { /* loop to try all matching rte_device */ /* If not pure ethdev filter and */ if (iter->bus != NULL && @@ -316,6 +320,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); 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 +336,7 @@ 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,6 +357,7 @@ 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; } @@ -358,6 +365,7 @@ 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); return rte_eth_find_next_of(port_id, rte_eth_devices[ref_port_id].device); } @@ -371,6 +379,7 @@ eth_dev_is_allocated(const struct rte_eth_dev *ethdev) int rte_eth_dev_is_valid_port(uint16_t port_id) { + rte_ethdev_trace_is_valid_port(port_id); if (port_id >= RTE_MAX_ETHPORTS || (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)) return 0; @@ -395,6 +404,7 @@ 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 +423,7 @@ 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 +487,7 @@ 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 +505,7 @@ 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 +539,7 @@ 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 +569,7 @@ 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; } @@ -562,6 +577,7 @@ int rte_eth_dev_socket_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); + rte_ethdev_trace_socket_id(port_id); return rte_eth_devices[port_id].data->numa_node; } @@ -569,6 +585,7 @@ void * rte_eth_dev_get_sec_ctx(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL); + rte_ethdev_trace_get_sec_ctx(port_id); return rte_eth_devices[port_id].security_ctx; } @@ -583,6 +600,7 @@ rte_eth_dev_count_avail(void) RTE_ETH_FOREACH_DEV(p) count++; + rte_ethdev_trace_count_avail(count); return count; } @@ -594,6 +612,7 @@ rte_eth_dev_count_total(void) RTE_ETH_FOREACH_VALID_DEV(port) count++; + rte_ethdev_trace_count_total(count); return count; } @@ -614,6 +633,7 @@ 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; } @@ -636,6 +656,7 @@ 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; } @@ -737,6 +758,7 @@ rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) return 0; } + rte_ethdev_trace_rx_queue_start(port_id, rx_queue_id); return eth_err(port_id, dev->dev_ops->rx_queue_start(dev, rx_queue_id)); } @@ -770,6 +792,7 @@ rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) return 0; } + rte_ethdev_trace_rx_queue_stop(port_id, rx_queue_id); return eth_err(port_id, dev->dev_ops->rx_queue_stop(dev, rx_queue_id)); } @@ -810,6 +833,7 @@ rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) return 0; } + rte_ethdev_trace_tx_queue_start(port_id, tx_queue_id); return eth_err(port_id, dev->dev_ops->tx_queue_start(dev, tx_queue_id)); } @@ -843,12 +867,14 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) return 0; } + rte_ethdev_trace_tx_queue_stop(port_id, tx_queue_id); return eth_err(port_id, dev->dev_ops->tx_queue_stop(dev, tx_queue_id)); } uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex) { + rte_eth_trace_speed_bitflag(speed, duplex); switch (speed) { case RTE_ETH_SPEED_NUM_10M: return duplex ? RTE_ETH_LINK_SPEED_10M : RTE_ETH_LINK_SPEED_10M_HD; @@ -894,6 +920,7 @@ rte_eth_dev_rx_offload_name(uint64_t offload) } } + rte_ethdev_trace_rx_offload_name(offload, name); return name; } @@ -910,6 +937,7 @@ rte_eth_dev_tx_offload_name(uint64_t offload) } } + rte_ethdev_trace_tx_offload_name(offload, name); return name; } @@ -926,6 +954,7 @@ rte_eth_dev_capability_name(uint64_t capability) } } + rte_ethdev_trace_capability_name(capability, name); return name; } @@ -1552,6 +1581,7 @@ rte_eth_dev_set_link_up(uint16_t port_id) if (*dev->dev_ops->dev_set_link_up == NULL) return -ENOTSUP; + rte_ethdev_trace_set_link_up(port_id); return eth_err(port_id, (*dev->dev_ops->dev_set_link_up)(dev)); } @@ -1565,6 +1595,7 @@ rte_eth_dev_set_link_down(uint16_t port_id) if (*dev->dev_ops->dev_set_link_down == NULL) return -ENOTSUP; + rte_ethdev_trace_set_link_down(port_id); return eth_err(port_id, (*dev->dev_ops->dev_set_link_down)(dev)); } @@ -1621,6 +1652,7 @@ rte_eth_dev_reset(uint16_t port_id) port_id, rte_strerror(-ret)); } ret = dev->dev_ops->dev_reset(dev); + rte_ethdev_trace_reset(port_id, ret); return eth_err(port_id, ret); } @@ -1645,6 +1677,7 @@ 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; } @@ -1984,6 +2017,8 @@ 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; + rte_eth_trace_rx_hairpin_queue_setup(port_id, rx_queue_id, nb_rx_desc, + conf, ret); return eth_err(port_id, ret); } @@ -2151,6 +2186,7 @@ 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; + rte_eth_trace_tx_hairpin_queue_setup(port_id, tx_queue_id, nb_tx_desc, conf, ret); return eth_err(port_id, ret); } @@ -2176,6 +2212,7 @@ 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; } @@ -2201,6 +2238,7 @@ 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; } @@ -2237,6 +2275,7 @@ 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; } @@ -2244,6 +2283,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); rte_pktmbuf_free_bulk(pkts, unsent); } @@ -2255,6 +2295,7 @@ 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(pkts, unsent, *count); } int @@ -2267,6 +2308,7 @@ rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer, return -EINVAL; } + rte_eth_trace_tx_buffer_set_err_callback(buffer, cbfn, userdata); buffer->error_callback = cbfn; buffer->error_userdata = userdata; return 0; @@ -2288,6 +2330,7 @@ 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; } @@ -2306,6 +2349,7 @@ 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); + rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt, ret); return eth_err(port_id, ret); } @@ -2327,6 +2371,7 @@ rte_eth_promiscuous_enable(uint16_t port_id) diag = (*dev->dev_ops->promiscuous_enable)(dev); dev->data->promiscuous = (diag == 0) ? 1 : 0; + rte_eth_trace_promiscuous_enable(port_id, dev->data->promiscuous); return eth_err(port_id, diag); } @@ -2350,6 +2395,7 @@ rte_eth_promiscuous_disable(uint16_t port_id) if (diag != 0) dev->data->promiscuous = 1; + rte_eth_trace_promiscuous_disable(port_id, dev->data->promiscuous); return eth_err(port_id, diag); } @@ -2361,6 +2407,7 @@ 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; } @@ -2381,6 +2428,7 @@ rte_eth_allmulticast_enable(uint16_t port_id) diag = (*dev->dev_ops->allmulticast_enable)(dev); dev->data->all_multicast = (diag == 0) ? 1 : 0; + rte_eth_trace_allmulticast_enable(port_id, dev->data->all_multicast); return eth_err(port_id, diag); } @@ -2403,6 +2451,7 @@ rte_eth_allmulticast_disable(uint16_t port_id) if (diag != 0) dev->data->all_multicast = 1; + rte_eth_trace_allmulticast_disable(port_id, dev->data->all_multicast); return eth_err(port_id, diag); } @@ -2414,6 +2463,7 @@ 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; } @@ -2440,6 +2490,7 @@ 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; } @@ -2466,12 +2517,14 @@ 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) { + rte_eth_trace_link_speed_to_str(link_speed); switch (link_speed) { case RTE_ETH_SPEED_NUM_NONE: return "None"; case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; @@ -2511,6 +2564,7 @@ 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(str, len, eth_link); if (eth_link->link_status == RTE_ETH_LINK_DOWN) return snprintf(str, len, "Link down"); else @@ -2541,6 +2595,7 @@ 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; + rte_eth_trace_stats_get(port_id, stats); return eth_err(port_id, (*dev->dev_ops->stats_get)(dev, stats)); } @@ -2561,6 +2616,7 @@ rte_eth_stats_reset(uint16_t port_id) dev->data->rx_mbuf_alloc_failed = 0; + rte_eth_trace_stats_reset(port_id); return 0; } @@ -2625,6 +2681,7 @@ rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, return -ENOMEM; } + rte_eth_trace_xstats_get_id_by_name(port_id, xstat_name, id); /* Get count */ cnt_xstats = rte_eth_xstats_get_names_by_id(port_id, NULL, 0, NULL); if (cnt_xstats < 0) { @@ -2797,6 +2854,8 @@ 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); @@ -2836,6 +2895,7 @@ rte_eth_xstats_get_names(uint16_t port_id, cnt_used_entries += cnt_driver_entries; } + rte_eth_trace_xstats_get_names(port_id, xstats_names, size, cnt_used_entries); return cnt_used_entries; } @@ -2985,6 +3045,7 @@ 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; } @@ -3032,6 +3093,8 @@ 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], i); return count + xcount; } @@ -3044,6 +3107,7 @@ rte_eth_xstats_reset(uint16_t port_id) RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; + rte_eth_trace_xstats_reset(port_id); /* implemented by the driver */ if (dev->dev_ops->xstats_reset != NULL) return eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev)); @@ -3079,6 +3143,8 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) { + rte_ethdev_trace_set_tx_queue_stats_mapping(port_id, tx_queue_id, + stat_idx); return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id, tx_queue_id, stat_idx, STAT_QMAP_TX)); @@ -3088,6 +3154,8 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) { + rte_ethdev_trace_set_rx_queue_stats_mapping(port_id, rx_queue_id, + stat_idx); return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id, rx_queue_id, stat_idx, STAT_QMAP_RX)); @@ -3110,6 +3178,7 @@ 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; + rte_ethdev_trace_fw_version_get(port_id, fw_version, fw_size); return eth_err(port_id, (*dev->dev_ops->fw_version_get)(dev, fw_version, fw_size)); } @@ -3171,6 +3240,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); return 0; } @@ -3191,6 +3261,7 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct rte_eth_conf)); + rte_ethdev_trace_conf_get(port_id, dev_conf); return 0; } @@ -3226,6 +3297,7 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, j++; } + rte_ethdev_trace_get_supported_ptypes(port_id, ptype_mask, ptypes, num, j); return j; } @@ -3310,6 +3382,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, if (set_ptypes != NULL && j < num) set_ptypes[j] = RTE_PTYPE_UNKNOWN; + rte_ethdev_trace_set_ptypes(port_id, ptype_mask, set_ptypes, num); return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask); ptype_unknown: @@ -3341,6 +3414,7 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, num = RTE_MIN(dev_info.max_mac_addrs, num); memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); + rte_eth_trace_macaddrs_get(port_id, ma, num); return num; } @@ -3359,6 +3433,7 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) return -EINVAL; } + rte_eth_trace_macaddr_get(port_id, mac_addr); rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); return 0; @@ -3379,6 +3454,7 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + rte_ethdev_trace_get_mtu(port_id, *mtu); return 0; } @@ -3421,6 +3497,7 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; + rte_ethdev_trace_set_mtu(port_id, mtu, ret); return eth_err(port_id, ret); } @@ -3464,6 +3541,7 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) vfc->ids[vidx] &= ~RTE_BIT64(vbit); } + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); return eth_err(port_id, ret); } @@ -3483,6 +3561,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, if (*dev->dev_ops->vlan_strip_queue_set == NULL) return -ENOTSUP; + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); return 0; @@ -3500,6 +3579,7 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, if (*dev->dev_ops->vlan_tpid_set == NULL) return -ENOTSUP; + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid); return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, tpid)); } @@ -3593,6 +3673,7 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) dev->data->dev_conf.rxmode.offloads = orig_offloads; } + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); return eth_err(port_id, ret); } @@ -3619,6 +3700,7 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); return ret; } @@ -3632,6 +3714,7 @@ rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) if (*dev->dev_ops->vlan_pvid_set == NULL) return -ENOTSUP; + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on); return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); } @@ -3653,6 +3736,7 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_get == NULL) return -ENOTSUP; memset(fc_conf, 0, sizeof(*fc_conf)); + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf); return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); } @@ -3678,6 +3762,7 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_set == NULL) return -ENOTSUP; + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf); return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); } @@ -3702,6 +3787,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, return -EINVAL; } + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf); /* High water, low water validation are device specific */ if (*dev->dev_ops->priority_flow_ctrl_set) return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) @@ -3774,6 +3860,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, pfc_queue_info); if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); @@ -3845,6 +3932,8 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, return ret; } + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf); if (*dev->dev_ops->priority_flow_ctrl_queue_config) return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_config)( @@ -3940,6 +4029,7 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, if (*dev->dev_ops->reta_update == NULL) return -ENOTSUP; + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size); return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, reta_size)); } @@ -3969,6 +4059,7 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, if (*dev->dev_ops->reta_query == NULL) return -ENOTSUP; + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size); return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, reta_size)); } @@ -4014,6 +4105,7 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, if (*dev->dev_ops->rss_hash_update == NULL) return -ENOTSUP; + rte_ethdev_trace_rss_hash_update(port_id, rss_conf); return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, rss_conf)); } @@ -4036,6 +4128,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, if (*dev->dev_ops->rss_hash_conf_get == NULL) return -ENOTSUP; + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf); return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, rss_conf)); } @@ -4063,6 +4156,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_add == NULL) return -ENOTSUP; + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel); return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel)); } @@ -4090,6 +4184,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_del == NULL) return -ENOTSUP; + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel); return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel)); } @@ -4104,6 +4199,7 @@ rte_eth_led_on(uint16_t port_id) if (*dev->dev_ops->dev_led_on == NULL) return -ENOTSUP; + rte_eth_trace_led_on(port_id); return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); } @@ -4117,6 +4213,7 @@ rte_eth_led_off(uint16_t port_id) if (*dev->dev_ops->dev_led_off == NULL) return -ENOTSUP; + rte_eth_trace_led_off(port_id); return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); } @@ -4142,6 +4239,7 @@ rte_eth_fec_get_capability(uint16_t port_id, return -ENOTSUP; ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, num); + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); return ret; } @@ -4162,6 +4260,7 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) if (*dev->dev_ops->fec_get == NULL) return -ENOTSUP; + rte_eth_trace_fec_get(port_id, fec_capa); return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); } @@ -4175,6 +4274,7 @@ rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) if (*dev->dev_ops->fec_set == NULL) return -ENOTSUP; + rte_eth_trace_fec_set(port_id, fec_capa); return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); } @@ -4252,6 +4352,7 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, return 0; } + rte_ethdev_trace_mac_addr_add(port_id, addr, pool); /* Update NIC */ ret = (*dev->dev_ops->mac_addr_add)(dev, addr, index, pool); @@ -4294,6 +4395,7 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) } else if (index < 0) return 0; /* Do nothing if address wasn't found */ + rte_ethdev_trace_mac_addr_remove(port_id, addr); /* Update NIC */ (*dev->dev_ops->mac_addr_remove)(dev, index); @@ -4329,6 +4431,7 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) return -ENOTSUP; ret = (*dev->dev_ops->mac_addr_set)(dev, addr); + rte_ethdev_trace_default_mac_addr_set(port_id, addr, ret); if (ret < 0) return ret; @@ -4415,6 +4518,7 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, if (*dev->dev_ops->uc_hash_table_set == NULL) return -ENOTSUP; ret = (*dev->dev_ops->uc_hash_table_set)(dev, addr, on); + rte_ethdev_trace_uc_hash_table_set(port_id, addr, on, ret); if (ret == 0) { /* Update address in NIC data structure */ if (on) @@ -4438,6 +4542,7 @@ rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) if (*dev->dev_ops->uc_all_hash_table_set == NULL) return -ENOTSUP; + rte_ethdev_trace_uc_all_hash_table_set(port_id, on); return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, on)); } @@ -4475,6 +4580,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (*dev->dev_ops->set_queue_rate_limit == NULL) return -ENOTSUP; + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate); return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate)); } @@ -4502,6 +4608,7 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, } if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) return -ENOTSUP; + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh); return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, queue_id, avail_thresh)); } @@ -4521,6 +4628,7 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) return -ENOTSUP; + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id); return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, avail_thresh)); } @@ -4570,6 +4678,9 @@ rte_eth_dev_callback_register(uint16_t port_id, next_port = last_port = port_id; } + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, next_port, + last_port); + rte_spinlock_lock(ð_dev_cb_lock); do { @@ -4665,6 +4776,7 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, ret); return ret; } @@ -4694,6 +4806,7 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { vec = rte_intr_vec_list_index_get(intr_handle, qid); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + rte_ethdev_trace_rx_intr_ctl(port_id, epfd, op, data, rc); if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -4737,6 +4850,7 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); return fd; } @@ -4770,6 +4884,7 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, vec = rte_intr_vec_list_index_get(intr_handle, queue_id); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -4796,6 +4911,7 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_enable == NULL) return -ENOTSUP; + rte_ethdev_trace_rx_intr_enable(port_id, queue_id); return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); } @@ -4815,6 +4931,7 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_disable == NULL) return -ENOTSUP; + rte_ethdev_trace_rx_intr_disable(port_id, queue_id); return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); } @@ -4873,6 +4990,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, cb); return cb; } @@ -4912,6 +5030,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, cb, __ATOMIC_RELEASE); rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param, cb); return cb; } @@ -4971,6 +5090,7 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, cb); return cb; } @@ -5005,6 +5125,7 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); return ret; } @@ -5039,6 +5160,7 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); return ret; } @@ -5085,6 +5207,7 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); return 0; } @@ -5131,6 +5254,7 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); return 0; } @@ -5158,6 +5282,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->rx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode); return eth_err(port_id, dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); } @@ -5186,6 +5311,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->tx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode); return eth_err(port_id, dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); } @@ -5213,6 +5339,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->get_monitor_addr == NULL) return -ENOTSUP; + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc); return eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); } @@ -5229,6 +5356,7 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, if (*dev->dev_ops->set_mc_addr_list == NULL) return -ENOTSUP; + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr); return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, mc_addr_set, nb_mc_addr)); } @@ -5243,6 +5371,7 @@ rte_eth_timesync_enable(uint16_t port_id) if (*dev->dev_ops->timesync_enable == NULL) return -ENOTSUP; + rte_eth_trace_timesync_enable(port_id); return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); } @@ -5256,6 +5385,7 @@ rte_eth_timesync_disable(uint16_t port_id) if (*dev->dev_ops->timesync_disable == NULL) return -ENOTSUP; + rte_eth_trace_timesync_disable(port_id); return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); } @@ -5277,6 +5407,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) return -ENOTSUP; + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags); return eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) (dev, timestamp, flags)); } @@ -5299,6 +5430,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) return -ENOTSUP; + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp); return eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) (dev, timestamp)); } @@ -5313,6 +5445,7 @@ rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) if (*dev->dev_ops->timesync_adjust_time == NULL) return -ENOTSUP; + rte_eth_trace_timesync_adjust_time(port_id, delta); return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); } @@ -5333,6 +5466,7 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) if (*dev->dev_ops->timesync_read_time == NULL) return -ENOTSUP; + rte_eth_trace_timesync_read_time(port_id, timestamp); return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, timestamp)); } @@ -5354,6 +5488,7 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) if (*dev->dev_ops->timesync_write_time == NULL) return -ENOTSUP; + rte_eth_trace_timesync_write_time(port_id, timestamp); return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, timestamp)); } @@ -5374,6 +5509,7 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) if (*dev->dev_ops->read_clock == NULL) return -ENOTSUP; + rte_eth_trace_read_clock(port_id, clock); return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); } @@ -5394,6 +5530,7 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) if (*dev->dev_ops->get_reg == NULL) return -ENOTSUP; + rte_ethdev_trace_get_reg_info(port_id, info); return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); } @@ -5407,6 +5544,7 @@ rte_eth_dev_get_eeprom_length(uint16_t port_id) if (*dev->dev_ops->get_eeprom_length == NULL) return -ENOTSUP; + rte_ethdev_trace_get_eeprom_length(port_id); return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); } @@ -5427,6 +5565,7 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->get_eeprom == NULL) return -ENOTSUP; + rte_ethdev_trace_get_eeprom(port_id, info); return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); } @@ -5447,6 +5586,7 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->set_eeprom == NULL) return -ENOTSUP; + rte_ethdev_trace_set_eeprom(port_id, info); return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); } @@ -5468,6 +5608,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, if (*dev->dev_ops->get_module_info == NULL) return -ENOTSUP; + rte_ethdev_trace_get_module_info(port_id, modinfo); return (*dev->dev_ops->get_module_info)(dev, modinfo); } @@ -5503,6 +5644,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, if (*dev->dev_ops->get_module_eeprom == NULL) return -ENOTSUP; + rte_ethdev_trace_get_module_eeprom(port_id, info); return (*dev->dev_ops->get_module_eeprom)(dev, info); } @@ -5526,6 +5668,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, if (*dev->dev_ops->get_dcb_info == NULL) return -ENOTSUP; + rte_ethdev_trace_get_dcb_info(port_id, dcb_info); return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); } @@ -5562,6 +5705,7 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id, *nb_rx_desc, *nb_tx_desc); return 0; } @@ -5584,6 +5728,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, if (*dev->dev_ops->hairpin_cap_get == NULL) return -ENOTSUP; memset(cap, 0, sizeof(*cap)); + rte_ethdev_trace_hairpin_capability_get(port_id, cap); return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); } @@ -5605,6 +5750,7 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) if (*dev->dev_ops->pool_ops_supported == NULL) return 1; /* all pools are supported */ + rte_ethdev_trace_pool_ops_supported(port_id, pool); return (*dev->dev_ops->pool_ops_supported)(dev, pool); } @@ -5901,6 +6047,7 @@ rte_eth_representor_info_get(uint16_t port_id, if (*dev->dev_ops->representor_info_get == NULL) return -ENOTSUP; + rte_eth_trace_representor_info_get(port_id, info); return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); } @@ -5924,6 +6071,7 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) return -EINVAL; } + rte_eth_trace_rx_metadata_negotiate(port_id, features, *features); if (*dev->dev_ops->rx_metadata_negotiate == NULL) return -ENOTSUP; return eth_err(port_id, @@ -5956,6 +6104,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, return -ENOTSUP; memset(reassembly_capa, 0, sizeof(struct rte_eth_ip_reassembly_params)); + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa); return eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) (dev, reassembly_capa)); } @@ -5985,6 +6134,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_get == NULL) return -ENOTSUP; memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); + rte_eth_trace_ip_reassembly_conf_get(port_id, conf); return eth_err(port_id, (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); } @@ -6022,6 +6172,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_set == NULL) return -ENOTSUP; + rte_eth_trace_ip_reassembly_conf_set(port_id, conf); return eth_err(port_id, (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); } @@ -6041,6 +6192,7 @@ rte_eth_dev_priv_dump(uint16_t port_id, FILE *file) if (*dev->dev_ops->eth_dev_priv_dump == NULL) return -ENOTSUP; + rte_ethdev_trace_priv_dump(port_id); return eth_err(port_id, (*dev->dev_ops->eth_dev_priv_dump)(dev, file)); } diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 1491c815c3..802f2c1ae1 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -88,6 +88,1200 @@ RTE_TRACE_POINT( rte_trace_point_emit_u16(port_id); ) +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, void *user_param, + 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_rx_callback, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + rte_rx_callback_fn fn, void *user_param, + 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, void *user_param, + 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_allmulticast_disable, + 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_allmulticast_enable, + 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_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_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_adjust_nb_rx_tx_desc, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t nb_rx_desc, + uint16_t nb_tx_desc), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(nb_rx_desc); + rte_trace_point_emit_u16(nb_tx_desc); +) + +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, 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, 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_default_mac_addr_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_flow_ctrl_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf *fc_conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(fc_conf); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_flow_ctrl_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf *fc_conf), + 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( + rte_ethdev_trace_fw_version_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, char *fw_version, size_t fw_size), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(fw_version); + rte_trace_point_emit_size_t(fw_size); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_dcb_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info *dcb_info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(dcb_info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_eeprom_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_eeprom_length, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + 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); +) + +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, 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_get_reg_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_reg_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_sec_ctx, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_supported_ptypes, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, + uint32_t *ptypes, int num, int j), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(ptype_mask); + rte_trace_point_emit_ptr(ptypes); + rte_trace_point_emit_int(num); + rte_trace_point_emit_int(j); +) + +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_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_u32(dev_info->if_index); + 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_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_u16(dev_info->nb_rx_queues); + rte_trace_point_emit_u16(dev_info->nb_tx_queues); +) + +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_ethdev_trace_is_valid_port, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_mac_addr_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, + uint32_t pool), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); + rte_trace_point_emit_u32(pool); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_mac_addr_remove, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_pool_ops_supported, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *pool), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pool); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_priority_flow_ctrl_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf), + 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( + 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_ethdev_trace_rss_hash_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf *rss_conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(rss_conf); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rss_hash_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf *rss_conf), + 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( + rte_ethdev_trace_rss_reta_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(reta_conf); + rte_trace_point_emit_u16(reta_size); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rss_reta_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(reta_conf->mask); + rte_trace_point_emit_u16(reta_size); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rx_intr_ctl, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int epfd, int op, void *data, int rc), + rte_trace_point_emit_u16(port_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_ethdev_trace_rx_intr_ctl_q, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int epfd, + int op, 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_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_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rx_intr_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); +) + +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_rx_queue_start, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(rx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_rx_queue_stop, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(rx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_eeprom_info *info), + 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( + rte_ethdev_trace_set_link_down, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_link_up, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_set_mc_addr_list, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_ether_addr *mc_addr_set, + uint32_t nb_mc_addr), + 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( + rte_ethdev_trace_set_ptypes, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, + uint32_t *set_ptypes, unsigned int num), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(ptype_mask); + rte_trace_point_emit_ptr(set_ptypes); + rte_trace_point_emit_u32(num); +) + +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), + 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( + 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), + 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( + 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(vlan_type); + rte_trace_point_emit_u16(tag_type); +) + +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_set_vlan_pvid, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t pvid, int on), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(pvid); + rte_trace_point_emit_int(on); +) + +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_socket_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +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_tx_queue_start, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(tx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_tx_queue_stop, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(tx_queue_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_uc_all_hash_table_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint8_t on), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u8(on); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_uc_hash_table_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, + uint8_t on, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); + rte_trace_point_emit_u8(on); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_udp_tunnel_port_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp), + 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( + rte_ethdev_trace_udp_tunnel_port_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp), + 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( + 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_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_start, + const struct rte_device *parent), + rte_trace_point_emit_u16(port_id_start); + rte_trace_point_emit_ptr(parent); +) + +RTE_TRACE_POINT( + rte_eth_trace_find_next_owned_by, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const uint64_t owner_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(owner_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_find_next_sibling, + RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t ref_port_id), + rte_trace_point_emit_u16(port_id_start); + rte_trace_point_emit_u16(ref_port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_cleanup, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), + rte_trace_point_emit_ptr(iter); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_init, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter, const char *devargs), + rte_trace_point_emit_ptr(iter); + rte_trace_point_emit_ptr(devargs); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_next, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), + rte_trace_point_emit_ptr(iter); +) + +RTE_TRACE_POINT( + rte_eth_trace_led_off, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_led_on, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(link->link_speed); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_get_nowait, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(link->link_speed); +) + +RTE_TRACE_POINT( + rte_eth_trace_macaddr_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *mac_addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(mac_addr); +) + +RTE_TRACE_POINT( + rte_eth_trace_promiscuous_disable, + 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_promiscuous_enable, + 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_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_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_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_eth_burst_mode *mode), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(mode); +) + +RTE_TRACE_POINT( + rte_eth_trace_rx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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->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_rx_queue_setup, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, + uint16_t nb_rx_desc, unsigned int socket_id, + const struct rte_eth_rxconf *rx_conf, + struct rte_mempool *mb_pool), + 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_u32(socket_id); + rte_trace_point_emit_ptr(rx_conf); + rte_trace_point_emit_ptr(mb_pool); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_idx); + rte_trace_point_emit_u16(tx_rate); +) + +RTE_TRACE_POINT( + rte_eth_trace_speed_bitflag, + RTE_TRACE_POINT_ARGS(uint32_t speed, int duplex), + rte_trace_point_emit_u32(speed); + rte_trace_point_emit_int(duplex); +) + +RTE_TRACE_POINT( + rte_eth_trace_stats_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats *stats), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_u64(stats->rx_nombuf); +) + +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_timesync_adjust_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int64_t delta), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_i64(delta); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_read_rx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *timestamp, + uint32_t flags), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(timestamp); + rte_trace_point_emit_u32(flags); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_read_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *time), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(time); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_read_tx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *timestamp), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(timestamp); +) + +RTE_TRACE_POINT( + rte_eth_trace_timesync_write_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct timespec *time), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(time); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_buffer_count_callback, + RTE_TRACE_POINT_ARGS(struct rte_mbuf **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); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_buffer_drop_callback, + RTE_TRACE_POINT_ARGS(struct rte_mbuf **pkts, uint16_t unsent), + rte_trace_point_emit_ptr(pkts); + rte_trace_point_emit_u16(unsent); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_buffer_init, + RTE_TRACE_POINT_ARGS(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_buffer_set_err_callback, + RTE_TRACE_POINT_ARGS(struct rte_eth_dev_tx_buffer *buffer, + buffer_tx_error_fn callback, void *userdata), + rte_trace_point_emit_ptr(buffer); + rte_trace_point_emit_ptr(callback); + rte_trace_point_emit_ptr(userdata); +) + +RTE_TRACE_POINT( + rte_eth_trace_tx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_eth_burst_mode *mode), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(mode); +) + +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_tx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_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); +) + +RTE_TRACE_POINT( + rte_eth_trace_xstats_get_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, + 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_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_ptr(id); +) + +RTE_TRACE_POINT( + 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); +) + +RTE_TRACE_POINT( + rte_eth_trace_xstats_get_names_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_reset, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_owner_delete, + RTE_TRACE_POINT_ARGS(const 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_owner_get, + RTE_TRACE_POINT_ARGS(const uint16_t port_id, + 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_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(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), + 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_get_module_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_dev_eeprom_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_get_module_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_dev_module_info *modinfo), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(modinfo); +) + +RTE_TRACE_POINT( + rte_eth_trace_read_clock, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t *clk), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(clk); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_hairpin_capability_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_hairpin_cap *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +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), + 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_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), + 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_ptr(conf); + 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_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); +) + +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_link_speed_to_str, + RTE_TRACE_POINT_ARGS(uint32_t link_speed), + rte_trace_point_emit_u32(link_speed); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_to_str, + RTE_TRACE_POINT_ARGS(char *str, size_t len, + const struct rte_eth_link *eth_link), + rte_trace_point_emit_ptr(str); + rte_trace_point_emit_size_t(len); + rte_trace_point_emit_ptr(eth_link); +) + +RTE_TRACE_POINT( + rte_eth_trace_fec_get_capability, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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(num); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_eth_trace_fec_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t *fec_capa), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(fec_capa); +) + +RTE_TRACE_POINT( + rte_eth_trace_fec_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t fec_capa), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(fec_capa); +) + +RTE_TRACE_POINT( + rte_eth_trace_get_monitor_addr, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + struct rte_power_monitor_cond *pmc), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pmc); +) + +RTE_TRACE_POINT( + rte_eth_trace_representor_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_representor_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(info); +) + +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_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_eth_trace_macaddrs_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *ma, + unsigned int num), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(ma); + rte_trace_point_emit_u32(num); +) + +RTE_TRACE_POINT( + rte_eth_trace_rx_metadata_negotiate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t *features, + uint64_t features_val), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(features); + rte_trace_point_emit_u64(features_val); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_priority_flow_ctrl_queue_configure, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_pfc_queue_conf *pfc_queue_conf), + 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( + rte_ethdev_trace_priority_flow_ctrl_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_pfc_queue_info *pfc_queue_info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pfc_queue_info); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_priv_dump, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_eth_trace_ip_reassembly_capability_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_ip_reassembly_params *capa), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(capa); +) + +RTE_TRACE_POINT( + rte_eth_trace_ip_reassembly_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_eth_ip_reassembly_params *conf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); +) + +RTE_TRACE_POINT( + rte_eth_trace_rx_avail_thresh_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_u8(avail_thresh); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 40084d1929..ba3fdd04a2 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -37,6 +37,25 @@ 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, + 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_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, + uint16_t nb_pkts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_u16(nb_pkts); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 3651ceb234..79d0b2ee1f 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -319,4 +319,148 @@ INTERNAL { rte_eth_representor_id_get; rte_eth_switch_domain_alloc; rte_eth_switch_domain_free; + __rte_eth_trace_add_first_rx_callback; + __rte_eth_trace_add_rx_callback; + __rte_eth_trace_add_tx_callback; + __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_ethdev_trace_count_avail; + __rte_ethdev_trace_count_total; + __rte_ethdev_trace_set_mtu; + __rte_ethdev_trace_adjust_nb_rx_tx_desc; + __rte_ethdev_trace_callback_register; + __rte_ethdev_trace_callback_unregister; + __rte_ethdev_trace_default_mac_addr_set; + __rte_ethdev_trace_flow_ctrl_get; + __rte_ethdev_trace_flow_ctrl_set; + __rte_ethdev_trace_fw_version_get; + __rte_ethdev_trace_get_dcb_info; + __rte_ethdev_trace_get_eeprom; + __rte_ethdev_trace_get_eeprom_length; + __rte_ethdev_trace_get_mtu; + __rte_ethdev_trace_get_name_by_port; + __rte_ethdev_trace_get_port_by_name; + __rte_ethdev_trace_get_reg_info; + __rte_ethdev_trace_get_sec_ctx; + __rte_ethdev_trace_get_supported_ptypes; + __rte_ethdev_trace_get_vlan_offload; + __rte_ethdev_trace_info_get; + __rte_ethdev_trace_is_removed; + __rte_ethdev_trace_is_valid_port; + __rte_ethdev_trace_mac_addr_add; + __rte_ethdev_trace_mac_addr_remove; + __rte_ethdev_trace_pool_ops_supported; + __rte_ethdev_trace_priority_flow_ctrl_set; + __rte_ethdev_trace_reset; + __rte_ethdev_trace_rss_hash_conf_get; + __rte_ethdev_trace_rss_hash_update; + __rte_ethdev_trace_rss_reta_query; + __rte_ethdev_trace_rss_reta_update; + __rte_ethdev_trace_rx_intr_ctl; + __rte_ethdev_trace_rx_intr_ctl_q; + __rte_ethdev_trace_rx_intr_ctl_q_get_fd; + __rte_ethdev_trace_rx_intr_disable; + __rte_ethdev_trace_rx_intr_enable; + __rte_ethdev_trace_rx_offload_name; + __rte_ethdev_trace_rx_queue_start; + __rte_ethdev_trace_rx_queue_stop; + __rte_ethdev_trace_set_eeprom; + __rte_ethdev_trace_set_link_down; + __rte_ethdev_trace_set_link_up; + __rte_ethdev_trace_set_mc_addr_list; + __rte_ethdev_trace_set_ptypes; + __rte_ethdev_trace_set_rx_queue_stats_mapping; + __rte_ethdev_trace_set_tx_queue_stats_mapping; + __rte_ethdev_trace_set_vlan_ether_type; + __rte_ethdev_trace_set_vlan_offload; + __rte_ethdev_trace_set_vlan_pvid; + __rte_ethdev_trace_set_vlan_strip_on_queue; + __rte_ethdev_trace_socket_id; + __rte_ethdev_trace_tx_offload_name; + __rte_ethdev_trace_tx_queue_start; + __rte_ethdev_trace_tx_queue_stop; + __rte_ethdev_trace_uc_all_hash_table_set; + __rte_ethdev_trace_uc_hash_table_set; + __rte_ethdev_trace_udp_tunnel_port_add; + __rte_ethdev_trace_udp_tunnel_port_delete; + __rte_ethdev_trace_vlan_filter; + __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_iterator_cleanup; + __rte_eth_trace_iterator_init; + __rte_eth_trace_iterator_next; + __rte_eth_trace_led_off; + __rte_eth_trace_led_on; + __rte_eth_trace_link_get; + __rte_eth_trace_link_get_nowait; + __rte_eth_trace_macaddr_get; + __rte_eth_trace_promiscuous_disable; + __rte_eth_trace_promiscuous_enable; + __rte_eth_trace_promiscuous_get; + __rte_eth_trace_remove_rx_callback; + __rte_eth_trace_remove_tx_callback; + __rte_eth_trace_rx_burst_mode_get; + __rte_eth_trace_rx_queue_info_get; + __rte_eth_trace_rx_queue_setup; + __rte_eth_trace_set_queue_rate_limit; + __rte_eth_trace_speed_bitflag; + __rte_eth_trace_stats_get; + __rte_eth_trace_stats_reset; + __rte_eth_trace_timesync_adjust_time; + __rte_eth_trace_timesync_disable; + __rte_eth_trace_timesync_enable; + __rte_eth_trace_timesync_read_rx_timestamp; + __rte_eth_trace_timesync_read_time; + __rte_eth_trace_timesync_read_tx_timestamp; + __rte_eth_trace_timesync_write_time; + __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_burst_mode_get; + __rte_eth_trace_tx_done_cleanup; + __rte_eth_trace_tx_queue_info_get; + __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_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_get_module_eeprom; + __rte_ethdev_trace_get_module_info; + __rte_ethdev_trace_hairpin_capability_get; + __rte_eth_trace_rx_hairpin_queue_setup; + __rte_eth_trace_tx_hairpin_queue_setup; + __rte_eth_trace_hairpin_bind; + __rte_eth_trace_hairpin_get_peer_ports; + __rte_eth_trace_hairpin_unbind; + __rte_eth_trace_link_speed_to_str; + __rte_eth_trace_link_to_str; + __rte_eth_trace_fec_get_capability; + __rte_eth_trace_fec_get; + __rte_eth_trace_fec_set; + __rte_eth_trace_get_monitor_addr; + __rte_eth_trace_representor_info_get; + __rte_ethdev_trace_capability_name; + __rte_ethdev_trace_conf_get; + __rte_eth_trace_macaddrs_get; + __rte_eth_trace_rx_metadata_negotiate; + __rte_ethdev_trace_priority_flow_ctrl_queue_configure; + __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; + __rte_ethdev_trace_priv_dump; + __rte_eth_trace_ip_reassembly_capability_get; + __rte_eth_trace_ip_reassembly_conf_get; + __rte_eth_trace_ip_reassembly_conf_set; + __rte_eth_trace_rx_avail_thresh_query; + __rte_eth_trace_rx_avail_thresh_set; }; -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v3 1/4] ethdev: add trace points 2022-10-06 15:18 ` [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi @ 2022-10-06 16:03 ` Morten Brørup 2022-10-07 16:23 ` Ankur Dwivedi ` (2 subsequent siblings) 3 siblings, 0 replies; 172+ messages in thread From: Morten Brørup @ 2022-10-06 16:03 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia > From: Ankur Dwivedi [mailto:adwivedi@marvell.com] > Sent: Thursday, 6 October 2022 17.19 > > Add trace points for ethdev functions. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- I did my best, but this series needs review by people with direct knowledge about the affected functions. rte_eth_call_rx/tx_callbacks() are treated as fast path functions, but I think more functions should be too: rte_eth_tx_buffer_drop_callback() and rte_eth_tx_buffer_count_callback() are certainly fast path functions. rte_eth_tx_done_cleanup()probably is too. rte_eth_macaddr_get() could be, but probably isn't. If treated as slow path, it could be noted in its documentation. I don't know about rte_eth_timesync_read_rx/tx_timestamp(), rte_eth_timesync_adjust/read/write_time() and rte_eth_read_clock(). ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v3 1/4] ethdev: add trace points 2022-10-06 15:18 ` [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi 2022-10-06 16:03 ` Morten Brørup @ 2022-10-07 16:23 ` Ankur Dwivedi 2022-10-10 6:39 ` Ankur Dwivedi 2022-12-12 18:38 ` Ferruh Yigit 2022-12-13 20:06 ` Ferruh Yigit 3 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-07 16:23 UTC (permalink / raw) To: dev, Morten Brørup Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia Hi Morten, >-----Original Message----- >From: Ankur Dwivedi <adwivedi@marvell.com> >Sent: Thursday, October 6, 2022 8:49 PM >To: dev@dpdk.org >Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; >jbehrens@vmware.com; maxime.coquelin@redhat.com; >chenbo.xia@intel.com; steven.webster@windriver.com; >matt.peters@windriver.com; bruce.richardson@intel.com; >mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; >cristian.dumitrescu@intel.com; jgrajcia@cisco.com; Ankur Dwivedi ><adwivedi@marvell.com> >Subject: [PATCH v3 1/4] ethdev: add trace points > >Add trace points for ethdev functions. > >Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >--- Yes the functions you mentioned in previous comment are called in while loop in worker core. So I think they are fastpath. rte_eth_stats_get() is called in fastpath. Similar to rte_eth_macaddr_get(), I think functions like rte_eth_pro miscuous_get(), rte_eth_allmulticast_get() can also be called in fastpath. I am not sure which other functions can be fastpath. Is there a guideline/theme which can be used to determine this? > lib/ethdev/ethdev_private.c | 3 + > lib/ethdev/ethdev_trace_points.c | 435 +++++++++++ > lib/ethdev/rte_ethdev.c | 152 ++++ > lib/ethdev/rte_ethdev_trace.h | 1194 ++++++++++++++++++++++++++++++ > lib/ethdev/rte_ethdev_trace_fp.h | 19 + > lib/ethdev/version.map | 144 ++++ > 6 files changed, 1947 insertions(+) > >diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c >index 48090c879a..08e7f49fd8 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.h" > #include "ethdev_driver.h" > #include "ethdev_private.h" > >@@ -297,6 +298,7 @@ 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, nb_rx, nb_pkts); > return nb_rx; > } > >@@ -312,6 +314,7 @@ 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, nb_pkts); > return nb_pkts; > } > >diff --git a/lib/ethdev/ethdev_trace_points.c >b/lib/ethdev/ethdev_trace_points.c >index 2919409a15..2c06b47b7f 100644 >--- a/lib/ethdev/ethdev_trace_points.c >+++ b/lib/ethdev/ethdev_trace_points.c >@@ -29,3 +29,438 @@ >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_add_first_rx_callback, >+ lib.ethdev.add_first_rx_callback) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_rx_callback, >+ lib.ethdev.add_rx_callback) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_tx_callback, >+ lib.ethdev.add_tx_callback) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_disable, >+ lib.ethdev.allmulticast_disable) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_enable, >+ lib.ethdev.allmulticast_enable) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_get, >+ lib.ethdev.allmulticast_get) >+ >+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_ethdev_trace_set_mtu, >+ lib.ethdev.set_mtu) >+ >+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_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_default_mac_addr_set, >+ lib.ethdev.default_mac_addr_set) >+ >+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_fw_version_get, >+ lib.ethdev.fw_version_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_dcb_info, >+ lib.ethdev.get_dcb_info) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom, >+ lib.ethdev.get_eeprom) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom_length, >+ lib.ethdev.get_eeprom_length) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_mtu, >+ lib.ethdev.get_mtu) >+ >+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_get_reg_info, >+ lib.ethdev.get_reg_info) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_sec_ctx, >+ lib.ethdev.get_sec_ctx) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_supported_ptypes, >+ lib.ethdev.get_supported_ptypes) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_vlan_offload, >+ lib.ethdev.get_vlan_offload) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_info_get, >+ lib.ethdev.info_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_removed, >+ lib.ethdev.is_removed) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_valid_port, >+ lib.ethdev.is_valid_port) >+ >+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_pool_ops_supported, >+ lib.ethdev.pool_ops_supported) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_set, >+ lib.ethdev.priority_flow_ctrl_set) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_reset, >+ lib.ethdev.reset) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_conf_get, >+ lib.ethdev.rss_hash_conf_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_update, >+ lib.ethdev.rss_hash_update) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_query, >+ lib.ethdev.rss_reta_query) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_update, >+ lib.ethdev.rss_reta_update) >+ >+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, >+ lib.ethdev.rx_intr_ctl_q) >+ >+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_disable, >+ lib.ethdev.rx_intr_disable) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_enable, >+ lib.ethdev.rx_intr_enable) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_offload_name, >+ lib.ethdev.rx_offload_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_set_eeprom, >+ lib.ethdev.set_eeprom) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_down, >+ lib.ethdev.set_link_down) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_up, >+ lib.ethdev.set_link_up) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_mc_addr_list, >+ lib.ethdev.set_mc_addr_list) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_ptypes, >+ lib.ethdev.set_ptypes) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mappi >ng, >+ lib.ethdev.set_rx_queue_stats_mapping) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_tx_queue_stats_mappin >g, >+ lib.ethdev.set_tx_queue_stats_mapping) >+ >+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_set_vlan_pvid, >+ lib.ethdev.set_vlan_pvid) >+ >+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_socket_id, >+ lib.ethdev.socket_id) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_tx_offload_name, >+ lib.ethdev.tx_offload_name) >+ >+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_ethdev_trace_uc_all_hash_table_set, >+ lib.ethdev.uc_all_hash_table_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_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_ethdev_trace_vlan_filter, >+ lib.ethdev.vlan_filter) >+ >+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_owned_by, >+ lib.ethdev.find_next_owned_by) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_find_next_sibling, >+ lib.ethdev.find_next_sibling) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_iterator_cleanup, >+ lib.ethdev.iterator_cleanup) >+ >+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_led_off, >+ lib.ethdev.led_off) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_led_on, >+ lib.ethdev.led_on) >+ >+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_macaddr_get, >+ lib.ethdev.macaddr_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_disable, >+ lib.ethdev.promiscuous_disable) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_enable, >+ lib.ethdev.promiscuous_enable) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_get, >+ lib.ethdev.promiscuous_get) >+ >+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_burst_mode_get, >+ lib.ethdev.rx_burst_mode_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_info_get, >+ lib.ethdev.rx_queue_info_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_setup, >+ lib.ethdev.rx_queue_setup) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_set_queue_rate_limit, >+ lib.ethdev.set_queue_rate_limit) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_speed_bitflag, >+ lib.ethdev.speed_bitflag) >+ >+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_timesync_adjust_time, >+ lib.ethdev.timesync_adjust_time) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_disable, >+ lib.ethdev.timesync_disable) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_enable, >+ lib.ethdev.timesync_enable) >+ >+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_time, >+ lib.ethdev.timesync_read_time) >+ >+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_write_time, >+ lib.ethdev.timesync_write_time) >+ >+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_drop_callback, >+ lib.ethdev.tx_buffer_drop_callback) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_buffer_init, >+ lib.ethdev.tx_buffer_init) >+ >+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_burst_mode_get, >+ lib.ethdev.tx_burst_mode_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_done_cleanup, >+ lib.ethdev.tx_done_cleanup) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_queue_info_get, >+ lib.ethdev.tx_queue_info_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get, >+ lib.ethdev.xstats_get) >+ >+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_id_by_name, >+ lib.ethdev.xstats_get_id_by_name) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get_names, >+ lib.ethdev.xstats_get_names) >+ >+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_reset, >+ lib.ethdev.xstats_reset) >+ >+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_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_get_module_eeprom, >+ lib.ethdev.get_module_eeprom) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_module_info, >+ lib.ethdev.get_module_info) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_read_clock, >+ lib.ethdev.read_clock) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_hairpin_capability_get, >+ lib.ethdev.hairpin_capability_get) >+ >+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_get_peer_ports, >+ lib.ethdev.hairpin_get_peer_ports) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_unbind, >+ lib.ethdev.hairpin_unbind) >+ >+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_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_eth_trace_get_monitor_addr, >+ lib.ethdev.get_monitor_addr) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_representor_info_get, >+ lib.ethdev.representor_info_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_capability_name, >+ lib.ethdev.capability_name) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_conf_get, >+ lib.ethdev.conf_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_macaddrs_get, >+ lib.ethdev.macaddrs_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_metadata_negotiate, >+ lib.ethdev.rx_metadata_negotiate) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_co >nfigure, >+ lib.ethdev.priority_flow_ctrl_queue_configure) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_in >fo_get, >+ lib.ethdev.priority_flow_ctrl_queue_info_get) >+ >+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priv_dump, >+ lib.ethdev.priv_dump) >+ >+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_rx_avail_thresh_query, >+ lib.ethdev.rx_avail_thresh_query) >+ >+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set, >+ lib.ethdev.rx_avail_thresh_set) >diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c >index 01c141a039..f66d3ecd0a 100644 >--- a/lib/ethdev/rte_ethdev.c >+++ b/lib/ethdev/rte_ethdev.c >@@ -182,6 +182,8 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, >const char *devargs_str) > memset(iter, 0, sizeof(*iter)); > memset(&devargs, 0, sizeof(devargs)); > >+ rte_eth_trace_iterator_init(iter, devargs_str); >+ > /* > * The devargs string may use various syntaxes: > * - 0000:08:00.0,representor=[1-3] >@@ -283,6 +285,8 @@ rte_eth_iterator_next(struct rte_dev_iterator *iter) > if (iter->cls == NULL) /* invalid ethdev iterator */ > return RTE_MAX_ETHPORTS; > >+ rte_eth_trace_iterator_next(iter); >+ > do { /* loop to try all matching rte_device */ > /* If not pure ethdev filter and */ > if (iter->bus != NULL && >@@ -316,6 +320,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); > 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 +336,7 @@ 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,6 +357,7 @@ 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; > } > >@@ -358,6 +365,7 @@ 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); > return rte_eth_find_next_of(port_id, > rte_eth_devices[ref_port_id].device); > } >@@ -371,6 +379,7 @@ eth_dev_is_allocated(const struct rte_eth_dev >*ethdev) > int > rte_eth_dev_is_valid_port(uint16_t port_id) > { >+ rte_ethdev_trace_is_valid_port(port_id); > if (port_id >= RTE_MAX_ETHPORTS || > (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)) > return 0; >@@ -395,6 +404,7 @@ 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 +423,7 @@ 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 +487,7 @@ 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 +505,7 @@ 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 +539,7 @@ 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 +569,7 @@ 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; > } > >@@ -562,6 +577,7 @@ int > rte_eth_dev_socket_id(uint16_t port_id) > { > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); >+ rte_ethdev_trace_socket_id(port_id); > return rte_eth_devices[port_id].data->numa_node; > } > >@@ -569,6 +585,7 @@ void * > rte_eth_dev_get_sec_ctx(uint16_t port_id) > { > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL); >+ rte_ethdev_trace_get_sec_ctx(port_id); > return rte_eth_devices[port_id].security_ctx; > } > >@@ -583,6 +600,7 @@ rte_eth_dev_count_avail(void) > RTE_ETH_FOREACH_DEV(p) > count++; > >+ rte_ethdev_trace_count_avail(count); > return count; > } > >@@ -594,6 +612,7 @@ rte_eth_dev_count_total(void) > RTE_ETH_FOREACH_VALID_DEV(port) > count++; > >+ rte_ethdev_trace_count_total(count); > return count; > } > >@@ -614,6 +633,7 @@ 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; > } > >@@ -636,6 +656,7 @@ 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; > } > >@@ -737,6 +758,7 @@ rte_eth_dev_rx_queue_start(uint16_t port_id, >uint16_t rx_queue_id) > return 0; > } > >+ rte_ethdev_trace_rx_queue_start(port_id, rx_queue_id); > return eth_err(port_id, dev->dev_ops->rx_queue_start(dev, >rx_queue_id)); > } > >@@ -770,6 +792,7 @@ rte_eth_dev_rx_queue_stop(uint16_t port_id, >uint16_t rx_queue_id) > return 0; > } > >+ rte_ethdev_trace_rx_queue_stop(port_id, rx_queue_id); > return eth_err(port_id, dev->dev_ops->rx_queue_stop(dev, >rx_queue_id)); > } > >@@ -810,6 +833,7 @@ rte_eth_dev_tx_queue_start(uint16_t port_id, >uint16_t tx_queue_id) > return 0; > } > >+ rte_ethdev_trace_tx_queue_start(port_id, tx_queue_id); > return eth_err(port_id, dev->dev_ops->tx_queue_start(dev, >tx_queue_id)); > } > >@@ -843,12 +867,14 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, >uint16_t tx_queue_id) > return 0; > } > >+ rte_ethdev_trace_tx_queue_stop(port_id, tx_queue_id); > return eth_err(port_id, dev->dev_ops->tx_queue_stop(dev, >tx_queue_id)); > } > > uint32_t > rte_eth_speed_bitflag(uint32_t speed, int duplex) > { >+ rte_eth_trace_speed_bitflag(speed, duplex); > switch (speed) { > case RTE_ETH_SPEED_NUM_10M: > return duplex ? RTE_ETH_LINK_SPEED_10M : >RTE_ETH_LINK_SPEED_10M_HD; >@@ -894,6 +920,7 @@ rte_eth_dev_rx_offload_name(uint64_t offload) > } > } > >+ rte_ethdev_trace_rx_offload_name(offload, name); > return name; > } > >@@ -910,6 +937,7 @@ rte_eth_dev_tx_offload_name(uint64_t offload) > } > } > >+ rte_ethdev_trace_tx_offload_name(offload, name); > return name; > } > >@@ -926,6 +954,7 @@ rte_eth_dev_capability_name(uint64_t capability) > } > } > >+ rte_ethdev_trace_capability_name(capability, name); > return name; > } > >@@ -1552,6 +1581,7 @@ rte_eth_dev_set_link_up(uint16_t port_id) > > if (*dev->dev_ops->dev_set_link_up == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_set_link_up(port_id); > return eth_err(port_id, (*dev->dev_ops->dev_set_link_up)(dev)); > } > >@@ -1565,6 +1595,7 @@ rte_eth_dev_set_link_down(uint16_t port_id) > > if (*dev->dev_ops->dev_set_link_down == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_set_link_down(port_id); > return eth_err(port_id, (*dev->dev_ops->dev_set_link_down)(dev)); > } > >@@ -1621,6 +1652,7 @@ rte_eth_dev_reset(uint16_t port_id) > port_id, rte_strerror(-ret)); > } > ret = dev->dev_ops->dev_reset(dev); >+ rte_ethdev_trace_reset(port_id, ret); > > return eth_err(port_id, ret); > } >@@ -1645,6 +1677,7 @@ 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; > } > >@@ -1984,6 +2017,8 @@ 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; >+ rte_eth_trace_rx_hairpin_queue_setup(port_id, rx_queue_id, >nb_rx_desc, >+ conf, ret); > return eth_err(port_id, ret); > } > >@@ -2151,6 +2186,7 @@ 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; >+ rte_eth_trace_tx_hairpin_queue_setup(port_id, tx_queue_id, >nb_tx_desc, conf, ret); > return eth_err(port_id, ret); > } > >@@ -2176,6 +2212,7 @@ 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; > } > >@@ -2201,6 +2238,7 @@ 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; > } > >@@ -2237,6 +2275,7 @@ 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; > } > >@@ -2244,6 +2283,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); > rte_pktmbuf_free_bulk(pkts, unsent); > } > >@@ -2255,6 +2295,7 @@ 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(pkts, unsent, *count); > } > > int >@@ -2267,6 +2308,7 @@ rte_eth_tx_buffer_set_err_callback(struct >rte_eth_dev_tx_buffer *buffer, > return -EINVAL; > } > >+ rte_eth_trace_tx_buffer_set_err_callback(buffer, cbfn, userdata); > buffer->error_callback = cbfn; > buffer->error_userdata = userdata; > return 0; >@@ -2288,6 +2330,7 @@ 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; > } > >@@ -2306,6 +2349,7 @@ 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); >+ rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt, ret); > return eth_err(port_id, ret); > } > >@@ -2327,6 +2371,7 @@ rte_eth_promiscuous_enable(uint16_t port_id) > diag = (*dev->dev_ops->promiscuous_enable)(dev); > dev->data->promiscuous = (diag == 0) ? 1 : 0; > >+ rte_eth_trace_promiscuous_enable(port_id, dev->data- >>promiscuous); > return eth_err(port_id, diag); > } > >@@ -2350,6 +2395,7 @@ rte_eth_promiscuous_disable(uint16_t port_id) > if (diag != 0) > dev->data->promiscuous = 1; > >+ rte_eth_trace_promiscuous_disable(port_id, dev->data- >>promiscuous); > return eth_err(port_id, diag); > } > >@@ -2361,6 +2407,7 @@ 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; > } > >@@ -2381,6 +2428,7 @@ rte_eth_allmulticast_enable(uint16_t port_id) > diag = (*dev->dev_ops->allmulticast_enable)(dev); > dev->data->all_multicast = (diag == 0) ? 1 : 0; > >+ rte_eth_trace_allmulticast_enable(port_id, dev->data->all_multicast); > return eth_err(port_id, diag); > } > >@@ -2403,6 +2451,7 @@ rte_eth_allmulticast_disable(uint16_t port_id) > if (diag != 0) > dev->data->all_multicast = 1; > >+ rte_eth_trace_allmulticast_disable(port_id, dev->data->all_multicast); > return eth_err(port_id, diag); > } > >@@ -2414,6 +2463,7 @@ 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; > } > >@@ -2440,6 +2490,7 @@ 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; > } > >@@ -2466,12 +2517,14 @@ 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) > { >+ rte_eth_trace_link_speed_to_str(link_speed); > switch (link_speed) { > case RTE_ETH_SPEED_NUM_NONE: return "None"; > case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; >@@ -2511,6 +2564,7 @@ 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(str, len, eth_link); > if (eth_link->link_status == RTE_ETH_LINK_DOWN) > return snprintf(str, len, "Link down"); > else >@@ -2541,6 +2595,7 @@ 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; >+ rte_eth_trace_stats_get(port_id, stats); > return eth_err(port_id, (*dev->dev_ops->stats_get)(dev, stats)); > } > >@@ -2561,6 +2616,7 @@ rte_eth_stats_reset(uint16_t port_id) > > dev->data->rx_mbuf_alloc_failed = 0; > >+ rte_eth_trace_stats_reset(port_id); > return 0; > } > >@@ -2625,6 +2681,7 @@ rte_eth_xstats_get_id_by_name(uint16_t port_id, >const char *xstat_name, > return -ENOMEM; > } > >+ rte_eth_trace_xstats_get_id_by_name(port_id, xstat_name, id); > /* Get count */ > cnt_xstats = rte_eth_xstats_get_names_by_id(port_id, NULL, 0, NULL); > if (cnt_xstats < 0) { >@@ -2797,6 +2854,8 @@ 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); >@@ -2836,6 +2895,7 @@ rte_eth_xstats_get_names(uint16_t port_id, > cnt_used_entries += cnt_driver_entries; > } > >+ rte_eth_trace_xstats_get_names(port_id, xstats_names, size, >cnt_used_entries); > return cnt_used_entries; > } > >@@ -2985,6 +3045,7 @@ 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; > } > >@@ -3032,6 +3093,8 @@ 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], i); > return count + xcount; > } > >@@ -3044,6 +3107,7 @@ rte_eth_xstats_reset(uint16_t port_id) > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > >+ rte_eth_trace_xstats_reset(port_id); > /* implemented by the driver */ > if (dev->dev_ops->xstats_reset != NULL) > return eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev)); >@@ -3079,6 +3143,8 @@ int > rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t >tx_queue_id, > uint8_t stat_idx) > { >+ rte_ethdev_trace_set_tx_queue_stats_mapping(port_id, tx_queue_id, >+ stat_idx); > return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id, > tx_queue_id, > stat_idx, STAT_QMAP_TX)); >@@ -3088,6 +3154,8 @@ int > rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t >rx_queue_id, > uint8_t stat_idx) > { >+ rte_ethdev_trace_set_rx_queue_stats_mapping(port_id, >rx_queue_id, >+ stat_idx); > return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id, > rx_queue_id, > stat_idx, STAT_QMAP_RX)); >@@ -3110,6 +3178,7 @@ 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; >+ rte_ethdev_trace_fw_version_get(port_id, fw_version, fw_size); > return eth_err(port_id, (*dev->dev_ops->fw_version_get)(dev, > fw_version, fw_size)); > } >@@ -3171,6 +3240,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct >rte_eth_dev_info *dev_info) > > dev_info->dev_flags = &dev->data->dev_flags; > >+ rte_ethdev_trace_info_get(port_id, dev_info); > return 0; > } > >@@ -3191,6 +3261,7 @@ rte_eth_dev_conf_get(uint16_t port_id, struct >rte_eth_conf *dev_conf) > > memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct >rte_eth_conf)); > >+ rte_ethdev_trace_conf_get(port_id, dev_conf); > return 0; > } > >@@ -3226,6 +3297,7 @@ rte_eth_dev_get_supported_ptypes(uint16_t >port_id, uint32_t ptype_mask, > j++; > } > >+ rte_ethdev_trace_get_supported_ptypes(port_id, ptype_mask, >ptypes, num, j); > return j; > } > >@@ -3310,6 +3382,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t >ptype_mask, > if (set_ptypes != NULL && j < num) > set_ptypes[j] = RTE_PTYPE_UNKNOWN; > >+ rte_ethdev_trace_set_ptypes(port_id, ptype_mask, set_ptypes, num); > return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask); > > ptype_unknown: >@@ -3341,6 +3414,7 @@ rte_eth_macaddrs_get(uint16_t port_id, struct >rte_ether_addr *ma, > num = RTE_MIN(dev_info.max_mac_addrs, num); > memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); > >+ rte_eth_trace_macaddrs_get(port_id, ma, num); > return num; > } > >@@ -3359,6 +3433,7 @@ rte_eth_macaddr_get(uint16_t port_id, struct >rte_ether_addr *mac_addr) > return -EINVAL; > } > >+ rte_eth_trace_macaddr_get(port_id, mac_addr); > rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); > > return 0; >@@ -3379,6 +3454,7 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t >*mtu) > } > > *mtu = dev->data->mtu; >+ rte_ethdev_trace_get_mtu(port_id, *mtu); > return 0; > } > >@@ -3421,6 +3497,7 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t >mtu) > if (ret == 0) > dev->data->mtu = mtu; > >+ rte_ethdev_trace_set_mtu(port_id, mtu, ret); > return eth_err(port_id, ret); > } > >@@ -3464,6 +3541,7 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t >vlan_id, int on) > vfc->ids[vidx] &= ~RTE_BIT64(vbit); > } > >+ rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); > return eth_err(port_id, ret); > } > >@@ -3483,6 +3561,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t >port_id, uint16_t rx_queue_id, > > if (*dev->dev_ops->vlan_strip_queue_set == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, >on); > (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); > > return 0; >@@ -3500,6 +3579,7 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, > > if (*dev->dev_ops->vlan_tpid_set == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid); > return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, >vlan_type, > tpid)); > } >@@ -3593,6 +3673,7 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int >offload_mask) > dev->data->dev_conf.rxmode.offloads = orig_offloads; > } > >+ rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); > return eth_err(port_id, ret); > } > >@@ -3619,6 +3700,7 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) > if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) > ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; > >+ rte_ethdev_trace_get_vlan_offload(port_id, ret); > return ret; > } > >@@ -3632,6 +3714,7 @@ rte_eth_dev_set_vlan_pvid(uint16_t port_id, >uint16_t pvid, int on) > > if (*dev->dev_ops->vlan_pvid_set == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on); > return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, >on)); > } > >@@ -3653,6 +3736,7 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct >rte_eth_fc_conf *fc_conf) > if (*dev->dev_ops->flow_ctrl_get == NULL) > return -ENOTSUP; > memset(fc_conf, 0, sizeof(*fc_conf)); >+ rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf); > return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, >fc_conf)); > } > >@@ -3678,6 +3762,7 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct >rte_eth_fc_conf *fc_conf) > > if (*dev->dev_ops->flow_ctrl_set == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf); > return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); > } > >@@ -3702,6 +3787,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t >port_id, > return -EINVAL; > } > >+ rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf); > /* High water, low water validation are device specific */ > if (*dev->dev_ops->priority_flow_ctrl_set) > return eth_err(port_id, (*dev->dev_ops- >>priority_flow_ctrl_set) >@@ -3774,6 +3860,7 @@ >rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, > return -EINVAL; > } > >+ rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, >pfc_queue_info); > if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) > return eth_err(port_id, (*dev->dev_ops- >>priority_flow_ctrl_queue_info_get) > (dev, pfc_queue_info)); >@@ -3845,6 +3932,8 @@ >rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, > return ret; > } > >+ rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, >+ pfc_queue_conf); > if (*dev->dev_ops->priority_flow_ctrl_queue_config) > return eth_err(port_id, > (*dev->dev_ops- >>priority_flow_ctrl_queue_config)( >@@ -3940,6 +4029,7 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, > > if (*dev->dev_ops->reta_update == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size); > return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, >reta_conf, > reta_size)); > } >@@ -3969,6 +4059,7 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, > > if (*dev->dev_ops->reta_query == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size); > return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, > reta_size)); > } >@@ -4014,6 +4105,7 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, > > if (*dev->dev_ops->rss_hash_update == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_rss_hash_update(port_id, rss_conf); > return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, > rss_conf)); > } >@@ -4036,6 +4128,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, > > if (*dev->dev_ops->rss_hash_conf_get == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf); > return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, > rss_conf)); > } >@@ -4063,6 +4156,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t >port_id, > > if (*dev->dev_ops->udp_tunnel_port_add == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel); > return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, > udp_tunnel)); > } >@@ -4090,6 +4184,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t >port_id, > > if (*dev->dev_ops->udp_tunnel_port_del == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel); > return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, > udp_tunnel)); > } >@@ -4104,6 +4199,7 @@ rte_eth_led_on(uint16_t port_id) > > if (*dev->dev_ops->dev_led_on == NULL) > return -ENOTSUP; >+ rte_eth_trace_led_on(port_id); > return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); > } > >@@ -4117,6 +4213,7 @@ rte_eth_led_off(uint16_t port_id) > > if (*dev->dev_ops->dev_led_off == NULL) > return -ENOTSUP; >+ rte_eth_trace_led_off(port_id); > return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); > } > >@@ -4142,6 +4239,7 @@ rte_eth_fec_get_capability(uint16_t port_id, > return -ENOTSUP; > ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, >num); > >+ rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); > return ret; > } > >@@ -4162,6 +4260,7 @@ rte_eth_fec_get(uint16_t port_id, uint32_t >*fec_capa) > > if (*dev->dev_ops->fec_get == NULL) > return -ENOTSUP; >+ rte_eth_trace_fec_get(port_id, fec_capa); > return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); > } > >@@ -4175,6 +4274,7 @@ rte_eth_fec_set(uint16_t port_id, uint32_t >fec_capa) > > if (*dev->dev_ops->fec_set == NULL) > return -ENOTSUP; >+ rte_eth_trace_fec_set(port_id, fec_capa); > return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); > } > >@@ -4252,6 +4352,7 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, >struct rte_ether_addr *addr, > return 0; > } > >+ rte_ethdev_trace_mac_addr_add(port_id, addr, pool); > /* Update NIC */ > ret = (*dev->dev_ops->mac_addr_add)(dev, addr, index, pool); > >@@ -4294,6 +4395,7 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, >struct rte_ether_addr *addr) > } else if (index < 0) > return 0; /* Do nothing if address wasn't found */ > >+ rte_ethdev_trace_mac_addr_remove(port_id, addr); > /* Update NIC */ > (*dev->dev_ops->mac_addr_remove)(dev, index); > >@@ -4329,6 +4431,7 @@ rte_eth_dev_default_mac_addr_set(uint16_t >port_id, struct rte_ether_addr *addr) > return -ENOTSUP; > > ret = (*dev->dev_ops->mac_addr_set)(dev, addr); >+ rte_ethdev_trace_default_mac_addr_set(port_id, addr, ret); > if (ret < 0) > return ret; > >@@ -4415,6 +4518,7 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, >struct rte_ether_addr *addr, > if (*dev->dev_ops->uc_hash_table_set == NULL) > return -ENOTSUP; > ret = (*dev->dev_ops->uc_hash_table_set)(dev, addr, on); >+ rte_ethdev_trace_uc_hash_table_set(port_id, addr, on, ret); > if (ret == 0) { > /* Update address in NIC data structure */ > if (on) >@@ -4438,6 +4542,7 @@ rte_eth_dev_uc_all_hash_table_set(uint16_t >port_id, uint8_t on) > > if (*dev->dev_ops->uc_all_hash_table_set == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_uc_all_hash_table_set(port_id, on); > return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, > on)); > } >@@ -4475,6 +4580,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, >uint16_t queue_idx, > > if (*dev->dev_ops->set_queue_rate_limit == NULL) > return -ENOTSUP; >+ rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate); > return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, > queue_idx, tx_rate)); > } >@@ -4502,6 +4608,7 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, >uint16_t queue_id, > } > if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) > return -ENOTSUP; >+ rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh); > return eth_err(port_id, (*dev->dev_ops- >>rx_queue_avail_thresh_set)(dev, > queue_id, >avail_thresh)); > } >@@ -4521,6 +4628,7 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, >uint16_t *queue_id, > > if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) > return -ENOTSUP; >+ rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id); > return eth_err(port_id, (*dev->dev_ops- >>rx_queue_avail_thresh_query)(dev, > queue_id, >avail_thresh)); > } >@@ -4570,6 +4678,9 @@ rte_eth_dev_callback_register(uint16_t port_id, > next_port = last_port = port_id; > } > >+ rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, >next_port, >+ last_port); >+ > rte_spinlock_lock(ð_dev_cb_lock); > > do { >@@ -4665,6 +4776,7 @@ rte_eth_dev_callback_unregister(uint16_t port_id, > } while (++next_port <= last_port); > > rte_spinlock_unlock(ð_dev_cb_lock); >+ rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, >ret); > return ret; > } > >@@ -4694,6 +4806,7 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, >int op, void *data) > for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { > vec = rte_intr_vec_list_index_get(intr_handle, qid); > rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); >+ rte_ethdev_trace_rx_intr_ctl(port_id, epfd, op, data, rc); > if (rc && rc != -EEXIST) { > RTE_ETHDEV_LOG(ERR, > "p %u q %u Rx ctl error op %d epfd %d vec >%u\n", >@@ -4737,6 +4850,7 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, >uint16_t queue_id) > (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; > fd = rte_intr_efds_index_get(intr_handle, efd_idx); > >+ rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); > return fd; > } > >@@ -4770,6 +4884,7 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, >uint16_t queue_id, > > vec = rte_intr_vec_list_index_get(intr_handle, queue_id); > rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); >+ rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); > if (rc && rc != -EEXIST) { > RTE_ETHDEV_LOG(ERR, > "p %u q %u Rx ctl error op %d epfd %d vec %u\n", >@@ -4796,6 +4911,7 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, > > if (*dev->dev_ops->rx_queue_intr_enable == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_rx_intr_enable(port_id, queue_id); > return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, >queue_id)); > } > >@@ -4815,6 +4931,7 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, > > if (*dev->dev_ops->rx_queue_intr_disable == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_rx_intr_disable(port_id, queue_id); > return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, >queue_id)); > } > >@@ -4873,6 +4990,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t >queue_id, > } > rte_spinlock_unlock(ð_dev_rx_cb_lock); > >+ rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, >cb); > return cb; > } > >@@ -4912,6 +5030,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, >uint16_t queue_id, > cb, __ATOMIC_RELEASE); > rte_spinlock_unlock(ð_dev_rx_cb_lock); > >+ rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, >user_param, cb); > return cb; > } > >@@ -4971,6 +5090,7 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t >queue_id, > } > rte_spinlock_unlock(ð_dev_tx_cb_lock); > >+ rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, >cb); > return cb; > } > >@@ -5005,6 +5125,7 @@ rte_eth_remove_rx_callback(uint16_t port_id, >uint16_t queue_id, > } > rte_spinlock_unlock(ð_dev_rx_cb_lock); > >+ rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); > return ret; > } > >@@ -5039,6 +5160,7 @@ rte_eth_remove_tx_callback(uint16_t port_id, >uint16_t queue_id, > } > rte_spinlock_unlock(ð_dev_tx_cb_lock); > >+ rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); > return ret; > } > >@@ -5085,6 +5207,7 @@ rte_eth_rx_queue_info_get(uint16_t port_id, >uint16_t queue_id, > dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); > qinfo->queue_state = dev->data->rx_queue_state[queue_id]; > >+ rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); > return 0; > } > >@@ -5131,6 +5254,7 @@ rte_eth_tx_queue_info_get(uint16_t port_id, >uint16_t queue_id, > dev->dev_ops->txq_info_get(dev, queue_id, qinfo); > qinfo->queue_state = dev->data->tx_queue_state[queue_id]; > >+ rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); > return 0; > } > >@@ -5158,6 +5282,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, >uint16_t queue_id, > if (*dev->dev_ops->rx_burst_mode_get == NULL) > return -ENOTSUP; > memset(mode, 0, sizeof(*mode)); >+ rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode); > return eth_err(port_id, > dev->dev_ops->rx_burst_mode_get(dev, queue_id, >mode)); > } >@@ -5186,6 +5311,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, >uint16_t queue_id, > if (*dev->dev_ops->tx_burst_mode_get == NULL) > return -ENOTSUP; > memset(mode, 0, sizeof(*mode)); >+ rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode); > return eth_err(port_id, > dev->dev_ops->tx_burst_mode_get(dev, queue_id, >mode)); > } >@@ -5213,6 +5339,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, >uint16_t queue_id, > > if (*dev->dev_ops->get_monitor_addr == NULL) > return -ENOTSUP; >+ rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc); > return eth_err(port_id, > dev->dev_ops->get_monitor_addr(dev->data- >>rx_queues[queue_id], pmc)); > } >@@ -5229,6 +5356,7 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, > > if (*dev->dev_ops->set_mc_addr_list == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, >nb_mc_addr); > return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, > mc_addr_set, nb_mc_addr)); > } >@@ -5243,6 +5371,7 @@ rte_eth_timesync_enable(uint16_t port_id) > > if (*dev->dev_ops->timesync_enable == NULL) > return -ENOTSUP; >+ rte_eth_trace_timesync_enable(port_id); > return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); > } > >@@ -5256,6 +5385,7 @@ rte_eth_timesync_disable(uint16_t port_id) > > if (*dev->dev_ops->timesync_disable == NULL) > return -ENOTSUP; >+ rte_eth_trace_timesync_disable(port_id); > return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); > } > >@@ -5277,6 +5407,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t >port_id, struct timespec *timestamp, > > if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) > return -ENOTSUP; >+ rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, >flags); > return eth_err(port_id, (*dev->dev_ops- >>timesync_read_rx_timestamp) > (dev, timestamp, flags)); > } >@@ -5299,6 +5430,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t >port_id, > > if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) > return -ENOTSUP; >+ rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp); > return eth_err(port_id, (*dev->dev_ops- >>timesync_read_tx_timestamp) > (dev, timestamp)); > } >@@ -5313,6 +5445,7 @@ rte_eth_timesync_adjust_time(uint16_t port_id, >int64_t delta) > > if (*dev->dev_ops->timesync_adjust_time == NULL) > return -ENOTSUP; >+ rte_eth_trace_timesync_adjust_time(port_id, delta); > return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, >delta)); > } > >@@ -5333,6 +5466,7 @@ rte_eth_timesync_read_time(uint16_t port_id, >struct timespec *timestamp) > > if (*dev->dev_ops->timesync_read_time == NULL) > return -ENOTSUP; >+ rte_eth_trace_timesync_read_time(port_id, timestamp); > return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, > timestamp)); > } >@@ -5354,6 +5488,7 @@ rte_eth_timesync_write_time(uint16_t port_id, >const struct timespec *timestamp) > > if (*dev->dev_ops->timesync_write_time == NULL) > return -ENOTSUP; >+ rte_eth_trace_timesync_write_time(port_id, timestamp); > return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, > timestamp)); > } >@@ -5374,6 +5509,7 @@ rte_eth_read_clock(uint16_t port_id, uint64_t >*clock) > > if (*dev->dev_ops->read_clock == NULL) > return -ENOTSUP; >+ rte_eth_trace_read_clock(port_id, clock); > return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); > } > >@@ -5394,6 +5530,7 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct >rte_dev_reg_info *info) > > if (*dev->dev_ops->get_reg == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_get_reg_info(port_id, info); > return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); > } > >@@ -5407,6 +5544,7 @@ rte_eth_dev_get_eeprom_length(uint16_t port_id) > > if (*dev->dev_ops->get_eeprom_length == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_get_eeprom_length(port_id); > return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); > } > >@@ -5427,6 +5565,7 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct >rte_dev_eeprom_info *info) > > if (*dev->dev_ops->get_eeprom == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_get_eeprom(port_id, info); > return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); > } > >@@ -5447,6 +5586,7 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct >rte_dev_eeprom_info *info) > > if (*dev->dev_ops->set_eeprom == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_set_eeprom(port_id, info); > return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); > } > >@@ -5468,6 +5608,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, > > if (*dev->dev_ops->get_module_info == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_get_module_info(port_id, modinfo); > return (*dev->dev_ops->get_module_info)(dev, modinfo); > } > >@@ -5503,6 +5644,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, > > if (*dev->dev_ops->get_module_eeprom == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_get_module_eeprom(port_id, info); > return (*dev->dev_ops->get_module_eeprom)(dev, info); > } > >@@ -5526,6 +5668,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, > > if (*dev->dev_ops->get_dcb_info == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_get_dcb_info(port_id, dcb_info); > return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, >dcb_info)); > } > >@@ -5562,6 +5705,7 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t >port_id, > if (nb_tx_desc != NULL) > eth_dev_adjust_nb_desc(nb_tx_desc, >&dev_info.tx_desc_lim); > >+ rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id, *nb_rx_desc, >*nb_tx_desc); > return 0; > } > >@@ -5584,6 +5728,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t >port_id, > if (*dev->dev_ops->hairpin_cap_get == NULL) > return -ENOTSUP; > memset(cap, 0, sizeof(*cap)); >+ rte_ethdev_trace_hairpin_capability_get(port_id, cap); > return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); > } > >@@ -5605,6 +5750,7 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, >const char *pool) > if (*dev->dev_ops->pool_ops_supported == NULL) > return 1; /* all pools are supported */ > >+ rte_ethdev_trace_pool_ops_supported(port_id, pool); > return (*dev->dev_ops->pool_ops_supported)(dev, pool); > } > >@@ -5901,6 +6047,7 @@ rte_eth_representor_info_get(uint16_t port_id, > > if (*dev->dev_ops->representor_info_get == NULL) > return -ENOTSUP; >+ rte_eth_trace_representor_info_get(port_id, info); > return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, >info)); > } > >@@ -5924,6 +6071,7 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, >uint64_t *features) > return -EINVAL; > } > >+ rte_eth_trace_rx_metadata_negotiate(port_id, features, *features); > if (*dev->dev_ops->rx_metadata_negotiate == NULL) > return -ENOTSUP; > return eth_err(port_id, >@@ -5956,6 +6104,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t >port_id, > return -ENOTSUP; > memset(reassembly_capa, 0, sizeof(struct >rte_eth_ip_reassembly_params)); > >+ rte_eth_trace_ip_reassembly_capability_get(port_id, >reassembly_capa); > return eth_err(port_id, (*dev->dev_ops- >>ip_reassembly_capability_get) > (dev, reassembly_capa)); > } >@@ -5985,6 +6134,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, > if (*dev->dev_ops->ip_reassembly_conf_get == NULL) > return -ENOTSUP; > memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); >+ rte_eth_trace_ip_reassembly_conf_get(port_id, conf); > return eth_err(port_id, > (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); > } >@@ -6022,6 +6172,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, > > if (*dev->dev_ops->ip_reassembly_conf_set == NULL) > return -ENOTSUP; >+ rte_eth_trace_ip_reassembly_conf_set(port_id, conf); > return eth_err(port_id, > (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); > } >@@ -6041,6 +6192,7 @@ rte_eth_dev_priv_dump(uint16_t port_id, FILE *file) > > if (*dev->dev_ops->eth_dev_priv_dump == NULL) > return -ENOTSUP; >+ rte_ethdev_trace_priv_dump(port_id); > return eth_err(port_id, (*dev->dev_ops->eth_dev_priv_dump)(dev, >file)); > } > >diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h >index 1491c815c3..802f2c1ae1 100644 >--- a/lib/ethdev/rte_ethdev_trace.h >+++ b/lib/ethdev/rte_ethdev_trace.h >@@ -88,6 +88,1200 @@ RTE_TRACE_POINT( > rte_trace_point_emit_u16(port_id); > ) > >+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, void *user_param, >+ 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_rx_callback, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >+ rte_rx_callback_fn fn, void *user_param, >+ 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, void *user_param, >+ 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_allmulticast_disable, >+ 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_allmulticast_enable, >+ 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_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_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_adjust_nb_rx_tx_desc, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t nb_rx_desc, >+ uint16_t nb_tx_desc), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(nb_rx_desc); >+ rte_trace_point_emit_u16(nb_tx_desc); >+) >+ >+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, 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, 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_default_mac_addr_set, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >*addr, int ret), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(addr); >+ rte_trace_point_emit_int(ret); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_flow_ctrl_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf >*fc_conf), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(fc_conf); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_flow_ctrl_set, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf >*fc_conf), >+ 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( >+ rte_ethdev_trace_fw_version_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, char *fw_version, size_t >fw_size), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(fw_version); >+ rte_trace_point_emit_size_t(fw_size); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_get_dcb_info, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info >*dcb_info), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(dcb_info); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_get_eeprom, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct >rte_dev_eeprom_info *info), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(info); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_get_eeprom_length, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ 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); >+) >+ >+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, 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_get_reg_info, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_reg_info >*info), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(info); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_get_sec_ctx, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_get_supported_ptypes, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, >+ uint32_t *ptypes, int num, int j), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u32(ptype_mask); >+ rte_trace_point_emit_ptr(ptypes); >+ rte_trace_point_emit_int(num); >+ rte_trace_point_emit_int(j); >+) >+ >+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_info_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ 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_u32(dev_info->if_index); >+ 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_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_u16(dev_info->nb_rx_queues); >+ rte_trace_point_emit_u16(dev_info->nb_tx_queues); >+) >+ >+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_ethdev_trace_is_valid_port, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_mac_addr_add, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >*addr, >+ uint32_t pool), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(addr); >+ rte_trace_point_emit_u32(pool); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_mac_addr_remove, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >*addr), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(addr); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_pool_ops_supported, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *pool), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(pool); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_priority_flow_ctrl_set, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_pfc_conf >*pfc_conf), >+ 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( >+ 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_ethdev_trace_rss_hash_conf_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf >*rss_conf), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(rss_conf); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_rss_hash_update, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf >*rss_conf), >+ 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( >+ rte_ethdev_trace_rss_reta_query, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t >reta_size), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(reta_conf); >+ rte_trace_point_emit_u16(reta_size); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_rss_reta_update, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t >reta_size), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u64(reta_conf->mask); >+ rte_trace_point_emit_u16(reta_size); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_rx_intr_ctl, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, int epfd, int op, void >*data, int rc), >+ rte_trace_point_emit_u16(port_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_ethdev_trace_rx_intr_ctl_q, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int >epfd, >+ int op, 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_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_disable, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(queue_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_rx_intr_enable, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(queue_id); >+) >+ >+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_rx_queue_start, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(rx_queue_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_rx_queue_stop, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(rx_queue_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_set_eeprom, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct >rte_dev_eeprom_info *info), >+ 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( >+ rte_ethdev_trace_set_link_down, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_set_link_up, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_set_mc_addr_list, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_ether_addr *mc_addr_set, >+ uint32_t nb_mc_addr), >+ 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( >+ rte_ethdev_trace_set_ptypes, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, >+ uint32_t *set_ptypes, unsigned int num), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u32(ptype_mask); >+ rte_trace_point_emit_ptr(set_ptypes); >+ rte_trace_point_emit_u32(num); >+) >+ >+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), >+ 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( >+ 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), >+ 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( >+ 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), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_int(vlan_type); >+ rte_trace_point_emit_u16(tag_type); >+) >+ >+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_set_vlan_pvid, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t pvid, int on), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(pvid); >+ rte_trace_point_emit_int(on); >+) >+ >+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_socket_id, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+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_tx_queue_start, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(tx_queue_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_tx_queue_stop, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(tx_queue_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_uc_all_hash_table_set, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint8_t on), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u8(on); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_uc_hash_table_set, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >*addr, >+ uint8_t on, int ret), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(addr); >+ rte_trace_point_emit_u8(on); >+ rte_trace_point_emit_int(ret); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_udp_tunnel_port_add, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_udp_tunnel >*tunnel_udp), >+ 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( >+ rte_ethdev_trace_udp_tunnel_port_delete, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_udp_tunnel >*tunnel_udp), >+ 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( >+ 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_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_start, >+ const struct rte_device *parent), >+ rte_trace_point_emit_u16(port_id_start); >+ rte_trace_point_emit_ptr(parent); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_find_next_owned_by, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ const uint64_t owner_id), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u64(owner_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_find_next_sibling, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t >ref_port_id), >+ rte_trace_point_emit_u16(port_id_start); >+ rte_trace_point_emit_u16(ref_port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_iterator_cleanup, >+ RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), >+ rte_trace_point_emit_ptr(iter); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_iterator_init, >+ RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter, const char >*devargs), >+ rte_trace_point_emit_ptr(iter); >+ rte_trace_point_emit_ptr(devargs); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_iterator_next, >+ RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), >+ rte_trace_point_emit_ptr(iter); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_led_off, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_led_on, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_link_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u32(link->link_speed); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_link_get_nowait, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u32(link->link_speed); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_macaddr_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >*mac_addr), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(mac_addr); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_promiscuous_disable, >+ 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_promiscuous_enable, >+ 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_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_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_burst_mode_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >+ struct rte_eth_burst_mode *mode), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(queue_id); >+ rte_trace_point_emit_ptr(mode); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_rx_queue_info_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >+ 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->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_rx_queue_setup, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, >+ uint16_t nb_rx_desc, unsigned int socket_id, >+ const struct rte_eth_rxconf *rx_conf, >+ struct rte_mempool *mb_pool), >+ 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_u32(socket_id); >+ rte_trace_point_emit_ptr(rx_conf); >+ rte_trace_point_emit_ptr(mb_pool); >+) >+ >+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), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(queue_idx); >+ rte_trace_point_emit_u16(tx_rate); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_speed_bitflag, >+ RTE_TRACE_POINT_ARGS(uint32_t speed, int duplex), >+ rte_trace_point_emit_u32(speed); >+ rte_trace_point_emit_int(duplex); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_stats_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats >*stats), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(stats); >+ rte_trace_point_emit_u64(stats->rx_nombuf); >+) >+ >+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_timesync_adjust_time, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, int64_t delta), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_i64(delta); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_timesync_disable, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_timesync_enable, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_timesync_read_rx_timestamp, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec >*timestamp, >+ uint32_t flags), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(timestamp); >+ rte_trace_point_emit_u32(flags); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_timesync_read_time, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *time), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(time); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_timesync_read_tx_timestamp, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec >*timestamp), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(timestamp); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_timesync_write_time, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct timespec >*time), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(time); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_tx_buffer_count_callback, >+ RTE_TRACE_POINT_ARGS(struct rte_mbuf **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); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_tx_buffer_drop_callback, >+ RTE_TRACE_POINT_ARGS(struct rte_mbuf **pkts, uint16_t unsent), >+ rte_trace_point_emit_ptr(pkts); >+ rte_trace_point_emit_u16(unsent); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_tx_buffer_init, >+ RTE_TRACE_POINT_ARGS(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_buffer_set_err_callback, >+ RTE_TRACE_POINT_ARGS(struct rte_eth_dev_tx_buffer *buffer, >+ buffer_tx_error_fn callback, void *userdata), >+ rte_trace_point_emit_ptr(buffer); >+ rte_trace_point_emit_ptr(callback); >+ rte_trace_point_emit_ptr(userdata); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_tx_burst_mode_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >+ struct rte_eth_burst_mode *mode), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(queue_id); >+ rte_trace_point_emit_ptr(mode); >+) >+ >+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_tx_queue_info_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >+ 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_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); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_xstats_get_by_id, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, >+ 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_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_ptr(id); >+) >+ >+RTE_TRACE_POINT( >+ 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); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_xstats_get_names_by_id, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ 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_reset, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_owner_delete, >+ RTE_TRACE_POINT_ARGS(const 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_owner_get, >+ RTE_TRACE_POINT_ARGS(const uint16_t port_id, >+ 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_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(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), >+ 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_get_module_eeprom, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_dev_eeprom_info *info), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(info); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_get_module_info, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_eth_dev_module_info *modinfo), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(modinfo); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_read_clock, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t *clk), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(clk); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_hairpin_capability_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_eth_hairpin_cap *cap), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(cap); >+) >+ >+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), >+ 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_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), >+ 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_ptr(conf); >+ 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_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); >+) >+ >+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_link_speed_to_str, >+ RTE_TRACE_POINT_ARGS(uint32_t link_speed), >+ rte_trace_point_emit_u32(link_speed); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_link_to_str, >+ RTE_TRACE_POINT_ARGS(char *str, size_t len, >+ const struct rte_eth_link *eth_link), >+ rte_trace_point_emit_ptr(str); >+ rte_trace_point_emit_size_t(len); >+ rte_trace_point_emit_ptr(eth_link); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_fec_get_capability, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ 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(num); >+ rte_trace_point_emit_int(ret); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_fec_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t *fec_capa), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(fec_capa); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_fec_set, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t fec_capa), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u32(fec_capa); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_get_monitor_addr, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >+ struct rte_power_monitor_cond *pmc), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(queue_id); >+ rte_trace_point_emit_ptr(pmc); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_representor_info_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_eth_representor_info *info), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(info); >+) >+ >+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_conf_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_eth_trace_macaddrs_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >*ma, >+ unsigned int num), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(ma); >+ rte_trace_point_emit_u32(num); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_rx_metadata_negotiate, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t *features, >+ uint64_t features_val), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(features); >+ rte_trace_point_emit_u64(features_val); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_priority_flow_ctrl_queue_configure, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_eth_pfc_queue_conf *pfc_queue_conf), >+ 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( >+ rte_ethdev_trace_priority_flow_ctrl_queue_info_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_eth_pfc_queue_info *pfc_queue_info), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(pfc_queue_info); >+) >+ >+RTE_TRACE_POINT( >+ rte_ethdev_trace_priv_dump, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >+ rte_trace_point_emit_u16(port_id); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_ip_reassembly_capability_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_eth_ip_reassembly_params *capa), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(capa); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_ip_reassembly_conf_get, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >+ struct rte_eth_ip_reassembly_params *conf), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(conf); >+) >+ >+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), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_ptr(conf); >+) >+ >+RTE_TRACE_POINT( >+ rte_eth_trace_rx_avail_thresh_query, >+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(queue_id); >+) >+ >+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), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(queue_id); >+ rte_trace_point_emit_u8(avail_thresh); >+) >+ > #ifdef __cplusplus > } > #endif >diff --git a/lib/ethdev/rte_ethdev_trace_fp.h >b/lib/ethdev/rte_ethdev_trace_fp.h >index 40084d1929..ba3fdd04a2 100644 >--- a/lib/ethdev/rte_ethdev_trace_fp.h >+++ b/lib/ethdev/rte_ethdev_trace_fp.h >@@ -37,6 +37,25 @@ 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, >+ 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_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, >+ uint16_t nb_pkts), >+ rte_trace_point_emit_u16(port_id); >+ rte_trace_point_emit_u16(queue_id); >+ rte_trace_point_emit_u16(nb_pkts); >+) >+ > #ifdef __cplusplus > } > #endif >diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map >index 3651ceb234..79d0b2ee1f 100644 >--- a/lib/ethdev/version.map >+++ b/lib/ethdev/version.map >@@ -319,4 +319,148 @@ INTERNAL { > rte_eth_representor_id_get; > rte_eth_switch_domain_alloc; > rte_eth_switch_domain_free; >+ __rte_eth_trace_add_first_rx_callback; >+ __rte_eth_trace_add_rx_callback; >+ __rte_eth_trace_add_tx_callback; >+ __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_ethdev_trace_count_avail; >+ __rte_ethdev_trace_count_total; >+ __rte_ethdev_trace_set_mtu; >+ __rte_ethdev_trace_adjust_nb_rx_tx_desc; >+ __rte_ethdev_trace_callback_register; >+ __rte_ethdev_trace_callback_unregister; >+ __rte_ethdev_trace_default_mac_addr_set; >+ __rte_ethdev_trace_flow_ctrl_get; >+ __rte_ethdev_trace_flow_ctrl_set; >+ __rte_ethdev_trace_fw_version_get; >+ __rte_ethdev_trace_get_dcb_info; >+ __rte_ethdev_trace_get_eeprom; >+ __rte_ethdev_trace_get_eeprom_length; >+ __rte_ethdev_trace_get_mtu; >+ __rte_ethdev_trace_get_name_by_port; >+ __rte_ethdev_trace_get_port_by_name; >+ __rte_ethdev_trace_get_reg_info; >+ __rte_ethdev_trace_get_sec_ctx; >+ __rte_ethdev_trace_get_supported_ptypes; >+ __rte_ethdev_trace_get_vlan_offload; >+ __rte_ethdev_trace_info_get; >+ __rte_ethdev_trace_is_removed; >+ __rte_ethdev_trace_is_valid_port; >+ __rte_ethdev_trace_mac_addr_add; >+ __rte_ethdev_trace_mac_addr_remove; >+ __rte_ethdev_trace_pool_ops_supported; >+ __rte_ethdev_trace_priority_flow_ctrl_set; >+ __rte_ethdev_trace_reset; >+ __rte_ethdev_trace_rss_hash_conf_get; >+ __rte_ethdev_trace_rss_hash_update; >+ __rte_ethdev_trace_rss_reta_query; >+ __rte_ethdev_trace_rss_reta_update; >+ __rte_ethdev_trace_rx_intr_ctl; >+ __rte_ethdev_trace_rx_intr_ctl_q; >+ __rte_ethdev_trace_rx_intr_ctl_q_get_fd; >+ __rte_ethdev_trace_rx_intr_disable; >+ __rte_ethdev_trace_rx_intr_enable; >+ __rte_ethdev_trace_rx_offload_name; >+ __rte_ethdev_trace_rx_queue_start; >+ __rte_ethdev_trace_rx_queue_stop; >+ __rte_ethdev_trace_set_eeprom; >+ __rte_ethdev_trace_set_link_down; >+ __rte_ethdev_trace_set_link_up; >+ __rte_ethdev_trace_set_mc_addr_list; >+ __rte_ethdev_trace_set_ptypes; >+ __rte_ethdev_trace_set_rx_queue_stats_mapping; >+ __rte_ethdev_trace_set_tx_queue_stats_mapping; >+ __rte_ethdev_trace_set_vlan_ether_type; >+ __rte_ethdev_trace_set_vlan_offload; >+ __rte_ethdev_trace_set_vlan_pvid; >+ __rte_ethdev_trace_set_vlan_strip_on_queue; >+ __rte_ethdev_trace_socket_id; >+ __rte_ethdev_trace_tx_offload_name; >+ __rte_ethdev_trace_tx_queue_start; >+ __rte_ethdev_trace_tx_queue_stop; >+ __rte_ethdev_trace_uc_all_hash_table_set; >+ __rte_ethdev_trace_uc_hash_table_set; >+ __rte_ethdev_trace_udp_tunnel_port_add; >+ __rte_ethdev_trace_udp_tunnel_port_delete; >+ __rte_ethdev_trace_vlan_filter; >+ __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_iterator_cleanup; >+ __rte_eth_trace_iterator_init; >+ __rte_eth_trace_iterator_next; >+ __rte_eth_trace_led_off; >+ __rte_eth_trace_led_on; >+ __rte_eth_trace_link_get; >+ __rte_eth_trace_link_get_nowait; >+ __rte_eth_trace_macaddr_get; >+ __rte_eth_trace_promiscuous_disable; >+ __rte_eth_trace_promiscuous_enable; >+ __rte_eth_trace_promiscuous_get; >+ __rte_eth_trace_remove_rx_callback; >+ __rte_eth_trace_remove_tx_callback; >+ __rte_eth_trace_rx_burst_mode_get; >+ __rte_eth_trace_rx_queue_info_get; >+ __rte_eth_trace_rx_queue_setup; >+ __rte_eth_trace_set_queue_rate_limit; >+ __rte_eth_trace_speed_bitflag; >+ __rte_eth_trace_stats_get; >+ __rte_eth_trace_stats_reset; >+ __rte_eth_trace_timesync_adjust_time; >+ __rte_eth_trace_timesync_disable; >+ __rte_eth_trace_timesync_enable; >+ __rte_eth_trace_timesync_read_rx_timestamp; >+ __rte_eth_trace_timesync_read_time; >+ __rte_eth_trace_timesync_read_tx_timestamp; >+ __rte_eth_trace_timesync_write_time; >+ __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_burst_mode_get; >+ __rte_eth_trace_tx_done_cleanup; >+ __rte_eth_trace_tx_queue_info_get; >+ __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_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_get_module_eeprom; >+ __rte_ethdev_trace_get_module_info; >+ __rte_ethdev_trace_hairpin_capability_get; >+ __rte_eth_trace_rx_hairpin_queue_setup; >+ __rte_eth_trace_tx_hairpin_queue_setup; >+ __rte_eth_trace_hairpin_bind; >+ __rte_eth_trace_hairpin_get_peer_ports; >+ __rte_eth_trace_hairpin_unbind; >+ __rte_eth_trace_link_speed_to_str; >+ __rte_eth_trace_link_to_str; >+ __rte_eth_trace_fec_get_capability; >+ __rte_eth_trace_fec_get; >+ __rte_eth_trace_fec_set; >+ __rte_eth_trace_get_monitor_addr; >+ __rte_eth_trace_representor_info_get; >+ __rte_ethdev_trace_capability_name; >+ __rte_ethdev_trace_conf_get; >+ __rte_eth_trace_macaddrs_get; >+ __rte_eth_trace_rx_metadata_negotiate; >+ __rte_ethdev_trace_priority_flow_ctrl_queue_configure; >+ __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; >+ __rte_ethdev_trace_priv_dump; >+ __rte_eth_trace_ip_reassembly_capability_get; >+ __rte_eth_trace_ip_reassembly_conf_get; >+ __rte_eth_trace_ip_reassembly_conf_set; >+ __rte_eth_trace_rx_avail_thresh_query; >+ __rte_eth_trace_rx_avail_thresh_set; > }; >-- >2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v3 1/4] ethdev: add trace points 2022-10-07 16:23 ` Ankur Dwivedi @ 2022-10-10 6:39 ` Ankur Dwivedi 2022-12-12 18:34 ` Ferruh Yigit 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-10 6:39 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Morten Brørup Hi All, >-----Original Message----- >From: Ankur Dwivedi >Sent: Friday, October 7, 2022 9:54 PM >To: dev@dpdk.org; Morten Brørup <mb@smartsharesystems.com> >Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor Russkikh ><irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; yisen.zhuang@huawei.com; >xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; >zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; >qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; >xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; >rosen.xu@intel.com; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; >Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori ><skori@marvell.com>; Satha Koteswara Rao Kottidi ><skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara ><sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >sthemmin@microsoft.com; longli@microsoft.com; spinler@cesnet.cz; >chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; >apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >Rasesh Mody <rmody@marvell.com>; Shahed Shaikh ><shshaikh@marvell.com>; Devendra Singh Rawat ><dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; jgrajcia@cisco.com >Subject: RE: [PATCH v3 1/4] ethdev: add trace points > >Hi Morten, > >>-----Original Message----- >>From: Ankur Dwivedi <adwivedi@marvell.com> >>Sent: Thursday, October 6, 2022 8:49 PM >>To: dev@dpdk.org >>Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >>ferruh.yigit@xilinx.com; chas3@att.com; humin29@huawei.com; >>linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >>mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >>evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >>Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >>ed.czeck@atomicrules.com; john.miller@atomicrules.com; >>ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >>Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >>Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >>hyonkim@cisco.com; liudongdong3@huawei.com; >>yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >>cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >>simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >>Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >>jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >>Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda >><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >>Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi >><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla >><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >>Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >>viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@microsoft.com; >>spinler@cesnet.cz; chaoyong.he@corigine.com; >>niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >>sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >>sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody >><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >>Singh Rawat <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >>jiawenwu@trustnetic.com; jianwang@trustnetic.com; >>jbehrens@vmware.com; maxime.coquelin@redhat.com; >>chenbo.xia@intel.com; steven.webster@windriver.com; >>matt.peters@windriver.com; bruce.richardson@intel.com; >>mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; >>cristian.dumitrescu@intel.com; jgrajcia@cisco.com; Ankur Dwivedi >><adwivedi@marvell.com> >>Subject: [PATCH v3 1/4] ethdev: add trace points >> >>Add trace points for ethdev functions. >> >>Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >>--- >Yes the functions you mentioned in previous comment are called in while loop >in worker core. So I think they are fastpath. >rte_eth_stats_get() is called in fastpath. Similar to rte_eth_macaddr_get(), I >think functions like >rte_eth_pro miscuous_get(), rte_eth_allmulticast_get() can also be called in >fastpath. >I am not sure which other functions can be fastpath. Is there a guideline/theme >which can be used to determine this? [Ankur] I will make the trace call in following functions as fast path trace, considering they are used in while loop in worker core or as rx/tx callback in examples applications. rte_eth_tx_buffer_drop_callback rte_eth_tx_buffer_count_callback rte_eth_tx_done_cleanup rte_eth_macaddr_get rte_eth_timesync_read_rx_timestamp rte_eth_timesync_read_tx_timestamp rte_eth_timesync_adjust_time rte_eth_timesync_read_time rte_eth_timesync_write_time rte_eth_stats_get rte_flow_get_restore_info rte_eth_read_clock Please let me know your comments on the patch series. > >> lib/ethdev/ethdev_private.c | 3 + >> lib/ethdev/ethdev_trace_points.c | 435 +++++++++++ >> lib/ethdev/rte_ethdev.c | 152 ++++ >> lib/ethdev/rte_ethdev_trace.h | 1194 ++++++++++++++++++++++++++++++ >> lib/ethdev/rte_ethdev_trace_fp.h | 19 + >> lib/ethdev/version.map | 144 ++++ >> 6 files changed, 1947 insertions(+) >> >>diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c >>index 48090c879a..08e7f49fd8 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.h" >> #include "ethdev_driver.h" >> #include "ethdev_private.h" >> >>@@ -297,6 +298,7 @@ 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, nb_rx, nb_pkts); >> return nb_rx; >> } >> >>@@ -312,6 +314,7 @@ 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, nb_pkts); >> return nb_pkts; >> } >> >>diff --git a/lib/ethdev/ethdev_trace_points.c >>b/lib/ethdev/ethdev_trace_points.c >>index 2919409a15..2c06b47b7f 100644 >>--- a/lib/ethdev/ethdev_trace_points.c >>+++ b/lib/ethdev/ethdev_trace_points.c >>@@ -29,3 +29,438 @@ >>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_add_first_rx_callback, >>+ lib.ethdev.add_first_rx_callback) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_rx_callback, >>+ lib.ethdev.add_rx_callback) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_add_tx_callback, >>+ lib.ethdev.add_tx_callback) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_disable, >>+ lib.ethdev.allmulticast_disable) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_enable, >>+ lib.ethdev.allmulticast_enable) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_allmulticast_get, >>+ lib.ethdev.allmulticast_get) >>+ >>+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_ethdev_trace_set_mtu, >>+ lib.ethdev.set_mtu) >>+ >>+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_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_default_mac_addr_set, >>+ lib.ethdev.default_mac_addr_set) >>+ >>+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_fw_version_get, >>+ lib.ethdev.fw_version_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_dcb_info, >>+ lib.ethdev.get_dcb_info) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom, >>+ lib.ethdev.get_eeprom) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_eeprom_length, >>+ lib.ethdev.get_eeprom_length) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_mtu, >>+ lib.ethdev.get_mtu) >>+ >>+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_get_reg_info, >>+ lib.ethdev.get_reg_info) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_sec_ctx, >>+ lib.ethdev.get_sec_ctx) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_supported_ptypes, >>+ lib.ethdev.get_supported_ptypes) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_vlan_offload, >>+ lib.ethdev.get_vlan_offload) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_info_get, >>+ lib.ethdev.info_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_removed, >>+ lib.ethdev.is_removed) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_is_valid_port, >>+ lib.ethdev.is_valid_port) >>+ >>+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_pool_ops_supported, >>+ lib.ethdev.pool_ops_supported) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_set, >>+ lib.ethdev.priority_flow_ctrl_set) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_reset, >>+ lib.ethdev.reset) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_conf_get, >>+ lib.ethdev.rss_hash_conf_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_hash_update, >>+ lib.ethdev.rss_hash_update) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_query, >>+ lib.ethdev.rss_reta_query) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rss_reta_update, >>+ lib.ethdev.rss_reta_update) >>+ >>+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, >>+ lib.ethdev.rx_intr_ctl_q) >>+ >>+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_disable, >>+ lib.ethdev.rx_intr_disable) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_intr_enable, >>+ lib.ethdev.rx_intr_enable) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_offload_name, >>+ lib.ethdev.rx_offload_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_set_eeprom, >>+ lib.ethdev.set_eeprom) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_down, >>+ lib.ethdev.set_link_down) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_link_up, >>+ lib.ethdev.set_link_up) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_mc_addr_list, >>+ lib.ethdev.set_mc_addr_list) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_ptypes, >>+ lib.ethdev.set_ptypes) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mappi >>ng, >>+ lib.ethdev.set_rx_queue_stats_mapping) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_tx_queue_stats_mappi >n >>g, >>+ lib.ethdev.set_tx_queue_stats_mapping) >>+ >>+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_set_vlan_pvid, >>+ lib.ethdev.set_vlan_pvid) >>+ >>+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_socket_id, >>+ lib.ethdev.socket_id) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_tx_offload_name, >>+ lib.ethdev.tx_offload_name) >>+ >>+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_ethdev_trace_uc_all_hash_table_set, >>+ lib.ethdev.uc_all_hash_table_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_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_ethdev_trace_vlan_filter, >>+ lib.ethdev.vlan_filter) >>+ >>+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_owned_by, >>+ lib.ethdev.find_next_owned_by) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_find_next_sibling, >>+ lib.ethdev.find_next_sibling) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_iterator_cleanup, >>+ lib.ethdev.iterator_cleanup) >>+ >>+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_led_off, >>+ lib.ethdev.led_off) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_led_on, >>+ lib.ethdev.led_on) >>+ >>+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_macaddr_get, >>+ lib.ethdev.macaddr_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_disable, >>+ lib.ethdev.promiscuous_disable) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_enable, >>+ lib.ethdev.promiscuous_enable) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_promiscuous_get, >>+ lib.ethdev.promiscuous_get) >>+ >>+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_burst_mode_get, >>+ lib.ethdev.rx_burst_mode_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_info_get, >>+ lib.ethdev.rx_queue_info_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_setup, >>+ lib.ethdev.rx_queue_setup) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_set_queue_rate_limit, >>+ lib.ethdev.set_queue_rate_limit) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_speed_bitflag, >>+ lib.ethdev.speed_bitflag) >>+ >>+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_timesync_adjust_time, >>+ lib.ethdev.timesync_adjust_time) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_disable, >>+ lib.ethdev.timesync_disable) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_timesync_enable, >>+ lib.ethdev.timesync_enable) >>+ >>+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_time, >>+ lib.ethdev.timesync_read_time) >>+ >>+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_write_time, >>+ lib.ethdev.timesync_write_time) >>+ >>+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_drop_callback, >>+ lib.ethdev.tx_buffer_drop_callback) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_buffer_init, >>+ lib.ethdev.tx_buffer_init) >>+ >>+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_burst_mode_get, >>+ lib.ethdev.tx_burst_mode_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_done_cleanup, >>+ lib.ethdev.tx_done_cleanup) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_queue_info_get, >>+ lib.ethdev.tx_queue_info_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get, >>+ lib.ethdev.xstats_get) >>+ >>+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_id_by_name, >>+ lib.ethdev.xstats_get_id_by_name) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_xstats_get_names, >>+ lib.ethdev.xstats_get_names) >>+ >>+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_reset, >>+ lib.ethdev.xstats_reset) >>+ >>+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_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_get_module_eeprom, >>+ lib.ethdev.get_module_eeprom) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_get_module_info, >>+ lib.ethdev.get_module_info) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_read_clock, >>+ lib.ethdev.read_clock) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_hairpin_capability_get, >>+ lib.ethdev.hairpin_capability_get) >>+ >>+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_get_peer_ports, >>+ lib.ethdev.hairpin_get_peer_ports) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_hairpin_unbind, >>+ lib.ethdev.hairpin_unbind) >>+ >>+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_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_eth_trace_get_monitor_addr, >>+ lib.ethdev.get_monitor_addr) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_representor_info_get, >>+ lib.ethdev.representor_info_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_capability_name, >>+ lib.ethdev.capability_name) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_conf_get, >>+ lib.ethdev.conf_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_macaddrs_get, >>+ lib.ethdev.macaddrs_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_metadata_negotiate, >>+ lib.ethdev.rx_metadata_negotiate) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_c >o >>nfigure, >>+ lib.ethdev.priority_flow_ctrl_queue_configure) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_i >n >>fo_get, >>+ lib.ethdev.priority_flow_ctrl_queue_info_get) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priv_dump, >>+ lib.ethdev.priv_dump) >>+ >>+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_rx_avail_thresh_query, >>+ lib.ethdev.rx_avail_thresh_query) >>+ >>+RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set, >>+ lib.ethdev.rx_avail_thresh_set) >>diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c >>index 01c141a039..f66d3ecd0a 100644 >>--- a/lib/ethdev/rte_ethdev.c >>+++ b/lib/ethdev/rte_ethdev.c >>@@ -182,6 +182,8 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, >>const char *devargs_str) >> memset(iter, 0, sizeof(*iter)); >> memset(&devargs, 0, sizeof(devargs)); >> >>+ rte_eth_trace_iterator_init(iter, devargs_str); >>+ >> /* >> * The devargs string may use various syntaxes: >> * - 0000:08:00.0,representor=[1-3] >>@@ -283,6 +285,8 @@ rte_eth_iterator_next(struct rte_dev_iterator *iter) >> if (iter->cls == NULL) /* invalid ethdev iterator */ >> return RTE_MAX_ETHPORTS; >> >>+ rte_eth_trace_iterator_next(iter); >>+ >> do { /* loop to try all matching rte_device */ >> /* If not pure ethdev filter and */ >> if (iter->bus != NULL && >>@@ -316,6 +320,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); >> 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 +336,7 @@ 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,6 +357,7 @@ 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; >> } >> >>@@ -358,6 +365,7 @@ 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); >> return rte_eth_find_next_of(port_id, >> rte_eth_devices[ref_port_id].device); >> } >>@@ -371,6 +379,7 @@ eth_dev_is_allocated(const struct rte_eth_dev >>*ethdev) >> int >> rte_eth_dev_is_valid_port(uint16_t port_id) >> { >>+ rte_ethdev_trace_is_valid_port(port_id); >> if (port_id >= RTE_MAX_ETHPORTS || >> (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)) >> return 0; >>@@ -395,6 +404,7 @@ 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 +423,7 @@ 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 +487,7 @@ 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 +505,7 @@ 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 +539,7 @@ 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 +569,7 @@ 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; >> } >> >>@@ -562,6 +577,7 @@ int >> rte_eth_dev_socket_id(uint16_t port_id) >> { >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); >>+ rte_ethdev_trace_socket_id(port_id); >> return rte_eth_devices[port_id].data->numa_node; >> } >> >>@@ -569,6 +585,7 @@ void * >> rte_eth_dev_get_sec_ctx(uint16_t port_id) >> { >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL); >>+ rte_ethdev_trace_get_sec_ctx(port_id); >> return rte_eth_devices[port_id].security_ctx; >> } >> >>@@ -583,6 +600,7 @@ rte_eth_dev_count_avail(void) >> RTE_ETH_FOREACH_DEV(p) >> count++; >> >>+ rte_ethdev_trace_count_avail(count); >> return count; >> } >> >>@@ -594,6 +612,7 @@ rte_eth_dev_count_total(void) >> RTE_ETH_FOREACH_VALID_DEV(port) >> count++; >> >>+ rte_ethdev_trace_count_total(count); >> return count; >> } >> >>@@ -614,6 +633,7 @@ 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; >> } >> >>@@ -636,6 +656,7 @@ 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; >> } >> >>@@ -737,6 +758,7 @@ rte_eth_dev_rx_queue_start(uint16_t port_id, >>uint16_t rx_queue_id) >> return 0; >> } >> >>+ rte_ethdev_trace_rx_queue_start(port_id, rx_queue_id); >> return eth_err(port_id, dev->dev_ops->rx_queue_start(dev, >>rx_queue_id)); >> } >> >>@@ -770,6 +792,7 @@ rte_eth_dev_rx_queue_stop(uint16_t port_id, >>uint16_t rx_queue_id) >> return 0; >> } >> >>+ rte_ethdev_trace_rx_queue_stop(port_id, rx_queue_id); >> return eth_err(port_id, dev->dev_ops->rx_queue_stop(dev, >>rx_queue_id)); >> } >> >>@@ -810,6 +833,7 @@ rte_eth_dev_tx_queue_start(uint16_t port_id, >>uint16_t tx_queue_id) >> return 0; >> } >> >>+ rte_ethdev_trace_tx_queue_start(port_id, tx_queue_id); >> return eth_err(port_id, dev->dev_ops->tx_queue_start(dev, >>tx_queue_id)); >> } >> >>@@ -843,12 +867,14 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, >>uint16_t tx_queue_id) >> return 0; >> } >> >>+ rte_ethdev_trace_tx_queue_stop(port_id, tx_queue_id); >> return eth_err(port_id, dev->dev_ops->tx_queue_stop(dev, >>tx_queue_id)); >> } >> >> uint32_t >> rte_eth_speed_bitflag(uint32_t speed, int duplex) >> { >>+ rte_eth_trace_speed_bitflag(speed, duplex); >> switch (speed) { >> case RTE_ETH_SPEED_NUM_10M: >> return duplex ? RTE_ETH_LINK_SPEED_10M : >>RTE_ETH_LINK_SPEED_10M_HD; >>@@ -894,6 +920,7 @@ rte_eth_dev_rx_offload_name(uint64_t offload) >> } >> } >> >>+ rte_ethdev_trace_rx_offload_name(offload, name); >> return name; >> } >> >>@@ -910,6 +937,7 @@ rte_eth_dev_tx_offload_name(uint64_t offload) >> } >> } >> >>+ rte_ethdev_trace_tx_offload_name(offload, name); >> return name; >> } >> >>@@ -926,6 +954,7 @@ rte_eth_dev_capability_name(uint64_t capability) >> } >> } >> >>+ rte_ethdev_trace_capability_name(capability, name); >> return name; >> } >> >>@@ -1552,6 +1581,7 @@ rte_eth_dev_set_link_up(uint16_t port_id) >> >> if (*dev->dev_ops->dev_set_link_up == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_set_link_up(port_id); >> return eth_err(port_id, (*dev->dev_ops->dev_set_link_up)(dev)); >> } >> >>@@ -1565,6 +1595,7 @@ rte_eth_dev_set_link_down(uint16_t port_id) >> >> if (*dev->dev_ops->dev_set_link_down == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_set_link_down(port_id); >> return eth_err(port_id, (*dev->dev_ops->dev_set_link_down)(dev)); >> } >> >>@@ -1621,6 +1652,7 @@ rte_eth_dev_reset(uint16_t port_id) >> port_id, rte_strerror(-ret)); >> } >> ret = dev->dev_ops->dev_reset(dev); >>+ rte_ethdev_trace_reset(port_id, ret); >> >> return eth_err(port_id, ret); >> } >>@@ -1645,6 +1677,7 @@ 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; >> } >> >>@@ -1984,6 +2017,8 @@ 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; >>+ rte_eth_trace_rx_hairpin_queue_setup(port_id, rx_queue_id, >>nb_rx_desc, >>+ conf, ret); >> return eth_err(port_id, ret); >> } >> >>@@ -2151,6 +2186,7 @@ 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; >>+ rte_eth_trace_tx_hairpin_queue_setup(port_id, tx_queue_id, >>nb_tx_desc, conf, ret); >> return eth_err(port_id, ret); >> } >> >>@@ -2176,6 +2212,7 @@ 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; >> } >> >>@@ -2201,6 +2238,7 @@ 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; >> } >> >>@@ -2237,6 +2275,7 @@ 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; >> } >> >>@@ -2244,6 +2283,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); >> rte_pktmbuf_free_bulk(pkts, unsent); >> } >> >>@@ -2255,6 +2295,7 @@ 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(pkts, unsent, *count); >> } >> >> int >>@@ -2267,6 +2308,7 @@ rte_eth_tx_buffer_set_err_callback(struct >>rte_eth_dev_tx_buffer *buffer, >> return -EINVAL; >> } >> >>+ rte_eth_trace_tx_buffer_set_err_callback(buffer, cbfn, userdata); >> buffer->error_callback = cbfn; >> buffer->error_userdata = userdata; >> return 0; >>@@ -2288,6 +2330,7 @@ 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; >> } >> >>@@ -2306,6 +2349,7 @@ 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); >>+ rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt, ret); >> return eth_err(port_id, ret); >> } >> >>@@ -2327,6 +2371,7 @@ rte_eth_promiscuous_enable(uint16_t port_id) >> diag = (*dev->dev_ops->promiscuous_enable)(dev); >> dev->data->promiscuous = (diag == 0) ? 1 : 0; >> >>+ rte_eth_trace_promiscuous_enable(port_id, dev->data- >>>promiscuous); >> return eth_err(port_id, diag); >> } >> >>@@ -2350,6 +2395,7 @@ rte_eth_promiscuous_disable(uint16_t port_id) >> if (diag != 0) >> dev->data->promiscuous = 1; >> >>+ rte_eth_trace_promiscuous_disable(port_id, dev->data- >>>promiscuous); >> return eth_err(port_id, diag); >> } >> >>@@ -2361,6 +2407,7 @@ 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; >> } >> >>@@ -2381,6 +2428,7 @@ rte_eth_allmulticast_enable(uint16_t port_id) >> diag = (*dev->dev_ops->allmulticast_enable)(dev); >> dev->data->all_multicast = (diag == 0) ? 1 : 0; >> >>+ rte_eth_trace_allmulticast_enable(port_id, dev->data->all_multicast); >> return eth_err(port_id, diag); >> } >> >>@@ -2403,6 +2451,7 @@ rte_eth_allmulticast_disable(uint16_t port_id) >> if (diag != 0) >> dev->data->all_multicast = 1; >> >>+ rte_eth_trace_allmulticast_disable(port_id, dev->data->all_multicast); >> return eth_err(port_id, diag); >> } >> >>@@ -2414,6 +2463,7 @@ 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; >> } >> >>@@ -2440,6 +2490,7 @@ 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; >> } >> >>@@ -2466,12 +2517,14 @@ 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) >> { >>+ rte_eth_trace_link_speed_to_str(link_speed); >> switch (link_speed) { >> case RTE_ETH_SPEED_NUM_NONE: return "None"; >> case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; >>@@ -2511,6 +2564,7 @@ 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(str, len, eth_link); >> if (eth_link->link_status == RTE_ETH_LINK_DOWN) >> return snprintf(str, len, "Link down"); >> else >>@@ -2541,6 +2595,7 @@ 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; >>+ rte_eth_trace_stats_get(port_id, stats); >> return eth_err(port_id, (*dev->dev_ops->stats_get)(dev, stats)); >> } >> >>@@ -2561,6 +2616,7 @@ rte_eth_stats_reset(uint16_t port_id) >> >> dev->data->rx_mbuf_alloc_failed = 0; >> >>+ rte_eth_trace_stats_reset(port_id); >> return 0; >> } >> >>@@ -2625,6 +2681,7 @@ rte_eth_xstats_get_id_by_name(uint16_t port_id, >>const char *xstat_name, >> return -ENOMEM; >> } >> >>+ rte_eth_trace_xstats_get_id_by_name(port_id, xstat_name, id); >> /* Get count */ >> cnt_xstats = rte_eth_xstats_get_names_by_id(port_id, NULL, 0, NULL); >> if (cnt_xstats < 0) { >>@@ -2797,6 +2854,8 @@ 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); >>@@ -2836,6 +2895,7 @@ rte_eth_xstats_get_names(uint16_t port_id, >> cnt_used_entries += cnt_driver_entries; >> } >> >>+ rte_eth_trace_xstats_get_names(port_id, xstats_names, size, >>cnt_used_entries); >> return cnt_used_entries; >> } >> >>@@ -2985,6 +3045,7 @@ 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; >> } >> >>@@ -3032,6 +3093,8 @@ 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], i); >> return count + xcount; >> } >> >>@@ -3044,6 +3107,7 @@ rte_eth_xstats_reset(uint16_t port_id) >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> >>+ rte_eth_trace_xstats_reset(port_id); >> /* implemented by the driver */ >> if (dev->dev_ops->xstats_reset != NULL) >> return eth_err(port_id, (*dev->dev_ops->xstats_reset)(dev)); >>@@ -3079,6 +3143,8 @@ int >> rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t >>tx_queue_id, >> uint8_t stat_idx) >> { >>+ rte_ethdev_trace_set_tx_queue_stats_mapping(port_id, tx_queue_id, >>+ stat_idx); >> return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id, >> tx_queue_id, >> stat_idx, STAT_QMAP_TX)); >>@@ -3088,6 +3154,8 @@ int >> rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t >>rx_queue_id, >> uint8_t stat_idx) >> { >>+ rte_ethdev_trace_set_rx_queue_stats_mapping(port_id, >>rx_queue_id, >>+ stat_idx); >> return eth_err(port_id, eth_dev_set_queue_stats_mapping(port_id, >> rx_queue_id, >> stat_idx, STAT_QMAP_RX)); >>@@ -3110,6 +3178,7 @@ 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; >>+ rte_ethdev_trace_fw_version_get(port_id, fw_version, fw_size); >> return eth_err(port_id, (*dev->dev_ops->fw_version_get)(dev, >> fw_version, fw_size)); >> } >>@@ -3171,6 +3240,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct >>rte_eth_dev_info *dev_info) >> >> dev_info->dev_flags = &dev->data->dev_flags; >> >>+ rte_ethdev_trace_info_get(port_id, dev_info); >> return 0; >> } >> >>@@ -3191,6 +3261,7 @@ rte_eth_dev_conf_get(uint16_t port_id, struct >>rte_eth_conf *dev_conf) >> >> memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct >>rte_eth_conf)); >> >>+ rte_ethdev_trace_conf_get(port_id, dev_conf); >> return 0; >> } >> >>@@ -3226,6 +3297,7 @@ rte_eth_dev_get_supported_ptypes(uint16_t >>port_id, uint32_t ptype_mask, >> j++; >> } >> >>+ rte_ethdev_trace_get_supported_ptypes(port_id, ptype_mask, >>ptypes, num, j); >> return j; >> } >> >>@@ -3310,6 +3382,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t >>ptype_mask, >> if (set_ptypes != NULL && j < num) >> set_ptypes[j] = RTE_PTYPE_UNKNOWN; >> >>+ rte_ethdev_trace_set_ptypes(port_id, ptype_mask, set_ptypes, num); >> return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask); >> >> ptype_unknown: >>@@ -3341,6 +3414,7 @@ rte_eth_macaddrs_get(uint16_t port_id, struct >>rte_ether_addr *ma, >> num = RTE_MIN(dev_info.max_mac_addrs, num); >> memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); >> >>+ rte_eth_trace_macaddrs_get(port_id, ma, num); >> return num; >> } >> >>@@ -3359,6 +3433,7 @@ rte_eth_macaddr_get(uint16_t port_id, struct >>rte_ether_addr *mac_addr) >> return -EINVAL; >> } >> >>+ rte_eth_trace_macaddr_get(port_id, mac_addr); >> rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); >> >> return 0; >>@@ -3379,6 +3454,7 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t >>*mtu) >> } >> >> *mtu = dev->data->mtu; >>+ rte_ethdev_trace_get_mtu(port_id, *mtu); >> return 0; >> } >> >>@@ -3421,6 +3497,7 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t >>mtu) >> if (ret == 0) >> dev->data->mtu = mtu; >> >>+ rte_ethdev_trace_set_mtu(port_id, mtu, ret); >> return eth_err(port_id, ret); >> } >> >>@@ -3464,6 +3541,7 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t >>vlan_id, int on) >> vfc->ids[vidx] &= ~RTE_BIT64(vbit); >> } >> >>+ rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); >> return eth_err(port_id, ret); >> } >> >>@@ -3483,6 +3561,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t >>port_id, uint16_t rx_queue_id, >> >> if (*dev->dev_ops->vlan_strip_queue_set == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, >>on); >> (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); >> >> return 0; >>@@ -3500,6 +3579,7 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, >> >> if (*dev->dev_ops->vlan_tpid_set == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid); >> return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, >>vlan_type, >> tpid)); >> } >>@@ -3593,6 +3673,7 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int >>offload_mask) >> dev->data->dev_conf.rxmode.offloads = orig_offloads; >> } >> >>+ rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); >> return eth_err(port_id, ret); >> } >> >>@@ -3619,6 +3700,7 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) >> if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) >> ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; >> >>+ rte_ethdev_trace_get_vlan_offload(port_id, ret); >> return ret; >> } >> >>@@ -3632,6 +3714,7 @@ rte_eth_dev_set_vlan_pvid(uint16_t port_id, >>uint16_t pvid, int on) >> >> if (*dev->dev_ops->vlan_pvid_set == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on); >> return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, >>on)); >> } >> >>@@ -3653,6 +3736,7 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct >>rte_eth_fc_conf *fc_conf) >> if (*dev->dev_ops->flow_ctrl_get == NULL) >> return -ENOTSUP; >> memset(fc_conf, 0, sizeof(*fc_conf)); >>+ rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf); >> return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, >>fc_conf)); >> } >> >>@@ -3678,6 +3762,7 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct >>rte_eth_fc_conf *fc_conf) >> >> if (*dev->dev_ops->flow_ctrl_set == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf); >> return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); >> } >> >>@@ -3702,6 +3787,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t >>port_id, >> return -EINVAL; >> } >> >>+ rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf); >> /* High water, low water validation are device specific */ >> if (*dev->dev_ops->priority_flow_ctrl_set) >> return eth_err(port_id, (*dev->dev_ops- >>>priority_flow_ctrl_set) >>@@ -3774,6 +3860,7 @@ >>rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, >> return -EINVAL; >> } >> >>+ rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, >>pfc_queue_info); >> if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) >> return eth_err(port_id, (*dev->dev_ops- >>>priority_flow_ctrl_queue_info_get) >> (dev, pfc_queue_info)); >>@@ -3845,6 +3932,8 @@ >>rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, >> return ret; >> } >> >>+ rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, >>+ pfc_queue_conf); >> if (*dev->dev_ops->priority_flow_ctrl_queue_config) >> return eth_err(port_id, >> (*dev->dev_ops- >>>priority_flow_ctrl_queue_config)( >>@@ -3940,6 +4029,7 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, >> >> if (*dev->dev_ops->reta_update == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size); >> return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, >>reta_conf, >> reta_size)); >> } >>@@ -3969,6 +4059,7 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, >> >> if (*dev->dev_ops->reta_query == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size); >> return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, >> reta_size)); >> } >>@@ -4014,6 +4105,7 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, >> >> if (*dev->dev_ops->rss_hash_update == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_rss_hash_update(port_id, rss_conf); >> return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, >> rss_conf)); >> } >>@@ -4036,6 +4128,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, >> >> if (*dev->dev_ops->rss_hash_conf_get == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf); >> return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, >> rss_conf)); >> } >>@@ -4063,6 +4156,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t >>port_id, >> >> if (*dev->dev_ops->udp_tunnel_port_add == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel); >> return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, >> udp_tunnel)); >> } >>@@ -4090,6 +4184,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t >>port_id, >> >> if (*dev->dev_ops->udp_tunnel_port_del == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel); >> return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, >> udp_tunnel)); >> } >>@@ -4104,6 +4199,7 @@ rte_eth_led_on(uint16_t port_id) >> >> if (*dev->dev_ops->dev_led_on == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_led_on(port_id); >> return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); >> } >> >>@@ -4117,6 +4213,7 @@ rte_eth_led_off(uint16_t port_id) >> >> if (*dev->dev_ops->dev_led_off == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_led_off(port_id); >> return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); >> } >> >>@@ -4142,6 +4239,7 @@ rte_eth_fec_get_capability(uint16_t port_id, >> return -ENOTSUP; >> ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, >>num); >> >>+ rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); >> return ret; >> } >> >>@@ -4162,6 +4260,7 @@ rte_eth_fec_get(uint16_t port_id, uint32_t >>*fec_capa) >> >> if (*dev->dev_ops->fec_get == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_fec_get(port_id, fec_capa); >> return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); >> } >> >>@@ -4175,6 +4274,7 @@ rte_eth_fec_set(uint16_t port_id, uint32_t >>fec_capa) >> >> if (*dev->dev_ops->fec_set == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_fec_set(port_id, fec_capa); >> return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); >> } >> >>@@ -4252,6 +4352,7 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, >>struct rte_ether_addr *addr, >> return 0; >> } >> >>+ rte_ethdev_trace_mac_addr_add(port_id, addr, pool); >> /* Update NIC */ >> ret = (*dev->dev_ops->mac_addr_add)(dev, addr, index, pool); >> >>@@ -4294,6 +4395,7 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, >>struct rte_ether_addr *addr) >> } else if (index < 0) >> return 0; /* Do nothing if address wasn't found */ >> >>+ rte_ethdev_trace_mac_addr_remove(port_id, addr); >> /* Update NIC */ >> (*dev->dev_ops->mac_addr_remove)(dev, index); >> >>@@ -4329,6 +4431,7 @@ rte_eth_dev_default_mac_addr_set(uint16_t >>port_id, struct rte_ether_addr *addr) >> return -ENOTSUP; >> >> ret = (*dev->dev_ops->mac_addr_set)(dev, addr); >>+ rte_ethdev_trace_default_mac_addr_set(port_id, addr, ret); >> if (ret < 0) >> return ret; >> >>@@ -4415,6 +4518,7 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, >>struct rte_ether_addr *addr, >> if (*dev->dev_ops->uc_hash_table_set == NULL) >> return -ENOTSUP; >> ret = (*dev->dev_ops->uc_hash_table_set)(dev, addr, on); >>+ rte_ethdev_trace_uc_hash_table_set(port_id, addr, on, ret); >> if (ret == 0) { >> /* Update address in NIC data structure */ >> if (on) >>@@ -4438,6 +4542,7 @@ rte_eth_dev_uc_all_hash_table_set(uint16_t >>port_id, uint8_t on) >> >> if (*dev->dev_ops->uc_all_hash_table_set == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_uc_all_hash_table_set(port_id, on); >> return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, >> on)); >> } >>@@ -4475,6 +4580,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, >>uint16_t queue_idx, >> >> if (*dev->dev_ops->set_queue_rate_limit == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate); >> return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, >> queue_idx, tx_rate)); >> } >>@@ -4502,6 +4608,7 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, >>uint16_t queue_id, >> } >> if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh); >> return eth_err(port_id, (*dev->dev_ops- >>>rx_queue_avail_thresh_set)(dev, >> queue_id, >>avail_thresh)); >> } >>@@ -4521,6 +4628,7 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, >>uint16_t *queue_id, >> >> if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id); >> return eth_err(port_id, (*dev->dev_ops- >>>rx_queue_avail_thresh_query)(dev, >> queue_id, >>avail_thresh)); >> } >>@@ -4570,6 +4678,9 @@ rte_eth_dev_callback_register(uint16_t port_id, >> next_port = last_port = port_id; >> } >> >>+ rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, >>next_port, >>+ last_port); >>+ >> rte_spinlock_lock(ð_dev_cb_lock); >> >> do { >>@@ -4665,6 +4776,7 @@ rte_eth_dev_callback_unregister(uint16_t port_id, >> } while (++next_port <= last_port); >> >> rte_spinlock_unlock(ð_dev_cb_lock); >>+ rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, >>ret); >> return ret; >> } >> >>@@ -4694,6 +4806,7 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, >>int op, void *data) >> for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { >> vec = rte_intr_vec_list_index_get(intr_handle, qid); >> rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); >>+ rte_ethdev_trace_rx_intr_ctl(port_id, epfd, op, data, rc); >> if (rc && rc != -EEXIST) { >> RTE_ETHDEV_LOG(ERR, >> "p %u q %u Rx ctl error op %d epfd %d vec >>%u\n", >>@@ -4737,6 +4850,7 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, >>uint16_t queue_id) >> (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; >> fd = rte_intr_efds_index_get(intr_handle, efd_idx); >> >>+ rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); >> return fd; >> } >> >>@@ -4770,6 +4884,7 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, >>uint16_t queue_id, >> >> vec = rte_intr_vec_list_index_get(intr_handle, queue_id); >> rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); >>+ rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); >> if (rc && rc != -EEXIST) { >> RTE_ETHDEV_LOG(ERR, >> "p %u q %u Rx ctl error op %d epfd %d vec %u\n", >>@@ -4796,6 +4911,7 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, >> >> if (*dev->dev_ops->rx_queue_intr_enable == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_rx_intr_enable(port_id, queue_id); >> return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, >>queue_id)); >> } >> >>@@ -4815,6 +4931,7 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, >> >> if (*dev->dev_ops->rx_queue_intr_disable == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_rx_intr_disable(port_id, queue_id); >> return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, >>queue_id)); >> } >> >>@@ -4873,6 +4990,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t >>queue_id, >> } >> rte_spinlock_unlock(ð_dev_rx_cb_lock); >> >>+ rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, >>cb); >> return cb; >> } >> >>@@ -4912,6 +5030,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, >>uint16_t queue_id, >> cb, __ATOMIC_RELEASE); >> rte_spinlock_unlock(ð_dev_rx_cb_lock); >> >>+ rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, >>user_param, cb); >> return cb; >> } >> >>@@ -4971,6 +5090,7 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t >>queue_id, >> } >> rte_spinlock_unlock(ð_dev_tx_cb_lock); >> >>+ rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, >>cb); >> return cb; >> } >> >>@@ -5005,6 +5125,7 @@ rte_eth_remove_rx_callback(uint16_t port_id, >>uint16_t queue_id, >> } >> rte_spinlock_unlock(ð_dev_rx_cb_lock); >> >>+ rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); >> return ret; >> } >> >>@@ -5039,6 +5160,7 @@ rte_eth_remove_tx_callback(uint16_t port_id, >>uint16_t queue_id, >> } >> rte_spinlock_unlock(ð_dev_tx_cb_lock); >> >>+ rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); >> return ret; >> } >> >>@@ -5085,6 +5207,7 @@ rte_eth_rx_queue_info_get(uint16_t port_id, >>uint16_t queue_id, >> dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); >> qinfo->queue_state = dev->data->rx_queue_state[queue_id]; >> >>+ rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); >> return 0; >> } >> >>@@ -5131,6 +5254,7 @@ rte_eth_tx_queue_info_get(uint16_t port_id, >>uint16_t queue_id, >> dev->dev_ops->txq_info_get(dev, queue_id, qinfo); >> qinfo->queue_state = dev->data->tx_queue_state[queue_id]; >> >>+ rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); >> return 0; >> } >> >>@@ -5158,6 +5282,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, >>uint16_t queue_id, >> if (*dev->dev_ops->rx_burst_mode_get == NULL) >> return -ENOTSUP; >> memset(mode, 0, sizeof(*mode)); >>+ rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode); >> return eth_err(port_id, >> dev->dev_ops->rx_burst_mode_get(dev, queue_id, >>mode)); >> } >>@@ -5186,6 +5311,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, >>uint16_t queue_id, >> if (*dev->dev_ops->tx_burst_mode_get == NULL) >> return -ENOTSUP; >> memset(mode, 0, sizeof(*mode)); >>+ rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode); >> return eth_err(port_id, >> dev->dev_ops->tx_burst_mode_get(dev, queue_id, >>mode)); >> } >>@@ -5213,6 +5339,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, >>uint16_t queue_id, >> >> if (*dev->dev_ops->get_monitor_addr == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc); >> return eth_err(port_id, >> dev->dev_ops->get_monitor_addr(dev->data- >>>rx_queues[queue_id], pmc)); >> } >>@@ -5229,6 +5356,7 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, >> >> if (*dev->dev_ops->set_mc_addr_list == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, >>nb_mc_addr); >> return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, >> mc_addr_set, nb_mc_addr)); >> } >>@@ -5243,6 +5371,7 @@ rte_eth_timesync_enable(uint16_t port_id) >> >> if (*dev->dev_ops->timesync_enable == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_timesync_enable(port_id); >> return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); >> } >> >>@@ -5256,6 +5385,7 @@ rte_eth_timesync_disable(uint16_t port_id) >> >> if (*dev->dev_ops->timesync_disable == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_timesync_disable(port_id); >> return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); >> } >> >>@@ -5277,6 +5407,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t >>port_id, struct timespec *timestamp, >> >> if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, >>flags); >> return eth_err(port_id, (*dev->dev_ops- >>>timesync_read_rx_timestamp) >> (dev, timestamp, flags)); >> } >>@@ -5299,6 +5430,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t >>port_id, >> >> if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp); >> return eth_err(port_id, (*dev->dev_ops- >>>timesync_read_tx_timestamp) >> (dev, timestamp)); >> } >>@@ -5313,6 +5445,7 @@ rte_eth_timesync_adjust_time(uint16_t port_id, >>int64_t delta) >> >> if (*dev->dev_ops->timesync_adjust_time == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_timesync_adjust_time(port_id, delta); >> return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, >>delta)); >> } >> >>@@ -5333,6 +5466,7 @@ rte_eth_timesync_read_time(uint16_t port_id, >>struct timespec *timestamp) >> >> if (*dev->dev_ops->timesync_read_time == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_timesync_read_time(port_id, timestamp); >> return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, >> timestamp)); >> } >>@@ -5354,6 +5488,7 @@ rte_eth_timesync_write_time(uint16_t port_id, >>const struct timespec *timestamp) >> >> if (*dev->dev_ops->timesync_write_time == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_timesync_write_time(port_id, timestamp); >> return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, >> timestamp)); >> } >>@@ -5374,6 +5509,7 @@ rte_eth_read_clock(uint16_t port_id, uint64_t >>*clock) >> >> if (*dev->dev_ops->read_clock == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_read_clock(port_id, clock); >> return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); >> } >> >>@@ -5394,6 +5530,7 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct >>rte_dev_reg_info *info) >> >> if (*dev->dev_ops->get_reg == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_get_reg_info(port_id, info); >> return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); >> } >> >>@@ -5407,6 +5544,7 @@ rte_eth_dev_get_eeprom_length(uint16_t port_id) >> >> if (*dev->dev_ops->get_eeprom_length == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_get_eeprom_length(port_id); >> return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); >> } >> >>@@ -5427,6 +5565,7 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct >>rte_dev_eeprom_info *info) >> >> if (*dev->dev_ops->get_eeprom == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_get_eeprom(port_id, info); >> return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); >> } >> >>@@ -5447,6 +5586,7 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct >>rte_dev_eeprom_info *info) >> >> if (*dev->dev_ops->set_eeprom == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_set_eeprom(port_id, info); >> return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); >> } >> >>@@ -5468,6 +5608,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, >> >> if (*dev->dev_ops->get_module_info == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_get_module_info(port_id, modinfo); >> return (*dev->dev_ops->get_module_info)(dev, modinfo); >> } >> >>@@ -5503,6 +5644,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, >> >> if (*dev->dev_ops->get_module_eeprom == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_get_module_eeprom(port_id, info); >> return (*dev->dev_ops->get_module_eeprom)(dev, info); >> } >> >>@@ -5526,6 +5668,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, >> >> if (*dev->dev_ops->get_dcb_info == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_get_dcb_info(port_id, dcb_info); >> return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, >>dcb_info)); >> } >> >>@@ -5562,6 +5705,7 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t >>port_id, >> if (nb_tx_desc != NULL) >> eth_dev_adjust_nb_desc(nb_tx_desc, >>&dev_info.tx_desc_lim); >> >>+ rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id, *nb_rx_desc, >>*nb_tx_desc); >> return 0; >> } >> >>@@ -5584,6 +5728,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t >>port_id, >> if (*dev->dev_ops->hairpin_cap_get == NULL) >> return -ENOTSUP; >> memset(cap, 0, sizeof(*cap)); >>+ rte_ethdev_trace_hairpin_capability_get(port_id, cap); >> return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); >> } >> >>@@ -5605,6 +5750,7 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, >>const char *pool) >> if (*dev->dev_ops->pool_ops_supported == NULL) >> return 1; /* all pools are supported */ >> >>+ rte_ethdev_trace_pool_ops_supported(port_id, pool); >> return (*dev->dev_ops->pool_ops_supported)(dev, pool); >> } >> >>@@ -5901,6 +6047,7 @@ rte_eth_representor_info_get(uint16_t port_id, >> >> if (*dev->dev_ops->representor_info_get == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_representor_info_get(port_id, info); >> return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, >>info)); >> } >> >>@@ -5924,6 +6071,7 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, >>uint64_t *features) >> return -EINVAL; >> } >> >>+ rte_eth_trace_rx_metadata_negotiate(port_id, features, *features); >> if (*dev->dev_ops->rx_metadata_negotiate == NULL) >> return -ENOTSUP; >> return eth_err(port_id, >>@@ -5956,6 +6104,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t >>port_id, >> return -ENOTSUP; >> memset(reassembly_capa, 0, sizeof(struct >>rte_eth_ip_reassembly_params)); >> >>+ rte_eth_trace_ip_reassembly_capability_get(port_id, >>reassembly_capa); >> return eth_err(port_id, (*dev->dev_ops- >>>ip_reassembly_capability_get) >> (dev, reassembly_capa)); >> } >>@@ -5985,6 +6134,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, >> if (*dev->dev_ops->ip_reassembly_conf_get == NULL) >> return -ENOTSUP; >> memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); >>+ rte_eth_trace_ip_reassembly_conf_get(port_id, conf); >> return eth_err(port_id, >> (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); >> } >>@@ -6022,6 +6172,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, >> >> if (*dev->dev_ops->ip_reassembly_conf_set == NULL) >> return -ENOTSUP; >>+ rte_eth_trace_ip_reassembly_conf_set(port_id, conf); >> return eth_err(port_id, >> (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); >> } >>@@ -6041,6 +6192,7 @@ rte_eth_dev_priv_dump(uint16_t port_id, FILE *file) >> >> if (*dev->dev_ops->eth_dev_priv_dump == NULL) >> return -ENOTSUP; >>+ rte_ethdev_trace_priv_dump(port_id); >> return eth_err(port_id, (*dev->dev_ops->eth_dev_priv_dump)(dev, >>file)); >> } >> >>diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h >>index 1491c815c3..802f2c1ae1 100644 >>--- a/lib/ethdev/rte_ethdev_trace.h >>+++ b/lib/ethdev/rte_ethdev_trace.h >>@@ -88,6 +88,1200 @@ RTE_TRACE_POINT( >> rte_trace_point_emit_u16(port_id); >> ) >> >>+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, void *user_param, >>+ 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_rx_callback, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >>+ rte_rx_callback_fn fn, void *user_param, >>+ 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, void *user_param, >>+ 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_allmulticast_disable, >>+ 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_allmulticast_enable, >>+ 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_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_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_adjust_nb_rx_tx_desc, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t nb_rx_desc, >>+ uint16_t nb_tx_desc), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(nb_rx_desc); >>+ rte_trace_point_emit_u16(nb_tx_desc); >>+) >>+ >>+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, 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, 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_default_mac_addr_set, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >>*addr, int ret), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(addr); >>+ rte_trace_point_emit_int(ret); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_flow_ctrl_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf >>*fc_conf), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(fc_conf); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_flow_ctrl_set, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf >>*fc_conf), >>+ 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( >>+ rte_ethdev_trace_fw_version_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, char *fw_version, size_t >>fw_size), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(fw_version); >>+ rte_trace_point_emit_size_t(fw_size); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_get_dcb_info, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info >>*dcb_info), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(dcb_info); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_get_eeprom, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct >>rte_dev_eeprom_info *info), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(info); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_get_eeprom_length, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ 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); >>+) >>+ >>+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, 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_get_reg_info, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_reg_info >>*info), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(info); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_get_sec_ctx, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_get_supported_ptypes, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, >>+ uint32_t *ptypes, int num, int j), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u32(ptype_mask); >>+ rte_trace_point_emit_ptr(ptypes); >>+ rte_trace_point_emit_int(num); >>+ rte_trace_point_emit_int(j); >>+) >>+ >>+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_info_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ 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_u32(dev_info->if_index); >>+ 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_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_u16(dev_info->nb_rx_queues); >>+ rte_trace_point_emit_u16(dev_info->nb_tx_queues); >>+) >>+ >>+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_ethdev_trace_is_valid_port, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_mac_addr_add, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >>*addr, >>+ uint32_t pool), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(addr); >>+ rte_trace_point_emit_u32(pool); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_mac_addr_remove, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >>*addr), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(addr); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_pool_ops_supported, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *pool), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(pool); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_priority_flow_ctrl_set, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_pfc_conf >>*pfc_conf), >>+ 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( >>+ 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_ethdev_trace_rss_hash_conf_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf >>*rss_conf), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(rss_conf); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_rss_hash_update, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf >>*rss_conf), >>+ 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( >>+ rte_ethdev_trace_rss_reta_query, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t >>reta_size), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(reta_conf); >>+ rte_trace_point_emit_u16(reta_size); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_rss_reta_update, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t >>reta_size), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u64(reta_conf->mask); >>+ rte_trace_point_emit_u16(reta_size); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_rx_intr_ctl, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, int epfd, int op, void >>*data, int rc), >>+ rte_trace_point_emit_u16(port_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_ethdev_trace_rx_intr_ctl_q, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int >>epfd, >>+ int op, 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_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_disable, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(queue_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_rx_intr_enable, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(queue_id); >>+) >>+ >>+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_rx_queue_start, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(rx_queue_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_rx_queue_stop, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(rx_queue_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_set_eeprom, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct >>rte_dev_eeprom_info *info), >>+ 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( >>+ rte_ethdev_trace_set_link_down, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_set_link_up, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_set_mc_addr_list, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_ether_addr *mc_addr_set, >>+ uint32_t nb_mc_addr), >>+ 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( >>+ rte_ethdev_trace_set_ptypes, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, >>+ uint32_t *set_ptypes, unsigned int num), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u32(ptype_mask); >>+ rte_trace_point_emit_ptr(set_ptypes); >>+ rte_trace_point_emit_u32(num); >>+) >>+ >>+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), >>+ 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( >>+ 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), >>+ 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( >>+ 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), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_int(vlan_type); >>+ rte_trace_point_emit_u16(tag_type); >>+) >>+ >>+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_set_vlan_pvid, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t pvid, int on), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(pvid); >>+ rte_trace_point_emit_int(on); >>+) >>+ >>+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_socket_id, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+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_tx_queue_start, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(tx_queue_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_tx_queue_stop, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(tx_queue_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_uc_all_hash_table_set, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint8_t on), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u8(on); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_uc_hash_table_set, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >>*addr, >>+ uint8_t on, int ret), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(addr); >>+ rte_trace_point_emit_u8(on); >>+ rte_trace_point_emit_int(ret); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_udp_tunnel_port_add, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_udp_tunnel >>*tunnel_udp), >>+ 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( >>+ rte_ethdev_trace_udp_tunnel_port_delete, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_udp_tunnel >>*tunnel_udp), >>+ 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( >>+ 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_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_start, >>+ const struct rte_device *parent), >>+ rte_trace_point_emit_u16(port_id_start); >>+ rte_trace_point_emit_ptr(parent); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_find_next_owned_by, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ const uint64_t owner_id), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u64(owner_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_find_next_sibling, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t >>ref_port_id), >>+ rte_trace_point_emit_u16(port_id_start); >>+ rte_trace_point_emit_u16(ref_port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_iterator_cleanup, >>+ RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), >>+ rte_trace_point_emit_ptr(iter); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_iterator_init, >>+ RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter, const char >>*devargs), >>+ rte_trace_point_emit_ptr(iter); >>+ rte_trace_point_emit_ptr(devargs); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_iterator_next, >>+ RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), >>+ rte_trace_point_emit_ptr(iter); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_led_off, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_led_on, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_link_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u32(link->link_speed); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_link_get_nowait, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u32(link->link_speed); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_macaddr_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >>*mac_addr), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(mac_addr); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_promiscuous_disable, >>+ 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_promiscuous_enable, >>+ 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_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_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_burst_mode_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >>+ struct rte_eth_burst_mode *mode), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(queue_id); >>+ rte_trace_point_emit_ptr(mode); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_rx_queue_info_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >>+ 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->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_rx_queue_setup, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, >>+ uint16_t nb_rx_desc, unsigned int socket_id, >>+ const struct rte_eth_rxconf *rx_conf, >>+ struct rte_mempool *mb_pool), >>+ 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_u32(socket_id); >>+ rte_trace_point_emit_ptr(rx_conf); >>+ rte_trace_point_emit_ptr(mb_pool); >>+) >>+ >>+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), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(queue_idx); >>+ rte_trace_point_emit_u16(tx_rate); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_speed_bitflag, >>+ RTE_TRACE_POINT_ARGS(uint32_t speed, int duplex), >>+ rte_trace_point_emit_u32(speed); >>+ rte_trace_point_emit_int(duplex); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_stats_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats >>*stats), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(stats); >>+ rte_trace_point_emit_u64(stats->rx_nombuf); >>+) >>+ >>+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_timesync_adjust_time, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, int64_t delta), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_i64(delta); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_timesync_disable, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_timesync_enable, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_timesync_read_rx_timestamp, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec >>*timestamp, >>+ uint32_t flags), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(timestamp); >>+ rte_trace_point_emit_u32(flags); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_timesync_read_time, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *time), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(time); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_timesync_read_tx_timestamp, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec >>*timestamp), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(timestamp); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_timesync_write_time, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct timespec >>*time), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(time); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_tx_buffer_count_callback, >>+ RTE_TRACE_POINT_ARGS(struct rte_mbuf **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); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_tx_buffer_drop_callback, >>+ RTE_TRACE_POINT_ARGS(struct rte_mbuf **pkts, uint16_t unsent), >>+ rte_trace_point_emit_ptr(pkts); >>+ rte_trace_point_emit_u16(unsent); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_tx_buffer_init, >>+ RTE_TRACE_POINT_ARGS(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_buffer_set_err_callback, >>+ RTE_TRACE_POINT_ARGS(struct rte_eth_dev_tx_buffer *buffer, >>+ buffer_tx_error_fn callback, void *userdata), >>+ rte_trace_point_emit_ptr(buffer); >>+ rte_trace_point_emit_ptr(callback); >>+ rte_trace_point_emit_ptr(userdata); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_tx_burst_mode_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >>+ struct rte_eth_burst_mode *mode), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(queue_id); >>+ rte_trace_point_emit_ptr(mode); >>+) >>+ >>+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_tx_queue_info_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >>+ 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_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); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_xstats_get_by_id, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, >>+ 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_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_ptr(id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ 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); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_xstats_get_names_by_id, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ 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_reset, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_owner_delete, >>+ RTE_TRACE_POINT_ARGS(const 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_owner_get, >>+ RTE_TRACE_POINT_ARGS(const uint16_t port_id, >>+ 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_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(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), >>+ 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_get_module_eeprom, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_dev_eeprom_info *info), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(info); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_get_module_info, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_eth_dev_module_info *modinfo), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(modinfo); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_read_clock, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t *clk), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(clk); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_hairpin_capability_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_eth_hairpin_cap *cap), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(cap); >>+) >>+ >>+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), >>+ 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_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), >>+ 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_ptr(conf); >>+ 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_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); >>+) >>+ >>+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_link_speed_to_str, >>+ RTE_TRACE_POINT_ARGS(uint32_t link_speed), >>+ rte_trace_point_emit_u32(link_speed); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_link_to_str, >>+ RTE_TRACE_POINT_ARGS(char *str, size_t len, >>+ const struct rte_eth_link *eth_link), >>+ rte_trace_point_emit_ptr(str); >>+ rte_trace_point_emit_size_t(len); >>+ rte_trace_point_emit_ptr(eth_link); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_fec_get_capability, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ 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(num); >>+ rte_trace_point_emit_int(ret); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_fec_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t *fec_capa), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(fec_capa); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_fec_set, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t fec_capa), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u32(fec_capa); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_get_monitor_addr, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >>+ struct rte_power_monitor_cond *pmc), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(queue_id); >>+ rte_trace_point_emit_ptr(pmc); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_representor_info_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_eth_representor_info *info), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(info); >>+) >>+ >>+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_conf_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_eth_trace_macaddrs_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >>*ma, >>+ unsigned int num), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(ma); >>+ rte_trace_point_emit_u32(num); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_rx_metadata_negotiate, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint64_t *features, >>+ uint64_t features_val), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(features); >>+ rte_trace_point_emit_u64(features_val); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_priority_flow_ctrl_queue_configure, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_eth_pfc_queue_conf *pfc_queue_conf), >>+ 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( >>+ rte_ethdev_trace_priority_flow_ctrl_queue_info_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_eth_pfc_queue_info *pfc_queue_info), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(pfc_queue_info); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_ethdev_trace_priv_dump, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id), >>+ rte_trace_point_emit_u16(port_id); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_ip_reassembly_capability_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_eth_ip_reassembly_params *capa), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(capa); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_ip_reassembly_conf_get, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, >>+ struct rte_eth_ip_reassembly_params *conf), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(conf); >>+) >>+ >>+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), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_ptr(conf); >>+) >>+ >>+RTE_TRACE_POINT( >>+ rte_eth_trace_rx_avail_thresh_query, >>+ RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(queue_id); >>+) >>+ >>+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), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(queue_id); >>+ rte_trace_point_emit_u8(avail_thresh); >>+) >>+ >> #ifdef __cplusplus >> } >> #endif >>diff --git a/lib/ethdev/rte_ethdev_trace_fp.h >>b/lib/ethdev/rte_ethdev_trace_fp.h >>index 40084d1929..ba3fdd04a2 100644 >>--- a/lib/ethdev/rte_ethdev_trace_fp.h >>+++ b/lib/ethdev/rte_ethdev_trace_fp.h >>@@ -37,6 +37,25 @@ 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, >>+ 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_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, >>+ uint16_t nb_pkts), >>+ rte_trace_point_emit_u16(port_id); >>+ rte_trace_point_emit_u16(queue_id); >>+ rte_trace_point_emit_u16(nb_pkts); >>+) >>+ >> #ifdef __cplusplus >> } >> #endif >>diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map >>index 3651ceb234..79d0b2ee1f 100644 >>--- a/lib/ethdev/version.map >>+++ b/lib/ethdev/version.map >>@@ -319,4 +319,148 @@ INTERNAL { >> rte_eth_representor_id_get; >> rte_eth_switch_domain_alloc; >> rte_eth_switch_domain_free; >>+ __rte_eth_trace_add_first_rx_callback; >>+ __rte_eth_trace_add_rx_callback; >>+ __rte_eth_trace_add_tx_callback; >>+ __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_ethdev_trace_count_avail; >>+ __rte_ethdev_trace_count_total; >>+ __rte_ethdev_trace_set_mtu; >>+ __rte_ethdev_trace_adjust_nb_rx_tx_desc; >>+ __rte_ethdev_trace_callback_register; >>+ __rte_ethdev_trace_callback_unregister; >>+ __rte_ethdev_trace_default_mac_addr_set; >>+ __rte_ethdev_trace_flow_ctrl_get; >>+ __rte_ethdev_trace_flow_ctrl_set; >>+ __rte_ethdev_trace_fw_version_get; >>+ __rte_ethdev_trace_get_dcb_info; >>+ __rte_ethdev_trace_get_eeprom; >>+ __rte_ethdev_trace_get_eeprom_length; >>+ __rte_ethdev_trace_get_mtu; >>+ __rte_ethdev_trace_get_name_by_port; >>+ __rte_ethdev_trace_get_port_by_name; >>+ __rte_ethdev_trace_get_reg_info; >>+ __rte_ethdev_trace_get_sec_ctx; >>+ __rte_ethdev_trace_get_supported_ptypes; >>+ __rte_ethdev_trace_get_vlan_offload; >>+ __rte_ethdev_trace_info_get; >>+ __rte_ethdev_trace_is_removed; >>+ __rte_ethdev_trace_is_valid_port; >>+ __rte_ethdev_trace_mac_addr_add; >>+ __rte_ethdev_trace_mac_addr_remove; >>+ __rte_ethdev_trace_pool_ops_supported; >>+ __rte_ethdev_trace_priority_flow_ctrl_set; >>+ __rte_ethdev_trace_reset; >>+ __rte_ethdev_trace_rss_hash_conf_get; >>+ __rte_ethdev_trace_rss_hash_update; >>+ __rte_ethdev_trace_rss_reta_query; >>+ __rte_ethdev_trace_rss_reta_update; >>+ __rte_ethdev_trace_rx_intr_ctl; >>+ __rte_ethdev_trace_rx_intr_ctl_q; >>+ __rte_ethdev_trace_rx_intr_ctl_q_get_fd; >>+ __rte_ethdev_trace_rx_intr_disable; >>+ __rte_ethdev_trace_rx_intr_enable; >>+ __rte_ethdev_trace_rx_offload_name; >>+ __rte_ethdev_trace_rx_queue_start; >>+ __rte_ethdev_trace_rx_queue_stop; >>+ __rte_ethdev_trace_set_eeprom; >>+ __rte_ethdev_trace_set_link_down; >>+ __rte_ethdev_trace_set_link_up; >>+ __rte_ethdev_trace_set_mc_addr_list; >>+ __rte_ethdev_trace_set_ptypes; >>+ __rte_ethdev_trace_set_rx_queue_stats_mapping; >>+ __rte_ethdev_trace_set_tx_queue_stats_mapping; >>+ __rte_ethdev_trace_set_vlan_ether_type; >>+ __rte_ethdev_trace_set_vlan_offload; >>+ __rte_ethdev_trace_set_vlan_pvid; >>+ __rte_ethdev_trace_set_vlan_strip_on_queue; >>+ __rte_ethdev_trace_socket_id; >>+ __rte_ethdev_trace_tx_offload_name; >>+ __rte_ethdev_trace_tx_queue_start; >>+ __rte_ethdev_trace_tx_queue_stop; >>+ __rte_ethdev_trace_uc_all_hash_table_set; >>+ __rte_ethdev_trace_uc_hash_table_set; >>+ __rte_ethdev_trace_udp_tunnel_port_add; >>+ __rte_ethdev_trace_udp_tunnel_port_delete; >>+ __rte_ethdev_trace_vlan_filter; >>+ __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_iterator_cleanup; >>+ __rte_eth_trace_iterator_init; >>+ __rte_eth_trace_iterator_next; >>+ __rte_eth_trace_led_off; >>+ __rte_eth_trace_led_on; >>+ __rte_eth_trace_link_get; >>+ __rte_eth_trace_link_get_nowait; >>+ __rte_eth_trace_macaddr_get; >>+ __rte_eth_trace_promiscuous_disable; >>+ __rte_eth_trace_promiscuous_enable; >>+ __rte_eth_trace_promiscuous_get; >>+ __rte_eth_trace_remove_rx_callback; >>+ __rte_eth_trace_remove_tx_callback; >>+ __rte_eth_trace_rx_burst_mode_get; >>+ __rte_eth_trace_rx_queue_info_get; >>+ __rte_eth_trace_rx_queue_setup; >>+ __rte_eth_trace_set_queue_rate_limit; >>+ __rte_eth_trace_speed_bitflag; >>+ __rte_eth_trace_stats_get; >>+ __rte_eth_trace_stats_reset; >>+ __rte_eth_trace_timesync_adjust_time; >>+ __rte_eth_trace_timesync_disable; >>+ __rte_eth_trace_timesync_enable; >>+ __rte_eth_trace_timesync_read_rx_timestamp; >>+ __rte_eth_trace_timesync_read_time; >>+ __rte_eth_trace_timesync_read_tx_timestamp; >>+ __rte_eth_trace_timesync_write_time; >>+ __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_burst_mode_get; >>+ __rte_eth_trace_tx_done_cleanup; >>+ __rte_eth_trace_tx_queue_info_get; >>+ __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_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_get_module_eeprom; >>+ __rte_ethdev_trace_get_module_info; >>+ __rte_ethdev_trace_hairpin_capability_get; >>+ __rte_eth_trace_rx_hairpin_queue_setup; >>+ __rte_eth_trace_tx_hairpin_queue_setup; >>+ __rte_eth_trace_hairpin_bind; >>+ __rte_eth_trace_hairpin_get_peer_ports; >>+ __rte_eth_trace_hairpin_unbind; >>+ __rte_eth_trace_link_speed_to_str; >>+ __rte_eth_trace_link_to_str; >>+ __rte_eth_trace_fec_get_capability; >>+ __rte_eth_trace_fec_get; >>+ __rte_eth_trace_fec_set; >>+ __rte_eth_trace_get_monitor_addr; >>+ __rte_eth_trace_representor_info_get; >>+ __rte_ethdev_trace_capability_name; >>+ __rte_ethdev_trace_conf_get; >>+ __rte_eth_trace_macaddrs_get; >>+ __rte_eth_trace_rx_metadata_negotiate; >>+ __rte_ethdev_trace_priority_flow_ctrl_queue_configure; >>+ __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; >>+ __rte_ethdev_trace_priv_dump; >>+ __rte_eth_trace_ip_reassembly_capability_get; >>+ __rte_eth_trace_ip_reassembly_conf_get; >>+ __rte_eth_trace_ip_reassembly_conf_set; >>+ __rte_eth_trace_rx_avail_thresh_query; >>+ __rte_eth_trace_rx_avail_thresh_set; >> }; >>-- >>2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v3 1/4] ethdev: add trace points 2022-10-10 6:39 ` Ankur Dwivedi @ 2022-12-12 18:34 ` Ferruh Yigit 0 siblings, 0 replies; 172+ messages in thread From: Ferruh Yigit @ 2022-12-12 18:34 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Morten Brørup On 10/10/2022 7:39 AM, Ankur Dwivedi wrote: >> Yes the functions you mentioned in previous comment are called in while loop >> in worker core. So I think they are fastpath. >> rte_eth_stats_get() is called in fastpath. Similar to rte_eth_macaddr_get(), I >> think functions like >> rte_eth_pro miscuous_get(), rte_eth_allmulticast_get() can also be called in >> fastpath. >> I am not sure which other functions can be fastpath. Is there a guideline/theme >> which can be used to determine this? > [Ankur] I will make the trace call in following functions as fast path trace, considering they are used in while loop in worker core or as rx/tx callback in examples applications. > rte_eth_tx_buffer_drop_callback > rte_eth_tx_buffer_count_callback > rte_eth_tx_done_cleanup > rte_eth_macaddr_get > rte_eth_timesync_read_rx_timestamp > rte_eth_timesync_read_tx_timestamp > rte_eth_timesync_adjust_time > rte_eth_timesync_read_time > rte_eth_timesync_write_time > rte_eth_stats_get > rte_flow_get_restore_info > rte_eth_read_clock > > Please let me know your comments on the patch series. Hi Ankur, I agree that tracing should not cause performance degradation, but not all APIs in your list are for datapath, or for each packet (even called in datapath in sample app). I would use fast path trace for following ones, but keep rest regular trace for rest: fastpath rte_eth_tx_buffer_drop_callback rte_eth_tx_buffer_count_callback rte_eth_tx_done_cleanup btw, I am planning to review series today/tomorrow, so please hold a possible new version for a while. ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v3 1/4] ethdev: add trace points 2022-10-06 15:18 ` [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi 2022-10-06 16:03 ` Morten Brørup 2022-10-07 16:23 ` Ankur Dwivedi @ 2022-12-12 18:38 ` Ferruh Yigit 2022-12-14 10:34 ` David Marchand 2022-12-13 20:06 ` Ferruh Yigit 3 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2022-12-12 18:38 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On 10/6/2022 4:18 PM, Ankur Dwivedi wrote: > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > index 3651ceb234..79d0b2ee1f 100644 > --- a/lib/ethdev/version.map > +++ b/lib/ethdev/version.map > @@ -319,4 +319,148 @@ INTERNAL { > rte_eth_representor_id_get; > rte_eth_switch_domain_alloc; > rte_eth_switch_domain_free; > + __rte_eth_trace_add_first_rx_callback; > + __rte_eth_trace_add_rx_callback; > + __rte_eth_trace_add_tx_callback; > + __rte_eth_trace_allmulticast_disable; These are not trace functions, but trace point objects, I see this is common usage in other libraries too, but can you please explain why we need to export the trace point objects from the .so file? For some datapath functions, which are static inline functions, trace point objects are need to be accessible by application, it is OK to export them, but they are very limited, but I am not clear why exporting all of them is required. ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v3 1/4] ethdev: add trace points 2022-12-12 18:38 ` Ferruh Yigit @ 2022-12-14 10:34 ` David Marchand 2022-12-14 11:04 ` Ferruh Yigit 0 siblings, 1 reply; 172+ messages in thread From: David Marchand @ 2022-12-14 10:34 UTC (permalink / raw) To: Ferruh Yigit Cc: Ankur Dwivedi, dev, thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On Mon, Dec 12, 2022 at 7:38 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote: > > On 10/6/2022 4:18 PM, Ankur Dwivedi wrote: > > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > > index 3651ceb234..79d0b2ee1f 100644 > > --- a/lib/ethdev/version.map > > +++ b/lib/ethdev/version.map > > @@ -319,4 +319,148 @@ INTERNAL { > > rte_eth_representor_id_get; > > rte_eth_switch_domain_alloc; > > rte_eth_switch_domain_free; > > + __rte_eth_trace_add_first_rx_callback; > > + __rte_eth_trace_add_rx_callback; > > + __rte_eth_trace_add_tx_callback; > > + __rte_eth_trace_allmulticast_disable; > > > These are not trace functions, but trace point objects, I see this is > common usage in other libraries too, but can you please explain why we > need to export the trace point objects from the .so file? > > For some datapath functions, which are static inline functions, trace > point objects are need to be accessible by application, it is OK to > export them, but they are very limited, but I am not clear why exporting > all of them is required. There should be no need to export them. The only usage I can think of is when calling a tracepoint from a public inline helper. -- David Marchand ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v3 1/4] ethdev: add trace points 2022-12-14 10:34 ` David Marchand @ 2022-12-14 11:04 ` Ferruh Yigit 0 siblings, 0 replies; 172+ messages in thread From: Ferruh Yigit @ 2022-12-14 11:04 UTC (permalink / raw) To: David Marchand Cc: Ankur Dwivedi, dev, thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On 12/14/2022 10:34 AM, David Marchand wrote: > On Mon, Dec 12, 2022 at 7:38 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote: >> >> On 10/6/2022 4:18 PM, Ankur Dwivedi wrote: >>> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map >>> index 3651ceb234..79d0b2ee1f 100644 >>> --- a/lib/ethdev/version.map >>> +++ b/lib/ethdev/version.map >>> @@ -319,4 +319,148 @@ INTERNAL { >>> rte_eth_representor_id_get; >>> rte_eth_switch_domain_alloc; >>> rte_eth_switch_domain_free; >>> + __rte_eth_trace_add_first_rx_callback; >>> + __rte_eth_trace_add_rx_callback; >>> + __rte_eth_trace_add_tx_callback; >>> + __rte_eth_trace_allmulticast_disable; >> >> >> These are not trace functions, but trace point objects, I see this is >> common usage in other libraries too, but can you please explain why we >> need to export the trace point objects from the .so file? >> >> For some datapath functions, which are static inline functions, trace >> point objects are need to be accessible by application, it is OK to >> export them, but they are very limited, but I am not clear why exporting >> all of them is required. > > There should be no need to export them. > The only usage I can think of is when calling a tracepoint from a > public inline helper. > Like '__rte_ethdev_trace_rx_burst' & '__rte_ethdev_trace_tx_burst', which are used by 'rte_eth_rx_burst()' & 'rte_eth_tx_burst()' static inline functions. ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v3 1/4] ethdev: add trace points 2022-10-06 15:18 ` [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi ` (2 preceding siblings ...) 2022-12-12 18:38 ` Ferruh Yigit @ 2022-12-13 20:06 ` Ferruh Yigit 2022-12-14 10:40 ` Jerin Jacob 2022-12-14 13:52 ` [EXT] Re: [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi 3 siblings, 2 replies; 172+ messages in thread From: Ferruh Yigit @ 2022-12-13 20:06 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On 10/6/2022 4:18 PM, Ankur Dwivedi wrote: Hi Ankur, Jerin, I have some major questions, I can see some already queried by Andrew as well: 1) How flexible are we on changing trace log output? Should we take trace log as kind of user interface and don't break it (as much as possible)? Or is it OK to change whenever we want? 2) What is the main purpose of the trace library. Is it to record type and frequency of the calls? Or is it to log values and state of the device/driver after each call? This can guide us to decide - which values to record (should record only pointers or values of structs) - if to record API return values and failure paths - if to add tracing all APIs or not, like 'rte_eth_dev_rx_offload_name()' kind of helper function that converts offload to a string, which doesn't have any functional impact, or 'rte_eth_speed_bitflag()', and many more... 3) What is the runtime impact. As far as I can see some values copied and some memory is used for this support, even user is not interested in tracing. For control path APIs we can ignore the additional cost by memcpy, but how big memory requirement is? 4) Why we need to export trace point variables in the .map files, like '__rte_eth_trace_allmulticast_disable' one... 5) (bonus Q) Can we have an 'rte_trace_point_emit_xx()' function to record mac address (struct rte_ether_addr) as string? And maybe another set for array types? There are bunch of small comments inline, some are related to above highlevel question. But I stopped after some point, specifically after 'rte_eth_trace_timesync_adjust_time()' :), this is a big file, splitting it may help reviewers. > > Add trace points for ethdev functions. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> <...> > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_burst_mode_get, > + lib.ethdev.rx_burst_mode_get) > + Tx counterpart of this API is missing. > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_info_get, > + lib.ethdev.rx_queue_info_get) > + > +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_setup, > + lib.ethdev.rx_queue_setup) > + ! rte_eth_trace_rx_queue_setup() is not called. And Tx counterpart of this API is missing, these are important APIs, we should have them. <...> > @@ -331,6 +336,7 @@ 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); For the output 'port_id', trace function is after "return RTE_MAX_ETHPORTS;", so "there is no next port" case is ignored, need to update function to get trace on each call. <...> > @@ -636,6 +656,7 @@ 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); This completely ignores the path that not able to find port_id from name. What about change the function as ``` ret = -ENODEV; *port_id = RTE_MAX_ETHPORTS; RTE_ETH_FOREACH_VALID_DEV(pid) if (!strcmp()) *port_id = pid; ret = 0; break; rte_ethdev_trace_get_port_by_name(name, *port_id, ret); return ret; ``` > return 0; > } > > @@ -737,6 +758,7 @@ rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) > return 0; > } > > + rte_ethdev_trace_rx_queue_start(port_id, rx_queue_id); Please include return value. > return eth_err(port_id, dev->dev_ops->rx_queue_start(dev, rx_queue_id)); > } > > @@ -770,6 +792,7 @@ rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) > return 0; > } > > + rte_ethdev_trace_rx_queue_stop(port_id, rx_queue_id); Please include return value. > return eth_err(port_id, dev->dev_ops->rx_queue_stop(dev, rx_queue_id)); > } > > @@ -810,6 +833,7 @@ rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) > return 0; > } > > + rte_ethdev_trace_tx_queue_start(port_id, tx_queue_id); Please include return value. > return eth_err(port_id, dev->dev_ops->tx_queue_start(dev, tx_queue_id)); > } > > @@ -843,12 +867,14 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) > return 0; > } > > + rte_ethdev_trace_tx_queue_stop(port_id, tx_queue_id); Please include return value. > return eth_err(port_id, dev->dev_ops->tx_queue_stop(dev, tx_queue_id)); > } > > uint32_t > rte_eth_speed_bitflag(uint32_t speed, int duplex) > { > + rte_eth_trace_speed_bitflag(speed, duplex); I think this should have return value, but I can see this requires change in the function. I am for either having return value or drop the tracing of this function completely. <...> > @@ -1552,6 +1581,7 @@ rte_eth_dev_set_link_up(uint16_t port_id) > > if (*dev->dev_ops->dev_set_link_up == NULL) > return -ENOTSUP; > + rte_ethdev_trace_set_link_up(port_id); Please include return value. > return eth_err(port_id, (*dev->dev_ops->dev_set_link_up)(dev)); > } > > @@ -1565,6 +1595,7 @@ rte_eth_dev_set_link_down(uint16_t port_id) > > if (*dev->dev_ops->dev_set_link_down == NULL) > return -ENOTSUP; > + rte_ethdev_trace_set_link_down(port_id); Please include return value. <...> > @@ -2327,6 +2371,7 @@ rte_eth_promiscuous_enable(uint16_t port_id) > diag = (*dev->dev_ops->promiscuous_enable)(dev); > dev->data->promiscuous = (diag == 0) ? 1 : 0; > > + rte_eth_trace_promiscuous_enable(port_id, dev->data->promiscuous); Above is good, but to be consistent what about returning return value of the API (diag (with record name 'return')), which is relavent with 'dev->data->promiscuous' value. > return eth_err(port_id, diag); > } > > @@ -2350,6 +2395,7 @@ rte_eth_promiscuous_disable(uint16_t port_id) > if (diag != 0) > dev->data->promiscuous = 1; > > + rte_eth_trace_promiscuous_disable(port_id, dev->data->promiscuous); Above is good, but to be consistent what about returning return value of the API (diag (with record name 'return')), which is relavent with 'dev->data->promiscuous' value. <...> > @@ -2561,6 +2616,7 @@ rte_eth_stats_reset(uint16_t port_id) > > dev->data->rx_mbuf_alloc_failed = 0; > > + rte_eth_trace_stats_reset(port_id); Please include return value. <...> > @@ -3483,6 +3561,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, > > if (*dev->dev_ops->vlan_strip_queue_set == NULL) > return -ENOTSUP; > + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); Please include return value. > (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); > > return 0; > @@ -3500,6 +3579,7 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, > > if (*dev->dev_ops->vlan_tpid_set == NULL) > return -ENOTSUP; > + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid); Please include return value. <...> > @@ -3632,6 +3714,7 @@ rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) > > if (*dev->dev_ops->vlan_pvid_set == NULL) > return -ENOTSUP; > + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on); Please include return value. <...> > @@ -3702,6 +3787,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, > return -EINVAL; > } > > + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf); Please put the call very bottom of the function and include return value. <...> > @@ -4063,6 +4156,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, > > if (*dev->dev_ops->udp_tunnel_port_add == NULL) > return -ENOTSUP; > + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel); Please include return value. > return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, > udp_tunnel)); > } > @@ -4090,6 +4184,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, > > if (*dev->dev_ops->udp_tunnel_port_del == NULL) > return -ENOTSUP; > + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel); Please include return value. > return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, > udp_tunnel)); > } > @@ -4104,6 +4199,7 @@ rte_eth_led_on(uint16_t port_id) > > if (*dev->dev_ops->dev_led_on == NULL) > return -ENOTSUP; > + rte_eth_trace_led_on(port_id); Please include return value. > return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); > } > > @@ -4117,6 +4213,7 @@ rte_eth_led_off(uint16_t port_id) > > if (*dev->dev_ops->dev_led_off == NULL) > return -ENOTSUP; > + rte_eth_trace_led_off(port_id); Please include return value. <...> > @@ -4294,6 +4395,7 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) > } else if (index < 0) > return 0; /* Do nothing if address wasn't found */ > > + rte_ethdev_trace_mac_addr_remove(port_id, addr); better to keep trace APIs are last thing in the function for consistency, as long as it is possible, and for this case it is possible. <...> > @@ -4438,6 +4542,7 @@ rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) > > if (*dev->dev_ops->uc_all_hash_table_set == NULL) > return -ENOTSUP; > + rte_ethdev_trace_uc_all_hash_table_set(port_id, on); Please include return value. > return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, > on)); > } > @@ -4475,6 +4580,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, > > if (*dev->dev_ops->set_queue_rate_limit == NULL) > return -ENOTSUP; > + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate); Please include return value. <...> > @@ -4570,6 +4678,9 @@ rte_eth_dev_callback_register(uint16_t port_id, > next_port = last_port = port_id; > } > > + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, next_port, > + last_port); > + I assume this added into middle to be able to use 'next_port' & 'last_port', but they are generated from given 'port_id', so what do you think to have only 'port_id', and move call to the bottom of the function. 'rte_ethdev_trace_callback_unregister()' has same logic, and it has only 'port_id' already. And I think better to standardise to record API return value or not, because some has it, some don't. What do you think to trace all return values, is there any downside of this approach? If we need fine grain on recording return values, what about following: - All API that changes device config return values should be recorded * like, record return for set_mtu(), but ignore it for get_mtu() - If return value has not API status but useful information, record it * like rte_eth_dev_is_valid_port() return value > rte_spinlock_lock(ð_dev_cb_lock); > > do { > @@ -4665,6 +4776,7 @@ rte_eth_dev_callback_unregister(uint16_t port_id, > } while (++next_port <= last_port); > > rte_spinlock_unlock(ð_dev_cb_lock); > + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, ret); Just a syntax comment, what do you think to have an empty line one before and after the trace call, to separate this trace calls from regular logic. > return ret; > } > > @@ -4694,6 +4806,7 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) > for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { > vec = rte_intr_vec_list_index_get(intr_handle, qid); > rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); > + rte_ethdev_trace_rx_intr_ctl(port_id, epfd, op, data, rc); Why this is in the for loop, API if for port level, this loop iterates on queues? What about moving this trace to the bottom of the function, and record return value as return value of the API? > if (rc && rc != -EEXIST) { > RTE_ETHDEV_LOG(ERR, > "p %u q %u Rx ctl error op %d epfd %d vec %u\n", > @@ -4737,6 +4850,7 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) > (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; > fd = rte_intr_efds_index_get(intr_handle, efd_idx); > > + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); > return fd; > } > > @@ -4770,6 +4884,7 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, > > vec = rte_intr_vec_list_index_get(intr_handle, queue_id); > rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); > + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); Instead of trace API having in the middle, what about changing API as: ``` rc = ... if (rc && rc != -EEXIST) { ... } rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); return rc; ``` > if (rc && rc != -EEXIST) { > RTE_ETHDEV_LOG(ERR, > "p %u q %u Rx ctl error op %d epfd %d vec %u\n", > @@ -4796,6 +4911,7 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, > > if (*dev->dev_ops->rx_queue_intr_enable == NULL) > return -ENOTSUP; > + rte_ethdev_trace_rx_intr_enable(port_id, queue_id); Please include return value. > return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); > } > > @@ -4815,6 +4931,7 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, > > if (*dev->dev_ops->rx_queue_intr_disable == NULL) > return -ENOTSUP; > + rte_ethdev_trace_rx_intr_disable(port_id, queue_id); Please include return value. <...> > @@ -5447,6 +5586,7 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) > > if (*dev->dev_ops->set_eeprom == NULL) > return -ENOTSUP; > + rte_ethdev_trace_set_eeprom(port_id, info); Please include return value. <...> > @@ -5562,6 +5705,7 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, > if (nb_tx_desc != NULL) > eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); > > + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id, *nb_rx_desc, *nb_rx_desc); 'nb_rx_desc' or 'nb_rx_desc' can be NULL, so we can't directly access them. <...> > @@ -5605,6 +5750,7 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) > if (*dev->dev_ops->pool_ops_supported == NULL) > return 1; /* all pools are supported */ > > + rte_ethdev_trace_pool_ops_supported(port_id, pool); Please include return value. <...> > +RTE_TRACE_POINT( > + rte_ethdev_trace_flow_ctrl_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf *fc_conf), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(fc_conf); > +) 'fc_conf' is pointer for the config struct, its address is not much useful, can you expand it similar to ones in 'rte_ethdev_trace_flow_ctrl_set()' API? > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_flow_ctrl_set, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf *fc_conf), > + 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( > + rte_ethdev_trace_fw_version_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, char *fw_version, size_t fw_size), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(fw_version); > + rte_trace_point_emit_size_t(fw_size); > +) 'fw_version' is string, it help to display the string, but not sure if the pointer value has a value. Is there a way to display string in the trace point? And 'fw_size' is normally just used to know the valid data in the 'fw_version', when 'fw_version' string is displayed, not sure if there is a value to have 'fw_size' > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_get_dcb_info, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info *dcb_info), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(dcb_info); > +) 'dcb_info' is pointer to a info struct, not useful as pointer value, we should display content of the 'dcb_info' struct. There are arrays in the 'dcb_info', perhaps it can be possible to trace 'dcb_info->nb_tcs', also 'dcb_info->prio_tc[]' & 'dcb_info->tc_bws[]' since their size is small (8). > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_get_eeprom, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_eeprom_info *info), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(info); > +) > + Similarly, content of the 'info' should be displayed, for '*data' it can be possible to display address of it, but values for rest. > +RTE_TRACE_POINT( > + rte_ethdev_trace_get_eeprom_length, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) > + This should return the size of the eeprom, existing 'rte_eth_dev_get_eeprom_length()' needs to be updated for it. <...> > +RTE_TRACE_POINT( > + rte_ethdev_trace_get_reg_info, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_reg_info *info), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(info); > +) What do you think to display content of the 'info', insted of pointer value which is not very useful. > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_get_sec_ctx, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) 'security_ctx' is "void *", so can't record content, but what do you think to record pointer value of it? > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_get_supported_ptypes, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, > + uint32_t *ptypes, int num, int j), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u32(ptype_mask); > + rte_trace_point_emit_ptr(ptypes); > + rte_trace_point_emit_int(num); > + rte_trace_point_emit_int(j); > +) better to use 'supported_num' instead of 'j' which is not clear what it is. The real information is in 'ptypes' but that is an array, I guess not possible to record array values. > + > +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_info_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_u32(dev_info->if_index); > + 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_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_u16(dev_info->nb_rx_queues); > + rte_trace_point_emit_u16(dev_info->nb_tx_queues); > +) > + It is a debate what to display, but I would remove 'if_index' and add 'max_rx_queues', 'max_tx_queues', 'max_mac_addrs', 'flow_type_rss_offloads', 'rx_desc_lim', 'tx_desc_lim', 'speed_capa', 'dev_capa'. > +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_ethdev_trace_is_valid_port, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) > + Should have return value, if the port is valid of not. > +RTE_TRACE_POINT( > + rte_ethdev_trace_mac_addr_add, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, > + uint32_t pool), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(addr); > + rte_trace_point_emit_u32(pool); > +) > + Isn't it possible to return 'addr' as string? I am not sure about benefit to record addr pointer value. Should have return value. > +RTE_TRACE_POINT( > + rte_ethdev_trace_mac_addr_remove, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(addr); > +) > + As above, can content of 'addr' be recorded, like as string? > +RTE_TRACE_POINT( > + rte_ethdev_trace_pool_ops_supported, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *pool), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(pool); > +) > + 'pool' should be string, instead of pointer. > +RTE_TRACE_POINT( > + rte_ethdev_trace_priority_flow_ctrl_set, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf), > + 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( > + 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_ethdev_trace_rss_hash_conf_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf *rss_conf), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(rss_conf); > +) > + Please record content of the 'rss_conf' instead of pointer value. > +RTE_TRACE_POINT( > + rte_ethdev_trace_rss_hash_update, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf *rss_conf), > + 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); > +) > + Please add return value. > +RTE_TRACE_POINT( > + rte_ethdev_trace_rss_reta_query, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(reta_conf); > + rte_trace_point_emit_u16(reta_size); > +) > + > +RTE_TRACE_POINT( > + rte_ethdev_trace_rss_reta_update, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u64(reta_conf->mask); > + rte_trace_point_emit_u16(reta_size); > +) 'reta_conf->mask' on its own is not much usefull, and 'reta_conf->reta' is an array and hard to record. As above 'rte_ethdev_trace_rss_reta_query' trace point only record reta_config pointer, this can do the same. Overall, I think better to make get/set pair of an API record same set of values. <...> > +RTE_TRACE_POINT( > + rte_ethdev_trace_set_mc_addr_list, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + struct rte_ether_addr *mc_addr_set, > + uint32_t nb_mc_addr), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(mc_addr_set); > + rte_trace_point_emit_u32(nb_mc_addr); > +) > + Better to record content of 'mc_addr_set' but it is pointer array for mac address, so I guess we can't record these mac addresses. > +RTE_TRACE_POINT( > + rte_ethdev_trace_set_ptypes, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, > + uint32_t *set_ptypes, unsigned int num), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u32(ptype_mask); > + rte_trace_point_emit_ptr(set_ptypes); > + rte_trace_point_emit_u32(num); > +) > + Similarly 'set_ptypes' is an array. I wonder if there should be an rte_trace_point_emit_ function for arrays? What do you think? <...> > +RTE_TRACE_POINT( > + rte_ethdev_trace_socket_id, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) Should include 'socket_id'. <...> > +RTE_TRACE_POINT( > + rte_ethdev_trace_uc_hash_table_set, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, > + uint8_t on, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(addr); > + rte_trace_point_emit_u8(on); > + rte_trace_point_emit_int(ret); > +) > + Can have 'addr' as string? Do we need a specific rte_trace_point_emit_ function for mac addr? <...> > +RTE_TRACE_POINT( > + rte_eth_trace_find_next, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) > + rte_eth_trace_find_next* functions gets 'port_id' as input parameter, and returns next 'port_id', so both input and output is 'port_id' and both should be recorded. For this need to update these functions to create an interim variable for input 'port_id'. Above comments are for all 'rte_eth_trace_find_next*()' functions. <...> > +RTE_TRACE_POINT( > + rte_eth_trace_link_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u32(link->link_speed); > +) I think better to record other link values too. > + > +RTE_TRACE_POINT( > + rte_eth_trace_link_get_nowait, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u32(link->link_speed); > +) > + I think better to record other link values too. <...> > +RTE_TRACE_POINT( > + rte_eth_trace_rx_burst_mode_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + struct rte_eth_burst_mode *mode), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(queue_id); > + rte_trace_point_emit_ptr(mode); > +) > + Can you please record content of 'mode' inst > +RTE_TRACE_POINT( > + rte_eth_trace_rx_queue_info_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + 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->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); > +) > + Can you please add 'qinfo->conf->rx_drop_en' & 'qinfo->conf->offloads'. > +RTE_TRACE_POINT( > + rte_eth_trace_rx_queue_setup, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, > + uint16_t nb_rx_desc, unsigned int socket_id, > + const struct rte_eth_rxconf *rx_conf, > + struct rte_mempool *mb_pool), > + 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_u32(socket_id); > + rte_trace_point_emit_ptr(rx_conf); > + rte_trace_point_emit_ptr(mb_pool); > +) > + Can you please add 'rx_conf->rx_drop_en' & 'rx_conf->offloads'. > +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), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(queue_idx); > + rte_trace_point_emit_u16(tx_rate); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_speed_bitflag, > + RTE_TRACE_POINT_ARGS(uint32_t speed, int duplex), > + rte_trace_point_emit_u32(speed); > + rte_trace_point_emit_int(duplex); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_stats_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats *stats), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(stats); > + rte_trace_point_emit_u64(stats->rx_nombuf); > +) > + Not sure what to record here, I think all basic stat counters can be recorded if there cost is effordable. ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v3 1/4] ethdev: add trace points 2022-12-13 20:06 ` Ferruh Yigit @ 2022-12-14 10:40 ` Jerin Jacob 2022-12-14 12:10 ` Ferruh Yigit 2022-12-14 13:52 ` [EXT] Re: [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi 1 sibling, 1 reply; 172+ messages in thread From: Jerin Jacob @ 2022-12-14 10:40 UTC (permalink / raw) To: Ferruh Yigit Cc: Ankur Dwivedi, dev, thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On Wed, Dec 14, 2022 at 1:37 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote: > > On 10/6/2022 4:18 PM, Ankur Dwivedi wrote: > > Hi Ankur, Jerin, Hi Ferruh, Please find answers to generic trace questions. > > I have some major questions, I can see some already queried by Andrew as > well: > > 1) How flexible are we on changing trace log output? > Should we take trace log as kind of user interface and don't break it > (as much as possible)? Or is it OK to change whenever we want? If you see https://doc.dpdk.org/guides/prog_guide/trace_lib.html "Section: 6.9.3. Trace memory layout", Currently, we defined packet.header, packet.context, trace.header as minimum as required. It can be extended if needed. Trace payload is not fixed, it is created based on arguments of RTE_TRACE_POINT. > > > 2) What is the main purpose of the trace library. > Is it to record type and frequency of the calls? Or is it to log values > and state of the device/driver after each call? From the framework POV, it can be used for both. I think, as first step, we can emit the traces for public DPDK APIs with return type of each API. > This can guide us to decide > - which values to record (should record only pointers or values of structs) > - if to record API return values and failure paths > - if to add tracing all APIs or not, like > 'rte_eth_dev_rx_offload_name()' kind of helper function that converts > offload to a string, which doesn't have any functional impact, or > 'rte_eth_speed_bitflag()', and many more... > > > 3) What is the runtime impact. Profiling overhead is one cycle. i.e. RTE_TRACE_POINT is added, and it is disabled at runtime. For RTE_TRACE_POINT_FP it is zero if it is not enabled at compile time. > As far as I can see some values copied and some memory is used for this > support, even user is not interested in tracing. For control path APIs > we can ignore the additional cost by memcpy, but how big memory > requirement is? Currently, per core/thread 1MB trace buffer is created as default. The size can be overridden via EAL command line argument. See __rte_trace_mem_per_thread_alloc(). If you see https://doc.dpdk.org/guides/prog_guide/trace_lib.html section "6.5. Event record mode", it has two modes Overwrite - When the trace buffer is full, new trace events overwrites the existing captured events in the trace buffer. Discard - When the trace buffer is full, new trace events will be discarded. > > > 4) Why we need to export trace point variables in the .map files, > like '__rte_eth_trace_allmulticast_disable' one... If you see app/test/test_trace.c example There are two-way to operate on trace point, We need to export symbol iff we need option 1 option1: rte_trace_point_enable(&__app_dpdk_test_tp); option2: rte_trace_point_t *trace = rte_trace_point_lookup("app.dpdk.test.tp"); rte_trace_point_enable(trace); > > > > 5) (bonus Q) Can we have an 'rte_trace_point_emit_xx()' function to > record mac address (struct rte_ether_addr) as string? > And maybe another set for array types? Yes it possible and better to add rte_trace_pint_emit_,mac() or so. > > > There are bunch of small comments inline, some are related to above > highlevel question. > But I stopped after some point, specifically after > 'rte_eth_trace_timesync_adjust_time()' :), this is a big file, splitting > it may help reviewers. > ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v3 1/4] ethdev: add trace points 2022-12-14 10:40 ` Jerin Jacob @ 2022-12-14 12:10 ` Ferruh Yigit 2022-12-15 6:49 ` Jerin Jacob 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2022-12-14 12:10 UTC (permalink / raw) To: Jerin Jacob Cc: Ankur Dwivedi, dev, thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On 12/14/2022 10:40 AM, Jerin Jacob wrote: > On Wed, Dec 14, 2022 at 1:37 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote: >> >> On 10/6/2022 4:18 PM, Ankur Dwivedi wrote: >> >> Hi Ankur, Jerin, > > Hi Ferruh, Please find answers to generic trace questions. > >> >> I have some major questions, I can see some already queried by Andrew as >> well: >> >> 1) How flexible are we on changing trace log output? >> Should we take trace log as kind of user interface and don't break it >> (as much as possible)? Or is it OK to change whenever we want? > > If you see https://doc.dpdk.org/guides/prog_guide/trace_lib.html > "Section: 6.9.3. Trace memory layout", Currently, we defined packet.header, > packet.context, trace.header as minimum as required. It can be > extended if needed. > Trace payload is not fixed, it is created based on arguments of RTE_TRACE_POINT. > I am aware payload is not fixed technically, but my concern is from user perspective. Lets get 'rte_ethdev_trace_info_get' as example, right now it records 'dev_info->if_index', if we remove it in next release, will it impact the users? Or if we start recording 'dev_info->max_rx_queues' in another release, it will change order of fields in output, will it impact the user? If changing payload doesn't impact user, we can accept changes easier since we can tweak them as needed without user impact. But if the target is to stick to the payload layout as much as possible, we should be more careful before we finalize it. I am trying to understand how strict to be in accepting trace point patches. >> >> >> 2) What is the main purpose of the trace library. >> Is it to record type and frequency of the calls? Or is it to log values >> and state of the device/driver after each call? > > From the framework POV, it can be used for both. > I think, as first step, we can emit the traces for public DPDK APIs > with return type of each API. > Most of the trace point records only on success path, and not record at all when there is a failure in the API, that is why I think trace can't completely replace the logging. But trace may be useful to analysis a functioning system for performance issues, overall system analysis, or unexpected behaviors. In that case I am not sure how much detail to record in trace. Because recording more fields comes with additional runtime cost and memory cost, right? Also useless records can be noise in the trace output. OK to record return values but I don't know if it may be misleading because in some of the failure path trace functions not called at all, so recorded failures will be subset of the overall failures. BTW, I don't think that we should record all failures in trace log, that will create to much noise in the code. >> This can guide us to decide >> - which values to record (should record only pointers or values of structs) >> - if to record API return values and failure paths >> - if to add tracing all APIs or not, like >> 'rte_eth_dev_rx_offload_name()' kind of helper function that converts >> offload to a string, which doesn't have any functional impact, or >> 'rte_eth_speed_bitflag()', and many more... >> >> >> 3) What is the runtime impact. > > Profiling overhead is one cycle. i.e. RTE_TRACE_POINT is added, and it > is disabled at runtime. Got it, there is '__RTE_TRACE_FIELD_ENABLE_MASK' check, and this is the only cost when trace is disabled. > For RTE_TRACE_POINT_FP it is zero if it is not enabled at compile time. > ack > >> As far as I can see some values copied and some memory is used for this >> support, even user is not interested in tracing. For control path APIs >> we can ignore the additional cost by memcpy, but how big memory >> requirement is? > > Currently, per core/thread 1MB trace buffer is created as default. The > size can be overridden via EAL command line argument. > See __rte_trace_mem_per_thread_alloc(). > If you see https://doc.dpdk.org/guides/prog_guide/trace_lib.html > section "6.5. Event record mode", it has two modes > Overwrite - When the trace buffer is full, new trace events overwrites > the existing captured events in the trace buffer. > Discard - When the trace buffer is full, new trace events will be discarded. > OK, default 1M buffer doesn't look something to worry about. >> >> >> 4) Why we need to export trace point variables in the .map files, >> like '__rte_eth_trace_allmulticast_disable' one... > > If you see app/test/test_trace.c example > > There are two-way to operate on trace point, We need to export symbol > iff we need option 1 > > option1: > rte_trace_point_enable(&__app_dpdk_test_tp); > > option2: > rte_trace_point_t *trace = rte_trace_point_lookup("app.dpdk.test.tp"); > rte_trace_point_enable(trace); > got it, do we really need direct access to trace point (option 1), I would be OK to remove that option to not expose all these trace point objects. > >> >> >> >> 5) (bonus Q) Can we have an 'rte_trace_point_emit_xx()' function to >> record mac address (struct rte_ether_addr) as string? >> And maybe another set for array types? > > Yes it possible and better to add rte_trace_pint_emit_,mac() or so. > Thanks. > >> >> >> There are bunch of small comments inline, some are related to above >> highlevel question. >> But I stopped after some point, specifically after >> 'rte_eth_trace_timesync_adjust_time()' :), this is a big file, splitting >> it may help reviewers. >> ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v3 1/4] ethdev: add trace points 2022-12-14 12:10 ` Ferruh Yigit @ 2022-12-15 6:49 ` Jerin Jacob 2023-01-12 9:10 ` Thomas Monjalon 0 siblings, 1 reply; 172+ messages in thread From: Jerin Jacob @ 2022-12-15 6:49 UTC (permalink / raw) To: Ferruh Yigit Cc: Ankur Dwivedi, dev, thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia On Wed, Dec 14, 2022 at 5:40 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote: > > On 12/14/2022 10:40 AM, Jerin Jacob wrote: > > On Wed, Dec 14, 2022 at 1:37 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote: > >> > >> On 10/6/2022 4:18 PM, Ankur Dwivedi wrote: > >> > >> Hi Ankur, Jerin, > > > > Hi Ferruh, Please find answers to generic trace questions. > > > >> > >> I have some major questions, I can see some already queried by Andrew as > >> well: > >> > >> 1) How flexible are we on changing trace log output? > >> Should we take trace log as kind of user interface and don't break it > >> (as much as possible)? Or is it OK to change whenever we want? > > > > If you see https://doc.dpdk.org/guides/prog_guide/trace_lib.html > > "Section: 6.9.3. Trace memory layout", Currently, we defined packet.header, > > packet.context, trace.header as minimum as required. It can be > > extended if needed. > > Trace payload is not fixed, it is created based on arguments of RTE_TRACE_POINT. > > > > I am aware payload is not fixed technically, but my concern is from user > perspective. > > Lets get 'rte_ethdev_trace_info_get' as example, right now it records > 'dev_info->if_index', if we remove it in next release, will it impact > the users? > Or if we start recording 'dev_info->max_rx_queues' in another release, > it will change order of fields in output, will it impact the user? No. IMO, That level of compatibility is not needed. > > If changing payload doesn't impact user, we can accept changes easier > since we can tweak them as needed without user impact. > But if the target is to stick to the payload layout as much as possible, > we should be more careful before we finalize it. > > I am trying to understand how strict to be in accepting trace point patches. > > >> > >> > >> 2) What is the main purpose of the trace library. > >> Is it to record type and frequency of the calls? Or is it to log values > >> and state of the device/driver after each call? > > > > From the framework POV, it can be used for both. > > I think, as first step, we can emit the traces for public DPDK APIs > > with return type of each API. > > > > Most of the trace point records only on success path, and not record at > all when there is a failure in the API, that is why I think trace can't > completely replace the logging. Yes. > > But trace may be useful to analysis a functioning system for performance > issues, overall system analysis, or unexpected behaviors. > In that case I am not sure how much detail to record in trace. For other projects(example: https://docs.zephyrproject.org/2.6.0/guides/tracing/index.html), I see it's just capturing the PUBLIC APIs to know how application using the library and debug customer issues. i.e API contract between user and DPDK library, > > Because recording more fields comes with additional runtime cost and > memory cost, right? Also useless records can be noise in the trace output. Since each trace point can be disabled(using regex pattern) at runtime, users have control on it > > OK to record return values but I don't know if it may be misleading > because in some of the failure path trace functions not called at all, > so recorded failures will be subset of the overall failures. > BTW, I don't think that we should record all failures in trace log, that > will create to much noise in the code. Yes. Just the return value of the function is enough in most case. Also, it is up to the specific subsystem maintainer to decide what level of info needs to capture. > > >> This can guide us to decide > >> - which values to record (should record only pointers or values of structs) > >> - if to record API return values and failure paths > >> - if to add tracing all APIs or not, like > >> 'rte_eth_dev_rx_offload_name()' kind of helper function that converts > >> offload to a string, which doesn't have any functional impact, or > >> 'rte_eth_speed_bitflag()', and many more... > >> > >> > >> 3) What is the runtime impact. > > > > Profiling overhead is one cycle. i.e. RTE_TRACE_POINT is added, and it > > is disabled at runtime. > > Got it, there is '__RTE_TRACE_FIELD_ENABLE_MASK' check, and this is the > only cost when trace is disabled. > > > For RTE_TRACE_POINT_FP it is zero if it is not enabled at compile time. > > > > ack > > > > >> As far as I can see some values copied and some memory is used for this > >> support, even user is not interested in tracing. For control path APIs > >> we can ignore the additional cost by memcpy, but how big memory > >> requirement is? > > > > Currently, per core/thread 1MB trace buffer is created as default. The > > size can be overridden via EAL command line argument. > > See __rte_trace_mem_per_thread_alloc(). > > If you see https://doc.dpdk.org/guides/prog_guide/trace_lib.html > > section "6.5. Event record mode", it has two modes > > Overwrite - When the trace buffer is full, new trace events overwrites > > the existing captured events in the trace buffer. > > Discard - When the trace buffer is full, new trace events will be discarded. > > > > OK, default 1M buffer doesn't look something to worry about. > > >> > >> > >> 4) Why we need to export trace point variables in the .map files, > >> like '__rte_eth_trace_allmulticast_disable' one... > > > > If you see app/test/test_trace.c example > > > > There are two-way to operate on trace point, We need to export symbol > > iff we need option 1 > > > > option1: > > rte_trace_point_enable(&__app_dpdk_test_tp); > > > > option2: > > rte_trace_point_t *trace = rte_trace_point_lookup("app.dpdk.test.tp"); > > rte_trace_point_enable(trace); > > > > got it, do we really need direct access to trace point (option 1), I > would be OK to remove that option to not expose all these trace point > objects. Looks good to me. > > > > >> > >> > >> > >> 5) (bonus Q) Can we have an 'rte_trace_point_emit_xx()' function to > >> record mac address (struct rte_ether_addr) as string? > >> And maybe another set for array types? > > > > Yes it possible and better to add rte_trace_pint_emit_,mac() or so. > > > > Thanks. > > > > >> > >> > >> There are bunch of small comments inline, some are related to above > >> highlevel question. > >> But I stopped after some point, specifically after > >> 'rte_eth_trace_timesync_adjust_time()' :), this is a big file, splitting > >> it may help reviewers. > >> > ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v3 1/4] ethdev: add trace points 2022-12-15 6:49 ` Jerin Jacob @ 2023-01-12 9:10 ` Thomas Monjalon 2023-01-12 9:43 ` trace point symbols Morten Brørup 0 siblings, 1 reply; 172+ messages in thread From: Thomas Monjalon @ 2023-01-12 9:10 UTC (permalink / raw) To: Ferruh Yigit, Jerin Jacob, jerinj Cc: dev, Ankur Dwivedi, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, david.marchand 15/12/2022 07:49, Jerin Jacob: > On Wed, Dec 14, 2022 at 5:40 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote: > > > > On 12/14/2022 10:40 AM, Jerin Jacob wrote: > > > On Wed, Dec 14, 2022 at 1:37 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote: > > >> 4) Why we need to export trace point variables in the .map files, > > >> like '__rte_eth_trace_allmulticast_disable' one... > > > > > > If you see app/test/test_trace.c example > > > > > > There are two-way to operate on trace point, We need to export symbol > > > iff we need option 1 > > > > > > option1: > > > rte_trace_point_enable(&__app_dpdk_test_tp); > > > > > > option2: > > > rte_trace_point_t *trace = rte_trace_point_lookup("app.dpdk.test.tp"); > > > rte_trace_point_enable(trace); > > > > > > > got it, do we really need direct access to trace point (option 1), I > > would be OK to remove that option to not expose all these trace point > > objects. > > Looks good to me. I would like to see a policy regarding trace symbols. If we decide option 1 is not so useful, then we should not export trace symbols at all and document this policy. Also there are some trace symbols which could be cleaned up. ^ permalink raw reply [flat|nested] 172+ messages in thread
* trace point symbols 2023-01-12 9:10 ` Thomas Monjalon @ 2023-01-12 9:43 ` Morten Brørup 2023-01-13 11:22 ` Jerin Jacob 0 siblings, 1 reply; 172+ messages in thread From: Morten Brørup @ 2023-01-12 9:43 UTC (permalink / raw) To: Thomas Monjalon, Ferruh Yigit, Jerin Jacob, jerinj, bruce.richardson Cc: dev, Ankur Dwivedi, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, david.marchand > From: Thomas Monjalon [mailto:thomas@monjalon.net] > Sent: Thursday, 12 January 2023 10.11 > > 15/12/2022 07:49, Jerin Jacob: > > On Wed, Dec 14, 2022 at 5:40 PM Ferruh Yigit <ferruh.yigit@amd.com> > wrote: > > > > > > On 12/14/2022 10:40 AM, Jerin Jacob wrote: > > > > On Wed, Dec 14, 2022 at 1:37 AM Ferruh Yigit > <ferruh.yigit@amd.com> wrote: > > > >> 4) Why we need to export trace point variables in the .map > files, > > > >> like '__rte_eth_trace_allmulticast_disable' one... > > > > > > > > If you see app/test/test_trace.c example > > > > > > > > There are two-way to operate on trace point, We need to export > symbol > > > > iff we need option 1 > > > > > > > > option1: > > > > rte_trace_point_enable(&__app_dpdk_test_tp); > > > > > > > > option2: > > > > rte_trace_point_t *trace = > rte_trace_point_lookup("app.dpdk.test.tp"); > > > > rte_trace_point_enable(trace); rte_trace_point_enable() allows passing a NULL pointer, so enabling a trace point can still be a one-liner: rte_trace_point_enable(rte_trace_point_lookup("app.dpdk.test.tp")); With option2, we lose the build-time error if trying to enable a non-existing trace point. But it's an acceptable tradeoff. > > > > > > > > > > got it, do we really need direct access to trace point (option 1), > I > > > would be OK to remove that option to not expose all these trace > point > > > objects. > > > > Looks good to me. > > I would like to see a policy regarding trace symbols. > If we decide option 1 is not so useful, > then we should not export trace symbols at all and document this > policy. > Also there are some trace symbols which could be cleaned up. +1 for not exposing trace point symbols at all. The trace point symbols are only used internally by DPDK, so they should not be part of DPDK's public API. It might also make it easier for Bruce to move the trace library out of EAL. I'm not familiar with the CTF format, but I assume that if we don't expose the trace point symbols, the trace points can still be identified when parsing the trace file. ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: trace point symbols 2023-01-12 9:43 ` trace point symbols Morten Brørup @ 2023-01-13 11:22 ` Jerin Jacob 0 siblings, 0 replies; 172+ messages in thread From: Jerin Jacob @ 2023-01-13 11:22 UTC (permalink / raw) To: Morten Brørup Cc: Thomas Monjalon, Ferruh Yigit, jerinj, bruce.richardson, dev, Ankur Dwivedi, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, david.marchand On Thu, Jan 12, 2023 at 3:13 PM Morten Brørup <mb@smartsharesystems.com> wrote: > > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > Sent: Thursday, 12 January 2023 10.11 > > > > > > I would like to see a policy regarding trace symbols. > > If we decide option 1 is not so useful, > > then we should not export trace symbols at all and document this > > policy. > > Also there are some trace symbols which could be cleaned up. I can send a patch to remove existing exposed symbols for option 1 in DPDK repo. But, Is n't an ABI break? The only downside, I can think of, is that a few more entries in version.map file. I don't have a strong option one way, either. Let me know what you think? If we decided to remove then, In https://doc.dpdk.org/guides/prog_guide/trace_lib.html, There is NOTE section as following, I can remove that as well. -- The RTE_TRACE_POINT_REGISTER defines the placeholder for the rte_trace_point_t tracepoint object. The user must export a __<trace_function_name> symbol in the library .map file for this tracepoint to be used out of the library, in shared builds. For example, __app_trace_string will be the exported symbol in the above example. --- > > +1 for not exposing trace point symbols at all. > > The trace point symbols are only used internally by DPDK, so they should not be part of DPDK's public API. > > It might also make it easier for Bruce to move the trace library out of EAL. > > I'm not familiar with the CTF format, but I assume that if we don't expose the trace point symbols, the trace points can still be identified when parsing the trace file. Yes. It won't impact. The only use case for option 1 is to avoid named lookup. > ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v3 1/4] ethdev: add trace points 2022-12-13 20:06 ` Ferruh Yigit 2022-12-14 10:40 ` Jerin Jacob @ 2022-12-14 13:52 ` Ankur Dwivedi 1 sibling, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-12-14 13:52 UTC (permalink / raw) To: Ferruh Yigit, dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia Hi Ferruh, Thanks a lot for reviewing this patch. The generic questions have been answered by Jerin in earlier email. I have replied inline to the remaining comments. > >There are bunch of small comments inline, some are related to above highlevel >question. >But I stopped after some point, specifically after >'rte_eth_trace_timesync_adjust_time()' :), this is a big file, splitting it may help >reviewers. I will split this patch into two. > >> >> Add trace points for ethdev functions. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > ><...> > >> +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_burst_mode_get, >> + lib.ethdev.rx_burst_mode_get) >> + > >Tx counterpart of this API is missing. The tx API is also added. +RTE_TRACE_POINT_REGISTER(rte_eth_trace_tx_burst_mode_get, + lib.ethdev.tx_burst_mode_get) + > >> +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_info_get, >> + lib.ethdev.rx_queue_info_get) >> + >> +RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_queue_setup, >> + lib.ethdev.rx_queue_setup) >> + > >! rte_eth_trace_rx_queue_setup() is not called. Will remove this. This is not required as rte_ethdev_trace_rxq_setup is already added. > >And Tx counterpart of this API is missing, these are important APIs, we should >have them. rte_ethdev_trace_txq_setup is already added. > ><...> > >> @@ -331,6 +336,7 @@ 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); > > >For the output 'port_id', trace function is after "return RTE_MAX_ETHPORTS;", >so "there is no next port" case is ignored, need to update function to get trace >on each call. Ok. Will add trace for the "there is no next port" case. > ><...> > >> @@ -636,6 +656,7 @@ 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); > > >This completely ignores the path that not able to find port_id from name. The trace was added for the success case only. For the failure case there is no port_id value. > >What about change the function as > >``` >ret = -ENODEV; >*port_id = RTE_MAX_ETHPORTS; > >RTE_ETH_FOREACH_VALID_DEV(pid) > if (!strcmp()) > *port_id = pid; > ret = 0; > break; > >rte_ethdev_trace_get_port_by_name(name, *port_id, ret); > >return ret; >``` > >> return 0; >> } >> >> @@ -737,6 +758,7 @@ rte_eth_dev_rx_queue_start(uint16_t port_id, >uint16_t rx_queue_id) >> return 0; >> } >> >> + rte_ethdev_trace_rx_queue_start(port_id, rx_queue_id); > >Please include return value. Will add return value. The following changes will be required: 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; > >> return eth_err(port_id, dev->dev_ops->rx_queue_start(dev, >> rx_queue_id)); } >> >> @@ -770,6 +792,7 @@ rte_eth_dev_rx_queue_stop(uint16_t port_id, >uint16_t rx_queue_id) >> return 0; >> } >> >> + rte_ethdev_trace_rx_queue_stop(port_id, rx_queue_id); > >Please include return value. Ok. > >> return eth_err(port_id, dev->dev_ops->rx_queue_stop(dev, >> rx_queue_id)); } >> >> @@ -810,6 +833,7 @@ rte_eth_dev_tx_queue_start(uint16_t port_id, >uint16_t tx_queue_id) >> return 0; >> } >> >> + rte_ethdev_trace_tx_queue_start(port_id, tx_queue_id); > >Please include return value. Ok. > >> return eth_err(port_id, dev->dev_ops->tx_queue_start(dev, >> tx_queue_id)); } >> >> @@ -843,12 +867,14 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, >uint16_t tx_queue_id) >> return 0; >> } >> >> + rte_ethdev_trace_tx_queue_stop(port_id, tx_queue_id); > >Please include return value. Ok. > >> return eth_err(port_id, dev->dev_ops->tx_queue_stop(dev, >> tx_queue_id)); } >> >> uint32_t >> rte_eth_speed_bitflag(uint32_t speed, int duplex) { >> + rte_eth_trace_speed_bitflag(speed, duplex); > >I think this should have return value, but I can see this requires change in the >function. > >I am for either having return value or drop the tracing of this function >completely. Will drop the tracing for this function. > ><...> > >> @@ -1552,6 +1581,7 @@ rte_eth_dev_set_link_up(uint16_t port_id) >> >> if (*dev->dev_ops->dev_set_link_up == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_set_link_up(port_id); > >Please include return value. Ok. > >> return eth_err(port_id, >> (*dev->dev_ops->dev_set_link_up)(dev)); >> } >> >> @@ -1565,6 +1595,7 @@ rte_eth_dev_set_link_down(uint16_t port_id) >> >> if (*dev->dev_ops->dev_set_link_down == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_set_link_down(port_id); > >Please include return value. Ok. > ><...> > >> @@ -2327,6 +2371,7 @@ rte_eth_promiscuous_enable(uint16_t port_id) >> diag = (*dev->dev_ops->promiscuous_enable)(dev); >> dev->data->promiscuous = (diag == 0) ? 1 : 0; >> >> + rte_eth_trace_promiscuous_enable(port_id, >> + dev->data->promiscuous); > >Above is good, but to be consistent what about returning return value of the >API (diag (with record name 'return')), which is relavent with 'dev->data- >>promiscuous' value. For this the following changes will capture return value and diag: ret = eth_err(port_id, diag); rte_eth_trace_promiscuous_enable(port_id, dev->data->promiscuous, diag, ret); return ret; > >> return eth_err(port_id, diag); } >> >> @@ -2350,6 +2395,7 @@ rte_eth_promiscuous_disable(uint16_t port_id) >> if (diag != 0) >> dev->data->promiscuous = 1; >> >> + rte_eth_trace_promiscuous_disable(port_id, >> + dev->data->promiscuous); > >Above is good, but to be consistent what about returning return value of the >API (diag (with record name 'return')), which is relavent with 'dev->data- >>promiscuous' value. Similar changes as rte_eth_trace_promiscuous_enable. > ><...> > >> @@ -2561,6 +2616,7 @@ rte_eth_stats_reset(uint16_t port_id) >> >> dev->data->rx_mbuf_alloc_failed = 0; >> >> + rte_eth_trace_stats_reset(port_id); > >Please include return value. Here the return value is not required, because if the control reached here the return is 0. > ><...> > >> @@ -3483,6 +3561,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t >> port_id, uint16_t rx_queue_id, >> >> if (*dev->dev_ops->vlan_strip_queue_set == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, >> + on); > >Please include return value. > >> (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); If the control reached this point the return is 0. I think the return value is not required here. >> >> return 0; >> @@ -3500,6 +3579,7 @@ rte_eth_dev_set_vlan_ether_type(uint16_t >> port_id, >> >> if (*dev->dev_ops->vlan_tpid_set == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, >> + tpid); > >Please include return value. Ok. > ><...> > >> @@ -3632,6 +3714,7 @@ rte_eth_dev_set_vlan_pvid(uint16_t port_id, >> uint16_t pvid, int on) >> >> if (*dev->dev_ops->vlan_pvid_set == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on); > >Please include return value. Ok. > ><...> > >> @@ -3702,6 +3787,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t >port_id, >> return -EINVAL; >> } >> >> + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf); > >Please put the call very bottom of the function and include return value. Ok. > ><...> > >> @@ -4063,6 +4156,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t >> port_id, >> >> if (*dev->dev_ops->udp_tunnel_port_add == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel); > >Please include return value. Ok. > >> return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, >> >> udp_tunnel)); } @@ -4090,6 +4184,7 @@ >> rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, >> >> if (*dev->dev_ops->udp_tunnel_port_del == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel); > >Please include return value. Ok. > >> return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, >> >> udp_tunnel)); } @@ -4104,6 +4199,7 @@ rte_eth_led_on(uint16_t >> port_id) >> >> if (*dev->dev_ops->dev_led_on == NULL) >> return -ENOTSUP; >> + rte_eth_trace_led_on(port_id); > >Please include return value. Ok. > >> return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); >> } >> >> @@ -4117,6 +4213,7 @@ rte_eth_led_off(uint16_t port_id) >> >> if (*dev->dev_ops->dev_led_off == NULL) >> return -ENOTSUP; >> + rte_eth_trace_led_off(port_id); > >Please include return value. Ok. > ><...> > >> @@ -4294,6 +4395,7 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, >struct rte_ether_addr *addr) >> } else if (index < 0) >> return 0; /* Do nothing if address wasn't found */ >> >> + rte_ethdev_trace_mac_addr_remove(port_id, addr); > >better to keep trace APIs are last thing in the function for consistency, as long as >it is possible, and for this case it is possible. Ok. > ><...> > >> @@ -4438,6 +4542,7 @@ rte_eth_dev_uc_all_hash_table_set(uint16_t >> port_id, uint8_t on) >> >> if (*dev->dev_ops->uc_all_hash_table_set == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_uc_all_hash_table_set(port_id, on); > >Please include return value. Ok. > >> return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, >> >> on)); } @@ -4475,6 +4580,7 @@ int >> rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, >> >> if (*dev->dev_ops->set_queue_rate_limit == NULL) >> return -ENOTSUP; >> + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, >> + tx_rate); > >Please include return value. Ok. > ><...> > >> @@ -4570,6 +4678,9 @@ rte_eth_dev_callback_register(uint16_t port_id, >> next_port = last_port = port_id; >> } >> >> + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, >next_port, >> + last_port); >> + > >I assume this added into middle to be able to use 'next_port' & 'last_port', but >they are generated from given 'port_id', so what do you think to have only >'port_id', and move call to the bottom of the function. I think its fine to move the trace to the bottom. But I was thinking of capturing all the input arguments to the function like port_id, event, cb_fn, cb_arg also. > >'rte_ethdev_trace_callback_unregister()' has same logic, and it has only >'port_id' already. > > > >And I think better to standardise to record API return value or not, because >some has it, some don't. >What do you think to trace all return values, is there any downside of this >approach? Initially my thought was to not change the existing code of library functions, and capture the trace with input args and in some cases capture return value where possible. But now I think small modifications are fine if return values can be captured. > >If we need fine grain on recording return values, what about following: >- All API that changes device config return values should be recorded > * like, record return for set_mtu(), but ignore it for get_mtu() >- If return value has not API status but useful information, record it > * like rte_eth_dev_is_valid_port() return value > > >> rte_spinlock_lock(ð_dev_cb_lock); >> >> do { >> @@ -4665,6 +4776,7 @@ rte_eth_dev_callback_unregister(uint16_t port_id, >> } while (++next_port <= last_port); >> >> rte_spinlock_unlock(ð_dev_cb_lock); >> + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, >> + cb_arg, ret); > >Just a syntax comment, what do you think to have an empty line one before >and after the trace call, to separate this trace calls from regular logic. Just that it makes the function(and as a result the file) longer. But i agree adding the empty lines improve readability. > >> return ret; >> } >> >> @@ -4694,6 +4806,7 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, >int op, void *data) >> for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { >> vec = rte_intr_vec_list_index_get(intr_handle, qid); >> rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, >> data); >> + rte_ethdev_trace_rx_intr_ctl(port_id, epfd, op, data, >> + rc); > >Why this is in the for loop, API if for port level, this loop iterates on queues? Yes this iterates on queues records the return (rc) for qid 0 to nb_rx_queues. >What about moving this trace to the bottom of the function, and record return >value as return value of the API? > >> if (rc && rc != -EEXIST) { >> RTE_ETHDEV_LOG(ERR, >> "p %u q %u Rx ctl error op %d epfd %d >> vec %u\n", @@ -4737,6 +4850,7 @@ >rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) >> (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; >> fd = rte_intr_efds_index_get(intr_handle, efd_idx); >> >> + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); >> return fd; >> } >> >> @@ -4770,6 +4884,7 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, >> uint16_t queue_id, >> >> vec = rte_intr_vec_list_index_get(intr_handle, queue_id); >> rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); >> + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, >> + data, rc); > >Instead of trace API having in the middle, what about changing API as: > >``` >rc = ... > >if (rc && rc != -EEXIST) { > ... >} > >rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); > >return rc; >``` In this trace the return value rc is being captured, so I was thinking changing the API is not required. > >> if (rc && rc != -EEXIST) { >> RTE_ETHDEV_LOG(ERR, >> "p %u q %u Rx ctl error op %d epfd %d vec >> %u\n", @@ -4796,6 +4911,7 @@ rte_eth_dev_rx_intr_enable(uint16_t >> port_id, >> >> if (*dev->dev_ops->rx_queue_intr_enable == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_rx_intr_enable(port_id, queue_id); > >Please include return value. Ok. > >> return eth_err(port_id, >> (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); } >> >> @@ -4815,6 +4931,7 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, >> >> if (*dev->dev_ops->rx_queue_intr_disable == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_rx_intr_disable(port_id, queue_id); > >Please include return value. Ok. > ><...> > >> @@ -5447,6 +5586,7 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct >> rte_dev_eeprom_info *info) >> >> if (*dev->dev_ops->set_eeprom == NULL) >> return -ENOTSUP; >> + rte_ethdev_trace_set_eeprom(port_id, info); > >Please include return value. Ok. > ><...> > >> @@ -5562,6 +5705,7 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t >port_id, >> if (nb_tx_desc != NULL) >> eth_dev_adjust_nb_desc(nb_tx_desc, >> &dev_info.tx_desc_lim); >> >> + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id, *nb_rx_desc, >> + *nb_rx_desc); > > >'nb_rx_desc' or 'nb_rx_desc' can be NULL, so we can't directly access them. Yes. Will remove nb_rx_desc and nb_tx_desc. > ><...> > >> @@ -5605,6 +5750,7 @@ rte_eth_dev_pool_ops_supported(uint16_t >port_id, const char *pool) >> if (*dev->dev_ops->pool_ops_supported == NULL) >> return 1; /* all pools are supported */ >> >> + rte_ethdev_trace_pool_ops_supported(port_id, pool); > >Please include return value. Ok. > ><...> > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_flow_ctrl_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf >*fc_conf), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(fc_conf); >> +) > >'fc_conf' is pointer for the config struct, its address is not much useful, can you >expand it similar to ones in 'rte_ethdev_trace_flow_ctrl_set()' API? The value of fc_conf is updated after this line. return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); So to capture fc_conf values the return of eth_err needs to be stored in a local variable and also the return needs to be checked for success(if condition). Then only fc_conf will have valid values. Is this fine? > >> + >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_flow_ctrl_set, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_fc_conf >*fc_conf), >> + 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( >> + rte_ethdev_trace_fw_version_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, char *fw_version, size_t >fw_size), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(fw_version); >> + rte_trace_point_emit_size_t(fw_size); >> +) > >'fw_version' is string, it help to display the string, but not sure if the pointer >value has a value. >Is there a way to display string in the trace point? Yes string can be displayed in trace by rte_trace_point_emit_string() function. But there is a max string length of 32 which can be displayed. Will display 'fw_version' as string. >And 'fw_size' is normally just used to know the valid data in the 'fw_version', >when 'fw_version' string is displayed, not sure if there is a value to have >'fw_size' If fw_size is greater than 32, displaying fw_size will present some additional information, as only 32 bytes of fw_version will be displayed. > >> + >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_get_dcb_info, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info >*dcb_info), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(dcb_info); >> +) > >'dcb_info' is pointer to a info struct, not useful as pointer value, we should >display content of the 'dcb_info' struct. >There are arrays in the 'dcb_info', perhaps it can be possible to trace 'dcb_info- >>nb_tcs', also 'dcb_info->prio_tc[]' & 'dcb_info->tc_bws[]' >since their size is small (8). Yes will capture the array also. Same changes required as fc_conf above. > >> + >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_get_eeprom, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_eeprom_info >*info), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(info); >> +) >> + > >Similarly, content of the 'info' should be displayed, for '*data' it can be possible >to display address of it, but values for rest. Ok. Same changes required as fc_conf above. > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_get_eeprom_length, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id), >> + rte_trace_point_emit_u16(port_id); >> +) >> + > >This should return the size of the eeprom, existing >'rte_eth_dev_get_eeprom_length()' needs to be updated for it. Ok. Same as fc_conf above. > ><...> > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_get_reg_info, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_dev_reg_info >*info), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(info); >> +) > >What do you think to display content of the 'info', insted of pointer value which >is not very useful. Yes info can be displayed. The rte_eth_dev_get_reg_info needs to be changed such that trace is called after eth_err() function call. Same as fc_conf above. > >> + >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_get_sec_ctx, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id), >> + rte_trace_point_emit_u16(port_id); >> +) > >'security_ctx' is "void *", so can't record content, but what do you think to >record pointer value of it? rte_eth_dev_get_sec_ctx() needs to be changed. The rte_eth_devices[port_id].security_ctx needs to be stored in a local variable. > >> + >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_get_supported_ptypes, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, >> + uint32_t *ptypes, int num, int j), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_u32(ptype_mask); >> + rte_trace_point_emit_ptr(ptypes); >> + rte_trace_point_emit_int(num); >> + rte_trace_point_emit_int(j); >> +) > >better to use 'supported_num' instead of 'j' which is not clear what it is. Ok. > >The real information is in 'ptypes' but that is an array, I guess not possible to >record array values. > >> + >> +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_info_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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_u32(dev_info->if_index); >> + 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_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_u16(dev_info->nb_rx_queues); >> + rte_trace_point_emit_u16(dev_info->nb_tx_queues); >> +) >> + > >It is a debate what to display, but I would remove 'if_index' and add >'max_rx_queues', 'max_tx_queues', 'max_mac_addrs', 'flow_type_rss_offloads', >'rx_desc_lim', 'tx_desc_lim', 'speed_capa', 'dev_capa'. Ok. > >> +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_ethdev_trace_is_valid_port, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id), >> + rte_trace_point_emit_u16(port_id); >> +) >> + > >Should have return value, if the port is valid of not. Some changes needs to be made as the rte_ethdev_is_valid_port function return 0 or 1. > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_mac_addr_add, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, >> + uint32_t pool), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(addr); >> + rte_trace_point_emit_u32(pool); >> +) >> + > >Isn't it possible to return 'addr' as string? I am not sure about benefit to record >addr pointer value. >Should have return value. Right now the function to display array is not there in trace. I have added a new function(not yet sent upstream) to display mac addresses. > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_mac_addr_remove, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(addr); >> +) >> + > >As above, can content of 'addr' be recorded, like as string? > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_pool_ops_supported, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, const char *pool), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(pool); >> +) >> + > >'pool' should be string, instead of pointer. Ok. > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_priority_flow_ctrl_set, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_pfc_conf >*pfc_conf), >> + 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( >> + 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_ethdev_trace_rss_hash_conf_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf >*rss_conf), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(rss_conf); >> +) >> + > >Please record content of the 'rss_conf' instead of pointer value. Ok. Same as fc_conf above. > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_rss_hash_update, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_rss_conf >*rss_conf), >> + 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); >> +) >> + > >Please add return value. Ok. > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_rss_reta_query, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(reta_conf); >> + rte_trace_point_emit_u16(reta_size); >> +) >> + >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_rss_reta_update, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_u64(reta_conf->mask); >> + rte_trace_point_emit_u16(reta_size); >> +) > >'reta_conf->mask' on its own is not much usefull, and 'reta_conf->reta' >is an array and hard to record. >As above 'rte_ethdev_trace_rss_reta_query' trace point only record reta_config >pointer, this can do the same. In rte_eth_dev_rss_reta_query, if return of eth_err is captured and success then reta conf can be displayed. > >Overall, I think better to make get/set pair of an API record same set of values. > ><...> > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_set_mc_addr_list, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + struct rte_ether_addr *mc_addr_set, >> + uint32_t nb_mc_addr), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(mc_addr_set); >> + rte_trace_point_emit_u32(nb_mc_addr); >> +) >> + > >Better to record content of 'mc_addr_set' but it is pointer array for mac address, >so I guess we can't record these mac addresses. > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_set_ptypes, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t ptype_mask, >> + uint32_t *set_ptypes, unsigned int num), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_u32(ptype_mask); >> + rte_trace_point_emit_ptr(set_ptypes); >> + rte_trace_point_emit_u32(num); >> +) >> + > >Similarly 'set_ptypes' is an array. > >I wonder if there should be an rte_trace_point_emit_ function for arrays? What >do you think? In my new series(not yet sent upstream), I have added a function to display uint8_t arrays like mac addresses. Will have to check how much change is required to display other array type. > ><...> > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_socket_id, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id), >> + rte_trace_point_emit_u16(port_id); >> +) > >Should include 'socket_id'. Ok. > ><...> > >> +RTE_TRACE_POINT( >> + rte_ethdev_trace_uc_hash_table_set, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr, >> + uint8_t on, int ret), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(addr); >> + rte_trace_point_emit_u8(on); >> + rte_trace_point_emit_int(ret); >> +) >> + > >Can have 'addr' as string? mac_addr can be displayed as arrays. >Do we need a specific rte_trace_point_emit_ function for mac addr? > ><...> > >> +RTE_TRACE_POINT( >> + rte_eth_trace_find_next, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id), >> + rte_trace_point_emit_u16(port_id); >> +) >> + > >rte_eth_trace_find_next* functions gets 'port_id' as input parameter, and >returns next 'port_id', so both input and output is 'port_id' and both should be >recorded. > >For this need to update these functions to create an interim variable for input >'port_id'. > >Above comments are for all 'rte_eth_trace_find_next*()' functions. Ok. > ><...> > >> +RTE_TRACE_POINT( >> + rte_eth_trace_link_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_u32(link->link_speed); >> +) > >I think better to record other link values too. Ok. > >> + >> +RTE_TRACE_POINT( >> + rte_eth_trace_link_get_nowait, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_link *link), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_u32(link->link_speed); >> +) >> + > >I think better to record other link values too. > ><...> > >> +RTE_TRACE_POINT( >> + rte_eth_trace_rx_burst_mode_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >> + struct rte_eth_burst_mode *mode), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_u16(queue_id); >> + rte_trace_point_emit_ptr(mode); >> +) >> + > >Can you please record content of 'mode' inst mode->flags can be displayed. Not sure about info array. > >> +RTE_TRACE_POINT( >> + rte_eth_trace_rx_queue_info_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >> + 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->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); >> +) >> + > >Can you please add 'qinfo->conf->rx_drop_en' & 'qinfo->conf->offloads'. Ok. > > >> +RTE_TRACE_POINT( >> + rte_eth_trace_rx_queue_setup, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, >> + uint16_t nb_rx_desc, unsigned int socket_id, >> + const struct rte_eth_rxconf *rx_conf, >> + struct rte_mempool *mb_pool), >> + 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_u32(socket_id); >> + rte_trace_point_emit_ptr(rx_conf); >> + rte_trace_point_emit_ptr(mb_pool); >> +) >> + > >Can you please add 'rx_conf->rx_drop_en' & 'rx_conf->offloads'. Ok. > >> +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), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_u16(queue_idx); >> + rte_trace_point_emit_u16(tx_rate); >> +) >> + >> +RTE_TRACE_POINT( >> + rte_eth_trace_speed_bitflag, >> + RTE_TRACE_POINT_ARGS(uint32_t speed, int duplex), >> + rte_trace_point_emit_u32(speed); >> + rte_trace_point_emit_int(duplex); >> +) >> + >> +RTE_TRACE_POINT( >> + rte_eth_trace_stats_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats *stats), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(stats); >> + rte_trace_point_emit_u64(stats->rx_nombuf); >> +) >> + > >Not sure what to record here, I think all basic stat counters can be recorded if >there cost is effordable. Ok. Same changes required as fc_conf above. ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v3 2/4] ethdev: add trace points for flow 2022-10-06 15:18 ` [PATCH v3 " Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi @ 2022-10-06 15:18 ` Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 3/4] ethdev: add trace points for mtr Ankur Dwivedi ` (2 subsequent siblings) 4 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-06 15:18 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 117 +++++++++ lib/ethdev/rte_ethdev_trace.h | 434 +++++++++++++++++++++++++++++++ lib/ethdev/rte_flow.c | 54 ++++ lib/ethdev/version.map | 39 +++ 4 files changed, 644 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2c06b47b7f..165be941a1 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -464,3 +464,120 @@ RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_query, RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set, lib.ethdev.rx_avail_thresh_set) + +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_error_set, + lib.ethdev.flow.error_set) + +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_dev_dump, + lib.ethdev.flow.dev_dump) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_aged_flows, + lib.ethdev.flow.get_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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 802f2c1ae1..d47357babe 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -1282,6 +1282,440 @@ RTE_TRACE_POINT( rte_trace_point_emit_u8(avail_thresh); ) +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_ptr(actions); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + 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); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_destroy, + 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_error_set, + RTE_TRACE_POINT_ARGS(struct rte_flow_error *err_p, + int code, enum rte_flow_error_type type, + const void *cause, const char *message), + rte_trace_point_emit_ptr(err_p); + rte_trace_point_emit_int(code); + rte_trace_point_emit_int(type); + rte_trace_point_emit_ptr(cause); + rte_trace_point_emit_string(message); +) + +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_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( + 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_ptr(data); + 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_dev_dump, + 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_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( + 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), + 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( + 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), + 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( + rte_flow_trace_get_restore_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_mbuf *m, + struct rte_flow_restore_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(m); + rte_trace_point_emit_ptr(info); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_u32(num_of_actions); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(items); + rte_trace_point_emit_u32(num_of_items); +) + +RTE_TRACE_POINT( + 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + 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_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( + 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( + 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_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_pick_transfer_proxy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t *proxy_port_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(proxy_port_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(port_info); + rte_trace_point_emit_ptr(queue_info); +) + +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_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, + struct rte_flow_pattern_template *template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_attr); + rte_trace_point_emit_ptr(pattern); + rte_trace_point_emit_ptr(template); +) + +RTE_TRACE_POINT( + rte_flow_trace_pattern_template_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_pattern_template *pattern_template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pattern_template); +) + +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, + struct rte_flow_actions_template *template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_attr); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_ptr(masks); + rte_trace_point_emit_ptr(template); +) + +RTE_TRACE_POINT( + rte_flow_trace_actions_template_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_actions_template *actions_template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions_template); +) + +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_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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_table); +) + +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), + 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( + rte_flow_trace_push, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); +) + +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); +) + +RTE_TRACE_POINT( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index d11ba270db..23ce3b95d2 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -13,6 +13,7 @@ #include <rte_string_fns.h> #include <rte_mbuf_dyn.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" #include "rte_flow_driver.h" #include "rte_flow.h" @@ -276,6 +277,7 @@ 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,6 +364,7 @@ rte_flow_validate(uint16_t port_id, fts_enter(dev); ret = ops->validate(dev, attr, pattern, actions, error); fts_exit(dev); + rte_flow_trace_validate(port_id, attr, pattern, actions, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -389,6 +392,7 @@ 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, @@ -412,6 +416,7 @@ rte_flow_destroy(uint16_t port_id, fts_enter(dev); ret = ops->destroy(dev, flow, error); fts_exit(dev); + rte_flow_trace_destroy(port_id, flow, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -434,6 +439,7 @@ rte_flow_flush(uint16_t port_id, fts_enter(dev); ret = ops->flush(dev, error); fts_exit(dev); + rte_flow_trace_flush(port_id, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -459,6 +465,7 @@ rte_flow_query(uint16_t port_id, fts_enter(dev); ret = ops->query(dev, flow, action, data, error); fts_exit(dev); + rte_flow_trace_query(port_id, flow, action, data, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -482,6 +489,7 @@ rte_flow_isolate(uint16_t port_id, fts_enter(dev); ret = ops->isolate(dev, set, error); fts_exit(dev); + rte_flow_trace_isolate(port_id, set, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -505,6 +513,7 @@ rte_flow_error_set(struct rte_flow_error *error, }; } rte_errno = code; + rte_flow_trace_error_set(error, code, type, cause, message); return -code; } @@ -1003,6 +1012,7 @@ 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 +1097,7 @@ 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; } @@ -1104,6 +1115,7 @@ rte_flow_dev_dump(uint16_t port_id, struct rte_flow *flow, fts_enter(dev); ret = ops->dev_dump(dev, flow, file, error); fts_exit(dev); + rte_flow_trace_dev_dump(port_id, flow, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -1125,6 +1137,7 @@ 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); + rte_flow_trace_get_aged_flows(port_id, contexts, nb_contexts, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOTSUP, @@ -1153,6 +1166,7 @@ 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; } @@ -1172,6 +1186,7 @@ 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); + rte_flow_trace_action_handle_destroy(port_id, handle, ret); return flow_err(port_id, ret, error); } @@ -1192,6 +1207,7 @@ 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); + rte_flow_trace_action_handle_update(port_id, handle, update, ret); return flow_err(port_id, ret, error); } @@ -1212,6 +1228,7 @@ 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); + rte_flow_trace_action_handle_query(port_id, handle, data, ret); return flow_err(port_id, ret, error); } @@ -1227,6 +1244,7 @@ rte_flow_tunnel_decap_set(uint16_t port_id, if (unlikely(!ops)) return -rte_errno; + rte_flow_trace_tunnel_decap_set(port_id, tunnel, actions, num_of_actions); if (likely(!!ops->tunnel_decap_set)) { return flow_err(port_id, ops->tunnel_decap_set(dev, tunnel, actions, @@ -1250,6 +1268,7 @@ rte_flow_tunnel_match(uint16_t port_id, if (unlikely(!ops)) return -rte_errno; + rte_flow_trace_tunnel_match(port_id, tunnel, items, num_of_items); if (likely(!!ops->tunnel_match)) { return flow_err(port_id, ops->tunnel_match(dev, tunnel, items, @@ -1272,6 +1291,7 @@ rte_flow_get_restore_info(uint16_t port_id, if (unlikely(!ops)) return -rte_errno; + rte_flow_trace_get_restore_info(port_id, m, restore_info); if (likely(!!ops->get_restore_info)) { return flow_err(port_id, ops->get_restore_info(dev, m, restore_info, @@ -1294,6 +1314,7 @@ rte_flow_tunnel_action_decap_release(uint16_t port_id, if (unlikely(!ops)) return -rte_errno; + rte_flow_trace_tunnel_action_decap_release(port_id, actions, num_of_actions); if (likely(!!ops->tunnel_action_decap_release)) { return flow_err(port_id, ops->tunnel_action_decap_release(dev, actions, @@ -1317,6 +1338,7 @@ rte_flow_tunnel_item_release(uint16_t port_id, if (unlikely(!ops)) return -rte_errno; + rte_flow_trace_tunnel_item_release(port_id, items, num_of_items); if (likely(!!ops->tunnel_item_release)) { return flow_err(port_id, ops->tunnel_item_release(dev, items, @@ -1345,6 +1367,7 @@ rte_flow_pick_transfer_proxy(uint16_t port_id, uint16_t *proxy_port_id, dev = &rte_eth_devices[port_id]; + rte_flow_trace_pick_transfer_proxy(port_id, proxy_port_id); return flow_err(port_id, ops->pick_transfer_proxy(dev, proxy_port_id, error), error); @@ -1370,6 +1393,7 @@ 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; } @@ -1387,6 +1411,7 @@ 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); + rte_flow_trace_flex_item_release(port_id, handle, ret); return flow_err(port_id, ret, error); } @@ -1411,6 +1436,7 @@ rte_flow_info_get(uint16_t port_id, RTE_FLOW_LOG(ERR, "Port %"PRIu16" info is NULL.\n", port_id); return -EINVAL; } + rte_flow_trace_info_get(port_id, port_info, queue_info); if (likely(!!ops->info_get)) { return flow_err(port_id, ops->info_get(dev, port_info, queue_info, error), @@ -1458,6 +1484,7 @@ 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; + rte_flow_trace_configure(port_id, port_attr, nb_queue, queue_attr, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOTSUP, @@ -1509,6 +1536,8 @@ 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; } rte_flow_error_set(error, ENOTSUP, @@ -1529,6 +1558,7 @@ rte_flow_pattern_template_destroy(uint16_t port_id, return -rte_errno; if (unlikely(pattern_template == NULL)) return 0; + rte_flow_trace_pattern_template_destroy(port_id, pattern_template); if (likely(!!ops->pattern_template_destroy)) { return flow_err(port_id, ops->pattern_template_destroy(dev, @@ -1595,6 +1625,8 @@ 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); return template; } rte_flow_error_set(error, ENOTSUP, @@ -1615,6 +1647,7 @@ rte_flow_actions_template_destroy(uint16_t port_id, return -rte_errno; if (unlikely(actions_template == NULL)) return 0; + rte_flow_trace_actions_template_destroy(port_id, actions_template); if (likely(!!ops->actions_template_destroy)) { return flow_err(port_id, ops->actions_template_destroy(dev, @@ -1685,6 +1718,11 @@ 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; } rte_flow_error_set(error, ENOTSUP, @@ -1705,6 +1743,7 @@ rte_flow_template_table_destroy(uint16_t port_id, return -rte_errno; if (unlikely(template_table == NULL)) return 0; + rte_flow_trace_template_table_destroy(port_id, template_table); if (likely(!!ops->template_table_destroy)) { return flow_err(port_id, ops->template_table_destroy(dev, @@ -1740,6 +1779,9 @@ 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; } @@ -1754,6 +1796,8 @@ 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); + rte_flow_trace_async_destroy(port_id, queue_id, op_attr, flow, + user_data); return flow_err(port_id, ops->async_destroy(dev, queue_id, op_attr, flow, @@ -1769,6 +1813,7 @@ 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); + rte_flow_trace_push(port_id, queue_id); return flow_err(port_id, ops->push(dev, queue_id, error), error); @@ -1786,6 +1831,7 @@ rte_flow_pull(uint16_t port_id, int ret; ret = ops->pull(dev, queue_id, res, n_res, error); + rte_flow_trace_pull(port_id, queue_id, res, n_res, ret); return ret ? ret : flow_err(port_id, ret, error); } @@ -1806,6 +1852,9 @@ 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); return handle; } @@ -1823,6 +1872,8 @@ 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); + rte_flow_trace_async_action_handle_destroy(port_id, queue_id, op_attr, + action_handle, user_data, ret); return flow_err(port_id, ret, error); } @@ -1841,6 +1892,9 @@ 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); + rte_flow_trace_async_action_handle_update(port_id, queue_id, op_attr, + action_handle, update, + user_data, ret); return flow_err(port_id, ret, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 79d0b2ee1f..50897a6cee 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -463,4 +463,43 @@ INTERNAL { __rte_eth_trace_ip_reassembly_conf_set; __rte_eth_trace_rx_avail_thresh_query; __rte_eth_trace_rx_avail_thresh_set; + __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_dev_dump; + __rte_flow_trace_dynf_metadata_register; + __rte_flow_trace_error_set; + __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; }; -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v3 3/4] ethdev: add trace points for mtr 2022-10-06 15:18 ` [PATCH v3 " Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 2/4] ethdev: add trace points for flow Ankur Dwivedi @ 2022-10-06 15:18 ` Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 4/4] ethdev: add trace points for tm Ankur Dwivedi 2022-12-22 6:32 ` [PATCH v4 0/6] add trace points in ethdev library Ankur Dwivedi 4 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-06 15:18 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 57 ++++++++++ lib/ethdev/rte_ethdev_trace.h | 176 +++++++++++++++++++++++++++++++ lib/ethdev/rte_mtr.c | 27 +++++ lib/ethdev/version.map | 19 ++++ 4 files changed, 279 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 165be941a1..4fe1b10979 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -581,3 +581,60 @@ RTE_TRACE_POINT_REGISTER(rte_flow_trace_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_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_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_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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index d47357babe..af245d5b09 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1716,6 +1717,181 @@ 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, + struct rte_mtr_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +RTE_TRACE_POINT( + rte_mtr_trace_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + struct rte_mtr_params *params, int shared), + 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( + rte_mtr_trace_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(dscp_table); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id, + struct rte_mtr_meter_profile *profile), + 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( + rte_mtr_trace_meter_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(meter_profile_id); +) + +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), + 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( + rte_mtr_trace_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + struct rte_mtr_stats *stats, uint64_t *stats_mask, + int clear), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_ptr(stats_mask); + rte_trace_point_emit_int(clear); +) + +RTE_TRACE_POINT( + rte_mtr_trace_stats_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + uint64_t stats_mask), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_u64(stats_mask); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_policy_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + 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( + rte_mtr_trace_meter_policy_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(policy_id); +) + +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), + 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( + rte_mtr_trace_meter_policy_validate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_int(actions->type); + rte_trace_point_emit_ptr(actions->conf); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_vlan_table_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + enum rte_color *vlan_table), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(vlan_table); +) + +RTE_TRACE_POINT( + rte_mtr_trace_color_in_protocol_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_int(proto); +) + +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), + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index 3954839531..a8a8985c24 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -6,6 +6,7 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -82,6 +83,7 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_capabilities_get(port_id, cap); return RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); } @@ -94,6 +96,7 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile); return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); } @@ -105,6 +108,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id); return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); } @@ -127,6 +131,10 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_validate(port_id, policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); } @@ -139,6 +147,11 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_add(port_id, policy_id, + policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); } @@ -150,6 +163,7 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_delete(port_id, policy_id); return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); } @@ -174,6 +188,7 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_create(port_id, mtr_id, params, shared); return RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); } @@ -185,6 +200,7 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_destroy(port_id, mtr_id); return RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); } @@ -196,6 +212,7 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_enable(port_id, mtr_id); return RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); } @@ -207,6 +224,7 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_disable(port_id, mtr_id); return RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); } @@ -219,6 +237,7 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id); return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); } @@ -231,6 +250,7 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id); return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); } @@ -243,6 +263,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table); return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, proto, dscp_table, error); } @@ -255,6 +276,7 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table); return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, proto, vlan_table, error); } @@ -268,6 +290,7 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority); return RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); } @@ -280,6 +303,7 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id); return RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); } @@ -293,6 +317,7 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto); return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); } @@ -305,6 +330,7 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask); return RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); } @@ -319,6 +345,7 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_stats_read(port_id, mtr_id, stats, stats_mask, clear); return RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 50897a6cee..e2c335ac25 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -502,4 +502,23 @@ INTERNAL { __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_update; + __rte_mtr_trace_meter_policy_validate; + __rte_mtr_trace_meter_profile_add; + __rte_mtr_trace_meter_profile_delete; + __rte_mtr_trace_meter_profile_update; + __rte_mtr_trace_meter_vlan_table_update; + __rte_mtr_trace_stats_read; + __rte_mtr_trace_stats_update; }; -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v3 4/4] ethdev: add trace points for tm 2022-10-06 15:18 ` [PATCH v3 " Ankur Dwivedi ` (2 preceding siblings ...) 2022-10-06 15:18 ` [PATCH v3 3/4] ethdev: add trace points for mtr Ankur Dwivedi @ 2022-10-06 15:18 ` Ankur Dwivedi 2022-12-22 6:32 ` [PATCH v4 0/6] add trace points in ethdev library Ankur Dwivedi 4 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-10-06 15:18 UTC (permalink / raw) To: dev Cc: thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, sthemmin, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 90 ++++++++++ lib/ethdev/rte_ethdev_trace.h | 283 +++++++++++++++++++++++++++++++ lib/ethdev/rte_tm.c | 40 +++++ lib/ethdev/version.map | 30 ++++ 4 files changed, 443 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 4fe1b10979..9527b413e5 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -638,3 +638,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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index af245d5b09..a917d9d7cb 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1892,6 +1893,288 @@ RTE_TRACE_POINT( rte_trace_point_emit_u32(priority); ) +RTE_TRACE_POINT( + rte_tm_trace_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_tm_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +RTE_TRACE_POINT( + rte_tm_trace_get_number_of_leaf_nodes, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t n_leaf_nodes, + struct rte_tm_error *error), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(n_leaf_nodes); + rte_trace_point_emit_int(error->type); + rte_trace_point_emit_string(error->message); +) + +RTE_TRACE_POINT( + rte_tm_trace_hierarchy_commit, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int clear_on_fail), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(clear_on_fail); +) + +RTE_TRACE_POINT( + rte_tm_trace_level_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t level_id, + struct rte_tm_level_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(level_id); + rte_trace_point_emit_ptr(cap); +) + +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), + 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( + rte_tm_trace_mark_ip_ecn, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red), + 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( + rte_tm_trace_mark_vlan_dei, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red), + 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( + 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, + struct rte_tm_node_params *params), + 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( + rte_tm_trace_node_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + struct rte_tm_node_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(cap); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_int(cman); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +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), + 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( + rte_tm_trace_node_resume, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +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), + 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( + 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), + 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( + 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), + 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( + rte_tm_trace_node_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + struct rte_tm_node_stats *stats, + uint64_t *stats_mask, int clear), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_ptr(stats_mask); + rte_trace_point_emit_int(clear); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_u64(stats_mask); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_suspend, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_type_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + int *is_leaf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(is_leaf); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_wfq_weight_mode_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + int *wfq_weight_mode, uint32_t n_sp_priorities), + 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( + rte_tm_trace_node_wred_context_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t wred_profile_id), + 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( + rte_tm_trace_shaper_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id, + struct rte_tm_shaper_params *profile), + 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( + rte_tm_trace_shaper_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shaper_profile_id); +) + +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), + 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( + rte_tm_trace_shared_shaper_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_shaper_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_shaper_id); +) + +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), + 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( + rte_tm_trace_shared_wred_context_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_wred_context_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_wred_context_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_wred_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id, + struct rte_tm_wred_params *profile), + 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( + rte_tm_trace_wred_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(wred_profile_id); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..b0b43eacc0 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -6,6 +6,7 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +80,7 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes, error); return 0; } @@ -90,6 +92,7 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_type_get(port_id, node_id, is_leaf); return RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); } @@ -100,6 +103,7 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_capabilities_get(port_id, cap); return RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); } @@ -111,6 +115,7 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_level_capabilities_get(port_id, level_id, cap); return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); } @@ -122,6 +127,7 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_capabilities_get(port_id, node_id, cap); return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); } @@ -133,6 +139,7 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile); return RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); } @@ -143,6 +150,7 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id); return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); } @@ -154,6 +162,8 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_wred_context_add_update(port_id, shared_wred_context_id, + wred_profile_id); return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); } @@ -164,6 +174,7 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_wred_context_delete(port_id, shared_wred_context_id); return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); } @@ -175,6 +186,7 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile); return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); } @@ -185,6 +197,7 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id); return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); } @@ -196,6 +209,8 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id); return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); } @@ -206,6 +221,7 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id); return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); } @@ -221,6 +237,8 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params); return RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); @@ -232,6 +250,7 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_delete(port_id, node_id); return RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); } @@ -242,6 +261,7 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_suspend(port_id, node_id); return RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); } @@ -252,6 +272,7 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_resume(port_id, node_id); return RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); } @@ -262,6 +283,7 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail); return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); } @@ -275,6 +297,8 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight); return RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); } @@ -286,6 +310,7 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id); return RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); } @@ -298,6 +323,8 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shared_shaper_update(port_id, node_id, shared_shaper_id, + add); return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); } @@ -309,6 +336,7 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask); return RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); } @@ -321,6 +349,8 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, wfq_weight_mode, + n_sp_priorities); return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); } @@ -332,6 +362,7 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_cman_update(port_id, node_id, cman); return RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); } @@ -343,6 +374,7 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id); return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); } @@ -355,6 +387,9 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add); return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); } @@ -368,6 +403,8 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_stats_read(port_id, node_id, stats, stats_mask, + clear); return RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); } @@ -380,6 +417,7 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); } @@ -392,6 +430,7 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); } @@ -404,6 +443,7 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index e2c335ac25..c7174b8e56 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -521,4 +521,34 @@ INTERNAL { __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; }; -- 2.28.0 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v4 0/6] add trace points in ethdev library 2022-10-06 15:18 ` [PATCH v3 " Ankur Dwivedi ` (3 preceding siblings ...) 2022-10-06 15:18 ` [PATCH v3 4/4] ethdev: add trace points for tm Ankur Dwivedi @ 2022-12-22 6:32 ` Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 1/6] eal: trace: add trace point emit for array Ankur Dwivedi ` (6 more replies) 4 siblings, 7 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-12-22 6:32 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, 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. 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 array ethdev: add trace points for ethdev ethdev: add trace points for remaining functions ethdev: add trace points for flow ethdev: add trace points for mtr ethdev: add trace points for tm app/test/test_trace.c | 3 + lib/eal/common/eal_common_trace_points.c | 2 + lib/eal/include/rte_eal_trace.h | 6 + lib/eal/include/rte_trace_point.h | 20 + lib/eal/include/rte_trace_point_register.h | 8 + lib/ethdev/ethdev_private.c | 3 + lib/ethdev/ethdev_trace_points.c | 715 ++++++++++ lib/ethdev/meson.build | 1 + lib/ethdev/rte_ethdev.c | 659 +++++++-- lib/ethdev/rte_ethdev.h | 2 +- lib/ethdev/rte_ethdev_cman.c | 30 +- lib/ethdev/rte_ethdev_trace.h | 1404 ++++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 967 +++++++++++++- lib/ethdev/rte_ethdev_trace_fp_burst.h | 44 + lib/ethdev/rte_flow.c | 57 + lib/ethdev/rte_mtr.c | 30 + lib/ethdev/rte_tm.c | 41 + lib/ethdev/version.map | 235 ++++ 18 files changed, 4118 insertions(+), 109 deletions(-) create mode 100644 lib/ethdev/rte_ethdev_trace_fp_burst.h -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v4 1/6] eal: trace: add trace point emit for array 2022-12-22 6:32 ` [PATCH v4 0/6] add trace points in ethdev library Ankur Dwivedi @ 2022-12-22 6:33 ` Ankur Dwivedi 2022-12-22 9:06 ` Sunil Kumar Kori 2022-12-22 10:32 ` Morten Brørup 2022-12-22 6:33 ` [PATCH v4 2/6] ethdev: add trace points for ethdev Ankur Dwivedi ` (5 subsequent siblings) 6 siblings, 2 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-12-22 6:33 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds a trace point emit function for array. The maximum array bytes which can be captured is set to 32. Also adds test case for emit array tracepoint function. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- app/test/test_trace.c | 3 +++ lib/eal/common/eal_common_trace_points.c | 2 ++ lib/eal/include/rte_eal_trace.h | 6 ++++++ lib/eal/include/rte_trace_point.h | 20 ++++++++++++++++++++ lib/eal/include/rte_trace_point_register.h | 8 ++++++++ 5 files changed, 39 insertions(+) diff --git a/app/test/test_trace.c b/app/test/test_trace.c index 6bedf14024..99cd0762d1 100644 --- a/app/test/test_trace.c +++ b/app/test/test_trace.c @@ -177,6 +177,7 @@ test_fp_trace_points(void) static int test_generic_trace_points(void) { + uint8_t arr[32] = {0}; int tmp; rte_eal_trace_generic_void(); @@ -195,6 +196,8 @@ 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_char_array(arr, 32); + rte_eal_trace_generic_char_array(arr, 64); RTE_EAL_TRACE_GENERIC_FUNC; return TEST_SUCCESS; diff --git a/lib/eal/common/eal_common_trace_points.c b/lib/eal/common/eal_common_trace_points.c index 0b0b254615..93fdaa634e 100644 --- a/lib/eal/common/eal_common_trace_points.c +++ b/lib/eal/common/eal_common_trace_points.c @@ -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_char_array, + lib.eal.generic.char.array) RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set, lib.eal.alarm.set) diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h index 5ef4398230..34fdd5331f 100644 --- a/lib/eal/include/rte_eal_trace.h +++ b/lib/eal/include/rte_eal_trace.h @@ -143,6 +143,12 @@ RTE_TRACE_POINT( rte_trace_point_emit_string(func); ) +RTE_TRACE_POINT( + rte_eal_trace_generic_char_array, + RTE_TRACE_POINT_ARGS(void *in, uint8_t len), + rte_trace_point_emit_char_array(in, len); +) + #define RTE_EAL_TRACE_GENERIC_FUNC rte_eal_trace_generic_func(__func__) /* Interrupt */ diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index 0f8700974f..9d9a9e0aaa 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -144,6 +144,8 @@ _tp _args \ #define rte_trace_point_emit_ptr(val) /** Tracepoint function payload for string datatype */ #define rte_trace_point_emit_string(val) +/** Tracepoint function payload for char array */ +#define rte_trace_point_emit_char_array(val, len) #endif /* __DOXYGEN__ */ @@ -151,6 +153,8 @@ _tp _args \ #define __RTE_TRACE_EMIT_STRING_LEN_MAX 32 /** @internal Macro to define event header size. */ #define __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t) +/** @internal Macro to define maximum emit length of array. */ +#define __RTE_TRACE_EMIT_ARRAY_LEN_MAX 32 /** * Enable recording events of the given tracepoint in the trace buffer. @@ -374,12 +378,28 @@ do { \ mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX); \ } while (0) +#define rte_trace_point_emit_char_array(in, len) \ +do { \ + if (unlikely(in == NULL)) \ + return; \ + if (len > __RTE_TRACE_EMIT_ARRAY_LEN_MAX) \ + return; \ + memcpy(mem, in, len); \ + mem = RTE_PTR_ADD(mem, len); \ +} 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_char_array(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..c76fe4dd48 100644 --- a/lib/eal/include/rte_trace_point_register.h +++ b/lib/eal/include/rte_trace_point_register.h @@ -47,6 +47,14 @@ do { \ RTE_STR(in)"[32]", "string_bounded_t"); \ } while (0) +#define rte_trace_point_emit_char_array(in, len) \ +do { \ + RTE_SET_USED(in); \ + if (len > __RTE_TRACE_EMIT_ARRAY_LEN_MAX) \ + return; \ + __rte_trace_point_emit_field(len, RTE_STR(in)"[32]", "uint8_t"); \ +} while (0) + #ifdef __cplusplus } #endif -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v4 1/6] eal: trace: add trace point emit for array 2022-12-22 6:33 ` [PATCH v4 1/6] eal: trace: add trace point emit for array Ankur Dwivedi @ 2022-12-22 9:06 ` Sunil Kumar Kori 2022-12-22 10:32 ` Morten Brørup 1 sibling, 0 replies; 172+ messages in thread From: Sunil Kumar Kori @ 2022-12-22 9:06 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Thursday, December 22, 2022 12:03 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha > Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi > <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla > <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; > Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; > viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > Rasesh Mody <rmody@marvell.com>; Shahed Shaikh > <shshaikh@marvell.com>; Devendra Singh Rawat > <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; Ankur Dwivedi > <adwivedi@marvell.com> > Subject: [PATCH v4 1/6] eal: trace: add trace point emit for array > > Adds a trace point emit function for array. The maximum array bytes which > can be captured is set to 32. > > Also adds test case for emit array tracepoint function. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > app/test/test_trace.c | 3 +++ > lib/eal/common/eal_common_trace_points.c | 2 ++ > lib/eal/include/rte_eal_trace.h | 6 ++++++ > lib/eal/include/rte_trace_point.h | 20 ++++++++++++++++++++ > lib/eal/include/rte_trace_point_register.h | 8 ++++++++ > 5 files changed, 39 insertions(+) > Please make sure that version history should be maintained. [sniped] > diff --git a/app/test/test_trace.c b/app/test/test_trace.c index > 6bedf14024..99cd0762d1 100644 > --- a/app/test/test_trace.c > +++ b/app/test/test_trace.c > -- > 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v4 1/6] eal: trace: add trace point emit for array 2022-12-22 6:33 ` [PATCH v4 1/6] eal: trace: add trace point emit for array Ankur Dwivedi 2022-12-22 9:06 ` Sunil Kumar Kori @ 2022-12-22 10:32 ` Morten Brørup 2022-12-22 15:18 ` Ankur Dwivedi 1 sibling, 1 reply; 172+ messages in thread From: Morten Brørup @ 2022-12-22 10:32 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, jerinj > From: Ankur Dwivedi [mailto:adwivedi@marvell.com] > Sent: Thursday, 22 December 2022 07.33 > > Adds a trace point emit function for array. The maximum array > bytes which can be captured is set to 32. This seems very useful. Disclaimer: I am not familiar with the trace library or the CTF file format, so my feedback below may be completely wrong and impossible - please keep in mind when reading. > > Also adds test case for emit array tracepoint function. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > app/test/test_trace.c | 3 +++ > lib/eal/common/eal_common_trace_points.c | 2 ++ > lib/eal/include/rte_eal_trace.h | 6 ++++++ > lib/eal/include/rte_trace_point.h | 20 ++++++++++++++++++++ > lib/eal/include/rte_trace_point_register.h | 8 ++++++++ > 5 files changed, 39 insertions(+) > > diff --git a/app/test/test_trace.c b/app/test/test_trace.c > index 6bedf14024..99cd0762d1 100644 > --- a/app/test/test_trace.c > +++ b/app/test/test_trace.c > @@ -177,6 +177,7 @@ test_fp_trace_points(void) > static int > test_generic_trace_points(void) > { > + uint8_t arr[32] = {0}; > int tmp; > > rte_eal_trace_generic_void(); > @@ -195,6 +196,8 @@ 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 *)); Please also test smaller, unaligned length, e.g.: rte_eal_trace_generic_char_array(arr, 17); Please also test variable len, unknown at build time, e.g.: rte_eal_trace_generic_char_array(arr, rand() % 31); > + rte_eal_trace_generic_char_array(arr, 32); > + rte_eal_trace_generic_char_array(arr, 64); > RTE_EAL_TRACE_GENERIC_FUNC; > > return TEST_SUCCESS; > diff --git a/lib/eal/common/eal_common_trace_points.c > b/lib/eal/common/eal_common_trace_points.c > index 0b0b254615..93fdaa634e 100644 > --- a/lib/eal/common/eal_common_trace_points.c > +++ b/lib/eal/common/eal_common_trace_points.c > @@ -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_char_array, > + lib.eal.generic.char.array) > > RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set, > lib.eal.alarm.set) > diff --git a/lib/eal/include/rte_eal_trace.h > b/lib/eal/include/rte_eal_trace.h > index 5ef4398230..34fdd5331f 100644 > --- a/lib/eal/include/rte_eal_trace.h > +++ b/lib/eal/include/rte_eal_trace.h > @@ -143,6 +143,12 @@ RTE_TRACE_POINT( > rte_trace_point_emit_string(func); > ) > > +RTE_TRACE_POINT( > + rte_eal_trace_generic_char_array, > + RTE_TRACE_POINT_ARGS(void *in, uint8_t len), > + rte_trace_point_emit_char_array(in, len); > +) > + > #define RTE_EAL_TRACE_GENERIC_FUNC > rte_eal_trace_generic_func(__func__) > > /* Interrupt */ > diff --git a/lib/eal/include/rte_trace_point.h > b/lib/eal/include/rte_trace_point.h > index 0f8700974f..9d9a9e0aaa 100644 > --- a/lib/eal/include/rte_trace_point.h > +++ b/lib/eal/include/rte_trace_point.h > @@ -144,6 +144,8 @@ _tp _args \ > #define rte_trace_point_emit_ptr(val) > /** Tracepoint function payload for string datatype */ > #define rte_trace_point_emit_string(val) > +/** Tracepoint function payload for char array */ > +#define rte_trace_point_emit_char_array(val, len) > > #endif /* __DOXYGEN__ */ > > @@ -151,6 +153,8 @@ _tp _args \ > #define __RTE_TRACE_EMIT_STRING_LEN_MAX 32 > /** @internal Macro to define event header size. */ > #define __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t) > +/** @internal Macro to define maximum emit length of array. */ > +#define __RTE_TRACE_EMIT_ARRAY_LEN_MAX 32 > > /** > * Enable recording events of the given tracepoint in the trace > buffer. > @@ -374,12 +378,28 @@ do { \ > mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX); \ > } while (0) > > +#define rte_trace_point_emit_char_array(in, len) \ > +do { \ > + if (unlikely(in == NULL)) \ > + return; \ > + if (len > __RTE_TRACE_EMIT_ARRAY_LEN_MAX) \ > + return; \ > + memcpy(mem, in, len); \ > + mem = RTE_PTR_ADD(mem, len); \ This does not work for len < 32, because the trace format is defined to emit an array of 32 byte. You must always increment mem by 32: mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_ARRAY_LEN_MAX); \ Also, instead of silently ignoring len > __RTE_TRACE_EMIT_ARRAY_LEN_MAX, you should: if (len < __RTE_TRACE_EMIT_ARRAY_LEN_MAX) { \ memcpy(mem, in, len); \ memset(RTE_PTR_ADD(mem, len), 0, __RTE_TRACE_EMIT_ARRAY_LEN_MAX - len); \ } else { \ memcpy(mem, in, __RTE_TRACE_EMIT_ARRAY_LEN_MAX); \ } \ If not emitting the length value (see my comments at the end), you should clear the unused part of the array; notice the added memset(). > +} 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_char_array(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..c76fe4dd48 100644 > --- a/lib/eal/include/rte_trace_point_register.h > +++ b/lib/eal/include/rte_trace_point_register.h > @@ -47,6 +47,14 @@ do { \ > RTE_STR(in)"[32]", "string_bounded_t"); \ > } while (0) > > +#define rte_trace_point_emit_char_array(in, len) \ > +do { \ > + RTE_SET_USED(in); \ > + if (len > __RTE_TRACE_EMIT_ARRAY_LEN_MAX) \ > + return; \ > + __rte_trace_point_emit_field(len, RTE_STR(in)"[32]", "uint8_t"); > \ > +} while (0) > + > #ifdef __cplusplus > } > #endif > -- > 2.25.1 > This emits 0..32 byte of binary data into a 32 byte array to the trace. But there is no way to read the length from the trace file, i.e. how many of the 32 bytes contain data. If length is required to be constant at build time, perhaps the "[32]" in rte_trace_point_register.h can be modified to emit the length as the array size. (If so, the requirement for the length to be constant must be documented.) Suggestion (not a requirement): Instead of simply emitting an array, consider emitting a structure where the first field is the length, and the second field is an array of 32 bytes of data: struct { integer { size = 8; } len; integer { size = 8; } data[32]; } Or even better, emit a sequence [1]: struct { integer { size = 16; } length; integer { size = 8; } data[length]; } [1]: https://diamon.org/ctf/#spec4.2.4 If emitting a sequence, the length does not have to be limited to 32 byte, but could be up to 65535 byte. And a personal preference about the name: I would prefer _blob instead of _char_array. ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v4 1/6] eal: trace: add trace point emit for array 2022-12-22 10:32 ` Morten Brørup @ 2022-12-22 15:18 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-12-22 15:18 UTC (permalink / raw) To: Morten Brørup, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Jerin Jacob Kollanukkaran Hi Morten, Thanks for your comments and suggestions. My comments are inline. >-----Original Message----- >From: Morten Brørup <mb@smartsharesystems.com> >Sent: Thursday, December 22, 2022 4:03 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; >orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; >humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; >qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; >shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; >chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; >shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; >john.miller@atomicrules.com; ajit.khaparde@broadcom.com; >somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran ><jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith >Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan ><srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; >rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; >liudongdong3@huawei.com; yisen.zhuang@huawei.com; >xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; >zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; >qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; >xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; >rosen.xu@intel.com; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; >Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori ><skori@marvell.com>; Satha Koteswara Rao Kottidi ><skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara ><sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; jgrajcia@cisco.com; >Jerin Jacob Kollanukkaran <jerinj@marvell.com> >Subject: [EXT] RE: [PATCH v4 1/6] eal: trace: add trace point emit for array > >External Email > >---------------------------------------------------------------------- >> From: Ankur Dwivedi [mailto:adwivedi@marvell.com] >> Sent: Thursday, 22 December 2022 07.33 >> >> Adds a trace point emit function for array. The maximum array bytes >> which can be captured is set to 32. > >This seems very useful. > >Disclaimer: I am not familiar with the trace library or the CTF file format, so my >feedback below may be completely wrong and impossible - please keep in mind >when reading. > >> >> Also adds test case for emit array tracepoint function. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> --- >> app/test/test_trace.c | 3 +++ >> lib/eal/common/eal_common_trace_points.c | 2 ++ >> lib/eal/include/rte_eal_trace.h | 6 ++++++ >> lib/eal/include/rte_trace_point.h | 20 ++++++++++++++++++++ >> lib/eal/include/rte_trace_point_register.h | 8 ++++++++ >> 5 files changed, 39 insertions(+) >> >> diff --git a/app/test/test_trace.c b/app/test/test_trace.c index >> 6bedf14024..99cd0762d1 100644 >> --- a/app/test/test_trace.c >> +++ b/app/test/test_trace.c >> @@ -177,6 +177,7 @@ test_fp_trace_points(void) static int >> test_generic_trace_points(void) >> { >> + uint8_t arr[32] = {0}; >> int tmp; >> >> rte_eal_trace_generic_void(); >> @@ -195,6 +196,8 @@ 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 *)); > >Please also test smaller, unaligned length, e.g.: >rte_eal_trace_generic_char_array(arr, 17); Ok. > >Please also test variable len, unknown at build time, e.g.: >rte_eal_trace_generic_char_array(arr, rand() % 31); Ok. > >> + rte_eal_trace_generic_char_array(arr, 32); >> + rte_eal_trace_generic_char_array(arr, 64); >> RTE_EAL_TRACE_GENERIC_FUNC; >> >> return TEST_SUCCESS; >> diff --git a/lib/eal/common/eal_common_trace_points.c >> b/lib/eal/common/eal_common_trace_points.c >> index 0b0b254615..93fdaa634e 100644 >> --- a/lib/eal/common/eal_common_trace_points.c >> +++ b/lib/eal/common/eal_common_trace_points.c >> @@ -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_char_array, >> + lib.eal.generic.char.array) >> >> RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set, >> lib.eal.alarm.set) >> diff --git a/lib/eal/include/rte_eal_trace.h >> b/lib/eal/include/rte_eal_trace.h index 5ef4398230..34fdd5331f 100644 >> --- a/lib/eal/include/rte_eal_trace.h >> +++ b/lib/eal/include/rte_eal_trace.h >> @@ -143,6 +143,12 @@ RTE_TRACE_POINT( >> rte_trace_point_emit_string(func); >> ) >> >> +RTE_TRACE_POINT( >> + rte_eal_trace_generic_char_array, >> + RTE_TRACE_POINT_ARGS(void *in, uint8_t len), >> + rte_trace_point_emit_char_array(in, len); >> +) >> + >> #define RTE_EAL_TRACE_GENERIC_FUNC >> rte_eal_trace_generic_func(__func__) >> >> /* Interrupt */ >> diff --git a/lib/eal/include/rte_trace_point.h >> b/lib/eal/include/rte_trace_point.h >> index 0f8700974f..9d9a9e0aaa 100644 >> --- a/lib/eal/include/rte_trace_point.h >> +++ b/lib/eal/include/rte_trace_point.h >> @@ -144,6 +144,8 @@ _tp _args \ >> #define rte_trace_point_emit_ptr(val) >> /** Tracepoint function payload for string datatype */ #define >> rte_trace_point_emit_string(val) >> +/** Tracepoint function payload for char array */ #define >> +rte_trace_point_emit_char_array(val, len) >> >> #endif /* __DOXYGEN__ */ >> >> @@ -151,6 +153,8 @@ _tp _args \ >> #define __RTE_TRACE_EMIT_STRING_LEN_MAX 32 >> /** @internal Macro to define event header size. */ #define >> __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t) >> +/** @internal Macro to define maximum emit length of array. */ >> +#define __RTE_TRACE_EMIT_ARRAY_LEN_MAX 32 >> >> /** >> * Enable recording events of the given tracepoint in the trace >> buffer. >> @@ -374,12 +378,28 @@ do { \ >> mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX); \ >} while >> (0) >> >> +#define rte_trace_point_emit_char_array(in, len) \ do { \ >> + if (unlikely(in == NULL)) \ >> + return; \ >> + if (len > __RTE_TRACE_EMIT_ARRAY_LEN_MAX) \ >> + return; \ >> + memcpy(mem, in, len); \ >> + mem = RTE_PTR_ADD(mem, len); \ > >This does not work for len < 32, because the trace format is defined to emit an >array of 32 byte. You must always increment mem by 32: I have tried smaller byte lengths such as mac address (6 bytes). It was working correctly. There were stale values in rest of the bytes (byte 6 -byte 31). > >mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_ARRAY_LEN_MAX); \ > >Also, instead of silently ignoring len > __RTE_TRACE_EMIT_ARRAY_LEN_MAX, >you should: Ok. > >if (len < __RTE_TRACE_EMIT_ARRAY_LEN_MAX) { \ > memcpy(mem, in, len); \ > memset(RTE_PTR_ADD(mem, len), 0, >__RTE_TRACE_EMIT_ARRAY_LEN_MAX - len); \ } else { \ > memcpy(mem, in, __RTE_TRACE_EMIT_ARRAY_LEN_MAX); \ } \ > >If not emitting the length value (see my comments at the end), you should clear >the unused part of the array; notice the added memset(). memset will help in clearing the stale values in unused bytes. > >> +} 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_char_array(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..c76fe4dd48 100644 >> --- a/lib/eal/include/rte_trace_point_register.h >> +++ b/lib/eal/include/rte_trace_point_register.h >> @@ -47,6 +47,14 @@ do { \ >> RTE_STR(in)"[32]", "string_bounded_t"); \ >> } while (0) >> >> +#define rte_trace_point_emit_char_array(in, len) \ >> +do { \ >> + RTE_SET_USED(in); \ >> + if (len > __RTE_TRACE_EMIT_ARRAY_LEN_MAX) \ >> + return; \ >> + __rte_trace_point_emit_field(len, RTE_STR(in)"[32]", "uint8_t"); >> \ >> +} while (0) >> + >> #ifdef __cplusplus >> } >> #endif >> -- >> 2.25.1 >> > >This emits 0..32 byte of binary data into a 32 byte array to the trace. But there is >no way to read the length from the trace file, i.e. how many of the 32 bytes >contain data. Yes, that's correct. > >If length is required to be constant at build time, perhaps the "[32]" in >rte_trace_point_register.h can be modified to emit the length as the array size. >(If so, the requirement for the length to be constant must be documented.) > >Suggestion (not a requirement): > >Instead of simply emitting an array, consider emitting a structure where the first >field is the length, and the second field is an array of 32 bytes of data: > >struct { > integer { > size = 8; > } len; > integer { > size = 8; > } data[32]; >} > >Or even better, emit a sequence [1]: > >struct { > integer { > size = 16; > } length; > integer { > size = 8; > } data[length]; >} > >[1]: https://urldefense.proofpoint.com/v2/url?u=https-3A__diamon.org_ctf_- >23spec4.2.4&d=DwIFAw&c=nKjWec2b6R0mOyPaz7xtfQ&r=ILjiNF3GF25y6QdHZ >UxMl6JrStU0MIuCtO5dMzn3Ybk&m=ctL43w6fn6cvuduQqeqQ0Scs3RQQIiv5uba >Lz9le2xyd8EJBURdSXD8IFLo7k-6H&s=vBCuOfVlqnotYr2SsovxiI7JRawt-uDVCDay- >_B1VD4&e= I will look into the above link. > >If emitting a sequence, the length does not have to be limited to 32 byte, but >could be up to 65535 byte. > > >And a personal preference about the name: I would prefer _blob instead of >_char_array. Will think about this. ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v4 2/6] ethdev: add trace points for ethdev 2022-12-22 6:32 ` [PATCH v4 0/6] add trace points in ethdev library Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 1/6] eal: trace: add trace point emit for array Ankur Dwivedi @ 2022-12-22 6:33 ` Ankur Dwivedi 2022-12-22 10:50 ` Morten Brørup 2022-12-22 6:33 ` [PATCH v4 3/6] ethdev: add trace points for remaining functions Ankur Dwivedi ` (4 subsequent siblings) 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2022-12-22 6:33 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_private.c | 3 + lib/ethdev/ethdev_trace_points.c | 193 +++++++++++++++++ lib/ethdev/meson.build | 1 + lib/ethdev/rte_ethdev.c | 203 ++++++++++++++++-- lib/ethdev/rte_ethdev.h | 2 +- lib/ethdev/rte_ethdev_trace.h | 285 +++++++++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 276 +++++++++++++++++++++++- lib/ethdev/rte_ethdev_trace_fp_burst.h | 44 ++++ lib/ethdev/version.map | 66 ++++++ 9 files changed, 1047 insertions(+), 26 deletions(-) create mode 100644 lib/ethdev/rte_ethdev_trace_fp_burst.h diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index 48090c879a..a8f87f22c1 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,7 @@ 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, nb_rx, nb_pkts); return nb_rx; } @@ -312,6 +314,7 @@ 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, nb_pkts); return nb_pkts; } diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2919409a15..4fea76e0ff 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -5,6 +5,7 @@ #include <rte_trace_point_register.h> #include <rte_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_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + 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..f5c0865023 100644 --- a/lib/ethdev/meson.build +++ b/lib/ethdev/meson.build @@ -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', diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 5d5e18db1e..48160efc58 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -27,8 +27,9 @@ #include <rte_ether.h> #include <rte_telemetry.h> -#include "rte_ethdev_trace.h" #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "ethdev_driver.h" #include "ethdev_profile.h" #include "ethdev_private.h" @@ -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; @@ -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"); @@ -283,6 +287,7 @@ rte_eth_iterator_next(struct rte_dev_iterator *iter) if (iter->cls == NULL) /* invalid ethdev iterator */ return RTE_MAX_ETHPORTS; + do { /* loop to try all matching rte_device */ /* If not pure ethdev filter and */ if (iter->bus != NULL && @@ -297,8 +302,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 */ + } } while (iter->bus != NULL); /* need to try next rte_device */ /* No more ethdev port to iterate. */ @@ -316,6 +324,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); 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 +333,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); + 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); return RTE_MAX_ETHPORTS; + } + + rte_eth_trace_find_next(port_id); return port_id; } @@ -347,10 +362,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); + rte_eth_trace_find_next_of(port_id); + return port_id; } @@ -358,6 +378,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); + return rte_eth_find_next_of(port_id, rte_eth_devices[ref_port_id].device); } @@ -372,10 +395,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; - else + } else { + rte_ethdev_trace_is_valid_port(port_id, 1); return 1; + } } static int @@ -395,6 +421,7 @@ 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 +440,7 @@ 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 +504,7 @@ 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 +522,7 @@ 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 +556,7 @@ 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 +586,7 @@ 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 +602,21 @@ 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 +630,7 @@ rte_eth_dev_count_avail(void) RTE_ETH_FOREACH_DEV(p) count++; + rte_ethdev_trace_count_avail(count); return count; } @@ -602,6 +642,7 @@ rte_eth_dev_count_total(void) RTE_ETH_FOREACH_VALID_DEV(port) count++; + rte_ethdev_trace_count_total(count); return count; } @@ -622,6 +663,7 @@ 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 +686,7 @@ 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 +788,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 +825,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 +869,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,12 +906,17 @@ 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) { + rte_eth_trace_speed_bitflag(speed, duplex); switch (speed) { case RTE_ETH_SPEED_NUM_10M: return duplex ? RTE_ETH_LINK_SPEED_10M : RTE_ETH_LINK_SPEED_10M_HD; @@ -902,6 +962,8 @@ rte_eth_dev_rx_offload_name(uint64_t offload) } } + rte_ethdev_trace_rx_offload_name(offload, name); + return name; } @@ -918,6 +980,8 @@ rte_eth_dev_tx_offload_name(uint64_t offload) } } + rte_ethdev_trace_tx_offload_name(offload, name); + return name; } @@ -934,6 +998,8 @@ rte_eth_dev_capability_name(uint64_t capability) } } + rte_ethdev_trace_capability_name(capability, name); + return name; } @@ -1554,26 +1620,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 @@ -1630,6 +1706,8 @@ rte_eth_dev_reset(uint16_t port_id) } ret = dev->dev_ops->dev_reset(dev); + rte_ethdev_trace_reset(port_id, ret); + return eth_err(port_id, ret); } @@ -1653,6 +1731,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,6 +2231,10 @@ 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; + + rte_eth_trace_rx_hairpin_queue_setup(port_id, rx_queue_id, nb_rx_desc, + conf, ret); + return eth_err(port_id, ret); } @@ -2340,6 +2424,9 @@ 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; + + rte_eth_trace_tx_hairpin_queue_setup(port_id, tx_queue_id, nb_tx_desc, conf, ret); + return eth_err(port_id, ret); } @@ -2365,6 +2452,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 +2479,7 @@ 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 +2516,8 @@ 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; } @@ -2433,6 +2525,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); rte_pktmbuf_free_bulk(pkts, unsent); } @@ -2444,6 +2537,7 @@ 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(pkts, unsent, *count); } int @@ -2458,6 +2552,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 +2574,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,6 +2594,9 @@ 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); + + rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt, ret); + return eth_err(port_id, ret); } @@ -2516,6 +2618,8 @@ rte_eth_promiscuous_enable(uint16_t port_id) diag = (*dev->dev_ops->promiscuous_enable)(dev); dev->data->promiscuous = (diag == 0) ? 1 : 0; + rte_eth_trace_promiscuous_enable(port_id, diag, dev->data->promiscuous); + return eth_err(port_id, diag); } @@ -2539,6 +2643,8 @@ rte_eth_promiscuous_disable(uint16_t port_id) if (diag != 0) dev->data->promiscuous = 1; + rte_eth_trace_promiscuous_disable(port_id, diag, dev->data->promiscuous); + return eth_err(port_id, diag); } @@ -2550,6 +2656,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,6 +2678,8 @@ rte_eth_allmulticast_enable(uint16_t port_id) diag = (*dev->dev_ops->allmulticast_enable)(dev); dev->data->all_multicast = (diag == 0) ? 1 : 0; + rte_eth_trace_allmulticast_enable(port_id, diag, dev->data->all_multicast); + return eth_err(port_id, diag); } @@ -2592,6 +2702,8 @@ rte_eth_allmulticast_disable(uint16_t port_id) if (diag != 0) dev->data->all_multicast = 1; + rte_eth_trace_allmulticast_disable(port_id, diag, dev->data->all_multicast); + return eth_err(port_id, diag); } @@ -2603,6 +2715,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 +2743,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,12 +2771,16 @@ 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) { + rte_eth_trace_link_speed_to_str(link_speed); + switch (link_speed) { case RTE_ETH_SPEED_NUM_NONE: return "None"; case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; @@ -2700,6 +2820,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); + if (eth_link->link_status == RTE_ETH_LINK_DOWN) return snprintf(str, len, "Link down"); else @@ -2715,6 +2837,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 +2853,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)); + + rte_eth_trace_stats_get(port_id, stats, ret); + + return ret; } int @@ -2750,6 +2878,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 +2963,7 @@ 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 +3117,8 @@ 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); @@ -3025,6 +3158,8 @@ rte_eth_xstats_get_names(uint16_t port_id, cnt_used_entries += cnt_driver_entries; } + rte_eth_trace_xstats_get_names(port_id, xstats_names, size, cnt_used_entries); + return cnt_used_entries; } @@ -3174,6 +3309,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 +3359,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], i); + return count + xcount; } @@ -3229,13 +3370,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]; /* 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)); + + rte_eth_trace_xstats_reset(port_id, ret); + + return ret; + } /* fallback to default */ return rte_eth_stats_reset(port_id); @@ -3268,24 +3415,37 @@ 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 +3459,13 @@ 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.h b/lib/ethdev/rte_ethdev.h index c129ca1eaf..92826a2253 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -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; diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 1491c815c3..ecc2cd1ccc 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -88,6 +88,291 @@ RTE_TRACE_POINT( 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(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); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_cleanup, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), + 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( + 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(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), + 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(const 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), + rte_trace_point_emit_u32(speed); + rte_trace_point_emit_int(duplex); +) + +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), + 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(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); +) + +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); + 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); +) + +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(struct rte_eth_dev_tx_buffer *buffer), + rte_trace_point_emit_ptr(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 diag, int promiscuous), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(diag); + rte_trace_point_emit_int(promiscuous); +) + +RTE_TRACE_POINT( + rte_eth_trace_promiscuous_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int diag, int promiscuous), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(diag); + rte_trace_point_emit_int(promiscuous); +) + +RTE_TRACE_POINT( + rte_eth_trace_allmulticast_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int diag, int all_multicast), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(diag); + rte_trace_point_emit_int(all_multicast); +) + +RTE_TRACE_POINT( + rte_eth_trace_allmulticast_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int diag, int all_multicast), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(diag); + rte_trace_point_emit_int(all_multicast); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_speed_to_str, + RTE_TRACE_POINT_ARGS(uint32_t link_speed), + rte_trace_point_emit_u32(link_speed); +) + +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, 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 40084d1929..efbaf1146c 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -17,26 +17,290 @@ extern "C" { #include <rte_trace_point.h> +#include "rte_ethdev.h" + RTE_TRACE_POINT_FP( - rte_ethdev_trace_rx_burst, + rte_eth_trace_call_rx_callbacks, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, - void **pkt_tbl, uint16_t nb_rx), + 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(pkt_tbl); rte_trace_point_emit_u16(nb_rx); + rte_trace_point_emit_u16(nb_pkts); ) RTE_TRACE_POINT_FP( - rte_ethdev_trace_tx_burst, + rte_eth_trace_call_tx_callbacks, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, - void **pkts_tbl, uint16_t nb_pkts), + uint16_t nb_pkts), rte_trace_point_emit_u16(port_id); rte_trace_point_emit_u16(queue_id); - rte_trace_point_emit_ptr(pkts_tbl); rte_trace_point_emit_u16(nb_pkts); ) +RTE_TRACE_POINT_FP( + rte_eth_trace_find_next, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_find_next_sibling, + RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t ref_port_id), + rte_trace_point_emit_u16(port_id_start); + rte_trace_point_emit_u16(ref_port_id); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_find_next_owned_by, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const uint64_t owner_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(owner_id); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_owner_get, + RTE_TRACE_POINT_ARGS(const uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_sec_ctx, + RTE_TRACE_POINT_ARGS(uint16_t port_id, void *ctx), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(ctx); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_count_avail, + RTE_TRACE_POINT_ARGS(uint16_t count), + rte_trace_point_emit_u16(count); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_count_total, + RTE_TRACE_POINT_ARGS(uint16_t count), + rte_trace_point_emit_u16(count); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_get_name_by_port, + RTE_TRACE_POINT_ARGS(uint16_t port_id, char *name), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_string(name); +) + +RTE_TRACE_POINT_FP( + 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_FP( + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_tx_buffer_drop_callback, + RTE_TRACE_POINT_ARGS(struct rte_mbuf **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(struct rte_mbuf **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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_tx_buffer_init, + RTE_TRACE_POINT_ARGS(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_FP( + 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_FP( + 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_FP( + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_link_get_nowait, + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_link_to_str, + RTE_TRACE_POINT_ARGS(size_t len, const 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_size_t(len); + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_stats_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats *stats, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(stats); + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_stats_reset, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_xstats_get_names_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_xstats_get_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, + 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_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); +) + +RTE_TRACE_POINT_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp_burst.h b/lib/ethdev/rte_ethdev_trace_fp_burst.h new file mode 100644 index 0000000000..899b4ed070 --- /dev/null +++ b/lib/ethdev/rte_ethdev_trace_fp_burst.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2022 Marvell International Ltd. + */ + +#ifndef _RTE_ETHDEV_TRACE_FP_BURST_H_ +#define _RTE_ETHDEV_TRACE_FP_BURST_H_ + +/** + * @file + * + * API for ethdev burst trace support + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <rte_trace_point.h> + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_rx_burst, + 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); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pkt_tbl); + rte_trace_point_emit_u16(nb_rx); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_tx_burst, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + void **pkts_tbl, uint16_t nb_pkts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pkts_tbl); + rte_trace_point_emit_u16(nb_pkts); +) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_ETHDEV_TRACE_FP_BURST_H_ */ diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 17201fbe0f..c7ba2e3dc8 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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; + __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; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v4 2/6] ethdev: add trace points for ethdev 2022-12-22 6:33 ` [PATCH v4 2/6] ethdev: add trace points for ethdev Ankur Dwivedi @ 2022-12-22 10:50 ` Morten Brørup 0 siblings, 0 replies; 172+ messages in thread From: Morten Brørup @ 2022-12-22 10:50 UTC (permalink / raw) To: Ankur Dwivedi, dev, jerinj Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia > From: Ankur Dwivedi [mailto:adwivedi@marvell.com] > Sent: Thursday, 22 December 2022 07.33 > > 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. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > lib/ethdev/ethdev_private.c | 3 + > lib/ethdev/ethdev_trace_points.c | 193 +++++++++++++++++ > lib/ethdev/meson.build | 1 + > lib/ethdev/rte_ethdev.c | 203 ++++++++++++++++-- > lib/ethdev/rte_ethdev.h | 2 +- > lib/ethdev/rte_ethdev_trace.h | 285 +++++++++++++++++++++++++ > lib/ethdev/rte_ethdev_trace_fp.h | 276 +++++++++++++++++++++++- > lib/ethdev/rte_ethdev_trace_fp_burst.h | 44 ++++ > lib/ethdev/version.map | 66 ++++++ > 9 files changed, 1047 insertions(+), 26 deletions(-) > create mode 100644 lib/ethdev/rte_ethdev_trace_fp_burst.h > > diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c > index 48090c879a..a8f87f22c1 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,7 @@ 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, nb_rx, > nb_pkts); Reviewing code like this, it is impossible to determine if this is a fast path trace or not, without also looking elsewhere. Could we please agree on a naming convention to include _fp in fast path trace functions and macros? > return nb_rx; > } > > @@ -312,6 +314,7 @@ 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, nb_pkts); > return nb_pkts; > } > > diff --git a/lib/ethdev/ethdev_trace_points.c > b/lib/ethdev/ethdev_trace_points.c > index 2919409a15..4fea76e0ff 100644 > --- a/lib/ethdev/ethdev_trace_points.c > +++ b/lib/ethdev/ethdev_trace_points.c > @@ -5,6 +5,7 @@ > #include <rte_trace_point_register.h> > > #include <rte_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) Same comment as above: Reviewing code like this, I cannot immediately determine if this is fast path trace or not. ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v4 3/6] ethdev: add trace points for remaining functions 2022-12-22 6:32 ` [PATCH v4 0/6] add trace points in ethdev library Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 1/6] eal: trace: add trace point emit for array Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 2/6] ethdev: add trace points for ethdev Ankur Dwivedi @ 2022-12-22 6:33 ` Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 4/6] ethdev: add trace points for flow Ankur Dwivedi ` (3 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-12-22 6:33 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for remaining ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 252 +++++++++++++++ lib/ethdev/rte_ethdev.c | 456 ++++++++++++++++++++++----- lib/ethdev/rte_ethdev_cman.c | 30 +- lib/ethdev/rte_ethdev_trace.h | 523 +++++++++++++++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 338 ++++++++++++++++++++ lib/ethdev/version.map | 81 +++++ 6 files changed, 1597 insertions(+), 83 deletions(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 4fea76e0ff..102a18fcc1 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 48160efc58..60cc5ddaa4 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -3525,6 +3525,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); + return 0; } @@ -3545,6 +3547,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct rte_eth_conf)); + rte_ethdev_trace_conf_get(port_id, dev_conf); + return 0; } @@ -3575,8 +3579,10 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) if (all_ptypes[i] & ptype_mask) { - if (j < num) + if (j < num) { ptypes[j] = all_ptypes[i]; + rte_ethdev_trace_get_supported_ptypes(port_id, j, num, ptypes[j]); + } j++; } @@ -3654,6 +3660,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, if (ptype_mask & all_ptypes[i]) { if (j < num - 1) { set_ptypes[j] = all_ptypes[i]; + rte_ethdev_trace_set_ptypes(port_id, j, num, set_ptypes[j]); j++; continue; } @@ -3695,6 +3702,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, num = RTE_MIN(dev_info.max_mac_addrs, num); memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); + rte_eth_trace_macaddrs_get(port_id, num); + return num; } @@ -3715,6 +3724,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); + rte_eth_trace_macaddr_get(port_id, mac_addr); + return 0; } @@ -3733,6 +3744,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + + rte_ethdev_trace_get_mtu(port_id, *mtu); + return 0; } @@ -3775,6 +3789,8 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; + rte_ethdev_trace_set_mtu(port_id, mtu, ret); + return eth_err(port_id, ret); } @@ -3818,6 +3834,8 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) vfc->ids[vidx] &= ~RTE_BIT64(vbit); } + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); + return eth_err(port_id, ret); } @@ -3837,8 +3855,11 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, if (*dev->dev_ops->vlan_strip_queue_set == NULL) return -ENOTSUP; + (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); + return 0; } @@ -3848,14 +3869,18 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, uint16_t tpid) { 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->vlan_tpid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, - tpid)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, tpid)); + + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); + + return ret; } int @@ -3947,6 +3972,8 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) dev->data->dev_conf.rxmode.offloads = orig_offloads; } + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); + return eth_err(port_id, ret); } @@ -3973,6 +4000,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); + return ret; } @@ -3980,19 +4009,25 @@ int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { 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->vlan_pvid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); + + return ret; } int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4007,13 +4042,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_get == NULL) return -ENOTSUP; memset(fc_conf, 0, sizeof(*fc_conf)); - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); + + return ret; } int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4032,7 +4072,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); + + return ret; } int @@ -4040,6 +4084,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4057,9 +4102,14 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, } /* High water, low water validation are device specific */ - if (*dev->dev_ops->priority_flow_ctrl_set) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) - (dev, pfc_conf)); + if (*dev->dev_ops->priority_flow_ctrl_set) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) + (dev, pfc_conf)); + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, ret); + + return ret; + } + return -ENOTSUP; } @@ -4118,6 +4168,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, struct rte_eth_pfc_queue_info *pfc_queue_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4128,9 +4179,13 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, pfc_queue_info, + ret); + return ret; + } return -ENOTSUP; } @@ -4199,10 +4254,16 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, return ret; } - if (*dev->dev_ops->priority_flow_ctrl_queue_config) - return eth_err(port_id, - (*dev->dev_ops->priority_flow_ctrl_queue_config)( - dev, pfc_queue_conf)); + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { + ret = eth_err(port_id, + (*dev->dev_ops->priority_flow_ctrl_queue_config)( + dev, pfc_queue_conf)); + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf, + ret); + return ret; + } + return -ENOTSUP; } @@ -4294,8 +4355,12 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, if (*dev->dev_ops->reta_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4323,8 +4388,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, if (*dev->dev_ops->reta_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4368,8 +4437,11 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, if (*dev->dev_ops->rss_hash_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, rss_conf)); + + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); + + return ret; } int @@ -4377,6 +4449,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4390,8 +4463,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, if (*dev->dev_ops->rss_hash_conf_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); + + return ret; } int @@ -4399,6 +4476,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4417,8 +4495,11 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_add == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, - udp_tunnel)); + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); + + return ret; } int @@ -4426,6 +4507,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4444,34 +4526,47 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_del == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, - udp_tunnel)); + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); + + return ret; } int rte_eth_led_on(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_led_on == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + + rte_eth_trace_led_on(port_id, ret); + + return ret; } int rte_eth_led_off(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_led_off == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + + rte_eth_trace_led_off(port_id, ret); + + return ret; } int @@ -4496,6 +4591,8 @@ rte_eth_fec_get_capability(uint16_t port_id, return -ENOTSUP; ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, num); + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); + return ret; } @@ -4503,6 +4600,7 @@ int rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4516,20 +4614,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) if (*dev->dev_ops->fec_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + + rte_eth_trace_fec_get(port_id, fec_capa, ret); + + return ret; } int rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) { 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->fec_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + + rte_eth_trace_fec_set(port_id, fec_capa, ret); + + return ret; } /* @@ -4617,6 +4724,8 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); } + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); + return eth_err(port_id, ret); } @@ -4657,6 +4766,8 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) /* reset pool bitmap */ dev->data->mac_pool_sel[index] = 0; + rte_ethdev_trace_mac_addr_remove(port_id, addr); + return 0; } @@ -4689,6 +4800,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) /* Update default address in NIC data structure */ rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); + rte_ethdev_trace_default_mac_addr_set(port_id, addr); + return 0; } @@ -4779,6 +4892,8 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, &dev->data->hash_mac_addrs[index]); } + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); + return eth_err(port_id, ret); } @@ -4786,14 +4901,18 @@ int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { 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->uc_all_hash_table_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, - on)); + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, on)); + + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, @@ -4829,14 +4948,18 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (*dev->dev_ops->set_queue_rate_limit == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, - queue_idx, tx_rate)); + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate)); + + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, ret); + + return ret; } int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, uint8_t avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4856,14 +4979,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, } if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, - queue_id, avail_thresh)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, queue_id, + avail_thresh)); + + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, ret); + + return ret; } int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, uint8_t *avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4875,8 +5003,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, - queue_id, avail_thresh)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, + avail_thresh)); + + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); + + return ret; } RTE_INIT(eth_dev_init_fp_ops) @@ -4958,6 +5090,10 @@ rte_eth_dev_callback_register(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, next_port, + last_port); + return 0; } @@ -5019,6 +5155,9 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, ret); + return ret; } @@ -5048,6 +5187,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { vec = rte_intr_vec_list_index_get(intr_handle, qid); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5091,6 +5233,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); + return fd; } @@ -5124,6 +5268,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, vec = rte_intr_vec_list_index_get(intr_handle, queue_id); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5150,7 +5297,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); + + return ret; } int @@ -5169,7 +5320,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); + + return ret; } @@ -5227,6 +5382,8 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5266,6 +5423,8 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, cb, __ATOMIC_RELEASE); rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5325,6 +5484,8 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5359,6 +5520,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5393,6 +5556,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5439,6 +5604,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5485,6 +5652,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5493,6 +5662,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5512,8 +5682,11 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->rx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5521,6 +5694,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5540,8 +5714,11 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->tx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5549,6 +5726,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, struct rte_power_monitor_cond *pmc) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5567,8 +5745,11 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->get_monitor_addr == NULL) return -ENOTSUP; - return eth_err(port_id, - dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); + + return ret; } int @@ -5577,40 +5758,54 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, uint32_t nb_mc_addr) { 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->set_mc_addr_list == NULL) return -ENOTSUP; - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, - mc_addr_set, nb_mc_addr)); + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, mc_addr_set, nb_mc_addr)); + + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr, ret); + + return ret; } int rte_eth_timesync_enable(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->timesync_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + + rte_eth_trace_timesync_enable(port_id, ret); + + return ret; } int rte_eth_timesync_disable(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->timesync_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + + rte_eth_trace_timesync_disable(port_id, ret); + + return ret; } int @@ -5618,6 +5813,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5631,8 +5827,13 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) - (dev, timestamp, flags)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) + (dev, timestamp, flags)); + + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags, ret); + + return ret; } int @@ -5640,6 +5841,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5653,27 +5855,39 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) - (dev, timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) + (dev, timestamp)); + + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, ret); + + return ret; + } int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { 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->timesync_adjust_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); + + return ret; } int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5687,14 +5901,19 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) if (*dev->dev_ops->timesync_read_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, - timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, timestamp)); + + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); + + return ret; } int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5708,14 +5927,18 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) if (*dev->dev_ops->timesync_write_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, - timestamp)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, timestamp)); + + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); + + return ret; } int rte_eth_read_clock(uint16_t port_id, uint64_t *clock) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5728,13 +5951,18 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) if (*dev->dev_ops->read_clock == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + + rte_eth_trace_read_clock(port_id, clock, ret); + + return ret; } int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; @@ -5748,26 +5976,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) if (*dev->dev_ops->get_reg == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + + rte_ethdev_trace_get_reg_info(port_id, info, ret); + + return ret; } int rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + + rte_ethdev_trace_get_eeprom_length(port_id, ret); + + return ret; } int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5781,13 +6019,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->get_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + + rte_ethdev_trace_get_eeprom(port_id, info, ret); + + return ret; } int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5801,7 +6044,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->set_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + + rte_ethdev_trace_set_eeprom(port_id, info, ret); + + return ret; } int @@ -5809,6 +6056,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5822,7 +6070,11 @@ rte_eth_dev_get_module_info(uint16_t port_id, if (*dev->dev_ops->get_module_info == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_info)(dev, modinfo); + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); + + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); + + return ret; } int @@ -5830,6 +6082,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5857,7 +6110,11 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, if (*dev->dev_ops->get_module_eeprom == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_eeprom)(dev, info); + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); + + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); + + return ret; } int @@ -5865,6 +6122,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5880,7 +6138,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, if (*dev->dev_ops->get_dcb_info == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); + + return ret; } static void @@ -5916,6 +6178,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); + return 0; } @@ -5924,6 +6188,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, struct rte_eth_hairpin_cap *cap) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5938,13 +6203,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, if (*dev->dev_ops->hairpin_cap_get == NULL) return -ENOTSUP; memset(cap, 0, sizeof(*cap)); - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); + + return ret; } int rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5959,7 +6229,11 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) if (*dev->dev_ops->pool_ops_supported == NULL) return 1; /* all pools are supported */ - return (*dev->dev_ops->pool_ops_supported)(dev, pool); + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); + + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); + + return ret; } static int @@ -6249,19 +6523,25 @@ rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_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]; if (*dev->dev_ops->representor_info_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + + rte_eth_trace_representor_info_get(port_id, info, ret); + + return ret; } int rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6280,8 +6560,11 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) if (*dev->dev_ops->rx_metadata_negotiate == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + ret = eth_err(port_id, (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + + rte_eth_trace_rx_metadata_negotiate(port_id, features, *features, ret); + + return ret; } int @@ -6289,6 +6572,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *reassembly_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6310,8 +6594,12 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, return -ENOTSUP; memset(reassembly_capa, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) (dev, reassembly_capa)); + + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa, ret); + + return ret; } int @@ -6319,6 +6607,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6339,8 +6628,11 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_get == NULL) return -ENOTSUP; memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); + + return ret; } int @@ -6348,6 +6640,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, const struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6376,8 +6669,11 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_set == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); + + return ret; } int @@ -6475,8 +6771,10 @@ rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes return 0; for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { - if (j < num) + if (j < num) { ptypes[j] = all_types[i]; + rte_eth_trace_buffer_split_get_supported_hdr_ptypes(port_id, j, ptypes[j]); + } j++; } diff --git a/lib/ethdev/rte_ethdev_cman.c b/lib/ethdev/rte_ethdev_cman.c index 4a1bdd7bd0..c4d877d878 100644 --- a/lib/ethdev/rte_ethdev_cman.c +++ b/lib/ethdev/rte_ethdev_cman.c @@ -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; } diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index ecc2cd1ccc..72d6cdff15 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -373,6 +373,529 @@ 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, + 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, 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_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_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_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_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, 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_configure, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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, + 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, 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, 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, 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, + 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_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, struct rte_ether_addr *addr, + uint32_t pool, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); + rte_trace_point_emit_char_array(addr->addr_bytes, RTE_ETHER_ADDR_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, struct rte_ether_addr *addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); + rte_trace_point_emit_char_array(addr->addr_bytes, RTE_ETHER_ADDR_LEN); +) + +RTE_TRACE_POINT( + rte_ethdev_trace_default_mac_addr_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(addr); + rte_trace_point_emit_char_array(addr->addr_bytes, RTE_ETHER_ADDR_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, 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, 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, + 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, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int epfd, + int op, 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_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); +) + +RTE_TRACE_POINT( + 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); +) + +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, + 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, void *user_param, + 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, void *user_param, + 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_ethdev_trace_set_mc_addr_list, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_ethdev_trace_set_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_hairpin_capability_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_rx_metadata_negotiate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, + 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_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_cman_config_init, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index efbaf1146c..3389893665 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -301,6 +301,344 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + 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_FP( + 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_FP( + rte_eth_trace_macaddr_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *mac_addr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(mac_addr); + rte_trace_point_emit_char_array(mac_addr->addr_bytes, RTE_ETHER_ADDR_LEN); +) + +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); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_ethdev_trace_flow_ctrl_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_priority_flow_ctrl_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_rss_reta_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_rss_hash_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_eth_trace_fec_get, + 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_ptr(fec_capa); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_rx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_tx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_rx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_tx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_get_monitor_addr, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_timesync_read_rx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_u64(timestamp->tv_sec); + rte_trace_point_emit_u64(timestamp->tv_nsec); + rte_trace_point_emit_u32(flags); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_timesync_read_tx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *timestamp, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(timestamp); + rte_trace_point_emit_u64(timestamp->tv_sec); + rte_trace_point_emit_u64(timestamp->tv_nsec); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_timesync_read_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *time, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(time); + rte_trace_point_emit_u64(time->tv_sec); + rte_trace_point_emit_u64(time->tv_nsec); + rte_trace_point_emit_int(ret); +) + +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); +) + +RTE_TRACE_POINT_FP( + 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_u64(time->tv_sec); + rte_trace_point_emit_u64(time->tv_nsec); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_read_clock, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_get_reg_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + 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_FP( + rte_ethdev_trace_get_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_get_module_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_module_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_dcb_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info *dcb_info, + int ret), + 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_char_array(dcb_info->prio_tc, + RTE_ETH_DCB_NUM_USER_PRIORITIES); + rte_trace_point_emit_char_array(dcb_info->tc_bws, RTE_ETH_DCB_NUM_TCS); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_representor_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_eth_trace_ip_reassembly_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + 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_FP( + rte_eth_trace_cman_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c7ba2e3dc8..c7c6bcd42b 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -300,36 +300,71 @@ EXPERIMENTAL { rte_mtr_meter_profile_get; # added in 23.03 + __rte_eth_trace_add_first_rx_callback; + __rte_eth_trace_add_rx_callback; + __rte_eth_trace_add_tx_callback; __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_cman_config_get; + __rte_eth_trace_cman_config_init; + __rte_eth_trace_cman_config_set; + __rte_eth_trace_cman_info_get; + __rte_eth_trace_fec_get_capability; + __rte_eth_trace_fec_get; + __rte_eth_trace_fec_set; __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_get_monitor_addr; __rte_eth_trace_hairpin_bind; __rte_eth_trace_hairpin_get_peer_ports; __rte_eth_trace_hairpin_unbind; + __rte_eth_trace_ip_reassembly_capability_get; + __rte_eth_trace_ip_reassembly_conf_get; + __rte_eth_trace_ip_reassembly_conf_set; __rte_eth_trace_iterator_cleanup; __rte_eth_trace_iterator_init; __rte_eth_trace_iterator_next; + __rte_eth_trace_led_off; + __rte_eth_trace_led_on; __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_macaddr_get; + __rte_eth_trace_macaddrs_get; __rte_eth_trace_promiscuous_disable; __rte_eth_trace_promiscuous_enable; __rte_eth_trace_promiscuous_get; + __rte_eth_trace_remove_rx_callback; + __rte_eth_trace_remove_tx_callback; + __rte_eth_trace_representor_info_get; + __rte_eth_trace_rx_avail_thresh_query; + __rte_eth_trace_rx_avail_thresh_set; + __rte_eth_trace_rx_burst_mode_get; __rte_eth_trace_rx_hairpin_queue_setup; + __rte_eth_trace_rx_metadata_negotiate; + __rte_eth_trace_rx_queue_info_get; + __rte_eth_trace_set_queue_rate_limit; __rte_eth_trace_speed_bitflag; __rte_eth_trace_stats_get; __rte_eth_trace_stats_reset; + __rte_eth_trace_timesync_adjust_time; + __rte_eth_trace_timesync_disable; + __rte_eth_trace_timesync_enable; + __rte_eth_trace_timesync_read_rx_timestamp; + __rte_eth_trace_timesync_read_time; + __rte_eth_trace_timesync_read_tx_timestamp; + __rte_eth_trace_timesync_write_time; __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_burst_mode_get; __rte_eth_trace_tx_done_cleanup; __rte_eth_trace_tx_hairpin_queue_setup; __rte_eth_trace_xstats_get; @@ -338,32 +373,78 @@ EXPERIMENTAL { __rte_eth_trace_xstats_get_names; __rte_eth_trace_xstats_get_names_by_id; __rte_eth_trace_xstats_reset; + __rte_ethdev_trace_adjust_nb_rx_tx_desc; + __rte_ethdev_trace_callback_register; + __rte_ethdev_trace_callback_unregister; __rte_ethdev_trace_capability_name; + __rte_ethdev_trace_conf_get; __rte_ethdev_trace_count_avail; __rte_ethdev_trace_count_total; + __rte_ethdev_trace_default_mac_addr_set; + __rte_ethdev_trace_flow_ctrl_get; + __rte_ethdev_trace_flow_ctrl_set; __rte_ethdev_trace_fw_version_get; + __rte_ethdev_trace_get_dcb_info; + __rte_ethdev_trace_get_eeprom; + __rte_ethdev_trace_get_eeprom_length; + __rte_ethdev_trace_get_module_eeprom; + __rte_ethdev_trace_get_module_info; + __rte_ethdev_trace_get_mtu; __rte_ethdev_trace_get_name_by_port; __rte_ethdev_trace_get_port_by_name; + __rte_ethdev_trace_get_reg_info; __rte_ethdev_trace_get_sec_ctx; + __rte_ethdev_trace_get_supported_ptypes; + __rte_ethdev_trace_get_vlan_offload; + __rte_ethdev_trace_hairpin_capability_get; + __rte_ethdev_trace_info_get; __rte_ethdev_trace_is_removed; __rte_ethdev_trace_is_valid_port; + __rte_ethdev_trace_mac_addr_add; + __rte_ethdev_trace_mac_addr_remove; __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_pool_ops_supported; + __rte_ethdev_trace_priority_flow_ctrl_queue_configure; + __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; + __rte_ethdev_trace_priority_flow_ctrl_set; __rte_ethdev_trace_reset; + __rte_ethdev_trace_rss_hash_conf_get; + __rte_ethdev_trace_rss_hash_update; + __rte_ethdev_trace_rss_reta_query; + __rte_ethdev_trace_rss_reta_update; + __rte_ethdev_trace_rx_intr_ctl; + __rte_ethdev_trace_rx_intr_ctl_q; + __rte_ethdev_trace_rx_intr_ctl_q_get_fd; + __rte_ethdev_trace_rx_intr_disable; + __rte_ethdev_trace_rx_intr_enable; __rte_ethdev_trace_rx_offload_name; __rte_ethdev_trace_rx_queue_start; __rte_ethdev_trace_rx_queue_stop; + __rte_ethdev_trace_set_eeprom; __rte_ethdev_trace_set_link_down; __rte_ethdev_trace_set_link_up; + __rte_ethdev_trace_set_mc_addr_list; + __rte_ethdev_trace_set_mtu; + __rte_ethdev_trace_set_ptypes; __rte_ethdev_trace_set_rx_queue_stats_mapping; __rte_ethdev_trace_set_tx_queue_stats_mapping; + __rte_ethdev_trace_set_vlan_ether_type; + __rte_ethdev_trace_set_vlan_offload; + __rte_ethdev_trace_set_vlan_pvid; + __rte_ethdev_trace_set_vlan_strip_on_queue; __rte_ethdev_trace_socket_id; __rte_ethdev_trace_tx_offload_name; __rte_ethdev_trace_tx_queue_start; __rte_ethdev_trace_tx_queue_stop; + __rte_ethdev_trace_uc_all_hash_table_set; + __rte_ethdev_trace_uc_hash_table_set; + __rte_ethdev_trace_udp_tunnel_port_add; + __rte_ethdev_trace_udp_tunnel_port_delete; + __rte_ethdev_trace_vlan_filter; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v4 4/6] ethdev: add trace points for flow 2022-12-22 6:32 ` [PATCH v4 0/6] add trace points in ethdev library Ankur Dwivedi ` (2 preceding siblings ...) 2022-12-22 6:33 ` [PATCH v4 3/6] ethdev: add trace points for remaining functions Ankur Dwivedi @ 2022-12-22 6:33 ` Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 5/6] ethdev: add trace points for mtr Ankur Dwivedi ` (2 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-12-22 6:33 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 117 ++++++++++ lib/ethdev/rte_ethdev_trace.h | 367 +++++++++++++++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 109 +++++++++ lib/ethdev/rte_flow.c | 57 +++++ lib/ethdev/version.map | 37 ++++ 5 files changed, 687 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 102a18fcc1..1953d90a5a 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 72d6cdff15..c1a0f0e226 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -896,6 +896,373 @@ 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); + 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_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); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_destroy, + 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), + 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( + 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), + 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( + 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_u32(num_of_actions); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(items); + rte_trace_point_emit_u32(num_of_items); +) + +RTE_TRACE_POINT( + 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); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_int(action->type); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(port_info); + rte_trace_point_emit_ptr(queue_info); +) + +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, + struct rte_flow_pattern_template *template), + 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(template); +) + +RTE_TRACE_POINT( + rte_flow_trace_pattern_template_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_pattern_template *pattern_template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pattern_template); +) + +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, + struct rte_flow_actions_template *template), + 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(template); +) + +RTE_TRACE_POINT( + rte_flow_trace_actions_template_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_actions_template *actions_template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions_template); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_table); +) + +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), + 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( + rte_flow_trace_push, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); +) + +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 diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 3389893665..73a8e2712b 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -639,6 +639,115 @@ 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(m); + rte_trace_point_emit_ptr(info); +) + +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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(proxy_port_id); +) + +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), + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 7d0c24366c..37ae3ff410 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -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,7 @@ 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,6 +365,7 @@ rte_flow_validate(uint16_t port_id, fts_enter(dev); ret = ops->validate(dev, attr, pattern, actions, error); fts_exit(dev); + rte_flow_trace_validate(port_id, attr, pattern, actions, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -389,6 +393,7 @@ 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, @@ -412,6 +417,7 @@ rte_flow_destroy(uint16_t port_id, fts_enter(dev); ret = ops->destroy(dev, flow, error); fts_exit(dev); + rte_flow_trace_destroy(port_id, flow, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -434,6 +440,7 @@ rte_flow_flush(uint16_t port_id, fts_enter(dev); ret = ops->flush(dev, error); fts_exit(dev); + rte_flow_trace_flush(port_id, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -459,6 +466,7 @@ rte_flow_query(uint16_t port_id, fts_enter(dev); ret = ops->query(dev, flow, action, data, error); fts_exit(dev); + rte_flow_trace_query(port_id, flow, action, data, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -482,6 +490,7 @@ rte_flow_isolate(uint16_t port_id, fts_enter(dev); ret = ops->isolate(dev, set, error); fts_exit(dev); + rte_flow_trace_isolate(port_id, set, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOSYS, @@ -1003,6 +1012,7 @@ 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 +1097,7 @@ 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,6 +1136,7 @@ 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); + rte_flow_trace_get_aged_flows(port_id, contexts, nb_contexts, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOTSUP, @@ -1147,6 +1159,8 @@ 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); + rte_flow_trace_get_q_aged_flows(port_id, queue_id, contexts, + nb_contexts, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOTSUP, @@ -1175,6 +1189,7 @@ 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,6 +1209,7 @@ 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); + rte_flow_trace_action_handle_destroy(port_id, handle, ret); return flow_err(port_id, ret, error); } @@ -1214,6 +1230,7 @@ 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); + rte_flow_trace_action_handle_update(port_id, handle, update, ret); return flow_err(port_id, ret, error); } @@ -1234,6 +1251,7 @@ 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); + rte_flow_trace_action_handle_query(port_id, handle, data, ret); return flow_err(port_id, ret, error); } @@ -1249,6 +1267,7 @@ rte_flow_tunnel_decap_set(uint16_t port_id, if (unlikely(!ops)) return -rte_errno; + rte_flow_trace_tunnel_decap_set(port_id, tunnel, actions, num_of_actions); if (likely(!!ops->tunnel_decap_set)) { return flow_err(port_id, ops->tunnel_decap_set(dev, tunnel, actions, @@ -1272,6 +1291,7 @@ rte_flow_tunnel_match(uint16_t port_id, if (unlikely(!ops)) return -rte_errno; + rte_flow_trace_tunnel_match(port_id, tunnel, items, num_of_items); if (likely(!!ops->tunnel_match)) { return flow_err(port_id, ops->tunnel_match(dev, tunnel, items, @@ -1294,6 +1314,7 @@ rte_flow_get_restore_info(uint16_t port_id, if (unlikely(!ops)) return -rte_errno; + rte_flow_trace_get_restore_info(port_id, m, restore_info); if (likely(!!ops->get_restore_info)) { return flow_err(port_id, ops->get_restore_info(dev, m, restore_info, @@ -1316,6 +1337,7 @@ rte_flow_tunnel_action_decap_release(uint16_t port_id, if (unlikely(!ops)) return -rte_errno; + rte_flow_trace_tunnel_action_decap_release(port_id, actions, num_of_actions); if (likely(!!ops->tunnel_action_decap_release)) { return flow_err(port_id, ops->tunnel_action_decap_release(dev, actions, @@ -1339,6 +1361,7 @@ rte_flow_tunnel_item_release(uint16_t port_id, if (unlikely(!ops)) return -rte_errno; + rte_flow_trace_tunnel_item_release(port_id, items, num_of_items); if (likely(!!ops->tunnel_item_release)) { return flow_err(port_id, ops->tunnel_item_release(dev, items, @@ -1367,6 +1390,7 @@ rte_flow_pick_transfer_proxy(uint16_t port_id, uint16_t *proxy_port_id, dev = &rte_eth_devices[port_id]; + rte_flow_trace_pick_transfer_proxy(port_id, proxy_port_id); return flow_err(port_id, ops->pick_transfer_proxy(dev, proxy_port_id, error), error); @@ -1392,6 +1416,7 @@ 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,6 +1434,7 @@ 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); + rte_flow_trace_flex_item_release(port_id, handle, ret); return flow_err(port_id, ret, error); } @@ -1433,6 +1459,7 @@ rte_flow_info_get(uint16_t port_id, RTE_FLOW_LOG(ERR, "Port %"PRIu16" info is NULL.\n", port_id); return -EINVAL; } + rte_flow_trace_info_get(port_id, port_info, queue_info); if (likely(!!ops->info_get)) { return flow_err(port_id, ops->info_get(dev, port_info, queue_info, error), @@ -1480,6 +1507,7 @@ 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; + rte_flow_trace_configure(port_id, port_attr, nb_queue, queue_attr, ret); return flow_err(port_id, ret, error); } return rte_flow_error_set(error, ENOTSUP, @@ -1531,6 +1559,8 @@ 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; } rte_flow_error_set(error, ENOTSUP, @@ -1551,6 +1581,7 @@ rte_flow_pattern_template_destroy(uint16_t port_id, return -rte_errno; if (unlikely(pattern_template == NULL)) return 0; + rte_flow_trace_pattern_template_destroy(port_id, pattern_template); if (likely(!!ops->pattern_template_destroy)) { return flow_err(port_id, ops->pattern_template_destroy(dev, @@ -1617,6 +1648,8 @@ 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); return template; } rte_flow_error_set(error, ENOTSUP, @@ -1637,6 +1670,7 @@ rte_flow_actions_template_destroy(uint16_t port_id, return -rte_errno; if (unlikely(actions_template == NULL)) return 0; + rte_flow_trace_actions_template_destroy(port_id, actions_template); if (likely(!!ops->actions_template_destroy)) { return flow_err(port_id, ops->actions_template_destroy(dev, @@ -1707,6 +1741,11 @@ 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; } rte_flow_error_set(error, ENOTSUP, @@ -1727,6 +1766,7 @@ rte_flow_template_table_destroy(uint16_t port_id, return -rte_errno; if (unlikely(template_table == NULL)) return 0; + rte_flow_trace_template_table_destroy(port_id, template_table); if (likely(!!ops->template_table_destroy)) { return flow_err(port_id, ops->template_table_destroy(dev, @@ -1762,6 +1802,9 @@ 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; } @@ -1776,6 +1819,8 @@ 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); + rte_flow_trace_async_destroy(port_id, queue_id, op_attr, flow, + user_data); return flow_err(port_id, ops->async_destroy(dev, queue_id, op_attr, flow, @@ -1791,6 +1836,7 @@ 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); + rte_flow_trace_push(port_id, queue_id); return flow_err(port_id, ops->push(dev, queue_id, error), error); @@ -1808,6 +1854,7 @@ rte_flow_pull(uint16_t port_id, int ret; ret = ops->pull(dev, queue_id, res, n_res, error); + rte_flow_trace_pull(port_id, queue_id, res, n_res, ret); return ret ? ret : flow_err(port_id, ret, error); } @@ -1828,6 +1875,9 @@ 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); return handle; } @@ -1845,6 +1895,8 @@ 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); + rte_flow_trace_async_action_handle_destroy(port_id, queue_id, op_attr, + action_handle, user_data, ret); return flow_err(port_id, ret, error); } @@ -1863,6 +1915,9 @@ 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); + rte_flow_trace_async_action_handle_update(port_id, queue_id, op_attr, + action_handle, update, + user_data, ret); return flow_err(port_id, ret, error); } @@ -1881,5 +1936,7 @@ 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); + rte_flow_trace_async_action_handle_query(port_id, queue_id, op_attr, + action_handle, data, user_data); return flow_err(port_id, ret, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c7c6bcd42b..0cb8222ad9 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v4 5/6] ethdev: add trace points for mtr 2022-12-22 6:32 ` [PATCH v4 0/6] add trace points in ethdev library Ankur Dwivedi ` (3 preceding siblings ...) 2022-12-22 6:33 ` [PATCH v4 4/6] ethdev: add trace points for flow Ankur Dwivedi @ 2022-12-22 6:33 ` Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-12-22 6:33 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 63 +++++++++++++++++++ lib/ethdev/rte_ethdev_trace.h | 103 +++++++++++++++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 89 ++++++++++++++++++++++++++ lib/ethdev/rte_mtr.c | 30 +++++++++ lib/ethdev/version.map | 21 +++++++ 5 files changed, 306 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 1953d90a5a..067e5fdab4 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index c1a0f0e226..53c3eb1225 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1263,6 +1264,108 @@ 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, + struct rte_mtr_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +RTE_TRACE_POINT( + rte_mtr_trace_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + struct rte_mtr_params *params, int shared), + 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( + rte_mtr_trace_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_enable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id, + struct rte_mtr_meter_profile *profile), + 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( + rte_mtr_trace_meter_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(meter_profile_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_policy_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + 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( + rte_mtr_trace_meter_policy_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(policy_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_policy_validate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_int(actions->type); + rte_trace_point_emit_ptr(actions->conf); +) + +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), + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 73a8e2712b..8c19940189 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT_FP( rte_eth_trace_call_rx_callbacks, @@ -748,6 +749,94 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_ptr(user_data); ) +RTE_TRACE_POINT_FP( + rte_mtr_trace_meter_profile_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(meter_profile_id); +) + +RTE_TRACE_POINT_FP( + rte_mtr_trace_meter_policy_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(policy_id); +) + +RTE_TRACE_POINT_FP( + rte_mtr_trace_meter_profile_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + uint32_t meter_profile_id), + 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_FP( + rte_mtr_trace_meter_policy_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + uint32_t meter_policy_id), + 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_FP( + rte_mtr_trace_meter_dscp_table_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + enum rte_color *dscp_table), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(dscp_table); +) + +RTE_TRACE_POINT_FP( + rte_mtr_trace_meter_vlan_table_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + enum rte_color *vlan_table), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(vlan_table); +) + +RTE_TRACE_POINT_FP( + rte_mtr_trace_color_in_protocol_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); +) + +RTE_TRACE_POINT_FP( + 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), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_int(proto); +) + +RTE_TRACE_POINT_FP( + rte_mtr_trace_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + struct rte_mtr_stats *stats, uint64_t *stats_mask, + int clear), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_ptr(stats_mask); + rte_trace_point_emit_int(clear); +) + +RTE_TRACE_POINT_FP( + rte_mtr_trace_stats_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + uint64_t stats_mask), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(mtr_id); + rte_trace_point_emit_u64(stats_mask); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index 3954839531..fc38e8e539 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -6,6 +6,8 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -82,6 +84,7 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_capabilities_get(port_id, cap); return RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); } @@ -94,6 +97,7 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile); return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); } @@ -105,6 +109,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id); return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); } @@ -116,6 +121,7 @@ rte_mtr_meter_profile_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_get(port_id, meter_profile_id); return RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, meter_profile_id, error); } @@ -127,6 +133,10 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_validate(port_id, policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); } @@ -139,6 +149,11 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_add(port_id, policy_id, + policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); } @@ -150,6 +165,7 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_delete(port_id, policy_id); return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); } @@ -161,6 +177,7 @@ rte_mtr_meter_policy_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_get(port_id, policy_id); return RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, policy_id, error); } @@ -174,6 +191,7 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_create(port_id, mtr_id, params, shared); return RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); } @@ -185,6 +203,7 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_destroy(port_id, mtr_id); return RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); } @@ -196,6 +215,7 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_enable(port_id, mtr_id); return RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); } @@ -207,6 +227,7 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_disable(port_id, mtr_id); return RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); } @@ -219,6 +240,7 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id); return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); } @@ -231,6 +253,7 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id); return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); } @@ -243,6 +266,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table); return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, proto, dscp_table, error); } @@ -255,6 +279,7 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table); return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, proto, vlan_table, error); } @@ -268,6 +293,7 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority); return RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); } @@ -280,6 +306,7 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id); return RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); } @@ -293,6 +320,7 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto); return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); } @@ -305,6 +333,7 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask); return RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); } @@ -319,6 +348,7 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_stats_read(port_id, mtr_id, stats, stats_mask, clear); return RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 0cb8222ad9..c1a6e4d30a 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v4 6/6] ethdev: add trace points for tm 2022-12-22 6:32 ` [PATCH v4 0/6] add trace points in ethdev library Ankur Dwivedi ` (4 preceding siblings ...) 2022-12-22 6:33 ` [PATCH v4 5/6] ethdev: add trace points for mtr Ankur Dwivedi @ 2022-12-22 6:33 ` Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2022-12-22 6:33 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace_points.c | 90 ++++++++++++++++++ lib/ethdev/rte_ethdev_trace.h | 126 +++++++++++++++++++++++++ lib/ethdev/rte_ethdev_trace_fp.h | 155 +++++++++++++++++++++++++++++++ lib/ethdev/rte_tm.c | 41 ++++++++ lib/ethdev/version.map | 30 ++++++ 5 files changed, 442 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 067e5fdab4..af66a139df 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 53c3eb1225..c32b56c2a8 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1366,6 +1367,131 @@ RTE_TRACE_POINT( rte_trace_point_emit_u32(priority); ) +RTE_TRACE_POINT( + rte_tm_trace_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_tm_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(cap); +) + +RTE_TRACE_POINT( + rte_tm_trace_hierarchy_commit, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int clear_on_fail), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(clear_on_fail); +) + +RTE_TRACE_POINT( + rte_tm_trace_level_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t level_id, + struct rte_tm_level_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(level_id); + rte_trace_point_emit_ptr(cap); +) + +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, + struct rte_tm_node_params *params), + 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( + rte_tm_trace_node_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + struct rte_tm_node_capabilities *cap), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(cap); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_resume, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_node_suspend, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_shaper_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id, + struct rte_tm_shaper_params *profile), + 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( + rte_tm_trace_shaper_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shaper_profile_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_shared_shaper_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_shaper_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_shaper_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_shared_wred_context_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shared_wred_context_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(shared_wred_context_id); +) + +RTE_TRACE_POINT( + rte_tm_trace_wred_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id, + struct rte_tm_wred_params *profile), + 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( + rte_tm_trace_wred_profile_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(wred_profile_id); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 8c19940189..03f319ea47 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT_FP( rte_eth_trace_call_rx_callbacks, @@ -837,6 +838,160 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_u64(stats_mask); ) +RTE_TRACE_POINT_FP( + 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_FP( + rte_tm_trace_node_type_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + int *is_leaf), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(is_leaf); +) + +RTE_TRACE_POINT_FP( + 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), + 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_FP( + 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), + 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_FP( + 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), + 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_FP( + rte_tm_trace_node_shaper_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t shaper_profile_id), + 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_FP( + 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), + 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_FP( + 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), + 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_FP( + rte_tm_trace_node_stats_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint64_t stats_mask), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_u64(stats_mask); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_wfq_weight_mode_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + int *wfq_weight_mode, uint32_t n_sp_priorities), + 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_FP( + rte_tm_trace_node_wred_context_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + uint32_t wred_profile_id), + 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_FP( + rte_tm_trace_node_cman_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + enum rte_tm_cman_mode cman), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_int(cman); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_node_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + struct rte_tm_node_stats *stats, + uint64_t *stats_mask, int clear), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(node_id); + rte_trace_point_emit_ptr(stats); + rte_trace_point_emit_ptr(stats_mask); + rte_trace_point_emit_int(clear); +) + +RTE_TRACE_POINT_FP( + rte_tm_trace_mark_vlan_dei, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red), + 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_FP( + rte_tm_trace_mark_ip_ecn, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red), + 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_FP( + rte_tm_trace_mark_ip_dscp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int mark_green, + int mark_yellow, int mark_red), + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..4578413adf 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -6,6 +6,8 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +81,7 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); return 0; } @@ -90,6 +93,7 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_type_get(port_id, node_id, is_leaf); return RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); } @@ -100,6 +104,7 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_capabilities_get(port_id, cap); return RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); } @@ -111,6 +116,7 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_level_capabilities_get(port_id, level_id, cap); return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); } @@ -122,6 +128,7 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_capabilities_get(port_id, node_id, cap); return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); } @@ -133,6 +140,7 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile); return RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); } @@ -143,6 +151,7 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id); return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); } @@ -154,6 +163,8 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_wred_context_add_update(port_id, shared_wred_context_id, + wred_profile_id); return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); } @@ -164,6 +175,7 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_wred_context_delete(port_id, shared_wred_context_id); return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); } @@ -175,6 +187,7 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile); return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); } @@ -185,6 +198,7 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id); return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); } @@ -196,6 +210,8 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id); return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); } @@ -206,6 +222,7 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id); return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); } @@ -221,6 +238,8 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params); return RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); @@ -232,6 +251,7 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_delete(port_id, node_id); return RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); } @@ -242,6 +262,7 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_suspend(port_id, node_id); return RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); } @@ -252,6 +273,7 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_resume(port_id, node_id); return RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); } @@ -262,6 +284,7 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail); return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); } @@ -275,6 +298,8 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight); return RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); } @@ -286,6 +311,7 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id); return RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); } @@ -298,6 +324,8 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shared_shaper_update(port_id, node_id, shared_shaper_id, + add); return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); } @@ -309,6 +337,7 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask); return RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); } @@ -321,6 +350,8 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, wfq_weight_mode, + n_sp_priorities); return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); } @@ -332,6 +363,7 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_cman_update(port_id, node_id, cman); return RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); } @@ -343,6 +375,7 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id); return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); } @@ -355,6 +388,9 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add); return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); } @@ -368,6 +404,8 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_node_stats_read(port_id, node_id, stats, stats_mask, + clear); return RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); } @@ -380,6 +418,7 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); } @@ -392,6 +431,7 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); } @@ -404,6 +444,7 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red); return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c1a6e4d30a..112b2b1039 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v5 0/6] add trace points in ethdev library 2022-12-22 6:32 ` [PATCH v4 0/6] add trace points in ethdev library Ankur Dwivedi ` (5 preceding siblings ...) 2022-12-22 6:33 ` [PATCH v4 6/6] ethdev: add trace points for tm Ankur Dwivedi @ 2023-01-12 11:21 ` Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi ` (7 more replies) 6 siblings, 8 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-12 11:21 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. 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 ethdev: add trace points for remaining functions ethdev: add trace points for flow ethdev: add trace points for mtr ethdev: add trace points for tm app/test/test_trace.c | 5 + lib/eal/common/eal_common_trace_points.c | 2 + lib/eal/include/rte_eal_trace.h | 6 + lib/eal/include/rte_trace_point.h | 17 + lib/eal/include/rte_trace_point_register.h | 7 + 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 ++++ 19 files changed, 4719 insertions(+), 236 deletions(-) create mode 100644 lib/ethdev/rte_ethdev_trace_fp_burst.h -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v5 1/6] eal: trace: add trace point emit for blob 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi @ 2023-01-12 11:21 ` Ankur Dwivedi 2023-01-12 12:38 ` Morten Brørup 2023-01-12 16:29 ` Sunil Kumar Kori 2023-01-12 11:21 ` [PATCH v5 2/6] ethdev: add trace points for ethdev Ankur Dwivedi ` (6 subsequent siblings) 7 siblings, 2 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-12 11:21 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds a trace point emit function for emitting a blob. The maximum blob bytes which can be captured is maximum value contained in uint16_t, which is 65535. Also adds test case for emit array tracepoint function. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- app/test/test_trace.c | 5 +++++ lib/eal/common/eal_common_trace_points.c | 2 ++ lib/eal/include/rte_eal_trace.h | 6 ++++++ lib/eal/include/rte_trace_point.h | 17 +++++++++++++++++ lib/eal/include/rte_trace_point_register.h | 7 +++++++ lib/eal/version.map | 3 +++ 6 files changed, 40 insertions(+) diff --git a/app/test/test_trace.c b/app/test/test_trace.c index 6bedf14024..cf781dc25b 100644 --- a/app/test/test_trace.c +++ b/app/test/test_trace.c @@ -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,6 +178,7 @@ test_fp_trace_points(void) static int test_generic_trace_points(void) { + uint8_t arr[32] = {0}; int tmp; rte_eal_trace_generic_void(); @@ -195,6 +197,9 @@ 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, 17); + rte_eal_trace_generic_blob(arr, 32); + rte_eal_trace_generic_blob(arr, rte_rand() % 32); RTE_EAL_TRACE_GENERIC_FUNC; return TEST_SUCCESS; diff --git a/lib/eal/common/eal_common_trace_points.c b/lib/eal/common/eal_common_trace_points.c index 0b0b254615..051f89809c 100644 --- a/lib/eal/common/eal_common_trace_points.c +++ b/lib/eal/common/eal_common_trace_points.c @@ -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) diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h index 5ef4398230..02e3a564a1 100644 --- a/lib/eal/include/rte_eal_trace.h +++ b/lib/eal/include/rte_eal_trace.h @@ -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, uint16_t len), + rte_trace_point_emit_blob(in, len); +) + #define RTE_EAL_TRACE_GENERIC_FUNC rte_eal_trace_generic_func(__func__) /* Interrupt */ diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index 0f8700974f..21b6bf7bf6 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -144,6 +144,8 @@ _tp _args \ #define rte_trace_point_emit_ptr(val) /** Tracepoint function payload for string datatype */ #define rte_trace_point_emit_string(val) +/** Tracepoint function payload for char array */ +#define rte_trace_point_emit_blob(val, len) #endif /* __DOXYGEN__ */ @@ -374,12 +376,27 @@ 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; \ + __rte_trace_point_emit(len, uint16_t); \ + memcpy(mem, in, len); \ + mem = RTE_PTR_ADD(mem, len); \ +} 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_ */ diff --git a/lib/eal/include/rte_trace_point_register.h b/lib/eal/include/rte_trace_point_register.h index a32f4d731b..a54f9769da 100644 --- a/lib/eal/include/rte_trace_point_register.h +++ b/lib/eal/include/rte_trace_point_register.h @@ -47,6 +47,13 @@ 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, uint16_t); \ + __rte_trace_point_emit_field(len, RTE_STR(in)"["#len"]", RTE_STR(uint8_t)); \ +} while (0) + #ifdef __cplusplus } #endif diff --git a/lib/eal/version.map b/lib/eal/version.map index 7ad12a7dc9..67be24686a 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v5 1/6] eal: trace: add trace point emit for blob 2023-01-12 11:21 ` [PATCH v5 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-01-12 12:38 ` Morten Brørup 2023-01-12 13:22 ` Ankur Dwivedi 2023-01-12 16:29 ` Sunil Kumar Kori 1 sibling, 1 reply; 172+ messages in thread From: Morten Brørup @ 2023-01-12 12:38 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia > From: Ankur Dwivedi [mailto:adwivedi@marvell.com] > Sent: Thursday, 12 January 2023 12.22 > > Adds a trace point emit function for emitting a blob. The maximum blob > bytes which can be captured is maximum value contained in uint16_t, > which is 65535. > > Also adds test case for emit array tracepoint function. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- Excellent, thank you. [...] > +#define rte_trace_point_emit_blob(in, len) \ > +do { \ > + if (unlikely(in == NULL)) \ > + return; \ > + __rte_trace_point_emit(len, uint16_t); \ > + memcpy(mem, in, len); \ > + mem = RTE_PTR_ADD(mem, len); \ > +} while (0) I am somewhat unsure about my concerns here, so please forgive me if they are invalid... Is rte_trace_point_emit_blob() always called with "len" being a variable, then this is OK. If "len" can be a non-constant formula (e.g. len++), you need a temporary variable: #define rte_trace_point_emit_blob(in, len) \ do { \ uint16_t _len = len; \ if (unlikely(in == NULL)) \ return; \ __rte_trace_point_emit(_len, uint16_t); \ memcpy(mem, in, _len); \ mem = RTE_PTR_ADD(_mem, _len); \ } while (0) But I don't think this can ever happen. However, if "len" can be a constant (e.g. 6), does __rte_trace_point_emit(len, uint16_t) accept it? (The __rte_trace_point_emit() macro is shown below.) A constant has no pointer to it (i.e. &6 does not exist). Looking deeper at it, I'm afraid this question can be generalized to all the existing macros/functions calling __rte_trace_point_emit(). And now that I have hijacked your patch with a generalized question, I wonder if the existing __rte_trace_point_emit() has a bug? It uses sizeof(in), but I think it should use sizeof(type). It looks like this: #define __rte_trace_point_emit(in, type) \ do { \ memcpy(mem, &(in), sizeof(in)); \ mem = RTE_PTR_ADD(mem, sizeof(in)); \ } while (0) Alternatively, __rte_trace_point_emit() should RTE_BUILD_BUG_ON(typeof(in) != type). If my concerns above are invalid, then: Acked-by: Morten Brørup <mb@smartsharesystems.com> ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v5 1/6] eal: trace: add trace point emit for blob 2023-01-12 12:38 ` Morten Brørup @ 2023-01-12 13:22 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-12 13:22 UTC (permalink / raw) To: Morten Brørup, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia Hi Morten, My comments are inline. >-----Original Message----- >From: Morten Brørup <mb@smartsharesystems.com> >Sent: Thursday, January 12, 2023 6:09 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; >orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; >humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; >qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; >shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; >chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; >shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; >john.miller@atomicrules.com; ajit.khaparde@broadcom.com; >somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran ><jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith >Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan ><srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; >rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; >liudongdong3@huawei.com; yisen.zhuang@huawei.com; >xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; >zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; >qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; >xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; >rosen.xu@intel.com; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; >Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori ><skori@marvell.com>; Satha Koteswara Rao Kottidi ><skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara ><sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; jgrajcia@cisco.com >Subject: [EXT] RE: [PATCH v5 1/6] eal: trace: add trace point emit for blob > >External Email > >---------------------------------------------------------------------- >> From: Ankur Dwivedi [mailto:adwivedi@marvell.com] >> Sent: Thursday, 12 January 2023 12.22 >> >> Adds a trace point emit function for emitting a blob. The maximum blob >> bytes which can be captured is maximum value contained in uint16_t, >> which is 65535. >> >> Also adds test case for emit array tracepoint function. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> --- > >Excellent, thank you. > >[...] > >> +#define rte_trace_point_emit_blob(in, len) \ do { \ >> + if (unlikely(in == NULL)) \ >> + return; \ >> + __rte_trace_point_emit(len, uint16_t); \ >> + memcpy(mem, in, len); \ >> + mem = RTE_PTR_ADD(mem, len); \ >> +} while (0) > >I am somewhat unsure about my concerns here, so please forgive me if they are >invalid... > >Is rte_trace_point_emit_blob() always called with "len" being a variable, then >this is OK. Yes rte_trace_point_emit_blob is always called with len being a variable. > >If "len" can be a non-constant formula (e.g. len++), you need a temporary >variable: > >#define rte_trace_point_emit_blob(in, len) \ do { \ > uint16_t _len = len; \ > if (unlikely(in == NULL)) \ > return; \ > __rte_trace_point_emit(_len, uint16_t); \ > memcpy(mem, in, _len); \ > mem = RTE_PTR_ADD(_mem, _len); \ >} while (0) > >But I don't think this can ever happen. Yes, I think the same. > >However, if "len" can be a constant (e.g. 6), does __rte_trace_point_emit(len, >uint16_t) accept it? (The __rte_trace_point_emit() macro is shown below.) A >constant has no pointer to it (i.e. &6 does not exist). > >Looking deeper at it, I'm afraid this question can be generalized to all the >existing macros/functions calling __rte_trace_point_emit(). > >And now that I have hijacked your patch with a generalized question, I wonder >if the existing __rte_trace_point_emit() has a bug? It uses sizeof(in), but I think >it should use sizeof(type). > >It looks like this: > >#define __rte_trace_point_emit(in, type) \ do { \ > memcpy(mem, &(in), sizeof(in)); \ > mem = RTE_PTR_ADD(mem, sizeof(in)); \ >} while (0) > >Alternatively, __rte_trace_point_emit() should RTE_BUILD_BUG_ON(typeof(in) >!= type). Yes there would be compilation error if typeof(in) is not same as type. > > >If my concerns above are invalid, then: > >Acked-by: Morten Brørup <mb@smartsharesystems.com> ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v5 1/6] eal: trace: add trace point emit for blob 2023-01-12 11:21 ` [PATCH v5 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-01-12 12:38 ` Morten Brørup @ 2023-01-12 16:29 ` Sunil Kumar Kori 2023-01-12 16:43 ` Sunil Kumar Kori 1 sibling, 1 reply; 172+ messages in thread From: Sunil Kumar Kori @ 2023-01-12 16:29 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Thursday, January 12, 2023 4:52 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha > Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi > <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla > <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; > Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; > viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > Rasesh Mody <rmody@marvell.com>; Shahed Shaikh > <shshaikh@marvell.com>; Devendra Singh Rawat > <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; > mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > Subject: [PATCH v5 1/6] eal: trace: add trace point emit for blob > > Adds a trace point emit function for emitting a blob. The maximum blob > bytes which can be captured is maximum value contained in uint16_t, which > is 65535. > > Also adds test case for emit array tracepoint function. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > app/test/test_trace.c | 5 +++++ > lib/eal/common/eal_common_trace_points.c | 2 ++ > lib/eal/include/rte_eal_trace.h | 6 ++++++ > lib/eal/include/rte_trace_point.h | 17 +++++++++++++++++ > lib/eal/include/rte_trace_point_register.h | 7 +++++++ > lib/eal/version.map | 3 +++ > 6 files changed, 40 insertions(+) > > diff --git a/app/test/test_trace.c b/app/test/test_trace.c index > 6bedf14024..cf781dc25b 100644 > --- a/app/test/test_trace.c > +++ b/app/test/test_trace.c > @@ -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,6 +178,7 @@ test_fp_trace_points(void) static int > test_generic_trace_points(void) > { > + uint8_t arr[32] = {0}; > int tmp; > > rte_eal_trace_generic_void(); > @@ -195,6 +197,9 @@ 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, 17); Do we need this test case now as (rte_rand % 32) will make sure to validate array of valid size only i.e. 0-31 ? > + rte_eal_trace_generic_blob(arr, 32); > + rte_eal_trace_generic_blob(arr, rte_rand() % 32); When executed trace_autotest then I didn't find 3rd generic.blob trace point. Can you please explain the behavior ? > RTE_EAL_TRACE_GENERIC_FUNC; > > return TEST_SUCCESS; > diff --git a/lib/eal/common/eal_common_trace_points.c > b/lib/eal/common/eal_common_trace_points.c > index 0b0b254615..051f89809c 100644 > --- a/lib/eal/common/eal_common_trace_points.c > +++ b/lib/eal/common/eal_common_trace_points.c > @@ -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) > diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h > index 5ef4398230..02e3a564a1 100644 > --- a/lib/eal/include/rte_eal_trace.h > +++ b/lib/eal/include/rte_eal_trace.h > @@ -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, uint16_t len), > + rte_trace_point_emit_blob(in, len); > +) > + > #define RTE_EAL_TRACE_GENERIC_FUNC > rte_eal_trace_generic_func(__func__) > > /* Interrupt */ > diff --git a/lib/eal/include/rte_trace_point.h > b/lib/eal/include/rte_trace_point.h > index 0f8700974f..21b6bf7bf6 100644 > --- a/lib/eal/include/rte_trace_point.h > +++ b/lib/eal/include/rte_trace_point.h > @@ -144,6 +144,8 @@ _tp _args \ > #define rte_trace_point_emit_ptr(val) > /** Tracepoint function payload for string datatype */ #define > rte_trace_point_emit_string(val) > +/** Tracepoint function payload for char array */ #define > +rte_trace_point_emit_blob(val, len) > > #endif /* __DOXYGEN__ */ > > @@ -374,12 +376,27 @@ 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; \ > + __rte_trace_point_emit(len, uint16_t); \ Just to confirm that is there any typo meaning "in should be used in place of len here" ? > + memcpy(mem, in, len); \ > + mem = RTE_PTR_ADD(mem, len); \ Also rte_trace_point_emit copies and increment the memory pointer itself. Then what is the purpose of above 2 instructions ? > +} 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_ */ diff --git > a/lib/eal/include/rte_trace_point_register.h > b/lib/eal/include/rte_trace_point_register.h > index a32f4d731b..a54f9769da 100644 > --- a/lib/eal/include/rte_trace_point_register.h > +++ b/lib/eal/include/rte_trace_point_register.h > @@ -47,6 +47,13 @@ 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, uint16_t); \ > + __rte_trace_point_emit_field(len, RTE_STR(in)"["#len"]", > +RTE_STR(uint8_t)); \ } while (0) > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/eal/version.map b/lib/eal/version.map index > 7ad12a7dc9..67be24686a 100644 > --- a/lib/eal/version.map > +++ b/lib/eal/version.map > @@ -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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v5 1/6] eal: trace: add trace point emit for blob 2023-01-12 16:29 ` Sunil Kumar Kori @ 2023-01-12 16:43 ` Sunil Kumar Kori 0 siblings, 0 replies; 172+ messages in thread From: Sunil Kumar Kori @ 2023-01-12 16:43 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi One more observation that the size of lib.eal.generic.blob trace point is 31962 bytes. Is this trace point this much big or some bug ? > -----Original Message----- > From: Sunil Kumar Kori > Sent: Thursday, January 12, 2023 10:00 PM > To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Satha Koteswara Rao Kottidi > <skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; > zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; > Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara > <sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; > longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; > niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; > sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; > sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody > <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra > Singh Rawat <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; > mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > Subject: RE: [PATCH v5 1/6] eal: trace: add trace point emit for blob > > > -----Original Message----- > > From: Ankur Dwivedi <adwivedi@marvell.com> > > Sent: Thursday, January 12, 2023 4:52 PM > > To: dev@dpdk.org > > Cc: thomas@monjalon.net; david.marchand@redhat.com; > mdr@ashroe.eu; > > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; > > Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori > > <skori@marvell.com>; Satha Koteswara Rao Kottidi > > <skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; > > zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; > > Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara > > <sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; > > longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; > > niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; > > sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; > > sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody > > <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; > Devendra > > Singh Rawat <dsinghrawat@marvell.com>; > andrew.rybchenko@oktetlabs.ru; > > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; > > maxime.coquelin@redhat.com; chenbo.xia@intel.com; > > steven.webster@windriver.com; matt.peters@windriver.com; > > bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; > > jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; > > jgrajcia@cisco.com; mb@smartsharesystems.com; Ankur Dwivedi > > <adwivedi@marvell.com> > > Subject: [PATCH v5 1/6] eal: trace: add trace point emit for blob > > > > Adds a trace point emit function for emitting a blob. The maximum blob > > bytes which can be captured is maximum value contained in uint16_t, > > which is 65535. > > > > Also adds test case for emit array tracepoint function. > > > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > > --- > > app/test/test_trace.c | 5 +++++ > > lib/eal/common/eal_common_trace_points.c | 2 ++ > > lib/eal/include/rte_eal_trace.h | 6 ++++++ > > lib/eal/include/rte_trace_point.h | 17 +++++++++++++++++ > > lib/eal/include/rte_trace_point_register.h | 7 +++++++ > > lib/eal/version.map | 3 +++ > > 6 files changed, 40 insertions(+) > > > > diff --git a/app/test/test_trace.c b/app/test/test_trace.c index > > 6bedf14024..cf781dc25b 100644 > > --- a/app/test/test_trace.c > > +++ b/app/test/test_trace.c > > @@ -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,6 +178,7 @@ test_fp_trace_points(void) static int > > test_generic_trace_points(void) > > { > > + uint8_t arr[32] = {0}; > > int tmp; > > > > rte_eal_trace_generic_void(); > > @@ -195,6 +197,9 @@ 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, 17); > Do we need this test case now as (rte_rand % 32) will make sure to validate > array of valid size only i.e. 0-31 ? > > > + rte_eal_trace_generic_blob(arr, 32); > > + rte_eal_trace_generic_blob(arr, rte_rand() % 32); > When executed trace_autotest then I didn't find 3rd generic.blob trace point. > Can you please explain the behavior ? > > > RTE_EAL_TRACE_GENERIC_FUNC; > > > > return TEST_SUCCESS; > > diff --git a/lib/eal/common/eal_common_trace_points.c > > b/lib/eal/common/eal_common_trace_points.c > > index 0b0b254615..051f89809c 100644 > > --- a/lib/eal/common/eal_common_trace_points.c > > +++ b/lib/eal/common/eal_common_trace_points.c > > @@ -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) > > diff --git a/lib/eal/include/rte_eal_trace.h > > b/lib/eal/include/rte_eal_trace.h index 5ef4398230..02e3a564a1 100644 > > --- a/lib/eal/include/rte_eal_trace.h > > +++ b/lib/eal/include/rte_eal_trace.h > > @@ -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, uint16_t len), > > + rte_trace_point_emit_blob(in, len); > > +) > > + > > #define RTE_EAL_TRACE_GENERIC_FUNC > > rte_eal_trace_generic_func(__func__) > > > > /* Interrupt */ > > diff --git a/lib/eal/include/rte_trace_point.h > > b/lib/eal/include/rte_trace_point.h > > index 0f8700974f..21b6bf7bf6 100644 > > --- a/lib/eal/include/rte_trace_point.h > > +++ b/lib/eal/include/rte_trace_point.h > > @@ -144,6 +144,8 @@ _tp _args \ > > #define rte_trace_point_emit_ptr(val) > > /** Tracepoint function payload for string datatype */ #define > > rte_trace_point_emit_string(val) > > +/** Tracepoint function payload for char array */ #define > > +rte_trace_point_emit_blob(val, len) > > > > #endif /* __DOXYGEN__ */ > > > > @@ -374,12 +376,27 @@ 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; \ > > + __rte_trace_point_emit(len, uint16_t); \ > Just to confirm that is there any typo meaning "in should be used in place of > len here" ? > > > + memcpy(mem, in, len); \ > > + mem = RTE_PTR_ADD(mem, len); \ > Also rte_trace_point_emit copies and increment the memory pointer itself. > Then what is the purpose of above 2 instructions ? > > > +} 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_ */ diff --git > > a/lib/eal/include/rte_trace_point_register.h > > b/lib/eal/include/rte_trace_point_register.h > > index a32f4d731b..a54f9769da 100644 > > --- a/lib/eal/include/rte_trace_point_register.h > > +++ b/lib/eal/include/rte_trace_point_register.h > > @@ -47,6 +47,13 @@ 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, uint16_t); \ > > + __rte_trace_point_emit_field(len, RTE_STR(in)"["#len"]", > > +RTE_STR(uint8_t)); \ } while (0) > > + > > #ifdef __cplusplus > > } > > #endif > > diff --git a/lib/eal/version.map b/lib/eal/version.map index > > 7ad12a7dc9..67be24686a 100644 > > --- a/lib/eal/version.map > > +++ b/lib/eal/version.map > > @@ -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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v5 2/6] ethdev: add trace points for ethdev 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-01-12 11:21 ` Ankur Dwivedi 2023-01-12 16:34 ` Sunil Kumar Kori 2023-01-12 11:21 ` [PATCH v5 3/6] ethdev: add trace points for remaining functions Ankur Dwivedi ` (5 subsequent siblings) 7 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-12 11:21 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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 diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index 48090c879a..fd16b25e55 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,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; } diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2919409a15..4fea76e0ff 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -5,6 +5,7 @@ #include <rte_trace_point_register.h> #include <rte_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_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + 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..f5c0865023 100644 --- a/lib/ethdev/meson.build +++ b/lib/ethdev/meson.build @@ -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', diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 5d5e18db1e..40897ad94d 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -27,8 +27,9 @@ #include <rte_ether.h> #include <rte_telemetry.h> -#include "rte_ethdev_trace.h" #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "ethdev_driver.h" #include "ethdev_profile.h" #include "ethdev_private.h" @@ -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; @@ -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 @@ 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 */ + } } 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); 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); + 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); 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) { 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); + 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); + 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; - else + } else { + rte_ethdev_trace_is_valid_port(port_id, 1); return 1; + } } static int @@ -395,6 +420,7 @@ 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 +439,7 @@ 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 +503,7 @@ 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 +521,7 @@ 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 +555,7 @@ 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 +585,7 @@ 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 +601,21 @@ 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 +629,7 @@ rte_eth_dev_count_avail(void) RTE_ETH_FOREACH_DEV(p) count++; + rte_ethdev_trace_count_avail(count); return count; } @@ -602,6 +641,7 @@ rte_eth_dev_count_total(void) RTE_ETH_FOREACH_VALID_DEV(port) count++; + rte_ethdev_trace_count_total(count); return count; } @@ -622,6 +662,7 @@ 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 +685,7 @@ 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 +787,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 +824,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 +868,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,12 +905,17 @@ 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) { + rte_eth_trace_speed_bitflag(speed, duplex); switch (speed) { case RTE_ETH_SPEED_NUM_10M: return duplex ? RTE_ETH_LINK_SPEED_10M : RTE_ETH_LINK_SPEED_10M_HD; @@ -902,6 +961,8 @@ rte_eth_dev_rx_offload_name(uint64_t offload) } } + rte_ethdev_trace_rx_offload_name(offload, name); + return name; } @@ -918,6 +979,8 @@ rte_eth_dev_tx_offload_name(uint64_t offload) } } + rte_ethdev_trace_tx_offload_name(offload, name); + return name; } @@ -934,6 +997,8 @@ rte_eth_dev_capability_name(uint64_t capability) } } + rte_ethdev_trace_capability_name(capability, name); + return name; } @@ -1554,26 +1619,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 +1703,12 @@ 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); - return eth_err(port_id, ret); + ret = eth_err(port_id, dev->dev_ops->dev_reset(dev)); + + rte_ethdev_trace_reset(port_id, ret); + + return ret; } int @@ -1653,6 +1731,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 +2231,13 @@ 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 +2426,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 +2456,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 +2483,7 @@ 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 +2520,8 @@ 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; } @@ -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); rte_pktmbuf_free_bulk(pkts, unsent); } @@ -2444,6 +2541,7 @@ 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(pkts, unsent, *count); } int @@ -2458,6 +2556,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 +2578,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 +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); + + rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt, ret); + + return ret; } int @@ -2516,7 +2624,11 @@ 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 +2651,11 @@ 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 +2666,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 +2688,11 @@ 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 +2714,11 @@ 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 +2729,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 +2757,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,12 +2785,16 @@ 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) { + rte_eth_trace_link_speed_to_str(link_speed); + switch (link_speed) { case RTE_ETH_SPEED_NUM_NONE: return "None"; case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; @@ -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); + 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) 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 +2892,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 +2977,7 @@ 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 +3131,8 @@ 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); @@ -3025,6 +3172,8 @@ rte_eth_xstats_get_names(uint16_t port_id, cnt_used_entries += cnt_driver_entries; } + rte_eth_trace_xstats_get_names(port_id, xstats_names, size, cnt_used_entries); + return cnt_used_entries; } @@ -3174,6 +3323,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 +3373,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], i); + return count + xcount; } @@ -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]; /* 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)); + + 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) { - 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 +3473,13 @@ 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.h b/lib/ethdev/rte_ethdev.h index 96d0650d0c..6340a84c10 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -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; diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 1491c815c3..bc3b3d2a1b 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -88,6 +88,291 @@ RTE_TRACE_POINT( 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(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); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_cleanup, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), + 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( + 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(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), + 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(const 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), + rte_trace_point_emit_u32(speed); + rte_trace_point_emit_int(duplex); +) + +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), + 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(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); +) + +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); + 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); +) + +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(struct rte_eth_dev_tx_buffer *buffer), + rte_trace_point_emit_ptr(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 diag), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(promiscuous); + rte_trace_point_emit_int(diag); +) + +RTE_TRACE_POINT( + rte_eth_trace_promiscuous_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int promiscuous, int diag), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(promiscuous); + rte_trace_point_emit_int(diag); +) + +RTE_TRACE_POINT( + rte_eth_trace_allmulticast_enable, + 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); +) + +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); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_speed_to_str, + RTE_TRACE_POINT_ARGS(uint32_t link_speed), + rte_trace_point_emit_u32(link_speed); +) + +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, 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 40084d1929..9f1d3d5a1b 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -17,26 +17,293 @@ extern "C" { #include <rte_trace_point.h> +#include "rte_ethdev.h" + RTE_TRACE_POINT_FP( - rte_ethdev_trace_rx_burst, + rte_eth_trace_call_rx_callbacks, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, - void **pkt_tbl, uint16_t nb_rx), + struct rte_mbuf **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(pkt_tbl); + 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_ethdev_trace_tx_burst, + rte_eth_trace_call_tx_callbacks, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, - void **pkts_tbl, uint16_t nb_pkts), + struct rte_mbuf **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(pkts_tbl); + rte_trace_point_emit_ptr(tx_pkts); rte_trace_point_emit_u16(nb_pkts); ) +RTE_TRACE_POINT_FP( + rte_eth_trace_find_next, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_find_next_sibling, + RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t ref_port_id), + rte_trace_point_emit_u16(port_id_start); + rte_trace_point_emit_u16(ref_port_id); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_find_next_owned_by, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const uint64_t owner_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(owner_id); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_owner_get, + RTE_TRACE_POINT_ARGS(const uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_sec_ctx, + RTE_TRACE_POINT_ARGS(uint16_t port_id, void *ctx), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(ctx); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_count_avail, + RTE_TRACE_POINT_ARGS(uint16_t count), + rte_trace_point_emit_u16(count); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_count_total, + RTE_TRACE_POINT_ARGS(uint16_t count), + rte_trace_point_emit_u16(count); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_get_name_by_port, + RTE_TRACE_POINT_ARGS(uint16_t port_id, char *name), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_string(name); +) + +RTE_TRACE_POINT_FP( + 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_FP( + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_tx_buffer_drop_callback, + RTE_TRACE_POINT_ARGS(struct rte_mbuf **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(struct rte_mbuf **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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_tx_buffer_init, + RTE_TRACE_POINT_ARGS(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_FP( + 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_FP( + 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_FP( + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_link_get_nowait, + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_link_to_str, + RTE_TRACE_POINT_ARGS(size_t len, const 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_size_t(len); + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_stats_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats *stats, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(stats); + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_stats_reset, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_xstats_get_names_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_xstats_get_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, + 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_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); +) + +RTE_TRACE_POINT_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp_burst.h b/lib/ethdev/rte_ethdev_trace_fp_burst.h new file mode 100644 index 0000000000..899b4ed070 --- /dev/null +++ b/lib/ethdev/rte_ethdev_trace_fp_burst.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2022 Marvell International Ltd. + */ + +#ifndef _RTE_ETHDEV_TRACE_FP_BURST_H_ +#define _RTE_ETHDEV_TRACE_FP_BURST_H_ + +/** + * @file + * + * API for ethdev burst trace support + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <rte_trace_point.h> + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_rx_burst, + 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); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pkt_tbl); + rte_trace_point_emit_u16(nb_rx); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_tx_burst, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + void **pkts_tbl, uint16_t nb_pkts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pkts_tbl); + rte_trace_point_emit_u16(nb_pkts); +) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_ETHDEV_TRACE_FP_BURST_H_ */ diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 17201fbe0f..c7ba2e3dc8 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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; + __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; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v5 2/6] ethdev: add trace points for ethdev 2023-01-12 11:21 ` [PATCH v5 2/6] ethdev: add trace points for ethdev Ankur Dwivedi @ 2023-01-12 16:34 ` Sunil Kumar Kori 0 siblings, 0 replies; 172+ messages in thread From: Sunil Kumar Kori @ 2023-01-12 16:34 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Thursday, January 12, 2023 4:52 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha > Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi > <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla > <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; > Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; > viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > Rasesh Mody <rmody@marvell.com>; Shahed Shaikh > <shshaikh@marvell.com>; Devendra Singh Rawat > <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; > mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > Subject: [PATCH v5 2/6] ethdev: add trace points for ethdev > > 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. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > 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 > Acked-by: Sunil Kumar Kori <skori@marvell.com> > diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c > index 48090c879a..fd16b25e55 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,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; > } > > diff --git a/lib/ethdev/ethdev_trace_points.c > b/lib/ethdev/ethdev_trace_points.c > index 2919409a15..4fea76e0ff 100644 > --- a/lib/ethdev/ethdev_trace_points.c > +++ b/lib/ethdev/ethdev_trace_points.c > @@ -5,6 +5,7 @@ > #include <rte_trace_point_register.h> > > #include <rte_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_mappi > ng, > + lib.ethdev.set_tx_queue_stats_mapping) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mappi > ng, > + 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..f5c0865023 100644 > --- a/lib/ethdev/meson.build > +++ b/lib/ethdev/meson.build > @@ -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', > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 5d5e18db1e..40897ad94d 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -27,8 +27,9 @@ > #include <rte_ether.h> > #include <rte_telemetry.h> > > -#include "rte_ethdev_trace.h" > #include "rte_ethdev.h" > +#include "rte_ethdev_trace.h" > +#include "rte_ethdev_trace_fp.h" > #include "ethdev_driver.h" > #include "ethdev_profile.h" > #include "ethdev_private.h" > @@ -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; > > @@ -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 @@ 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 */ > + } > } 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); > 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); > + > 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); > 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) > { > 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); > + > 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); > + > 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; > - else > + } else { > + rte_ethdev_trace_is_valid_port(port_id, 1); > return 1; > + } > } > > static int > @@ -395,6 +420,7 @@ 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 +439,7 @@ 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 +503,7 @@ 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 +521,7 @@ 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 +555,7 @@ 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 +585,7 @@ 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 +601,21 @@ 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 +629,7 @@ rte_eth_dev_count_avail(void) > RTE_ETH_FOREACH_DEV(p) > count++; > > + rte_ethdev_trace_count_avail(count); > return count; > } > > @@ -602,6 +641,7 @@ rte_eth_dev_count_total(void) > RTE_ETH_FOREACH_VALID_DEV(port) > count++; > > + rte_ethdev_trace_count_total(count); > return count; > } > > @@ -622,6 +662,7 @@ 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 +685,7 @@ 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 +787,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 +824,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 +868,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,12 +905,17 @@ 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) > { > + rte_eth_trace_speed_bitflag(speed, duplex); > switch (speed) { > case RTE_ETH_SPEED_NUM_10M: > return duplex ? RTE_ETH_LINK_SPEED_10M : > RTE_ETH_LINK_SPEED_10M_HD; > @@ -902,6 +961,8 @@ rte_eth_dev_rx_offload_name(uint64_t offload) > } > } > > + rte_ethdev_trace_rx_offload_name(offload, name); > + > return name; > } > > @@ -918,6 +979,8 @@ rte_eth_dev_tx_offload_name(uint64_t offload) > } > } > > + rte_ethdev_trace_tx_offload_name(offload, name); > + > return name; > } > > @@ -934,6 +997,8 @@ rte_eth_dev_capability_name(uint64_t capability) > } > } > > + rte_ethdev_trace_capability_name(capability, name); > + > return name; > } > > @@ -1554,26 +1619,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 +1703,12 @@ 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); > > - return eth_err(port_id, ret); > + ret = eth_err(port_id, dev->dev_ops->dev_reset(dev)); > + > + rte_ethdev_trace_reset(port_id, ret); > + > + return ret; > } > > int > @@ -1653,6 +1731,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 +2231,13 @@ 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 +2426,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 +2456,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 +2483,7 @@ 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 +2520,8 @@ 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; > } > > @@ -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); > rte_pktmbuf_free_bulk(pkts, unsent); > } > > @@ -2444,6 +2541,7 @@ 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(pkts, unsent, *count); > } > > int > @@ -2458,6 +2556,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 +2578,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 +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); > + > + rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt, ret); > + > + return ret; > } > > int > @@ -2516,7 +2624,11 @@ 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 +2651,11 @@ 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 +2666,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 +2688,11 @@ 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 +2714,11 @@ 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 +2729,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 +2757,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,12 +2785,16 @@ 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) > { > + rte_eth_trace_link_speed_to_str(link_speed); > + > switch (link_speed) { > case RTE_ETH_SPEED_NUM_NONE: return "None"; > case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; > @@ -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); > + > 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) > 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 +2892,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 +2977,7 @@ 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 +3131,8 @@ 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); > @@ -3025,6 +3172,8 @@ rte_eth_xstats_get_names(uint16_t port_id, > cnt_used_entries += cnt_driver_entries; > } > > + rte_eth_trace_xstats_get_names(port_id, xstats_names, size, > cnt_used_entries); > + > return cnt_used_entries; > } > > @@ -3174,6 +3323,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 +3373,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], i); > + > return count + xcount; > } > > @@ -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]; > > /* 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)); > + > + 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) > { > - 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 +3473,13 @@ 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.h b/lib/ethdev/rte_ethdev.h > index 96d0650d0c..6340a84c10 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -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; > diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h > index 1491c815c3..bc3b3d2a1b 100644 > --- a/lib/ethdev/rte_ethdev_trace.h > +++ b/lib/ethdev/rte_ethdev_trace.h > @@ -88,6 +88,291 @@ RTE_TRACE_POINT( > 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(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); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_iterator_cleanup, > + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), > + 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( > + 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(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), > + 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(const 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), > + rte_trace_point_emit_u32(speed); > + rte_trace_point_emit_int(duplex); > +) > + > +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), > + 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(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); > +) > + > +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); > + 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); > +) > + > +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(struct rte_eth_dev_tx_buffer *buffer), > + rte_trace_point_emit_ptr(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 > diag), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(promiscuous); > + rte_trace_point_emit_int(diag); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_promiscuous_disable, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, int promiscuous, int > diag), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_int(promiscuous); > + rte_trace_point_emit_int(diag); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_allmulticast_enable, > + 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); > +) > + > +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); > +) > + > +RTE_TRACE_POINT( > + rte_eth_trace_link_speed_to_str, > + RTE_TRACE_POINT_ARGS(uint32_t link_speed), > + rte_trace_point_emit_u32(link_speed); > +) > + > +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, 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); > +) > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/ethdev/rte_ethdev_trace_fp.h > b/lib/ethdev/rte_ethdev_trace_fp.h > index 40084d1929..9f1d3d5a1b 100644 > --- a/lib/ethdev/rte_ethdev_trace_fp.h > +++ b/lib/ethdev/rte_ethdev_trace_fp.h > @@ -17,26 +17,293 @@ extern "C" { > > #include <rte_trace_point.h> > > +#include "rte_ethdev.h" > + > RTE_TRACE_POINT_FP( > - rte_ethdev_trace_rx_burst, > + rte_eth_trace_call_rx_callbacks, > RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > - void **pkt_tbl, uint16_t nb_rx), > + struct rte_mbuf **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(pkt_tbl); > + 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_ethdev_trace_tx_burst, > + rte_eth_trace_call_tx_callbacks, > RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > - void **pkts_tbl, uint16_t nb_pkts), > + struct rte_mbuf **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(pkts_tbl); > + rte_trace_point_emit_ptr(tx_pkts); > rte_trace_point_emit_u16(nb_pkts); > ) > > +RTE_TRACE_POINT_FP( > + rte_eth_trace_find_next, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) > + > +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); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_find_next_sibling, > + RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t > ref_port_id), > + rte_trace_point_emit_u16(port_id_start); > + rte_trace_point_emit_u16(ref_port_id); > +) > + > +RTE_TRACE_POINT_FP( > + 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_FP( > + rte_eth_trace_find_next_owned_by, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + const uint64_t owner_id), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u64(owner_id); > +) > + > +RTE_TRACE_POINT_FP( > + rte_ethdev_trace_owner_get, > + RTE_TRACE_POINT_ARGS(const uint16_t port_id, > + 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_FP( > + rte_ethdev_trace_get_sec_ctx, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, void *ctx), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(ctx); > +) > + > +RTE_TRACE_POINT_FP( > + rte_ethdev_trace_count_avail, > + RTE_TRACE_POINT_ARGS(uint16_t count), > + rte_trace_point_emit_u16(count); > +) > + > +RTE_TRACE_POINT_FP( > + rte_ethdev_trace_count_total, > + RTE_TRACE_POINT_ARGS(uint16_t count), > + rte_trace_point_emit_u16(count); > +) > + > +RTE_TRACE_POINT_FP( > + rte_ethdev_trace_get_name_by_port, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, char *name), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_string(name); > +) > + > +RTE_TRACE_POINT_FP( > + 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_FP( > + 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_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); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_tx_buffer_drop_callback, > + RTE_TRACE_POINT_ARGS(struct rte_mbuf **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(struct rte_mbuf **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); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_tx_buffer_init, > + RTE_TRACE_POINT_ARGS(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_FP( > + 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_FP( > + 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_FP( > + 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_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); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_link_get_nowait, > + 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); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_link_to_str, > + RTE_TRACE_POINT_ARGS(size_t len, const 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_size_t(len); > + 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); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_stats_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats > *stats, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(stats); > + 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); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_stats_reset, > + RTE_TRACE_POINT_ARGS(uint16_t port_id), > + rte_trace_point_emit_u16(port_id); > +) > + > +RTE_TRACE_POINT_FP( > + 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_FP( > + rte_eth_trace_xstats_get_names_by_id, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_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); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_xstats_get_by_id, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, > + 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_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); > +) > + > +RTE_TRACE_POINT_FP( > + 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); > +) > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/ethdev/rte_ethdev_trace_fp_burst.h > b/lib/ethdev/rte_ethdev_trace_fp_burst.h > new file mode 100644 > index 0000000000..899b4ed070 > --- /dev/null > +++ b/lib/ethdev/rte_ethdev_trace_fp_burst.h > @@ -0,0 +1,44 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2022 Marvell International Ltd. > + */ > + > +#ifndef _RTE_ETHDEV_TRACE_FP_BURST_H_ > +#define _RTE_ETHDEV_TRACE_FP_BURST_H_ > + > +/** > + * @file > + * > + * API for ethdev burst trace support > + */ > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +#include <rte_trace_point.h> > + > +RTE_TRACE_POINT_FP( > + rte_ethdev_trace_rx_burst, > + 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); > + rte_trace_point_emit_u16(queue_id); > + rte_trace_point_emit_ptr(pkt_tbl); > + rte_trace_point_emit_u16(nb_rx); > +) > + > +RTE_TRACE_POINT_FP( > + rte_ethdev_trace_tx_burst, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + void **pkts_tbl, uint16_t nb_pkts), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(queue_id); > + rte_trace_point_emit_ptr(pkts_tbl); > + rte_trace_point_emit_u16(nb_pkts); > +) > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* _RTE_ETHDEV_TRACE_FP_BURST_H_ */ > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > index 17201fbe0f..c7ba2e3dc8 100644 > --- a/lib/ethdev/version.map > +++ b/lib/ethdev/version.map > @@ -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; > + __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; > }; > > INTERNAL { > -- > 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v5 3/6] ethdev: add trace points for remaining functions 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 2/6] ethdev: add trace points for ethdev Ankur Dwivedi @ 2023-01-12 11:21 ` Ankur Dwivedi 2023-01-12 16:38 ` Sunil Kumar Kori 2023-01-12 11:21 ` [PATCH v5 4/6] ethdev: add trace points for flow Ankur Dwivedi ` (4 subsequent siblings) 7 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-12 11:21 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for remaining ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 4fea76e0ff..102a18fcc1 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 40897ad94d..60d2ab47ea 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -3539,6 +3539,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); + return 0; } @@ -3559,6 +3561,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct rte_eth_conf)); + rte_ethdev_trace_conf_get(port_id, dev_conf); + return 0; } @@ -3589,8 +3593,10 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) if (all_ptypes[i] & ptype_mask) { - if (j < num) + if (j < num) { ptypes[j] = all_ptypes[i]; + rte_ethdev_trace_get_supported_ptypes(port_id, j, num, ptypes[j]); + } j++; } @@ -3668,6 +3674,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, if (ptype_mask & all_ptypes[i]) { if (j < num - 1) { set_ptypes[j] = all_ptypes[i]; + rte_ethdev_trace_set_ptypes(port_id, j, num, set_ptypes[j]); j++; continue; } @@ -3709,6 +3716,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, num = RTE_MIN(dev_info.max_mac_addrs, num); memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); + rte_eth_trace_macaddrs_get(port_id, num); + return num; } @@ -3729,6 +3738,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); + rte_eth_trace_macaddr_get(port_id, mac_addr); + return 0; } @@ -3747,6 +3758,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + + rte_ethdev_trace_get_mtu(port_id, *mtu); + return 0; } @@ -3789,7 +3803,11 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_mtu(port_id, mtu, ret); + + return ret; } int @@ -3832,7 +3850,11 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) vfc->ids[vidx] &= ~RTE_BIT64(vbit); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); + + return ret; } int @@ -3851,8 +3873,11 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, if (*dev->dev_ops->vlan_strip_queue_set == NULL) return -ENOTSUP; + (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); + return 0; } @@ -3862,14 +3887,18 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, uint16_t tpid) { 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->vlan_tpid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, - tpid)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, tpid)); + + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); + + return ret; } int @@ -3961,7 +3990,11 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) dev->data->dev_conf.rxmode.offloads = orig_offloads; } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); + + return ret; } int @@ -3987,6 +4020,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); + return ret; } @@ -3994,19 +4029,25 @@ int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { 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->vlan_pvid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); + + return ret; } int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4021,13 +4062,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_get == NULL) return -ENOTSUP; memset(fc_conf, 0, sizeof(*fc_conf)); - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); + + return ret; } int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4046,7 +4092,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); + + return ret; } int @@ -4054,6 +4104,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4071,9 +4122,14 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, } /* High water, low water validation are device specific */ - if (*dev->dev_ops->priority_flow_ctrl_set) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) - (dev, pfc_conf)); + if (*dev->dev_ops->priority_flow_ctrl_set) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) + (dev, pfc_conf)); + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, ret); + + return ret; + } + return -ENOTSUP; } @@ -4132,6 +4188,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, struct rte_eth_pfc_queue_info *pfc_queue_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4142,9 +4199,13 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, pfc_queue_info, + ret); + return ret; + } return -ENOTSUP; } @@ -4213,10 +4274,16 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, return ret; } - if (*dev->dev_ops->priority_flow_ctrl_queue_config) - return eth_err(port_id, - (*dev->dev_ops->priority_flow_ctrl_queue_config)( - dev, pfc_queue_conf)); + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { + ret = eth_err(port_id, + (*dev->dev_ops->priority_flow_ctrl_queue_config)( + dev, pfc_queue_conf)); + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf, + ret); + return ret; + } + return -ENOTSUP; } @@ -4308,8 +4375,12 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, if (*dev->dev_ops->reta_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4337,8 +4408,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, if (*dev->dev_ops->reta_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4382,8 +4457,11 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, if (*dev->dev_ops->rss_hash_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, rss_conf)); + + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); + + return ret; } int @@ -4391,6 +4469,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4404,8 +4483,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, if (*dev->dev_ops->rss_hash_conf_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); + + return ret; } int @@ -4413,6 +4496,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4431,8 +4515,11 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_add == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, - udp_tunnel)); + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); + + return ret; } int @@ -4440,6 +4527,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4458,34 +4546,47 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_del == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, - udp_tunnel)); + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); + + return ret; } int rte_eth_led_on(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_led_on == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + + rte_eth_trace_led_on(port_id, ret); + + return ret; } int rte_eth_led_off(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_led_off == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + + rte_eth_trace_led_off(port_id, ret); + + return ret; } int @@ -4510,6 +4611,8 @@ rte_eth_fec_get_capability(uint16_t port_id, return -ENOTSUP; ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, num); + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); + return ret; } @@ -4517,6 +4620,7 @@ int rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4530,20 +4634,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) if (*dev->dev_ops->fec_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + + rte_eth_trace_fec_get(port_id, fec_capa, ret); + + return ret; } int rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) { 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->fec_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + + rte_eth_trace_fec_set(port_id, fec_capa, ret); + + return ret; } /* @@ -4631,7 +4744,11 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); + + return ret; } int @@ -4671,6 +4788,8 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) /* reset pool bitmap */ dev->data->mac_pool_sel[index] = 0; + rte_ethdev_trace_mac_addr_remove(port_id, addr); + return 0; } @@ -4703,6 +4822,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) /* Update default address in NIC data structure */ rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); + rte_ethdev_trace_default_mac_addr_set(port_id, addr); + return 0; } @@ -4793,21 +4914,29 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, &dev->data->hash_mac_addrs[index]); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { 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->uc_all_hash_table_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, - on)); + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, on)); + + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, @@ -4843,14 +4972,18 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (*dev->dev_ops->set_queue_rate_limit == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, - queue_idx, tx_rate)); + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate)); + + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, ret); + + return ret; } int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, uint8_t avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4870,14 +5003,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, } if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, - queue_id, avail_thresh)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, queue_id, + avail_thresh)); + + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, ret); + + return ret; } int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, uint8_t *avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4889,8 +5027,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, - queue_id, avail_thresh)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, + avail_thresh)); + + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); + + return ret; } RTE_INIT(eth_dev_init_fp_ops) @@ -4972,6 +5114,10 @@ rte_eth_dev_callback_register(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, next_port, + last_port); + return 0; } @@ -5033,6 +5179,9 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, ret); + return ret; } @@ -5062,6 +5211,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { vec = rte_intr_vec_list_index_get(intr_handle, qid); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5105,6 +5257,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); + return fd; } @@ -5138,6 +5292,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, vec = rte_intr_vec_list_index_get(intr_handle, queue_id); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5164,7 +5321,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); + + return ret; } int @@ -5183,7 +5344,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); + + return ret; } @@ -5241,6 +5406,8 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5280,6 +5447,8 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, cb, __ATOMIC_RELEASE); rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5339,6 +5508,8 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5373,6 +5544,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5407,6 +5580,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5453,6 +5628,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5499,6 +5676,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5507,6 +5686,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5526,8 +5706,11 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->rx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5535,6 +5718,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5554,8 +5738,11 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->tx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5563,6 +5750,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, struct rte_power_monitor_cond *pmc) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5581,8 +5769,11 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->get_monitor_addr == NULL) return -ENOTSUP; - return eth_err(port_id, - dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); + + return ret; } int @@ -5591,40 +5782,54 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, uint32_t nb_mc_addr) { 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->set_mc_addr_list == NULL) return -ENOTSUP; - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, - mc_addr_set, nb_mc_addr)); + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, mc_addr_set, nb_mc_addr)); + + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr, ret); + + return ret; } int rte_eth_timesync_enable(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->timesync_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + + rte_eth_trace_timesync_enable(port_id, ret); + + return ret; } int rte_eth_timesync_disable(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->timesync_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + + rte_eth_trace_timesync_disable(port_id, ret); + + return ret; } int @@ -5632,6 +5837,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5645,8 +5851,13 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) - (dev, timestamp, flags)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) + (dev, timestamp, flags)); + + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags, ret); + + return ret; } int @@ -5654,6 +5865,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5667,27 +5879,39 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) - (dev, timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) + (dev, timestamp)); + + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, ret); + + return ret; + } int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { 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->timesync_adjust_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); + + return ret; } int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5701,14 +5925,19 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) if (*dev->dev_ops->timesync_read_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, - timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, timestamp)); + + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); + + return ret; } int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5722,14 +5951,18 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) if (*dev->dev_ops->timesync_write_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, - timestamp)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, timestamp)); + + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); + + return ret; } int rte_eth_read_clock(uint16_t port_id, uint64_t *clock) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5742,13 +5975,18 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) if (*dev->dev_ops->read_clock == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + + rte_eth_trace_read_clock(port_id, clock, ret); + + return ret; } int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; @@ -5762,26 +6000,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) if (*dev->dev_ops->get_reg == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + + rte_ethdev_trace_get_reg_info(port_id, info, ret); + + return ret; } int rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + + rte_ethdev_trace_get_eeprom_length(port_id, ret); + + return ret; } int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5795,13 +6043,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->get_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + + rte_ethdev_trace_get_eeprom(port_id, info, ret); + + return ret; } int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5815,7 +6068,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->set_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + + rte_ethdev_trace_set_eeprom(port_id, info, ret); + + return ret; } int @@ -5823,6 +6080,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5836,7 +6094,11 @@ rte_eth_dev_get_module_info(uint16_t port_id, if (*dev->dev_ops->get_module_info == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_info)(dev, modinfo); + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); + + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); + + return ret; } int @@ -5844,6 +6106,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5871,7 +6134,11 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, if (*dev->dev_ops->get_module_eeprom == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_eeprom)(dev, info); + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); + + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); + + return ret; } int @@ -5879,6 +6146,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5894,7 +6162,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, if (*dev->dev_ops->get_dcb_info == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); + + return ret; } static void @@ -5930,6 +6202,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); + return 0; } @@ -5938,6 +6212,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, struct rte_eth_hairpin_cap *cap) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5952,13 +6227,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, if (*dev->dev_ops->hairpin_cap_get == NULL) return -ENOTSUP; memset(cap, 0, sizeof(*cap)); - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); + + return ret; } int rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5973,7 +6253,11 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) if (*dev->dev_ops->pool_ops_supported == NULL) return 1; /* all pools are supported */ - return (*dev->dev_ops->pool_ops_supported)(dev, pool); + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); + + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); + + return ret; } static int @@ -6263,19 +6547,25 @@ rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_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]; if (*dev->dev_ops->representor_info_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + + rte_eth_trace_representor_info_get(port_id, info, ret); + + return ret; } int rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6294,8 +6584,11 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) if (*dev->dev_ops->rx_metadata_negotiate == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + ret = eth_err(port_id, (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + + rte_eth_trace_rx_metadata_negotiate(port_id, features, *features, ret); + + return ret; } int @@ -6303,6 +6596,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *reassembly_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6324,8 +6618,12 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, return -ENOTSUP; memset(reassembly_capa, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) (dev, reassembly_capa)); + + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa, ret); + + return ret; } int @@ -6333,6 +6631,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6353,8 +6652,11 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_get == NULL) return -ENOTSUP; memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); + + return ret; } int @@ -6362,6 +6664,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, const struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6390,8 +6693,11 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_set == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); + + return ret; } int @@ -6489,8 +6795,10 @@ rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes return 0; for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { - if (j < num) + if (j < num) { ptypes[j] = all_types[i]; + rte_eth_trace_buffer_split_get_supported_hdr_ptypes(port_id, j, ptypes[j]); + } j++; } diff --git a/lib/ethdev/rte_ethdev_cman.c b/lib/ethdev/rte_ethdev_cman.c index 4a1bdd7bd0..c4d877d878 100644 --- a/lib/ethdev/rte_ethdev_cman.c +++ b/lib/ethdev/rte_ethdev_cman.c @@ -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; } diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index bc3b3d2a1b..4c66834290 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -373,6 +373,535 @@ 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, + 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, 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_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_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_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_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, 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_configure, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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, + 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, 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, 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, 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, + 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_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, struct rte_ether_addr *addr, + uint32_t pool, int ret), + uint16_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, struct rte_ether_addr *addr), + uint16_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, struct rte_ether_addr *addr), + uint16_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, 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, 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, + 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, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int epfd, + int op, 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_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); +) + +RTE_TRACE_POINT( + 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); +) + +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, + 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, void *user_param, + 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, void *user_param, + 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_ethdev_trace_set_mc_addr_list, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_ethdev_trace_set_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_hairpin_capability_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_rx_metadata_negotiate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, + 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_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_cman_config_init, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 9f1d3d5a1b..3dbcc30c0a 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -304,6 +304,348 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + 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_FP( + 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_FP( + rte_eth_trace_macaddr_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr *mac_addr), + uint16_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); +) + +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); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_ethdev_trace_flow_ctrl_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_priority_flow_ctrl_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_rss_reta_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_rss_hash_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_eth_trace_fec_get, + 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_ptr(fec_capa); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_rx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_tx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_rx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_tx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_get_monitor_addr, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_timesync_read_rx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_u64(timestamp->tv_sec); + rte_trace_point_emit_u64(timestamp->tv_nsec); + rte_trace_point_emit_u32(flags); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_timesync_read_tx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *timestamp, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(timestamp); + rte_trace_point_emit_u64(timestamp->tv_sec); + rte_trace_point_emit_u64(timestamp->tv_nsec); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_timesync_read_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *time, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(time); + rte_trace_point_emit_u64(time->tv_sec); + rte_trace_point_emit_u64(time->tv_nsec); + rte_trace_point_emit_int(ret); +) + +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); +) + +RTE_TRACE_POINT_FP( + 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_u64(time->tv_sec); + rte_trace_point_emit_u64(time->tv_nsec); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_read_clock, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_get_reg_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + 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_FP( + rte_ethdev_trace_get_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_get_module_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_module_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_dcb_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info *dcb_info, + int ret), + uint16_t num_user_priorities = RTE_ETH_DCB_NUM_USER_PRIORITIES; + uint16_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_FP( + 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_FP( + rte_eth_trace_representor_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_eth_trace_ip_reassembly_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + 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_FP( + rte_eth_trace_cman_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c7ba2e3dc8..c7c6bcd42b 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -300,36 +300,71 @@ EXPERIMENTAL { rte_mtr_meter_profile_get; # added in 23.03 + __rte_eth_trace_add_first_rx_callback; + __rte_eth_trace_add_rx_callback; + __rte_eth_trace_add_tx_callback; __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_cman_config_get; + __rte_eth_trace_cman_config_init; + __rte_eth_trace_cman_config_set; + __rte_eth_trace_cman_info_get; + __rte_eth_trace_fec_get_capability; + __rte_eth_trace_fec_get; + __rte_eth_trace_fec_set; __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_get_monitor_addr; __rte_eth_trace_hairpin_bind; __rte_eth_trace_hairpin_get_peer_ports; __rte_eth_trace_hairpin_unbind; + __rte_eth_trace_ip_reassembly_capability_get; + __rte_eth_trace_ip_reassembly_conf_get; + __rte_eth_trace_ip_reassembly_conf_set; __rte_eth_trace_iterator_cleanup; __rte_eth_trace_iterator_init; __rte_eth_trace_iterator_next; + __rte_eth_trace_led_off; + __rte_eth_trace_led_on; __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_macaddr_get; + __rte_eth_trace_macaddrs_get; __rte_eth_trace_promiscuous_disable; __rte_eth_trace_promiscuous_enable; __rte_eth_trace_promiscuous_get; + __rte_eth_trace_remove_rx_callback; + __rte_eth_trace_remove_tx_callback; + __rte_eth_trace_representor_info_get; + __rte_eth_trace_rx_avail_thresh_query; + __rte_eth_trace_rx_avail_thresh_set; + __rte_eth_trace_rx_burst_mode_get; __rte_eth_trace_rx_hairpin_queue_setup; + __rte_eth_trace_rx_metadata_negotiate; + __rte_eth_trace_rx_queue_info_get; + __rte_eth_trace_set_queue_rate_limit; __rte_eth_trace_speed_bitflag; __rte_eth_trace_stats_get; __rte_eth_trace_stats_reset; + __rte_eth_trace_timesync_adjust_time; + __rte_eth_trace_timesync_disable; + __rte_eth_trace_timesync_enable; + __rte_eth_trace_timesync_read_rx_timestamp; + __rte_eth_trace_timesync_read_time; + __rte_eth_trace_timesync_read_tx_timestamp; + __rte_eth_trace_timesync_write_time; __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_burst_mode_get; __rte_eth_trace_tx_done_cleanup; __rte_eth_trace_tx_hairpin_queue_setup; __rte_eth_trace_xstats_get; @@ -338,32 +373,78 @@ EXPERIMENTAL { __rte_eth_trace_xstats_get_names; __rte_eth_trace_xstats_get_names_by_id; __rte_eth_trace_xstats_reset; + __rte_ethdev_trace_adjust_nb_rx_tx_desc; + __rte_ethdev_trace_callback_register; + __rte_ethdev_trace_callback_unregister; __rte_ethdev_trace_capability_name; + __rte_ethdev_trace_conf_get; __rte_ethdev_trace_count_avail; __rte_ethdev_trace_count_total; + __rte_ethdev_trace_default_mac_addr_set; + __rte_ethdev_trace_flow_ctrl_get; + __rte_ethdev_trace_flow_ctrl_set; __rte_ethdev_trace_fw_version_get; + __rte_ethdev_trace_get_dcb_info; + __rte_ethdev_trace_get_eeprom; + __rte_ethdev_trace_get_eeprom_length; + __rte_ethdev_trace_get_module_eeprom; + __rte_ethdev_trace_get_module_info; + __rte_ethdev_trace_get_mtu; __rte_ethdev_trace_get_name_by_port; __rte_ethdev_trace_get_port_by_name; + __rte_ethdev_trace_get_reg_info; __rte_ethdev_trace_get_sec_ctx; + __rte_ethdev_trace_get_supported_ptypes; + __rte_ethdev_trace_get_vlan_offload; + __rte_ethdev_trace_hairpin_capability_get; + __rte_ethdev_trace_info_get; __rte_ethdev_trace_is_removed; __rte_ethdev_trace_is_valid_port; + __rte_ethdev_trace_mac_addr_add; + __rte_ethdev_trace_mac_addr_remove; __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_pool_ops_supported; + __rte_ethdev_trace_priority_flow_ctrl_queue_configure; + __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; + __rte_ethdev_trace_priority_flow_ctrl_set; __rte_ethdev_trace_reset; + __rte_ethdev_trace_rss_hash_conf_get; + __rte_ethdev_trace_rss_hash_update; + __rte_ethdev_trace_rss_reta_query; + __rte_ethdev_trace_rss_reta_update; + __rte_ethdev_trace_rx_intr_ctl; + __rte_ethdev_trace_rx_intr_ctl_q; + __rte_ethdev_trace_rx_intr_ctl_q_get_fd; + __rte_ethdev_trace_rx_intr_disable; + __rte_ethdev_trace_rx_intr_enable; __rte_ethdev_trace_rx_offload_name; __rte_ethdev_trace_rx_queue_start; __rte_ethdev_trace_rx_queue_stop; + __rte_ethdev_trace_set_eeprom; __rte_ethdev_trace_set_link_down; __rte_ethdev_trace_set_link_up; + __rte_ethdev_trace_set_mc_addr_list; + __rte_ethdev_trace_set_mtu; + __rte_ethdev_trace_set_ptypes; __rte_ethdev_trace_set_rx_queue_stats_mapping; __rte_ethdev_trace_set_tx_queue_stats_mapping; + __rte_ethdev_trace_set_vlan_ether_type; + __rte_ethdev_trace_set_vlan_offload; + __rte_ethdev_trace_set_vlan_pvid; + __rte_ethdev_trace_set_vlan_strip_on_queue; __rte_ethdev_trace_socket_id; __rte_ethdev_trace_tx_offload_name; __rte_ethdev_trace_tx_queue_start; __rte_ethdev_trace_tx_queue_stop; + __rte_ethdev_trace_uc_all_hash_table_set; + __rte_ethdev_trace_uc_hash_table_set; + __rte_ethdev_trace_udp_tunnel_port_add; + __rte_ethdev_trace_udp_tunnel_port_delete; + __rte_ethdev_trace_vlan_filter; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v5 3/6] ethdev: add trace points for remaining functions 2023-01-12 11:21 ` [PATCH v5 3/6] ethdev: add trace points for remaining functions Ankur Dwivedi @ 2023-01-12 16:38 ` Sunil Kumar Kori 2023-01-13 6:31 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Sunil Kumar Kori @ 2023-01-12 16:38 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Thursday, January 12, 2023 4:52 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha > Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi > <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla > <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; > Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; > viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > Rasesh Mody <rmody@marvell.com>; Shahed Shaikh > <shshaikh@marvell.com>; Devendra Singh Rawat > <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; > mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > Subject: [PATCH v5 3/6] ethdev: add trace points for remaining functions > > Adds trace points for remaining ethdev functions. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > 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(-) > Why can't this patch be part of [PATCH v5 2/6] ? > diff --git a/lib/ethdev/ethdev_trace_points.c > b/lib/ethdev/ethdev_trace_points.c > index 4fea76e0ff..102a18fcc1 100644 > --- a/lib/ethdev/ethdev_trace_points.c > +++ b/lib/ethdev/ethdev_trace_points.c > @@ -222,3 +222,255 @@ > RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mappin > g, > > 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_i > nfo_get, > + lib.ethdev.priority_flow_ctrl_queue_info_get) > + > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_c > onfigure, > + 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_h > dr_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) > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 40897ad94d..60d2ab47ea 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -3539,6 +3539,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct > rte_eth_dev_info *dev_info) > > dev_info->dev_flags = &dev->data->dev_flags; > > + rte_ethdev_trace_info_get(port_id, dev_info); > + > return 0; > } > > @@ -3559,6 +3561,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct > rte_eth_conf *dev_conf) > > memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct > rte_eth_conf)); > > + rte_ethdev_trace_conf_get(port_id, dev_conf); > + > return 0; > } > > @@ -3589,8 +3593,10 @@ rte_eth_dev_get_supported_ptypes(uint16_t > port_id, uint32_t ptype_mask, > > for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) > if (all_ptypes[i] & ptype_mask) { > - if (j < num) > + if (j < num) { > ptypes[j] = all_ptypes[i]; > + > rte_ethdev_trace_get_supported_ptypes(port_id, j, num, ptypes[j]); > + } > j++; > } > > @@ -3668,6 +3674,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t > ptype_mask, > if (ptype_mask & all_ptypes[i]) { > if (j < num - 1) { > set_ptypes[j] = all_ptypes[i]; > + rte_ethdev_trace_set_ptypes(port_id, j, num, > set_ptypes[j]); > j++; > continue; > } > @@ -3709,6 +3716,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct > rte_ether_addr *ma, > num = RTE_MIN(dev_info.max_mac_addrs, num); > memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); > > + rte_eth_trace_macaddrs_get(port_id, num); > + > return num; > } > > @@ -3729,6 +3738,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct > rte_ether_addr *mac_addr) > > rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); > > + rte_eth_trace_macaddr_get(port_id, mac_addr); > + > return 0; > } > > @@ -3747,6 +3758,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t > *mtu) > } > > *mtu = dev->data->mtu; > + > + rte_ethdev_trace_get_mtu(port_id, *mtu); > + > return 0; > } > > @@ -3789,7 +3803,11 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t > mtu) > if (ret == 0) > dev->data->mtu = mtu; > > - return eth_err(port_id, ret); > + ret = eth_err(port_id, ret); > + > + rte_ethdev_trace_set_mtu(port_id, mtu, ret); > + > + return ret; > } > > int > @@ -3832,7 +3850,11 @@ rte_eth_dev_vlan_filter(uint16_t port_id, > uint16_t vlan_id, int on) > vfc->ids[vidx] &= ~RTE_BIT64(vbit); > } > > - return eth_err(port_id, ret); > + ret = eth_err(port_id, ret); > + > + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); > + > + return ret; > } > > int > @@ -3851,8 +3873,11 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t > port_id, uint16_t rx_queue_id, > > if (*dev->dev_ops->vlan_strip_queue_set == NULL) > return -ENOTSUP; > + > (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); > > + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, > on); > + > return 0; > } > > @@ -3862,14 +3887,18 @@ rte_eth_dev_set_vlan_ether_type(uint16_t > port_id, > uint16_t tpid) > { > 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->vlan_tpid_set == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, > vlan_type, > - tpid)); > + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, > vlan_type, tpid)); > + > + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); > + > + return ret; > } > > int > @@ -3961,7 +3990,11 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, > int offload_mask) > dev->data->dev_conf.rxmode.offloads = orig_offloads; > } > > - return eth_err(port_id, ret); > + ret = eth_err(port_id, ret); > + > + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); > + > + return ret; > } > > int > @@ -3987,6 +4020,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) > if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) > ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; > > + rte_ethdev_trace_get_vlan_offload(port_id, ret); > + > return ret; > } > > @@ -3994,19 +4029,25 @@ int > rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) > { > 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->vlan_pvid_set == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, > on)); > + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, > on)); > + > + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); > + > + return ret; > } > > int > rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4021,13 +4062,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, > struct rte_eth_fc_conf *fc_conf) > if (*dev->dev_ops->flow_ctrl_get == NULL) > return -ENOTSUP; > memset(fc_conf, 0, sizeof(*fc_conf)); > - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, > fc_conf)); > + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); > + > + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); > + > + return ret; > } > > int > rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4046,7 +4092,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, > struct rte_eth_fc_conf *fc_conf) > > if (*dev->dev_ops->flow_ctrl_set == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, > fc_conf)); > + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); > + > + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); > + > + return ret; > } > > int > @@ -4054,6 +4104,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t > port_id, > struct rte_eth_pfc_conf *pfc_conf) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4071,9 +4122,14 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t > port_id, > } > > /* High water, low water validation are device specific */ > - if (*dev->dev_ops->priority_flow_ctrl_set) > - return eth_err(port_id, (*dev->dev_ops- > >priority_flow_ctrl_set) > - (dev, pfc_conf)); > + if (*dev->dev_ops->priority_flow_ctrl_set) { > + ret = eth_err(port_id, (*dev->dev_ops- > >priority_flow_ctrl_set) > + (dev, pfc_conf)); > + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, > ret); > + > + return ret; > + } > + > return -ENOTSUP; > } > > @@ -4132,6 +4188,7 @@ > rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, > struct rte_eth_pfc_queue_info *pfc_queue_info) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4142,9 +4199,13 @@ > rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, > return -EINVAL; > } > > - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) > - return eth_err(port_id, (*dev->dev_ops- > >priority_flow_ctrl_queue_info_get) > + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { > + ret = eth_err(port_id, (*dev->dev_ops- > >priority_flow_ctrl_queue_info_get) > (dev, pfc_queue_info)); > + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, > pfc_queue_info, > + ret); > + return ret; > + } > return -ENOTSUP; > } > > @@ -4213,10 +4274,16 @@ > rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, > return ret; > } > > - if (*dev->dev_ops->priority_flow_ctrl_queue_config) > - return eth_err(port_id, > - (*dev->dev_ops- > >priority_flow_ctrl_queue_config)( > - dev, pfc_queue_conf)); > + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { > + ret = eth_err(port_id, > + (*dev->dev_ops- > >priority_flow_ctrl_queue_config)( > + dev, pfc_queue_conf)); > + > rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, > + > pfc_queue_conf, > + ret); > + return ret; > + } > + > return -ENOTSUP; > } > > @@ -4308,8 +4375,12 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, > > if (*dev->dev_ops->reta_update == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, > reta_conf, > - reta_size)); > + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, > + reta_size)); > + > + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, > ret); > + > + return ret; > } > > int > @@ -4337,8 +4408,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, > > if (*dev->dev_ops->reta_query == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, > - reta_size)); > + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, > + reta_size)); > + > + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); > + > + return ret; > } > > int > @@ -4382,8 +4457,11 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, > > if (*dev->dev_ops->rss_hash_update == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, > - rss_conf)); > + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, > rss_conf)); > + > + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); > + > + return ret; > } > > int > @@ -4391,6 +4469,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, > struct rte_eth_rss_conf *rss_conf) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4404,8 +4483,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, > > if (*dev->dev_ops->rss_hash_conf_get == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, > - rss_conf)); > + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, > + rss_conf)); > + > + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); > + > + return ret; > } > > int > @@ -4413,6 +4496,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t > port_id, > struct rte_eth_udp_tunnel *udp_tunnel) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4431,8 +4515,11 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t > port_id, > > if (*dev->dev_ops->udp_tunnel_port_add == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops- > >udp_tunnel_port_add)(dev, > - udp_tunnel)); > + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, > udp_tunnel)); > + > + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); > + > + return ret; > } > > int > @@ -4440,6 +4527,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t > port_id, > struct rte_eth_udp_tunnel *udp_tunnel) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4458,34 +4546,47 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t > port_id, > > if (*dev->dev_ops->udp_tunnel_port_del == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, > - udp_tunnel)); > + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, > udp_tunnel)); > + > + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); > + > + return ret; > } > > int > rte_eth_led_on(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_led_on == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); > + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); > + > + rte_eth_trace_led_on(port_id, ret); > + > + return ret; > } > > int > rte_eth_led_off(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_led_off == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); > + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); > + > + rte_eth_trace_led_off(port_id, ret); > + > + return ret; > } > > int > @@ -4510,6 +4611,8 @@ rte_eth_fec_get_capability(uint16_t port_id, > return -ENOTSUP; > ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, > num); > > + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, > ret); > + > return ret; > } > > @@ -4517,6 +4620,7 @@ int > rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4530,20 +4634,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t > *fec_capa) > > if (*dev->dev_ops->fec_get == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); > + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); > + > + rte_eth_trace_fec_get(port_id, fec_capa, ret); > + > + return ret; > } > > int > rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) > { > 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->fec_set == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); > + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); > + > + rte_eth_trace_fec_set(port_id, fec_capa, ret); > + > + return ret; > } > > /* > @@ -4631,7 +4744,11 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, > struct rte_ether_addr *addr, > dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); > } > > - return eth_err(port_id, ret); > + ret = eth_err(port_id, ret); > + > + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); > + > + return ret; > } > > int > @@ -4671,6 +4788,8 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, > struct rte_ether_addr *addr) > /* reset pool bitmap */ > dev->data->mac_pool_sel[index] = 0; > > + rte_ethdev_trace_mac_addr_remove(port_id, addr); > + > return 0; > } > > @@ -4703,6 +4822,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t > port_id, struct rte_ether_addr *addr) > /* Update default address in NIC data structure */ > rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); > > + rte_ethdev_trace_default_mac_addr_set(port_id, addr); > + > return 0; > } > > @@ -4793,21 +4914,29 @@ rte_eth_dev_uc_hash_table_set(uint16_t > port_id, struct rte_ether_addr *addr, > &dev->data- > >hash_mac_addrs[index]); > } > > - return eth_err(port_id, ret); > + ret = eth_err(port_id, ret); > + > + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); > + > + return ret; > } > > int > rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) > { > 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->uc_all_hash_table_set == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops- > >uc_all_hash_table_set)(dev, > - on)); > + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, > on)); > + > + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); > + > + return ret; > } > > int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, > @@ -4843,14 +4972,18 @@ int rte_eth_set_queue_rate_limit(uint16_t > port_id, uint16_t queue_idx, > > if (*dev->dev_ops->set_queue_rate_limit == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, > - queue_idx, tx_rate)); > + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, > queue_idx, tx_rate)); > + > + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, > ret); > + > + return ret; > } > > int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, > uint8_t avail_thresh) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4870,14 +5003,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t > port_id, uint16_t queue_id, > } > if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops- > >rx_queue_avail_thresh_set)(dev, > - queue_id, > avail_thresh)); > + ret = eth_err(port_id, (*dev->dev_ops- > >rx_queue_avail_thresh_set)(dev, queue_id, > + > avail_thresh)); > + > + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, > ret); > + > + return ret; > } > > int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, > uint8_t *avail_thresh) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4889,8 +5027,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t > port_id, uint16_t *queue_id, > > if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops- > >rx_queue_avail_thresh_query)(dev, > - queue_id, > avail_thresh)); > + ret = eth_err(port_id, (*dev->dev_ops- > >rx_queue_avail_thresh_query)(dev, queue_id, > + > avail_thresh)); > + > + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); > + > + return ret; > } > > RTE_INIT(eth_dev_init_fp_ops) > @@ -4972,6 +5114,10 @@ rte_eth_dev_callback_register(uint16_t port_id, > } while (++next_port <= last_port); > > rte_spinlock_unlock(ð_dev_cb_lock); > + > + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, > next_port, > + last_port); > + > return 0; > } > > @@ -5033,6 +5179,9 @@ rte_eth_dev_callback_unregister(uint16_t port_id, > } while (++next_port <= last_port); > > rte_spinlock_unlock(ð_dev_cb_lock); > + > + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, > ret); > + > return ret; > } > > @@ -5062,6 +5211,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, > int op, void *data) > for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { > vec = rte_intr_vec_list_index_get(intr_handle, qid); > rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); > + > + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); > + > if (rc && rc != -EEXIST) { > RTE_ETHDEV_LOG(ERR, > "p %u q %u Rx ctl error op %d epfd %d vec > %u\n", > @@ -5105,6 +5257,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t > port_id, uint16_t queue_id) > (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; > fd = rte_intr_efds_index_get(intr_handle, efd_idx); > > + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); > + > return fd; > } > > @@ -5138,6 +5292,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, > uint16_t queue_id, > > vec = rte_intr_vec_list_index_get(intr_handle, queue_id); > rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); > + > + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, > rc); > + > if (rc && rc != -EEXIST) { > RTE_ETHDEV_LOG(ERR, > "p %u q %u Rx ctl error op %d epfd %d vec %u\n", > @@ -5164,7 +5321,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, > > if (*dev->dev_ops->rx_queue_intr_enable == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops- > >rx_queue_intr_enable)(dev, queue_id)); > + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, > queue_id)); > + > + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); > + > + return ret; > } > > int > @@ -5183,7 +5344,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, > > if (*dev->dev_ops->rx_queue_intr_disable == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops- > >rx_queue_intr_disable)(dev, queue_id)); > + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, > queue_id)); > + > + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); > + > + return ret; > } > > > @@ -5241,6 +5406,8 @@ rte_eth_add_rx_callback(uint16_t port_id, > uint16_t queue_id, > } > rte_spinlock_unlock(ð_dev_rx_cb_lock); > > + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, > cb); > + > return cb; > } > > @@ -5280,6 +5447,8 @@ rte_eth_add_first_rx_callback(uint16_t port_id, > uint16_t queue_id, > cb, __ATOMIC_RELEASE); > rte_spinlock_unlock(ð_dev_rx_cb_lock); > > + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, > user_param, cb); > + > return cb; > } > > @@ -5339,6 +5508,8 @@ rte_eth_add_tx_callback(uint16_t port_id, > uint16_t queue_id, > } > rte_spinlock_unlock(ð_dev_tx_cb_lock); > > + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, > cb); > + > return cb; > } > > @@ -5373,6 +5544,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, > uint16_t queue_id, > } > rte_spinlock_unlock(ð_dev_rx_cb_lock); > > + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); > + > return ret; > } > > @@ -5407,6 +5580,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, > uint16_t queue_id, > } > rte_spinlock_unlock(ð_dev_tx_cb_lock); > > + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); > + > return ret; > } > > @@ -5453,6 +5628,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, > uint16_t queue_id, > dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); > qinfo->queue_state = dev->data->rx_queue_state[queue_id]; > > + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); > + > return 0; > } > > @@ -5499,6 +5676,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, > uint16_t queue_id, > dev->dev_ops->txq_info_get(dev, queue_id, qinfo); > qinfo->queue_state = dev->data->tx_queue_state[queue_id]; > > + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); > + > return 0; > } > > @@ -5507,6 +5686,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, > uint16_t queue_id, > struct rte_eth_burst_mode *mode) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5526,8 +5706,11 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, > uint16_t queue_id, > if (*dev->dev_ops->rx_burst_mode_get == NULL) > return -ENOTSUP; > memset(mode, 0, sizeof(*mode)); > - return eth_err(port_id, > - dev->dev_ops->rx_burst_mode_get(dev, queue_id, > mode)); > + ret = eth_err(port_id, dev->dev_ops->rx_burst_mode_get(dev, > queue_id, mode)); > + > + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); > + > + return ret; > } > > int > @@ -5535,6 +5718,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, > uint16_t queue_id, > struct rte_eth_burst_mode *mode) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5554,8 +5738,11 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, > uint16_t queue_id, > if (*dev->dev_ops->tx_burst_mode_get == NULL) > return -ENOTSUP; > memset(mode, 0, sizeof(*mode)); > - return eth_err(port_id, > - dev->dev_ops->tx_burst_mode_get(dev, queue_id, > mode)); > + ret = eth_err(port_id, dev->dev_ops->tx_burst_mode_get(dev, > queue_id, mode)); > + > + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); > + > + return ret; > } > > int > @@ -5563,6 +5750,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, > uint16_t queue_id, > struct rte_power_monitor_cond *pmc) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5581,8 +5769,11 @@ rte_eth_get_monitor_addr(uint16_t port_id, > uint16_t queue_id, > > if (*dev->dev_ops->get_monitor_addr == NULL) > return -ENOTSUP; > - return eth_err(port_id, > - dev->dev_ops->get_monitor_addr(dev->data- > >rx_queues[queue_id], pmc)); > + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data- > >rx_queues[queue_id], pmc)); > + > + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); > + > + return ret; > } > > int > @@ -5591,40 +5782,54 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, > uint32_t nb_mc_addr) > { > 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->set_mc_addr_list == NULL) > return -ENOTSUP; > - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, > - mc_addr_set, nb_mc_addr)); > + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, > mc_addr_set, nb_mc_addr)); > + > + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, > nb_mc_addr, ret); > + > + return ret; > } > > int > rte_eth_timesync_enable(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->timesync_enable == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); > + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); > + > + rte_eth_trace_timesync_enable(port_id, ret); > + > + return ret; > } > > int > rte_eth_timesync_disable(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->timesync_disable == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); > + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); > + > + rte_eth_trace_timesync_disable(port_id, ret); > + > + return ret; > } > > int > @@ -5632,6 +5837,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t > port_id, struct timespec *timestamp, > uint32_t flags) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5645,8 +5851,13 @@ rte_eth_timesync_read_rx_timestamp(uint16_t > port_id, struct timespec *timestamp, > > if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops- > >timesync_read_rx_timestamp) > - (dev, timestamp, flags)); > + > + ret = eth_err(port_id, (*dev->dev_ops- > >timesync_read_rx_timestamp) > + (dev, timestamp, flags)); > + > + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, > flags, ret); > + > + return ret; > } > > int > @@ -5654,6 +5865,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t > port_id, > struct timespec *timestamp) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5667,27 +5879,39 @@ rte_eth_timesync_read_tx_timestamp(uint16_t > port_id, > > if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops- > >timesync_read_tx_timestamp) > - (dev, timestamp)); > + > + ret = eth_err(port_id, (*dev->dev_ops- > >timesync_read_tx_timestamp) > + (dev, timestamp)); > + > + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, > ret); > + > + return ret; > + > } > > int > rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) > { > 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->timesync_adjust_time == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, > delta)); > + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, > delta)); > + > + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); > + > + return ret; > } > > int > rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5701,14 +5925,19 @@ rte_eth_timesync_read_time(uint16_t port_id, > struct timespec *timestamp) > > if (*dev->dev_ops->timesync_read_time == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, > - timestamp)); > + > + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, > timestamp)); > + > + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); > + > + return ret; > } > > int > rte_eth_timesync_write_time(uint16_t port_id, const struct timespec > *timestamp) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5722,14 +5951,18 @@ rte_eth_timesync_write_time(uint16_t port_id, > const struct timespec *timestamp) > > if (*dev->dev_ops->timesync_write_time == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, > - timestamp)); > + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, > timestamp)); > + > + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); > + > + return ret; > } > > int > rte_eth_read_clock(uint16_t port_id, uint64_t *clock) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5742,13 +5975,18 @@ rte_eth_read_clock(uint16_t port_id, uint64_t > *clock) > > if (*dev->dev_ops->read_clock == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); > + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); > + > + rte_eth_trace_read_clock(port_id, clock, ret); > + > + return ret; > } > > int > rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; > @@ -5762,26 +6000,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, > struct rte_dev_reg_info *info) > > if (*dev->dev_ops->get_reg == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); > + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); > + > + rte_ethdev_trace_get_reg_info(port_id, info, ret); > + > + return ret; > } > > int > rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); > + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); > + > + rte_ethdev_trace_get_eeprom_length(port_id, ret); > + > + return ret; > } > > int > rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; > @@ -5795,13 +6043,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, > struct rte_dev_eeprom_info *info) > > if (*dev->dev_ops->get_eeprom == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); > + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); > + > + rte_ethdev_trace_get_eeprom(port_id, info, ret); > + > + return ret; > } > > int > rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; > @@ -5815,7 +6068,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct > rte_dev_eeprom_info *info) > > if (*dev->dev_ops->set_eeprom == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); > + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); > + > + rte_ethdev_trace_set_eeprom(port_id, info, ret); > + > + return ret; > } > > int > @@ -5823,6 +6080,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, > struct rte_eth_dev_module_info *modinfo) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5836,7 +6094,11 @@ rte_eth_dev_get_module_info(uint16_t port_id, > > if (*dev->dev_ops->get_module_info == NULL) > return -ENOTSUP; > - return (*dev->dev_ops->get_module_info)(dev, modinfo); > + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); > + > + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); > + > + return ret; > } > > int > @@ -5844,6 +6106,7 @@ rte_eth_dev_get_module_eeprom(uint16_t > port_id, > struct rte_dev_eeprom_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]; > @@ -5871,7 +6134,11 @@ rte_eth_dev_get_module_eeprom(uint16_t > port_id, > > if (*dev->dev_ops->get_module_eeprom == NULL) > return -ENOTSUP; > - return (*dev->dev_ops->get_module_eeprom)(dev, info); > + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); > + > + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); > + > + return ret; > } > > int > @@ -5879,6 +6146,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, > struct rte_eth_dcb_info *dcb_info) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5894,7 +6162,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, > > if (*dev->dev_ops->get_dcb_info == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, > dcb_info)); > + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, > dcb_info)); > + > + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); > + > + return ret; > } > > static void > @@ -5930,6 +6202,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t > port_id, > if (nb_tx_desc != NULL) > eth_dev_adjust_nb_desc(nb_tx_desc, > &dev_info.tx_desc_lim); > > + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); > + > return 0; > } > > @@ -5938,6 +6212,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t > port_id, > struct rte_eth_hairpin_cap *cap) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5952,13 +6227,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t > port_id, > if (*dev->dev_ops->hairpin_cap_get == NULL) > return -ENOTSUP; > memset(cap, 0, sizeof(*cap)); > - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, > cap)); > + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); > + > + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); > + > + return ret; > } > > int > rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -5973,7 +6253,11 @@ rte_eth_dev_pool_ops_supported(uint16_t > port_id, const char *pool) > if (*dev->dev_ops->pool_ops_supported == NULL) > return 1; /* all pools are supported */ > > - return (*dev->dev_ops->pool_ops_supported)(dev, pool); > + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); > + > + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); > + > + return ret; > } > > static int > @@ -6263,19 +6547,25 @@ rte_eth_representor_info_get(uint16_t port_id, > struct rte_eth_representor_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]; > > if (*dev->dev_ops->representor_info_get == NULL) > return -ENOTSUP; > - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, > info)); > + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, > info)); > + > + rte_eth_trace_representor_info_get(port_id, info, ret); > + > + return ret; > } > > int > rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -6294,8 +6584,11 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, > uint64_t *features) > > if (*dev->dev_ops->rx_metadata_negotiate == NULL) > return -ENOTSUP; > - return eth_err(port_id, > - (*dev->dev_ops->rx_metadata_negotiate)(dev, > features)); > + ret = eth_err(port_id, (*dev->dev_ops->rx_metadata_negotiate)(dev, > features)); > + > + rte_eth_trace_rx_metadata_negotiate(port_id, features, *features, > ret); > + > + return ret; > } > > int > @@ -6303,6 +6596,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t > port_id, > struct rte_eth_ip_reassembly_params *reassembly_capa) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -6324,8 +6618,12 @@ rte_eth_ip_reassembly_capability_get(uint16_t > port_id, > return -ENOTSUP; > memset(reassembly_capa, 0, sizeof(struct > rte_eth_ip_reassembly_params)); > > - return eth_err(port_id, (*dev->dev_ops- > >ip_reassembly_capability_get) > + ret = eth_err(port_id, (*dev->dev_ops- > >ip_reassembly_capability_get) > (dev, reassembly_capa)); > + > + rte_eth_trace_ip_reassembly_capability_get(port_id, > reassembly_capa, ret); > + > + return ret; > } > > int > @@ -6333,6 +6631,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, > struct rte_eth_ip_reassembly_params *conf) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -6353,8 +6652,11 @@ rte_eth_ip_reassembly_conf_get(uint16_t > port_id, > if (*dev->dev_ops->ip_reassembly_conf_get == NULL) > return -ENOTSUP; > memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); > - return eth_err(port_id, > - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); > + ret = eth_err(port_id, (*dev->dev_ops- > >ip_reassembly_conf_get)(dev, conf)); > + > + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); > + > + return ret; > } > > int > @@ -6362,6 +6664,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, > const struct rte_eth_ip_reassembly_params *conf) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -6390,8 +6693,11 @@ rte_eth_ip_reassembly_conf_set(uint16_t > port_id, > > if (*dev->dev_ops->ip_reassembly_conf_set == NULL) > return -ENOTSUP; > - return eth_err(port_id, > - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); > + ret = eth_err(port_id, (*dev->dev_ops- > >ip_reassembly_conf_set)(dev, conf)); > + > + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); > + > + return ret; > } > > int > @@ -6489,8 +6795,10 @@ > rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t > *ptypes > return 0; > > for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { > - if (j < num) > + if (j < num) { > ptypes[j] = all_types[i]; > + > rte_eth_trace_buffer_split_get_supported_hdr_ptypes(port_id, j, > ptypes[j]); > + } > j++; > } > > diff --git a/lib/ethdev/rte_ethdev_cman.c b/lib/ethdev/rte_ethdev_cman.c > index 4a1bdd7bd0..c4d877d878 100644 > --- a/lib/ethdev/rte_ethdev_cman.c > +++ b/lib/ethdev/rte_ethdev_cman.c > @@ -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; > } > diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h > index bc3b3d2a1b..4c66834290 100644 > --- a/lib/ethdev/rte_ethdev_trace.h > +++ b/lib/ethdev/rte_ethdev_trace.h > @@ -373,6 +373,535 @@ 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, > + 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, 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_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_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_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_set, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, 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_configure, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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, > + 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, 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, 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, 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, > + 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_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, struct rte_ether_addr > *addr, > + uint32_t pool, int ret), > + uint16_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, struct rte_ether_addr > *addr), > + uint16_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, struct rte_ether_addr > *addr), > + uint16_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, 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, 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, > + 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, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int > epfd, > + int op, 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_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); > +) > + > +RTE_TRACE_POINT( > + 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); > +) > + > +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, > + 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, void *user_param, > + 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, void *user_param, > + 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_ethdev_trace_set_mc_addr_list, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_ethdev_trace_set_eeprom, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_hairpin_capability_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_rx_metadata_negotiate, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, > + 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_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_cman_config_init, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); > +) > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/ethdev/rte_ethdev_trace_fp.h > b/lib/ethdev/rte_ethdev_trace_fp.h > index 9f1d3d5a1b..3dbcc30c0a 100644 > --- a/lib/ethdev/rte_ethdev_trace_fp.h > +++ b/lib/ethdev/rte_ethdev_trace_fp.h > @@ -304,6 +304,348 @@ RTE_TRACE_POINT_FP( > rte_trace_point_emit_int(ret); > ) > > +RTE_TRACE_POINT_FP( > + 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_FP( > + 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_FP( > + rte_eth_trace_macaddr_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr > *mac_addr), > + uint16_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); > +) > + > +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); > +) > + > +RTE_TRACE_POINT_FP( > + 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_FP( > + rte_ethdev_trace_flow_ctrl_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > + rte_ethdev_trace_priority_flow_ctrl_queue_info_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_FP( > + rte_ethdev_trace_rss_reta_query, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > + rte_ethdev_trace_rss_hash_conf_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > + rte_eth_trace_fec_get, > + 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_ptr(fec_capa); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT_FP( > + 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_FP( > + rte_eth_trace_rx_queue_info_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + 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_FP( > + rte_eth_trace_tx_queue_info_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + 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_FP( > + rte_eth_trace_rx_burst_mode_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + 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_FP( > + rte_eth_trace_tx_burst_mode_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + 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_FP( > + rte_eth_trace_get_monitor_addr, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + 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_FP( > + rte_eth_trace_timesync_read_rx_timestamp, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_u64(timestamp->tv_sec); > + rte_trace_point_emit_u64(timestamp->tv_nsec); > + rte_trace_point_emit_u32(flags); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_timesync_read_tx_timestamp, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec > *timestamp, int ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(timestamp); > + rte_trace_point_emit_u64(timestamp->tv_sec); > + rte_trace_point_emit_u64(timestamp->tv_nsec); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_timesync_read_time, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *time, int > ret), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_ptr(time); > + rte_trace_point_emit_u64(time->tv_sec); > + rte_trace_point_emit_u64(time->tv_nsec); > + rte_trace_point_emit_int(ret); > +) > + > +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); > +) > + > +RTE_TRACE_POINT_FP( > + 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_u64(time->tv_sec); > + rte_trace_point_emit_u64(time->tv_nsec); > + rte_trace_point_emit_int(ret); > +) > + > +RTE_TRACE_POINT_FP( > + rte_eth_trace_read_clock, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > + rte_ethdev_trace_get_reg_info, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > + 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_FP( > + rte_ethdev_trace_get_eeprom, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > + rte_ethdev_trace_get_module_info, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_FP( > + rte_ethdev_trace_get_module_eeprom, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_FP( > + rte_ethdev_trace_get_dcb_info, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info > *dcb_info, > + int ret), > + uint16_t num_user_priorities = > RTE_ETH_DCB_NUM_USER_PRIORITIES; > + uint16_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_FP( > + 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_FP( > + rte_eth_trace_representor_info_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_FP( > + rte_eth_trace_ip_reassembly_conf_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_FP( > + 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_FP( > + rte_eth_trace_cman_info_get, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, > + 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_FP( > + 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); > +) > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > index c7ba2e3dc8..c7c6bcd42b 100644 > --- a/lib/ethdev/version.map > +++ b/lib/ethdev/version.map > @@ -300,36 +300,71 @@ EXPERIMENTAL { > rte_mtr_meter_profile_get; > > # added in 23.03 > + __rte_eth_trace_add_first_rx_callback; > + __rte_eth_trace_add_rx_callback; > + __rte_eth_trace_add_tx_callback; > __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_cman_config_get; > + __rte_eth_trace_cman_config_init; > + __rte_eth_trace_cman_config_set; > + __rte_eth_trace_cman_info_get; > + __rte_eth_trace_fec_get_capability; > + __rte_eth_trace_fec_get; > + __rte_eth_trace_fec_set; > __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_get_monitor_addr; > __rte_eth_trace_hairpin_bind; > __rte_eth_trace_hairpin_get_peer_ports; > __rte_eth_trace_hairpin_unbind; > + __rte_eth_trace_ip_reassembly_capability_get; > + __rte_eth_trace_ip_reassembly_conf_get; > + __rte_eth_trace_ip_reassembly_conf_set; > __rte_eth_trace_iterator_cleanup; > __rte_eth_trace_iterator_init; > __rte_eth_trace_iterator_next; > + __rte_eth_trace_led_off; > + __rte_eth_trace_led_on; > __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_macaddr_get; > + __rte_eth_trace_macaddrs_get; > __rte_eth_trace_promiscuous_disable; > __rte_eth_trace_promiscuous_enable; > __rte_eth_trace_promiscuous_get; > + __rte_eth_trace_remove_rx_callback; > + __rte_eth_trace_remove_tx_callback; > + __rte_eth_trace_representor_info_get; > + __rte_eth_trace_rx_avail_thresh_query; > + __rte_eth_trace_rx_avail_thresh_set; > + __rte_eth_trace_rx_burst_mode_get; > __rte_eth_trace_rx_hairpin_queue_setup; > + __rte_eth_trace_rx_metadata_negotiate; > + __rte_eth_trace_rx_queue_info_get; > + __rte_eth_trace_set_queue_rate_limit; > __rte_eth_trace_speed_bitflag; > __rte_eth_trace_stats_get; > __rte_eth_trace_stats_reset; > + __rte_eth_trace_timesync_adjust_time; > + __rte_eth_trace_timesync_disable; > + __rte_eth_trace_timesync_enable; > + __rte_eth_trace_timesync_read_rx_timestamp; > + __rte_eth_trace_timesync_read_time; > + __rte_eth_trace_timesync_read_tx_timestamp; > + __rte_eth_trace_timesync_write_time; > __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_burst_mode_get; > __rte_eth_trace_tx_done_cleanup; > __rte_eth_trace_tx_hairpin_queue_setup; > __rte_eth_trace_xstats_get; > @@ -338,32 +373,78 @@ EXPERIMENTAL { > __rte_eth_trace_xstats_get_names; > __rte_eth_trace_xstats_get_names_by_id; > __rte_eth_trace_xstats_reset; > + __rte_ethdev_trace_adjust_nb_rx_tx_desc; > + __rte_ethdev_trace_callback_register; > + __rte_ethdev_trace_callback_unregister; > __rte_ethdev_trace_capability_name; > + __rte_ethdev_trace_conf_get; > __rte_ethdev_trace_count_avail; > __rte_ethdev_trace_count_total; > + __rte_ethdev_trace_default_mac_addr_set; > + __rte_ethdev_trace_flow_ctrl_get; > + __rte_ethdev_trace_flow_ctrl_set; > __rte_ethdev_trace_fw_version_get; > + __rte_ethdev_trace_get_dcb_info; > + __rte_ethdev_trace_get_eeprom; > + __rte_ethdev_trace_get_eeprom_length; > + __rte_ethdev_trace_get_module_eeprom; > + __rte_ethdev_trace_get_module_info; > + __rte_ethdev_trace_get_mtu; > __rte_ethdev_trace_get_name_by_port; > __rte_ethdev_trace_get_port_by_name; > + __rte_ethdev_trace_get_reg_info; > __rte_ethdev_trace_get_sec_ctx; > + __rte_ethdev_trace_get_supported_ptypes; > + __rte_ethdev_trace_get_vlan_offload; > + __rte_ethdev_trace_hairpin_capability_get; > + __rte_ethdev_trace_info_get; > __rte_ethdev_trace_is_removed; > __rte_ethdev_trace_is_valid_port; > + __rte_ethdev_trace_mac_addr_add; > + __rte_ethdev_trace_mac_addr_remove; > __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_pool_ops_supported; > + __rte_ethdev_trace_priority_flow_ctrl_queue_configure; > + __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; > + __rte_ethdev_trace_priority_flow_ctrl_set; > __rte_ethdev_trace_reset; > + __rte_ethdev_trace_rss_hash_conf_get; > + __rte_ethdev_trace_rss_hash_update; > + __rte_ethdev_trace_rss_reta_query; > + __rte_ethdev_trace_rss_reta_update; > + __rte_ethdev_trace_rx_intr_ctl; > + __rte_ethdev_trace_rx_intr_ctl_q; > + __rte_ethdev_trace_rx_intr_ctl_q_get_fd; > + __rte_ethdev_trace_rx_intr_disable; > + __rte_ethdev_trace_rx_intr_enable; > __rte_ethdev_trace_rx_offload_name; > __rte_ethdev_trace_rx_queue_start; > __rte_ethdev_trace_rx_queue_stop; > + __rte_ethdev_trace_set_eeprom; > __rte_ethdev_trace_set_link_down; > __rte_ethdev_trace_set_link_up; > + __rte_ethdev_trace_set_mc_addr_list; > + __rte_ethdev_trace_set_mtu; > + __rte_ethdev_trace_set_ptypes; > __rte_ethdev_trace_set_rx_queue_stats_mapping; > __rte_ethdev_trace_set_tx_queue_stats_mapping; > + __rte_ethdev_trace_set_vlan_ether_type; > + __rte_ethdev_trace_set_vlan_offload; > + __rte_ethdev_trace_set_vlan_pvid; > + __rte_ethdev_trace_set_vlan_strip_on_queue; > __rte_ethdev_trace_socket_id; > __rte_ethdev_trace_tx_offload_name; > __rte_ethdev_trace_tx_queue_start; > __rte_ethdev_trace_tx_queue_stop; > + __rte_ethdev_trace_uc_all_hash_table_set; > + __rte_ethdev_trace_uc_hash_table_set; > + __rte_ethdev_trace_udp_tunnel_port_add; > + __rte_ethdev_trace_udp_tunnel_port_delete; > + __rte_ethdev_trace_vlan_filter; > }; > > INTERNAL { > -- > 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v5 3/6] ethdev: add trace points for remaining functions 2023-01-12 16:38 ` Sunil Kumar Kori @ 2023-01-13 6:31 ` Ankur Dwivedi 2023-01-13 8:11 ` Sunil Kumar Kori 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-13 6:31 UTC (permalink / raw) To: Sunil Kumar Kori, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb Hi Sunil, My comments are inline. >-----Original Message----- >From: Sunil Kumar Kori <skori@marvell.com> >Sent: Thursday, January 12, 2023 10:09 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; >orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; >humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; >qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; >shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; >chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; >shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; >john.miller@atomicrules.com; ajit.khaparde@broadcom.com; >somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran ><jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith >Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan ><srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; >rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; >liudongdong3@huawei.com; yisen.zhuang@huawei.com; >xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; >zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; >qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; >xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; >rosen.xu@intel.com; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; >Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Satha Koteswara Rao >Kottidi <skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara ><sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; jgrajcia@cisco.com; >mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> >Subject: RE: [PATCH v5 3/6] ethdev: add trace points for remaining functions > >> -----Original Message----- >> From: Ankur Dwivedi <adwivedi@marvell.com> >> Sent: Thursday, January 12, 2023 4:52 PM >> To: dev@dpdk.org >> Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; >> orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; >> humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; >> qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; >> shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; >> chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; >> shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; >> john.miller@atomicrules.com; ajit.khaparde@broadcom.com; >> somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran >> <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith >> Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan >> <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; >> rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; >> liudongdong3@huawei.com; yisen.zhuang@huawei.com; >> xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; >> zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; >> qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; >> xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; >> rosen.xu@intel.com; Nithin Kumar Dabilpuram >> <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda >> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi >> <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla >> <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >> Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >> viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; >> chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >> hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; >> apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >> Rasesh Mody <rmody@marvell.com>; Shahed Shaikh >> <shshaikh@marvell.com>; Devendra Singh Rawat >> <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >> jiawenwu@trustnetic.com; jianwang@trustnetic.com; >> jbehrens@vmware.com; maxime.coquelin@redhat.com; >> chenbo.xia@intel.com; steven.webster@windriver.com; >> matt.peters@windriver.com; bruce.richardson@intel.com; >> mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; >> cristian.dumitrescu@intel.com; jgrajcia@cisco.com; >> mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> >> Subject: [PATCH v5 3/6] ethdev: add trace points for remaining functions >> >> Adds trace points for remaining ethdev functions. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> --- >> 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(-) >> > >Why can't this patch be part of [PATCH v5 2/6] ? Combining this patch with PATCH v5 2/6 will make the combined patch large. There was a review comment in earlier version (v3) to split the patch. > >> diff --git a/lib/ethdev/ethdev_trace_points.c >> b/lib/ethdev/ethdev_trace_points.c >> index 4fea76e0ff..102a18fcc1 100644 >> --- a/lib/ethdev/ethdev_trace_points.c >> +++ b/lib/ethdev/ethdev_trace_points.c >> @@ -222,3 +222,255 @@ >> RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mappin >> g, >> >> 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_i >> nfo_get, >> + lib.ethdev.priority_flow_ctrl_queue_info_get) >> + >> +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_c >> onfigure, >> + 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_h >> dr_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) >> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c >> index 40897ad94d..60d2ab47ea 100644 >> --- a/lib/ethdev/rte_ethdev.c >> +++ b/lib/ethdev/rte_ethdev.c >> @@ -3539,6 +3539,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct >> rte_eth_dev_info *dev_info) >> >> dev_info->dev_flags = &dev->data->dev_flags; >> >> + rte_ethdev_trace_info_get(port_id, dev_info); >> + >> return 0; >> } >> >> @@ -3559,6 +3561,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct >> rte_eth_conf *dev_conf) >> >> memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct >> rte_eth_conf)); >> >> + rte_ethdev_trace_conf_get(port_id, dev_conf); >> + >> return 0; >> } >> >> @@ -3589,8 +3593,10 @@ rte_eth_dev_get_supported_ptypes(uint16_t >> port_id, uint32_t ptype_mask, >> >> for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) >> if (all_ptypes[i] & ptype_mask) { >> - if (j < num) >> + if (j < num) { >> ptypes[j] = all_ptypes[i]; >> + >> rte_ethdev_trace_get_supported_ptypes(port_id, j, num, ptypes[j]); >> + } >> j++; >> } >> >> @@ -3668,6 +3674,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t >> ptype_mask, >> if (ptype_mask & all_ptypes[i]) { >> if (j < num - 1) { >> set_ptypes[j] = all_ptypes[i]; >> + rte_ethdev_trace_set_ptypes(port_id, j, num, >> set_ptypes[j]); >> j++; >> continue; >> } >> @@ -3709,6 +3716,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct >> rte_ether_addr *ma, >> num = RTE_MIN(dev_info.max_mac_addrs, num); >> memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); >> >> + rte_eth_trace_macaddrs_get(port_id, num); >> + >> return num; >> } >> >> @@ -3729,6 +3738,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct >> rte_ether_addr *mac_addr) >> >> rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); >> >> + rte_eth_trace_macaddr_get(port_id, mac_addr); >> + >> return 0; >> } >> >> @@ -3747,6 +3758,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t >> *mtu) >> } >> >> *mtu = dev->data->mtu; >> + >> + rte_ethdev_trace_get_mtu(port_id, *mtu); >> + >> return 0; >> } >> >> @@ -3789,7 +3803,11 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t >> mtu) >> if (ret == 0) >> dev->data->mtu = mtu; >> >> - return eth_err(port_id, ret); >> + ret = eth_err(port_id, ret); >> + >> + rte_ethdev_trace_set_mtu(port_id, mtu, ret); >> + >> + return ret; >> } >> >> int >> @@ -3832,7 +3850,11 @@ rte_eth_dev_vlan_filter(uint16_t port_id, >> uint16_t vlan_id, int on) >> vfc->ids[vidx] &= ~RTE_BIT64(vbit); >> } >> >> - return eth_err(port_id, ret); >> + ret = eth_err(port_id, ret); >> + >> + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); >> + >> + return ret; >> } >> >> int >> @@ -3851,8 +3873,11 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t >> port_id, uint16_t rx_queue_id, >> >> if (*dev->dev_ops->vlan_strip_queue_set == NULL) >> return -ENOTSUP; >> + >> (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); >> >> + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, >> on); >> + >> return 0; >> } >> >> @@ -3862,14 +3887,18 @@ rte_eth_dev_set_vlan_ether_type(uint16_t >> port_id, >> uint16_t tpid) >> { >> 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->vlan_tpid_set == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, >> vlan_type, >> - tpid)); >> + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, >> vlan_type, tpid)); >> + >> + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); >> + >> + return ret; >> } >> >> int >> @@ -3961,7 +3990,11 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, >> int offload_mask) >> dev->data->dev_conf.rxmode.offloads = orig_offloads; >> } >> >> - return eth_err(port_id, ret); >> + ret = eth_err(port_id, ret); >> + >> + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); >> + >> + return ret; >> } >> >> int >> @@ -3987,6 +4020,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) >> if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) >> ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; >> >> + rte_ethdev_trace_get_vlan_offload(port_id, ret); >> + >> return ret; >> } >> >> @@ -3994,19 +4029,25 @@ int >> rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) >> { >> 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->vlan_pvid_set == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, >> on)); >> + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, >> on)); >> + >> + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4021,13 +4062,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, >> struct rte_eth_fc_conf *fc_conf) >> if (*dev->dev_ops->flow_ctrl_get == NULL) >> return -ENOTSUP; >> memset(fc_conf, 0, sizeof(*fc_conf)); >> - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, >> fc_conf)); >> + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); >> + >> + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4046,7 +4092,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, >> struct rte_eth_fc_conf *fc_conf) >> >> if (*dev->dev_ops->flow_ctrl_set == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, >> fc_conf)); >> + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); >> + >> + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); >> + >> + return ret; >> } >> >> int >> @@ -4054,6 +4104,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t >> port_id, >> struct rte_eth_pfc_conf *pfc_conf) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4071,9 +4122,14 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t >> port_id, >> } >> >> /* High water, low water validation are device specific */ >> - if (*dev->dev_ops->priority_flow_ctrl_set) >> - return eth_err(port_id, (*dev->dev_ops- >> >priority_flow_ctrl_set) >> - (dev, pfc_conf)); >> + if (*dev->dev_ops->priority_flow_ctrl_set) { >> + ret = eth_err(port_id, (*dev->dev_ops- >> >priority_flow_ctrl_set) >> + (dev, pfc_conf)); >> + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, >> ret); >> + >> + return ret; >> + } >> + >> return -ENOTSUP; >> } >> >> @@ -4132,6 +4188,7 @@ >> rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, >> struct rte_eth_pfc_queue_info *pfc_queue_info) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4142,9 +4199,13 @@ >> rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, >> return -EINVAL; >> } >> >> - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) >> - return eth_err(port_id, (*dev->dev_ops- >> >priority_flow_ctrl_queue_info_get) >> + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { >> + ret = eth_err(port_id, (*dev->dev_ops- >> >priority_flow_ctrl_queue_info_get) >> (dev, pfc_queue_info)); >> + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, >> pfc_queue_info, >> + ret); >> + return ret; >> + } >> return -ENOTSUP; >> } >> >> @@ -4213,10 +4274,16 @@ >> rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, >> return ret; >> } >> >> - if (*dev->dev_ops->priority_flow_ctrl_queue_config) >> - return eth_err(port_id, >> - (*dev->dev_ops- >> >priority_flow_ctrl_queue_config)( >> - dev, pfc_queue_conf)); >> + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { >> + ret = eth_err(port_id, >> + (*dev->dev_ops- >> >priority_flow_ctrl_queue_config)( >> + dev, pfc_queue_conf)); >> + >> rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, >> + >> pfc_queue_conf, >> + ret); >> + return ret; >> + } >> + >> return -ENOTSUP; >> } >> >> @@ -4308,8 +4375,12 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, >> >> if (*dev->dev_ops->reta_update == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, >> reta_conf, >> - reta_size)); >> + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, >> + reta_size)); >> + >> + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, >> ret); >> + >> + return ret; >> } >> >> int >> @@ -4337,8 +4408,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, >> >> if (*dev->dev_ops->reta_query == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, >> - reta_size)); >> + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, >> + reta_size)); >> + >> + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); >> + >> + return ret; >> } >> >> int >> @@ -4382,8 +4457,11 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, >> >> if (*dev->dev_ops->rss_hash_update == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, >> - rss_conf)); >> + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, >> rss_conf)); >> + >> + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); >> + >> + return ret; >> } >> >> int >> @@ -4391,6 +4469,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, >> struct rte_eth_rss_conf *rss_conf) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4404,8 +4483,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, >> >> if (*dev->dev_ops->rss_hash_conf_get == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, >> - rss_conf)); >> + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, >> + rss_conf)); >> + >> + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); >> + >> + return ret; >> } >> >> int >> @@ -4413,6 +4496,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t >> port_id, >> struct rte_eth_udp_tunnel *udp_tunnel) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4431,8 +4515,11 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t >> port_id, >> >> if (*dev->dev_ops->udp_tunnel_port_add == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops- >> >udp_tunnel_port_add)(dev, >> - udp_tunnel)); >> + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, >> udp_tunnel)); >> + >> + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); >> + >> + return ret; >> } >> >> int >> @@ -4440,6 +4527,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t >> port_id, >> struct rte_eth_udp_tunnel *udp_tunnel) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4458,34 +4546,47 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t >> port_id, >> >> if (*dev->dev_ops->udp_tunnel_port_del == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, >> - udp_tunnel)); >> + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, >> udp_tunnel)); >> + >> + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_led_on(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_led_on == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); >> + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); >> + >> + rte_eth_trace_led_on(port_id, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_led_off(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_led_off == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); >> + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); >> + >> + rte_eth_trace_led_off(port_id, ret); >> + >> + return ret; >> } >> >> int >> @@ -4510,6 +4611,8 @@ rte_eth_fec_get_capability(uint16_t port_id, >> return -ENOTSUP; >> ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, >> num); >> >> + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, >> ret); >> + >> return ret; >> } >> >> @@ -4517,6 +4620,7 @@ int >> rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4530,20 +4634,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t >> *fec_capa) >> >> if (*dev->dev_ops->fec_get == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); >> + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); >> + >> + rte_eth_trace_fec_get(port_id, fec_capa, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) >> { >> 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->fec_set == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); >> + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); >> + >> + rte_eth_trace_fec_set(port_id, fec_capa, ret); >> + >> + return ret; >> } >> >> /* >> @@ -4631,7 +4744,11 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, >> struct rte_ether_addr *addr, >> dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); >> } >> >> - return eth_err(port_id, ret); >> + ret = eth_err(port_id, ret); >> + >> + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); >> + >> + return ret; >> } >> >> int >> @@ -4671,6 +4788,8 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, >> struct rte_ether_addr *addr) >> /* reset pool bitmap */ >> dev->data->mac_pool_sel[index] = 0; >> >> + rte_ethdev_trace_mac_addr_remove(port_id, addr); >> + >> return 0; >> } >> >> @@ -4703,6 +4822,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t >> port_id, struct rte_ether_addr *addr) >> /* Update default address in NIC data structure */ >> rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); >> >> + rte_ethdev_trace_default_mac_addr_set(port_id, addr); >> + >> return 0; >> } >> >> @@ -4793,21 +4914,29 @@ rte_eth_dev_uc_hash_table_set(uint16_t >> port_id, struct rte_ether_addr *addr, >> &dev->data- >> >hash_mac_addrs[index]); >> } >> >> - return eth_err(port_id, ret); >> + ret = eth_err(port_id, ret); >> + >> + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) >> { >> 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->uc_all_hash_table_set == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops- >> >uc_all_hash_table_set)(dev, >> - on)); >> + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, >> on)); >> + >> + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); >> + >> + return ret; >> } >> >> int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, >> @@ -4843,14 +4972,18 @@ int rte_eth_set_queue_rate_limit(uint16_t >> port_id, uint16_t queue_idx, >> >> if (*dev->dev_ops->set_queue_rate_limit == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, >> - queue_idx, tx_rate)); >> + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, >> queue_idx, tx_rate)); >> + >> + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, >> ret); >> + >> + return ret; >> } >> >> int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, >> uint8_t avail_thresh) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4870,14 +5003,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t >> port_id, uint16_t queue_id, >> } >> if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops- >> >rx_queue_avail_thresh_set)(dev, >> - queue_id, >> avail_thresh)); >> + ret = eth_err(port_id, (*dev->dev_ops- >> >rx_queue_avail_thresh_set)(dev, queue_id, >> + >> avail_thresh)); >> + >> + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, >> ret); >> + >> + return ret; >> } >> >> int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, >> uint8_t *avail_thresh) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4889,8 +5027,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t >> port_id, uint16_t *queue_id, >> >> if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops- >> >rx_queue_avail_thresh_query)(dev, >> - queue_id, >> avail_thresh)); >> + ret = eth_err(port_id, (*dev->dev_ops- >> >rx_queue_avail_thresh_query)(dev, queue_id, >> + >> avail_thresh)); >> + >> + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); >> + >> + return ret; >> } >> >> RTE_INIT(eth_dev_init_fp_ops) >> @@ -4972,6 +5114,10 @@ rte_eth_dev_callback_register(uint16_t port_id, >> } while (++next_port <= last_port); >> >> rte_spinlock_unlock(ð_dev_cb_lock); >> + >> + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, >> next_port, >> + last_port); >> + >> return 0; >> } >> >> @@ -5033,6 +5179,9 @@ rte_eth_dev_callback_unregister(uint16_t port_id, >> } while (++next_port <= last_port); >> >> rte_spinlock_unlock(ð_dev_cb_lock); >> + >> + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, >> ret); >> + >> return ret; >> } >> >> @@ -5062,6 +5211,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, >> int op, void *data) >> for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { >> vec = rte_intr_vec_list_index_get(intr_handle, qid); >> rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); >> + >> + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); >> + >> if (rc && rc != -EEXIST) { >> RTE_ETHDEV_LOG(ERR, >> "p %u q %u Rx ctl error op %d epfd %d vec >> %u\n", >> @@ -5105,6 +5257,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t >> port_id, uint16_t queue_id) >> (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; >> fd = rte_intr_efds_index_get(intr_handle, efd_idx); >> >> + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); >> + >> return fd; >> } >> >> @@ -5138,6 +5292,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, >> uint16_t queue_id, >> >> vec = rte_intr_vec_list_index_get(intr_handle, queue_id); >> rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); >> + >> + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, >> rc); >> + >> if (rc && rc != -EEXIST) { >> RTE_ETHDEV_LOG(ERR, >> "p %u q %u Rx ctl error op %d epfd %d vec %u\n", >> @@ -5164,7 +5321,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, >> >> if (*dev->dev_ops->rx_queue_intr_enable == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops- >> >rx_queue_intr_enable)(dev, queue_id)); >> + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, >> queue_id)); >> + >> + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); >> + >> + return ret; >> } >> >> int >> @@ -5183,7 +5344,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, >> >> if (*dev->dev_ops->rx_queue_intr_disable == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops- >> >rx_queue_intr_disable)(dev, queue_id)); >> + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, >> queue_id)); >> + >> + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); >> + >> + return ret; >> } >> >> >> @@ -5241,6 +5406,8 @@ rte_eth_add_rx_callback(uint16_t port_id, >> uint16_t queue_id, >> } >> rte_spinlock_unlock(ð_dev_rx_cb_lock); >> >> + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, >> cb); >> + >> return cb; >> } >> >> @@ -5280,6 +5447,8 @@ rte_eth_add_first_rx_callback(uint16_t port_id, >> uint16_t queue_id, >> cb, __ATOMIC_RELEASE); >> rte_spinlock_unlock(ð_dev_rx_cb_lock); >> >> + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, >> user_param, cb); >> + >> return cb; >> } >> >> @@ -5339,6 +5508,8 @@ rte_eth_add_tx_callback(uint16_t port_id, >> uint16_t queue_id, >> } >> rte_spinlock_unlock(ð_dev_tx_cb_lock); >> >> + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, >> cb); >> + >> return cb; >> } >> >> @@ -5373,6 +5544,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, >> uint16_t queue_id, >> } >> rte_spinlock_unlock(ð_dev_rx_cb_lock); >> >> + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); >> + >> return ret; >> } >> >> @@ -5407,6 +5580,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, >> uint16_t queue_id, >> } >> rte_spinlock_unlock(ð_dev_tx_cb_lock); >> >> + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); >> + >> return ret; >> } >> >> @@ -5453,6 +5628,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, >> uint16_t queue_id, >> dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); >> qinfo->queue_state = dev->data->rx_queue_state[queue_id]; >> >> + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); >> + >> return 0; >> } >> >> @@ -5499,6 +5676,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, >> uint16_t queue_id, >> dev->dev_ops->txq_info_get(dev, queue_id, qinfo); >> qinfo->queue_state = dev->data->tx_queue_state[queue_id]; >> >> + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); >> + >> return 0; >> } >> >> @@ -5507,6 +5686,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, >> uint16_t queue_id, >> struct rte_eth_burst_mode *mode) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5526,8 +5706,11 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, >> uint16_t queue_id, >> if (*dev->dev_ops->rx_burst_mode_get == NULL) >> return -ENOTSUP; >> memset(mode, 0, sizeof(*mode)); >> - return eth_err(port_id, >> - dev->dev_ops->rx_burst_mode_get(dev, queue_id, >> mode)); >> + ret = eth_err(port_id, dev->dev_ops->rx_burst_mode_get(dev, >> queue_id, mode)); >> + >> + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); >> + >> + return ret; >> } >> >> int >> @@ -5535,6 +5718,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, >> uint16_t queue_id, >> struct rte_eth_burst_mode *mode) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5554,8 +5738,11 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, >> uint16_t queue_id, >> if (*dev->dev_ops->tx_burst_mode_get == NULL) >> return -ENOTSUP; >> memset(mode, 0, sizeof(*mode)); >> - return eth_err(port_id, >> - dev->dev_ops->tx_burst_mode_get(dev, queue_id, >> mode)); >> + ret = eth_err(port_id, dev->dev_ops->tx_burst_mode_get(dev, >> queue_id, mode)); >> + >> + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); >> + >> + return ret; >> } >> >> int >> @@ -5563,6 +5750,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, >> uint16_t queue_id, >> struct rte_power_monitor_cond *pmc) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5581,8 +5769,11 @@ rte_eth_get_monitor_addr(uint16_t port_id, >> uint16_t queue_id, >> >> if (*dev->dev_ops->get_monitor_addr == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, >> - dev->dev_ops->get_monitor_addr(dev->data- >> >rx_queues[queue_id], pmc)); >> + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data- >> >rx_queues[queue_id], pmc)); >> + >> + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); >> + >> + return ret; >> } >> >> int >> @@ -5591,40 +5782,54 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, >> uint32_t nb_mc_addr) >> { >> 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->set_mc_addr_list == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, >> - mc_addr_set, nb_mc_addr)); >> + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, >> mc_addr_set, nb_mc_addr)); >> + >> + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, >> nb_mc_addr, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_timesync_enable(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->timesync_enable == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); >> + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); >> + >> + rte_eth_trace_timesync_enable(port_id, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_timesync_disable(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->timesync_disable == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); >> + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); >> + >> + rte_eth_trace_timesync_disable(port_id, ret); >> + >> + return ret; >> } >> >> int >> @@ -5632,6 +5837,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t >> port_id, struct timespec *timestamp, >> uint32_t flags) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5645,8 +5851,13 @@ rte_eth_timesync_read_rx_timestamp(uint16_t >> port_id, struct timespec *timestamp, >> >> if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops- >> >timesync_read_rx_timestamp) >> - (dev, timestamp, flags)); >> + >> + ret = eth_err(port_id, (*dev->dev_ops- >> >timesync_read_rx_timestamp) >> + (dev, timestamp, flags)); >> + >> + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, >> flags, ret); >> + >> + return ret; >> } >> >> int >> @@ -5654,6 +5865,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t >> port_id, >> struct timespec *timestamp) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5667,27 +5879,39 @@ rte_eth_timesync_read_tx_timestamp(uint16_t >> port_id, >> >> if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops- >> >timesync_read_tx_timestamp) >> - (dev, timestamp)); >> + >> + ret = eth_err(port_id, (*dev->dev_ops- >> >timesync_read_tx_timestamp) >> + (dev, timestamp)); >> + >> + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, >> ret); >> + >> + return ret; >> + >> } >> >> int >> rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) >> { >> 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->timesync_adjust_time == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, >> delta)); >> + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, >> delta)); >> + >> + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5701,14 +5925,19 @@ rte_eth_timesync_read_time(uint16_t port_id, >> struct timespec *timestamp) >> >> if (*dev->dev_ops->timesync_read_time == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, >> - timestamp)); >> + >> + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, >> timestamp)); >> + >> + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_timesync_write_time(uint16_t port_id, const struct timespec >> *timestamp) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5722,14 +5951,18 @@ rte_eth_timesync_write_time(uint16_t port_id, >> const struct timespec *timestamp) >> >> if (*dev->dev_ops->timesync_write_time == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, >> - timestamp)); >> + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, >> timestamp)); >> + >> + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_read_clock(uint16_t port_id, uint64_t *clock) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5742,13 +5975,18 @@ rte_eth_read_clock(uint16_t port_id, uint64_t >> *clock) >> >> if (*dev->dev_ops->read_clock == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); >> + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); >> + >> + rte_eth_trace_read_clock(port_id, clock, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; >> @@ -5762,26 +6000,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, >> struct rte_dev_reg_info *info) >> >> if (*dev->dev_ops->get_reg == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); >> + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); >> + >> + rte_ethdev_trace_get_reg_info(port_id, info, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); >> + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); >> + >> + rte_ethdev_trace_get_eeprom_length(port_id, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; >> @@ -5795,13 +6043,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, >> struct rte_dev_eeprom_info *info) >> >> if (*dev->dev_ops->get_eeprom == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); >> + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); >> + >> + rte_ethdev_trace_get_eeprom(port_id, info, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; >> @@ -5815,7 +6068,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct >> rte_dev_eeprom_info *info) >> >> if (*dev->dev_ops->set_eeprom == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); >> + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); >> + >> + rte_ethdev_trace_set_eeprom(port_id, info, ret); >> + >> + return ret; >> } >> >> int >> @@ -5823,6 +6080,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, >> struct rte_eth_dev_module_info *modinfo) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5836,7 +6094,11 @@ rte_eth_dev_get_module_info(uint16_t port_id, >> >> if (*dev->dev_ops->get_module_info == NULL) >> return -ENOTSUP; >> - return (*dev->dev_ops->get_module_info)(dev, modinfo); >> + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); >> + >> + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); >> + >> + return ret; >> } >> >> int >> @@ -5844,6 +6106,7 @@ rte_eth_dev_get_module_eeprom(uint16_t >> port_id, >> struct rte_dev_eeprom_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]; >> @@ -5871,7 +6134,11 @@ rte_eth_dev_get_module_eeprom(uint16_t >> port_id, >> >> if (*dev->dev_ops->get_module_eeprom == NULL) >> return -ENOTSUP; >> - return (*dev->dev_ops->get_module_eeprom)(dev, info); >> + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); >> + >> + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); >> + >> + return ret; >> } >> >> int >> @@ -5879,6 +6146,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, >> struct rte_eth_dcb_info *dcb_info) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5894,7 +6162,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, >> >> if (*dev->dev_ops->get_dcb_info == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, >> dcb_info)); >> + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, >> dcb_info)); >> + >> + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); >> + >> + return ret; >> } >> >> static void >> @@ -5930,6 +6202,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t >> port_id, >> if (nb_tx_desc != NULL) >> eth_dev_adjust_nb_desc(nb_tx_desc, >> &dev_info.tx_desc_lim); >> >> + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); >> + >> return 0; >> } >> >> @@ -5938,6 +6212,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t >> port_id, >> struct rte_eth_hairpin_cap *cap) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5952,13 +6227,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t >> port_id, >> if (*dev->dev_ops->hairpin_cap_get == NULL) >> return -ENOTSUP; >> memset(cap, 0, sizeof(*cap)); >> - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, >> cap)); >> + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); >> + >> + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -5973,7 +6253,11 @@ rte_eth_dev_pool_ops_supported(uint16_t >> port_id, const char *pool) >> if (*dev->dev_ops->pool_ops_supported == NULL) >> return 1; /* all pools are supported */ >> >> - return (*dev->dev_ops->pool_ops_supported)(dev, pool); >> + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); >> + >> + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); >> + >> + return ret; >> } >> >> static int >> @@ -6263,19 +6547,25 @@ rte_eth_representor_info_get(uint16_t port_id, >> struct rte_eth_representor_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]; >> >> if (*dev->dev_ops->representor_info_get == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, >> info)); >> + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, >> info)); >> + >> + rte_eth_trace_representor_info_get(port_id, info, ret); >> + >> + return ret; >> } >> >> int >> rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -6294,8 +6584,11 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, >> uint64_t *features) >> >> if (*dev->dev_ops->rx_metadata_negotiate == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, >> - (*dev->dev_ops->rx_metadata_negotiate)(dev, >> features)); >> + ret = eth_err(port_id, (*dev->dev_ops->rx_metadata_negotiate)(dev, >> features)); >> + >> + rte_eth_trace_rx_metadata_negotiate(port_id, features, *features, >> ret); >> + >> + return ret; >> } >> >> int >> @@ -6303,6 +6596,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t >> port_id, >> struct rte_eth_ip_reassembly_params *reassembly_capa) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -6324,8 +6618,12 @@ rte_eth_ip_reassembly_capability_get(uint16_t >> port_id, >> return -ENOTSUP; >> memset(reassembly_capa, 0, sizeof(struct >> rte_eth_ip_reassembly_params)); >> >> - return eth_err(port_id, (*dev->dev_ops- >> >ip_reassembly_capability_get) >> + ret = eth_err(port_id, (*dev->dev_ops- >> >ip_reassembly_capability_get) >> (dev, reassembly_capa)); >> + >> + rte_eth_trace_ip_reassembly_capability_get(port_id, >> reassembly_capa, ret); >> + >> + return ret; >> } >> >> int >> @@ -6333,6 +6631,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, >> struct rte_eth_ip_reassembly_params *conf) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -6353,8 +6652,11 @@ rte_eth_ip_reassembly_conf_get(uint16_t >> port_id, >> if (*dev->dev_ops->ip_reassembly_conf_get == NULL) >> return -ENOTSUP; >> memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); >> - return eth_err(port_id, >> - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); >> + ret = eth_err(port_id, (*dev->dev_ops- >> >ip_reassembly_conf_get)(dev, conf)); >> + >> + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); >> + >> + return ret; >> } >> >> int >> @@ -6362,6 +6664,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, >> const struct rte_eth_ip_reassembly_params *conf) >> { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -6390,8 +6693,11 @@ rte_eth_ip_reassembly_conf_set(uint16_t >> port_id, >> >> if (*dev->dev_ops->ip_reassembly_conf_set == NULL) >> return -ENOTSUP; >> - return eth_err(port_id, >> - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); >> + ret = eth_err(port_id, (*dev->dev_ops- >> >ip_reassembly_conf_set)(dev, conf)); >> + >> + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); >> + >> + return ret; >> } >> >> int >> @@ -6489,8 +6795,10 @@ >> rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t >> *ptypes >> return 0; >> >> for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { >> - if (j < num) >> + if (j < num) { >> ptypes[j] = all_types[i]; >> + >> rte_eth_trace_buffer_split_get_supported_hdr_ptypes(port_id, j, >> ptypes[j]); >> + } >> j++; >> } >> >> diff --git a/lib/ethdev/rte_ethdev_cman.c b/lib/ethdev/rte_ethdev_cman.c >> index 4a1bdd7bd0..c4d877d878 100644 >> --- a/lib/ethdev/rte_ethdev_cman.c >> +++ b/lib/ethdev/rte_ethdev_cman.c >> @@ -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; >> } >> diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h >> index bc3b3d2a1b..4c66834290 100644 >> --- a/lib/ethdev/rte_ethdev_trace.h >> +++ b/lib/ethdev/rte_ethdev_trace.h >> @@ -373,6 +373,535 @@ 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, >> + 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, 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_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_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_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_set, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, 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_configure, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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, >> + 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, 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, 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, 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, >> + 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_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, struct rte_ether_addr >> *addr, >> + uint32_t pool, int ret), >> + uint16_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, struct rte_ether_addr >> *addr), >> + uint16_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, struct rte_ether_addr >> *addr), >> + uint16_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, 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, 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, >> + 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, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int >> epfd, >> + int op, 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_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); >> +) >> + >> +RTE_TRACE_POINT( >> + 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); >> +) >> + >> +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, >> + 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, void *user_param, >> + 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, void *user_param, >> + 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_ethdev_trace_set_mc_addr_list, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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_ethdev_trace_set_eeprom, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_hairpin_capability_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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_rx_metadata_negotiate, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, >> + 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_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_cman_config_init, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); >> +) >> + >> #ifdef __cplusplus >> } >> #endif >> diff --git a/lib/ethdev/rte_ethdev_trace_fp.h >> b/lib/ethdev/rte_ethdev_trace_fp.h >> index 9f1d3d5a1b..3dbcc30c0a 100644 >> --- a/lib/ethdev/rte_ethdev_trace_fp.h >> +++ b/lib/ethdev/rte_ethdev_trace_fp.h >> @@ -304,6 +304,348 @@ RTE_TRACE_POINT_FP( >> rte_trace_point_emit_int(ret); >> ) >> >> +RTE_TRACE_POINT_FP( >> + 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_FP( >> + 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_FP( >> + rte_eth_trace_macaddr_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr >> *mac_addr), >> + uint16_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); >> +) >> + >> +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); >> +) >> + >> +RTE_TRACE_POINT_FP( >> + 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_FP( >> + rte_ethdev_trace_flow_ctrl_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( >> + rte_ethdev_trace_priority_flow_ctrl_queue_info_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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_FP( >> + rte_ethdev_trace_rss_reta_query, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( >> + rte_ethdev_trace_rss_hash_conf_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( >> + rte_eth_trace_fec_get, >> + 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_ptr(fec_capa); >> + rte_trace_point_emit_int(ret); >> +) >> + >> +RTE_TRACE_POINT_FP( >> + 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_FP( >> + rte_eth_trace_rx_queue_info_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >> + 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_FP( >> + rte_eth_trace_tx_queue_info_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >> + 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_FP( >> + rte_eth_trace_rx_burst_mode_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >> + 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_FP( >> + rte_eth_trace_tx_burst_mode_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >> + 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_FP( >> + rte_eth_trace_get_monitor_addr, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, >> + 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_FP( >> + rte_eth_trace_timesync_read_rx_timestamp, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_u64(timestamp->tv_sec); >> + rte_trace_point_emit_u64(timestamp->tv_nsec); >> + rte_trace_point_emit_u32(flags); >> + rte_trace_point_emit_int(ret); >> +) >> + >> +RTE_TRACE_POINT_FP( >> + rte_eth_trace_timesync_read_tx_timestamp, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec >> *timestamp, int ret), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(timestamp); >> + rte_trace_point_emit_u64(timestamp->tv_sec); >> + rte_trace_point_emit_u64(timestamp->tv_nsec); >> + rte_trace_point_emit_int(ret); >> +) >> + >> +RTE_TRACE_POINT_FP( >> + rte_eth_trace_timesync_read_time, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *time, int >> ret), >> + rte_trace_point_emit_u16(port_id); >> + rte_trace_point_emit_ptr(time); >> + rte_trace_point_emit_u64(time->tv_sec); >> + rte_trace_point_emit_u64(time->tv_nsec); >> + rte_trace_point_emit_int(ret); >> +) >> + >> +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); >> +) >> + >> +RTE_TRACE_POINT_FP( >> + 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_u64(time->tv_sec); >> + rte_trace_point_emit_u64(time->tv_nsec); >> + rte_trace_point_emit_int(ret); >> +) >> + >> +RTE_TRACE_POINT_FP( >> + rte_eth_trace_read_clock, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( >> + rte_ethdev_trace_get_reg_info, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( >> + 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_FP( >> + rte_ethdev_trace_get_eeprom, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( >> + rte_ethdev_trace_get_module_info, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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_FP( >> + rte_ethdev_trace_get_module_eeprom, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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_FP( >> + rte_ethdev_trace_get_dcb_info, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info >> *dcb_info, >> + int ret), >> + uint16_t num_user_priorities = >> RTE_ETH_DCB_NUM_USER_PRIORITIES; >> + uint16_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_FP( >> + 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_FP( >> + rte_eth_trace_representor_info_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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_FP( >> + rte_eth_trace_ip_reassembly_conf_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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_FP( >> + 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_FP( >> + rte_eth_trace_cman_info_get, >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, >> + 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_FP( >> + 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); >> +) >> + >> #ifdef __cplusplus >> } >> #endif >> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map >> index c7ba2e3dc8..c7c6bcd42b 100644 >> --- a/lib/ethdev/version.map >> +++ b/lib/ethdev/version.map >> @@ -300,36 +300,71 @@ EXPERIMENTAL { >> rte_mtr_meter_profile_get; >> >> # added in 23.03 >> + __rte_eth_trace_add_first_rx_callback; >> + __rte_eth_trace_add_rx_callback; >> + __rte_eth_trace_add_tx_callback; >> __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_cman_config_get; >> + __rte_eth_trace_cman_config_init; >> + __rte_eth_trace_cman_config_set; >> + __rte_eth_trace_cman_info_get; >> + __rte_eth_trace_fec_get_capability; >> + __rte_eth_trace_fec_get; >> + __rte_eth_trace_fec_set; >> __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_get_monitor_addr; >> __rte_eth_trace_hairpin_bind; >> __rte_eth_trace_hairpin_get_peer_ports; >> __rte_eth_trace_hairpin_unbind; >> + __rte_eth_trace_ip_reassembly_capability_get; >> + __rte_eth_trace_ip_reassembly_conf_get; >> + __rte_eth_trace_ip_reassembly_conf_set; >> __rte_eth_trace_iterator_cleanup; >> __rte_eth_trace_iterator_init; >> __rte_eth_trace_iterator_next; >> + __rte_eth_trace_led_off; >> + __rte_eth_trace_led_on; >> __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_macaddr_get; >> + __rte_eth_trace_macaddrs_get; >> __rte_eth_trace_promiscuous_disable; >> __rte_eth_trace_promiscuous_enable; >> __rte_eth_trace_promiscuous_get; >> + __rte_eth_trace_remove_rx_callback; >> + __rte_eth_trace_remove_tx_callback; >> + __rte_eth_trace_representor_info_get; >> + __rte_eth_trace_rx_avail_thresh_query; >> + __rte_eth_trace_rx_avail_thresh_set; >> + __rte_eth_trace_rx_burst_mode_get; >> __rte_eth_trace_rx_hairpin_queue_setup; >> + __rte_eth_trace_rx_metadata_negotiate; >> + __rte_eth_trace_rx_queue_info_get; >> + __rte_eth_trace_set_queue_rate_limit; >> __rte_eth_trace_speed_bitflag; >> __rte_eth_trace_stats_get; >> __rte_eth_trace_stats_reset; >> + __rte_eth_trace_timesync_adjust_time; >> + __rte_eth_trace_timesync_disable; >> + __rte_eth_trace_timesync_enable; >> + __rte_eth_trace_timesync_read_rx_timestamp; >> + __rte_eth_trace_timesync_read_time; >> + __rte_eth_trace_timesync_read_tx_timestamp; >> + __rte_eth_trace_timesync_write_time; >> __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_burst_mode_get; >> __rte_eth_trace_tx_done_cleanup; >> __rte_eth_trace_tx_hairpin_queue_setup; >> __rte_eth_trace_xstats_get; >> @@ -338,32 +373,78 @@ EXPERIMENTAL { >> __rte_eth_trace_xstats_get_names; >> __rte_eth_trace_xstats_get_names_by_id; >> __rte_eth_trace_xstats_reset; >> + __rte_ethdev_trace_adjust_nb_rx_tx_desc; >> + __rte_ethdev_trace_callback_register; >> + __rte_ethdev_trace_callback_unregister; >> __rte_ethdev_trace_capability_name; >> + __rte_ethdev_trace_conf_get; >> __rte_ethdev_trace_count_avail; >> __rte_ethdev_trace_count_total; >> + __rte_ethdev_trace_default_mac_addr_set; >> + __rte_ethdev_trace_flow_ctrl_get; >> + __rte_ethdev_trace_flow_ctrl_set; >> __rte_ethdev_trace_fw_version_get; >> + __rte_ethdev_trace_get_dcb_info; >> + __rte_ethdev_trace_get_eeprom; >> + __rte_ethdev_trace_get_eeprom_length; >> + __rte_ethdev_trace_get_module_eeprom; >> + __rte_ethdev_trace_get_module_info; >> + __rte_ethdev_trace_get_mtu; >> __rte_ethdev_trace_get_name_by_port; >> __rte_ethdev_trace_get_port_by_name; >> + __rte_ethdev_trace_get_reg_info; >> __rte_ethdev_trace_get_sec_ctx; >> + __rte_ethdev_trace_get_supported_ptypes; >> + __rte_ethdev_trace_get_vlan_offload; >> + __rte_ethdev_trace_hairpin_capability_get; >> + __rte_ethdev_trace_info_get; >> __rte_ethdev_trace_is_removed; >> __rte_ethdev_trace_is_valid_port; >> + __rte_ethdev_trace_mac_addr_add; >> + __rte_ethdev_trace_mac_addr_remove; >> __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_pool_ops_supported; >> + __rte_ethdev_trace_priority_flow_ctrl_queue_configure; >> + __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; >> + __rte_ethdev_trace_priority_flow_ctrl_set; >> __rte_ethdev_trace_reset; >> + __rte_ethdev_trace_rss_hash_conf_get; >> + __rte_ethdev_trace_rss_hash_update; >> + __rte_ethdev_trace_rss_reta_query; >> + __rte_ethdev_trace_rss_reta_update; >> + __rte_ethdev_trace_rx_intr_ctl; >> + __rte_ethdev_trace_rx_intr_ctl_q; >> + __rte_ethdev_trace_rx_intr_ctl_q_get_fd; >> + __rte_ethdev_trace_rx_intr_disable; >> + __rte_ethdev_trace_rx_intr_enable; >> __rte_ethdev_trace_rx_offload_name; >> __rte_ethdev_trace_rx_queue_start; >> __rte_ethdev_trace_rx_queue_stop; >> + __rte_ethdev_trace_set_eeprom; >> __rte_ethdev_trace_set_link_down; >> __rte_ethdev_trace_set_link_up; >> + __rte_ethdev_trace_set_mc_addr_list; >> + __rte_ethdev_trace_set_mtu; >> + __rte_ethdev_trace_set_ptypes; >> __rte_ethdev_trace_set_rx_queue_stats_mapping; >> __rte_ethdev_trace_set_tx_queue_stats_mapping; >> + __rte_ethdev_trace_set_vlan_ether_type; >> + __rte_ethdev_trace_set_vlan_offload; >> + __rte_ethdev_trace_set_vlan_pvid; >> + __rte_ethdev_trace_set_vlan_strip_on_queue; >> __rte_ethdev_trace_socket_id; >> __rte_ethdev_trace_tx_offload_name; >> __rte_ethdev_trace_tx_queue_start; >> __rte_ethdev_trace_tx_queue_stop; >> + __rte_ethdev_trace_uc_all_hash_table_set; >> + __rte_ethdev_trace_uc_hash_table_set; >> + __rte_ethdev_trace_udp_tunnel_port_add; >> + __rte_ethdev_trace_udp_tunnel_port_delete; >> + __rte_ethdev_trace_vlan_filter; >> }; >> >> INTERNAL { >> -- >> 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v5 3/6] ethdev: add trace points for remaining functions 2023-01-13 6:31 ` Ankur Dwivedi @ 2023-01-13 8:11 ` Sunil Kumar Kori 0 siblings, 0 replies; 172+ messages in thread From: Sunil Kumar Kori @ 2023-01-13 8:11 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Friday, January 13, 2023 12:01 PM > To: Sunil Kumar Kori <skori@marvell.com>; dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Satha Koteswara Rao Kottidi > <skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; > zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; > Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara > <sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; > longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; > niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; > sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; > sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody > <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra > Singh Rawat <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; > mb@smartsharesystems.com > Subject: RE: [PATCH v5 3/6] ethdev: add trace points for remaining functions > > Hi Sunil, > > My comments are inline. > > >-----Original Message----- > >From: Sunil Kumar Kori <skori@marvell.com> > >Sent: Thursday, January 12, 2023 10:09 PM > >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org > >Cc: thomas@monjalon.net; david.marchand@redhat.com; > mdr@ashroe.eu; > >orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > >humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > >qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > >shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > >chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > >shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > >john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > >somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > ><jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > >Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > ><srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > >rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > >liudongdong3@huawei.com; yisen.zhuang@huawei.com; > >xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > >zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > >qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > >xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > >rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; > >Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Satha Koteswara > Rao > >Kottidi <skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; > >zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; > >Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara > ><sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; > >longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; > >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; > >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; > >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody > ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; > Devendra > >Singh Rawat <dsinghrawat@marvell.com>; > andrew.rybchenko@oktetlabs.ru; > >jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; > >maxime.coquelin@redhat.com; chenbo.xia@intel.com; > >steven.webster@windriver.com; matt.peters@windriver.com; > >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; > >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; > jgrajcia@cisco.com; > >mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > >Subject: RE: [PATCH v5 3/6] ethdev: add trace points for remaining functions > > > >> -----Original Message----- > >> From: Ankur Dwivedi <adwivedi@marvell.com> > >> Sent: Thursday, January 12, 2023 4:52 PM > >> To: dev@dpdk.org > >> Cc: thomas@monjalon.net; david.marchand@redhat.com; > mdr@ashroe.eu; > >> orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > >> humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > >> qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > >> shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > >> chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > >> shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > >> john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > >> somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > >> <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > >> Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > >> <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > >> rahul.lakkireddy@chelsio.com; johndale@cisco.com; > hyonkim@cisco.com; > >> liudongdong3@huawei.com; yisen.zhuang@huawei.com; > >> xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > >> zhouguoyang@huawei.com; simei.su@intel.com; > wenjun1.wu@intel.com; > >> qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > >> xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > >> rosen.xu@intel.com; Nithin Kumar Dabilpuram > >> <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > >> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; > Satha > >> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi > >> <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla > >> <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; > >> Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; > >> viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > >> chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > >> hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; > g.singh@nxp.com; > >> apeksha.gupta@nxp.com; sachin.saxena@nxp.com; > aboyer@pensando.io; > >> Rasesh Mody <rmody@marvell.com>; Shahed Shaikh > >> <shshaikh@marvell.com>; Devendra Singh Rawat > >> <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > >> jiawenwu@trustnetic.com; jianwang@trustnetic.com; > >> jbehrens@vmware.com; maxime.coquelin@redhat.com; > >> chenbo.xia@intel.com; steven.webster@windriver.com; > >> matt.peters@windriver.com; bruce.richardson@intel.com; > >> mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > >> cristian.dumitrescu@intel.com; jgrajcia@cisco.com; > >> mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > >> Subject: [PATCH v5 3/6] ethdev: add trace points for remaining functions > >> > >> Adds trace points for remaining ethdev functions. > >> > >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > >> --- > >> 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(-) > >> > > > >Why can't this patch be part of [PATCH v5 2/6] ? > > Combining this patch with PATCH v5 2/6 will make the combined patch large. > There was a review comment in earlier version (v3) to split the patch. > > Got it. So I would request you to rephrase the subject "for remaining functions". > >> diff --git a/lib/ethdev/ethdev_trace_points.c > >> b/lib/ethdev/ethdev_trace_points.c > >> index 4fea76e0ff..102a18fcc1 100644 > >> --- a/lib/ethdev/ethdev_trace_points.c > >> +++ b/lib/ethdev/ethdev_trace_points.c > >> @@ -222,3 +222,255 @@ > >> > RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mappin > >> g, > >> > >> 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_i > >> nfo_get, > >> + lib.ethdev.priority_flow_ctrl_queue_info_get) > >> + > >> > +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_priority_flow_ctrl_queue_c > >> onfigure, > >> + 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_h > >> dr_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) > >> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > >> index 40897ad94d..60d2ab47ea 100644 > >> --- a/lib/ethdev/rte_ethdev.c > >> +++ b/lib/ethdev/rte_ethdev.c > >> @@ -3539,6 +3539,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct > >> rte_eth_dev_info *dev_info) > >> > >> dev_info->dev_flags = &dev->data->dev_flags; > >> > >> + rte_ethdev_trace_info_get(port_id, dev_info); > >> + > >> return 0; > >> } > >> > >> @@ -3559,6 +3561,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct > >> rte_eth_conf *dev_conf) > >> > >> memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct > >> rte_eth_conf)); > >> > >> + rte_ethdev_trace_conf_get(port_id, dev_conf); > >> + > >> return 0; > >> } > >> > >> @@ -3589,8 +3593,10 @@ rte_eth_dev_get_supported_ptypes(uint16_t > >> port_id, uint32_t ptype_mask, > >> > >> for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) > >> if (all_ptypes[i] & ptype_mask) { > >> - if (j < num) > >> + if (j < num) { > >> ptypes[j] = all_ptypes[i]; > >> + > >> rte_ethdev_trace_get_supported_ptypes(port_id, j, num, ptypes[j]); > >> + } > >> j++; > >> } > >> > >> @@ -3668,6 +3674,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, > uint32_t > >> ptype_mask, > >> if (ptype_mask & all_ptypes[i]) { > >> if (j < num - 1) { > >> set_ptypes[j] = all_ptypes[i]; > >> + rte_ethdev_trace_set_ptypes(port_id, j, num, > >> set_ptypes[j]); > >> j++; > >> continue; > >> } > >> @@ -3709,6 +3716,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct > >> rte_ether_addr *ma, > >> num = RTE_MIN(dev_info.max_mac_addrs, num); > >> memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); > >> > >> + rte_eth_trace_macaddrs_get(port_id, num); > >> + > >> return num; > >> } > >> > >> @@ -3729,6 +3738,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct > >> rte_ether_addr *mac_addr) > >> > >> rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); > >> > >> + rte_eth_trace_macaddr_get(port_id, mac_addr); > >> + > >> return 0; > >> } > >> > >> @@ -3747,6 +3758,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, > uint16_t > >> *mtu) > >> } > >> > >> *mtu = dev->data->mtu; > >> + > >> + rte_ethdev_trace_get_mtu(port_id, *mtu); > >> + > >> return 0; > >> } > >> > >> @@ -3789,7 +3803,11 @@ rte_eth_dev_set_mtu(uint16_t port_id, > uint16_t > >> mtu) > >> if (ret == 0) > >> dev->data->mtu = mtu; > >> > >> - return eth_err(port_id, ret); > >> + ret = eth_err(port_id, ret); > >> + > >> + rte_ethdev_trace_set_mtu(port_id, mtu, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -3832,7 +3850,11 @@ rte_eth_dev_vlan_filter(uint16_t port_id, > >> uint16_t vlan_id, int on) > >> vfc->ids[vidx] &= ~RTE_BIT64(vbit); > >> } > >> > >> - return eth_err(port_id, ret); > >> + ret = eth_err(port_id, ret); > >> + > >> + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -3851,8 +3873,11 @@ > rte_eth_dev_set_vlan_strip_on_queue(uint16_t > >> port_id, uint16_t rx_queue_id, > >> > >> if (*dev->dev_ops->vlan_strip_queue_set == NULL) > >> return -ENOTSUP; > >> + > >> (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); > >> > >> + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, > >> on); > >> + > >> return 0; > >> } > >> > >> @@ -3862,14 +3887,18 @@ rte_eth_dev_set_vlan_ether_type(uint16_t > >> port_id, > >> uint16_t tpid) > >> { > >> 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->vlan_tpid_set == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, > >> vlan_type, > >> - tpid)); > >> + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, > >> vlan_type, tpid)); > >> + > >> + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -3961,7 +3990,11 @@ rte_eth_dev_set_vlan_offload(uint16_t > port_id, > >> int offload_mask) > >> dev->data->dev_conf.rxmode.offloads = orig_offloads; > >> } > >> > >> - return eth_err(port_id, ret); > >> + ret = eth_err(port_id, ret); > >> + > >> + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -3987,6 +4020,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) > >> if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) > >> ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; > >> > >> + rte_ethdev_trace_get_vlan_offload(port_id, ret); > >> + > >> return ret; > >> } > >> > >> @@ -3994,19 +4029,25 @@ int > >> rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) > >> { > >> 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->vlan_pvid_set == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, > >> on)); > >> + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, > >> on)); > >> + > >> + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf > *fc_conf) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -4021,13 +4062,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, > >> struct rte_eth_fc_conf *fc_conf) > >> if (*dev->dev_ops->flow_ctrl_get == NULL) > >> return -ENOTSUP; > >> memset(fc_conf, 0, sizeof(*fc_conf)); > >> - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, > >> fc_conf)); > >> + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); > >> + > >> + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf > *fc_conf) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -4046,7 +4092,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, > >> struct rte_eth_fc_conf *fc_conf) > >> > >> if (*dev->dev_ops->flow_ctrl_set == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, > >> fc_conf)); > >> + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); > >> + > >> + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -4054,6 +4104,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t > >> port_id, > >> struct rte_eth_pfc_conf *pfc_conf) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -4071,9 +4122,14 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t > >> port_id, > >> } > >> > >> /* High water, low water validation are device specific */ > >> - if (*dev->dev_ops->priority_flow_ctrl_set) > >> - return eth_err(port_id, (*dev->dev_ops- > >> >priority_flow_ctrl_set) > >> - (dev, pfc_conf)); > >> + if (*dev->dev_ops->priority_flow_ctrl_set) { > >> + ret = eth_err(port_id, (*dev->dev_ops- > >> >priority_flow_ctrl_set) > >> + (dev, pfc_conf)); > >> + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, > >> ret); > >> + > >> + return ret; > >> + } > >> + > >> return -ENOTSUP; > >> } > >> > >> @@ -4132,6 +4188,7 @@ > >> rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, > >> struct rte_eth_pfc_queue_info *pfc_queue_info) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -4142,9 +4199,13 @@ > >> rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, > >> return -EINVAL; > >> } > >> > >> - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) > >> - return eth_err(port_id, (*dev->dev_ops- > >> >priority_flow_ctrl_queue_info_get) > >> + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { > >> + ret = eth_err(port_id, (*dev->dev_ops- > >> >priority_flow_ctrl_queue_info_get) > >> (dev, pfc_queue_info)); > >> + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, > >> pfc_queue_info, > >> + ret); > >> + return ret; > >> + } > >> return -ENOTSUP; > >> } > >> > >> @@ -4213,10 +4274,16 @@ > >> rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, > >> return ret; > >> } > >> > >> - if (*dev->dev_ops->priority_flow_ctrl_queue_config) > >> - return eth_err(port_id, > >> - (*dev->dev_ops- > >> >priority_flow_ctrl_queue_config)( > >> - dev, pfc_queue_conf)); > >> + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { > >> + ret = eth_err(port_id, > >> + (*dev->dev_ops- > >> >priority_flow_ctrl_queue_config)( > >> + dev, pfc_queue_conf)); > >> + > >> rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, > >> + > >> pfc_queue_conf, > >> + ret); > >> + return ret; > >> + } > >> + > >> return -ENOTSUP; > >> } > >> > >> @@ -4308,8 +4375,12 @@ rte_eth_dev_rss_reta_update(uint16_t > port_id, > >> > >> if (*dev->dev_ops->reta_update == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, > >> reta_conf, > >> - reta_size)); > >> + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, > >> + reta_size)); > >> + > >> + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, > >> ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -4337,8 +4408,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, > >> > >> if (*dev->dev_ops->reta_query == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, > >> - reta_size)); > >> + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, > >> + reta_size)); > >> + > >> + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -4382,8 +4457,11 @@ rte_eth_dev_rss_hash_update(uint16_t > port_id, > >> > >> if (*dev->dev_ops->rss_hash_update == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, > >> - rss_conf)); > >> + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, > >> rss_conf)); > >> + > >> + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -4391,6 +4469,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t > port_id, > >> struct rte_eth_rss_conf *rss_conf) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -4404,8 +4483,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t > port_id, > >> > >> if (*dev->dev_ops->rss_hash_conf_get == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, > >> - rss_conf)); > >> + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, > >> + rss_conf)); > >> + > >> + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -4413,6 +4496,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t > >> port_id, > >> struct rte_eth_udp_tunnel *udp_tunnel) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -4431,8 +4515,11 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t > >> port_id, > >> > >> if (*dev->dev_ops->udp_tunnel_port_add == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops- > >> >udp_tunnel_port_add)(dev, > >> - udp_tunnel)); > >> + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, > >> udp_tunnel)); > >> + > >> + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -4440,6 +4527,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t > >> port_id, > >> struct rte_eth_udp_tunnel *udp_tunnel) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -4458,34 +4546,47 @@ > rte_eth_dev_udp_tunnel_port_delete(uint16_t > >> port_id, > >> > >> if (*dev->dev_ops->udp_tunnel_port_del == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, > >> - udp_tunnel)); > >> + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, > >> udp_tunnel)); > >> + > >> + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_led_on(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_led_on == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); > >> + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); > >> + > >> + rte_eth_trace_led_on(port_id, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_led_off(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_led_off == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); > >> + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); > >> + > >> + rte_eth_trace_led_off(port_id, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -4510,6 +4611,8 @@ rte_eth_fec_get_capability(uint16_t port_id, > >> return -ENOTSUP; > >> ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, > >> num); > >> > >> + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, > >> ret); > >> + > >> return ret; > >> } > >> > >> @@ -4517,6 +4620,7 @@ int > >> rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -4530,20 +4634,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t > >> *fec_capa) > >> > >> if (*dev->dev_ops->fec_get == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); > >> + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); > >> + > >> + rte_eth_trace_fec_get(port_id, fec_capa, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) > >> { > >> 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->fec_set == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); > >> + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); > >> + > >> + rte_eth_trace_fec_set(port_id, fec_capa, ret); > >> + > >> + return ret; > >> } > >> > >> /* > >> @@ -4631,7 +4744,11 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, > >> struct rte_ether_addr *addr, > >> dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); > >> } > >> > >> - return eth_err(port_id, ret); > >> + ret = eth_err(port_id, ret); > >> + > >> + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -4671,6 +4788,8 @@ rte_eth_dev_mac_addr_remove(uint16_t > port_id, > >> struct rte_ether_addr *addr) > >> /* reset pool bitmap */ > >> dev->data->mac_pool_sel[index] = 0; > >> > >> + rte_ethdev_trace_mac_addr_remove(port_id, addr); > >> + > >> return 0; > >> } > >> > >> @@ -4703,6 +4822,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t > >> port_id, struct rte_ether_addr *addr) > >> /* Update default address in NIC data structure */ > >> rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); > >> > >> + rte_ethdev_trace_default_mac_addr_set(port_id, addr); > >> + > >> return 0; > >> } > >> > >> @@ -4793,21 +4914,29 @@ rte_eth_dev_uc_hash_table_set(uint16_t > >> port_id, struct rte_ether_addr *addr, > >> &dev->data- > >> >hash_mac_addrs[index]); > >> } > >> > >> - return eth_err(port_id, ret); > >> + ret = eth_err(port_id, ret); > >> + > >> + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) > >> { > >> 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->uc_all_hash_table_set == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops- > >> >uc_all_hash_table_set)(dev, > >> - on)); > >> + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, > >> on)); > >> + > >> + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); > >> + > >> + return ret; > >> } > >> > >> int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, > >> @@ -4843,14 +4972,18 @@ int rte_eth_set_queue_rate_limit(uint16_t > >> port_id, uint16_t queue_idx, > >> > >> if (*dev->dev_ops->set_queue_rate_limit == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, > >> - queue_idx, tx_rate)); > >> + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, > >> queue_idx, tx_rate)); > >> + > >> + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, > >> ret); > >> + > >> + return ret; > >> } > >> > >> int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, > >> uint8_t avail_thresh) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -4870,14 +5003,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t > >> port_id, uint16_t queue_id, > >> } > >> if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops- > >> >rx_queue_avail_thresh_set)(dev, > >> - queue_id, > >> avail_thresh)); > >> + ret = eth_err(port_id, (*dev->dev_ops- > >> >rx_queue_avail_thresh_set)(dev, queue_id, > >> + > >> avail_thresh)); > >> + > >> + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, > >> ret); > >> + > >> + return ret; > >> } > >> > >> int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, > >> uint8_t *avail_thresh) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -4889,8 +5027,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t > >> port_id, uint16_t *queue_id, > >> > >> if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops- > >> >rx_queue_avail_thresh_query)(dev, > >> - queue_id, > >> avail_thresh)); > >> + ret = eth_err(port_id, (*dev->dev_ops- > >> >rx_queue_avail_thresh_query)(dev, queue_id, > >> + > >> avail_thresh)); > >> + > >> + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); > >> + > >> + return ret; > >> } > >> > >> RTE_INIT(eth_dev_init_fp_ops) > >> @@ -4972,6 +5114,10 @@ rte_eth_dev_callback_register(uint16_t > port_id, > >> } while (++next_port <= last_port); > >> > >> rte_spinlock_unlock(ð_dev_cb_lock); > >> + > >> + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, > >> next_port, > >> + last_port); > >> + > >> return 0; > >> } > >> > >> @@ -5033,6 +5179,9 @@ rte_eth_dev_callback_unregister(uint16_t > port_id, > >> } while (++next_port <= last_port); > >> > >> rte_spinlock_unlock(ð_dev_cb_lock); > >> + > >> + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, > >> ret); > >> + > >> return ret; > >> } > >> > >> @@ -5062,6 +5211,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int > epfd, > >> int op, void *data) > >> for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { > >> vec = rte_intr_vec_list_index_get(intr_handle, qid); > >> rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); > >> + > >> + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); > >> + > >> if (rc && rc != -EEXIST) { > >> RTE_ETHDEV_LOG(ERR, > >> "p %u q %u Rx ctl error op %d epfd %d vec > >> %u\n", > >> @@ -5105,6 +5257,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t > >> port_id, uint16_t queue_id) > >> (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; > >> fd = rte_intr_efds_index_get(intr_handle, efd_idx); > >> > >> + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); > >> + > >> return fd; > >> } > >> > >> @@ -5138,6 +5292,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, > >> uint16_t queue_id, > >> > >> vec = rte_intr_vec_list_index_get(intr_handle, queue_id); > >> rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); > >> + > >> + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, > >> rc); > >> + > >> if (rc && rc != -EEXIST) { > >> RTE_ETHDEV_LOG(ERR, > >> "p %u q %u Rx ctl error op %d epfd %d vec %u\n", > >> @@ -5164,7 +5321,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, > >> > >> if (*dev->dev_ops->rx_queue_intr_enable == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops- > >> >rx_queue_intr_enable)(dev, queue_id)); > >> + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, > >> queue_id)); > >> + > >> + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -5183,7 +5344,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, > >> > >> if (*dev->dev_ops->rx_queue_intr_disable == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops- > >> >rx_queue_intr_disable)(dev, queue_id)); > >> + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, > >> queue_id)); > >> + > >> + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); > >> + > >> + return ret; > >> } > >> > >> > >> @@ -5241,6 +5406,8 @@ rte_eth_add_rx_callback(uint16_t port_id, > >> uint16_t queue_id, > >> } > >> rte_spinlock_unlock(ð_dev_rx_cb_lock); > >> > >> + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, > >> cb); > >> + > >> return cb; > >> } > >> > >> @@ -5280,6 +5447,8 @@ rte_eth_add_first_rx_callback(uint16_t port_id, > >> uint16_t queue_id, > >> cb, __ATOMIC_RELEASE); > >> rte_spinlock_unlock(ð_dev_rx_cb_lock); > >> > >> + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, > >> user_param, cb); > >> + > >> return cb; > >> } > >> > >> @@ -5339,6 +5508,8 @@ rte_eth_add_tx_callback(uint16_t port_id, > >> uint16_t queue_id, > >> } > >> rte_spinlock_unlock(ð_dev_tx_cb_lock); > >> > >> + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, > >> cb); > >> + > >> return cb; > >> } > >> > >> @@ -5373,6 +5544,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, > >> uint16_t queue_id, > >> } > >> rte_spinlock_unlock(ð_dev_rx_cb_lock); > >> > >> + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); > >> + > >> return ret; > >> } > >> > >> @@ -5407,6 +5580,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, > >> uint16_t queue_id, > >> } > >> rte_spinlock_unlock(ð_dev_tx_cb_lock); > >> > >> + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); > >> + > >> return ret; > >> } > >> > >> @@ -5453,6 +5628,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, > >> uint16_t queue_id, > >> dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); > >> qinfo->queue_state = dev->data->rx_queue_state[queue_id]; > >> > >> + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); > >> + > >> return 0; > >> } > >> > >> @@ -5499,6 +5676,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, > >> uint16_t queue_id, > >> dev->dev_ops->txq_info_get(dev, queue_id, qinfo); > >> qinfo->queue_state = dev->data->tx_queue_state[queue_id]; > >> > >> + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); > >> + > >> return 0; > >> } > >> > >> @@ -5507,6 +5686,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, > >> uint16_t queue_id, > >> struct rte_eth_burst_mode *mode) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5526,8 +5706,11 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, > >> uint16_t queue_id, > >> if (*dev->dev_ops->rx_burst_mode_get == NULL) > >> return -ENOTSUP; > >> memset(mode, 0, sizeof(*mode)); > >> - return eth_err(port_id, > >> - dev->dev_ops->rx_burst_mode_get(dev, queue_id, > >> mode)); > >> + ret = eth_err(port_id, dev->dev_ops->rx_burst_mode_get(dev, > >> queue_id, mode)); > >> + > >> + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -5535,6 +5718,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, > >> uint16_t queue_id, > >> struct rte_eth_burst_mode *mode) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5554,8 +5738,11 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, > >> uint16_t queue_id, > >> if (*dev->dev_ops->tx_burst_mode_get == NULL) > >> return -ENOTSUP; > >> memset(mode, 0, sizeof(*mode)); > >> - return eth_err(port_id, > >> - dev->dev_ops->tx_burst_mode_get(dev, queue_id, > >> mode)); > >> + ret = eth_err(port_id, dev->dev_ops->tx_burst_mode_get(dev, > >> queue_id, mode)); > >> + > >> + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -5563,6 +5750,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, > >> uint16_t queue_id, > >> struct rte_power_monitor_cond *pmc) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5581,8 +5769,11 @@ rte_eth_get_monitor_addr(uint16_t port_id, > >> uint16_t queue_id, > >> > >> if (*dev->dev_ops->get_monitor_addr == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, > >> - dev->dev_ops->get_monitor_addr(dev->data- > >> >rx_queues[queue_id], pmc)); > >> + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data- > >> >rx_queues[queue_id], pmc)); > >> + > >> + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -5591,40 +5782,54 @@ rte_eth_dev_set_mc_addr_list(uint16_t > port_id, > >> uint32_t nb_mc_addr) > >> { > >> 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->set_mc_addr_list == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, > >> - mc_addr_set, nb_mc_addr)); > >> + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, > >> mc_addr_set, nb_mc_addr)); > >> + > >> + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, > >> nb_mc_addr, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_timesync_enable(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->timesync_enable == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); > >> + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); > >> + > >> + rte_eth_trace_timesync_enable(port_id, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_timesync_disable(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->timesync_disable == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); > >> + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); > >> + > >> + rte_eth_trace_timesync_disable(port_id, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -5632,6 +5837,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t > >> port_id, struct timespec *timestamp, > >> uint32_t flags) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5645,8 +5851,13 @@ > rte_eth_timesync_read_rx_timestamp(uint16_t > >> port_id, struct timespec *timestamp, > >> > >> if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops- > >> >timesync_read_rx_timestamp) > >> - (dev, timestamp, flags)); > >> + > >> + ret = eth_err(port_id, (*dev->dev_ops- > >> >timesync_read_rx_timestamp) > >> + (dev, timestamp, flags)); > >> + > >> + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, > >> flags, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -5654,6 +5865,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t > >> port_id, > >> struct timespec *timestamp) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5667,27 +5879,39 @@ > rte_eth_timesync_read_tx_timestamp(uint16_t > >> port_id, > >> > >> if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops- > >> >timesync_read_tx_timestamp) > >> - (dev, timestamp)); > >> + > >> + ret = eth_err(port_id, (*dev->dev_ops- > >> >timesync_read_tx_timestamp) > >> + (dev, timestamp)); > >> + > >> + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, > >> ret); > >> + > >> + return ret; > >> + > >> } > >> > >> int > >> rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) > >> { > >> 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->timesync_adjust_time == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, > >> delta)); > >> + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, > >> delta)); > >> + > >> + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_timesync_read_time(uint16_t port_id, struct timespec > *timestamp) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5701,14 +5925,19 @@ rte_eth_timesync_read_time(uint16_t > port_id, > >> struct timespec *timestamp) > >> > >> if (*dev->dev_ops->timesync_read_time == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, > >> - timestamp)); > >> + > >> + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, > >> timestamp)); > >> + > >> + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_timesync_write_time(uint16_t port_id, const struct timespec > >> *timestamp) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5722,14 +5951,18 @@ rte_eth_timesync_write_time(uint16_t > port_id, > >> const struct timespec *timestamp) > >> > >> if (*dev->dev_ops->timesync_write_time == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, > >> - timestamp)); > >> + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, > >> timestamp)); > >> + > >> + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_read_clock(uint16_t port_id, uint64_t *clock) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5742,13 +5975,18 @@ rte_eth_read_clock(uint16_t port_id, > uint64_t > >> *clock) > >> > >> if (*dev->dev_ops->read_clock == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); > >> + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); > >> + > >> + rte_eth_trace_read_clock(port_id, clock, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; > >> @@ -5762,26 +6000,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, > >> struct rte_dev_reg_info *info) > >> > >> if (*dev->dev_ops->get_reg == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); > >> + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); > >> + > >> + rte_ethdev_trace_get_reg_info(port_id, info, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); > >> + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); > >> + > >> + rte_ethdev_trace_get_eeprom_length(port_id, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; > >> @@ -5795,13 +6043,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, > >> struct rte_dev_eeprom_info *info) > >> > >> if (*dev->dev_ops->get_eeprom == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); > >> + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); > >> + > >> + rte_ethdev_trace_get_eeprom(port_id, info, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; > >> @@ -5815,7 +6068,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, > struct > >> rte_dev_eeprom_info *info) > >> > >> if (*dev->dev_ops->set_eeprom == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); > >> + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); > >> + > >> + rte_ethdev_trace_set_eeprom(port_id, info, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -5823,6 +6080,7 @@ rte_eth_dev_get_module_info(uint16_t > port_id, > >> struct rte_eth_dev_module_info *modinfo) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5836,7 +6094,11 @@ rte_eth_dev_get_module_info(uint16_t > port_id, > >> > >> if (*dev->dev_ops->get_module_info == NULL) > >> return -ENOTSUP; > >> - return (*dev->dev_ops->get_module_info)(dev, modinfo); > >> + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); > >> + > >> + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -5844,6 +6106,7 @@ rte_eth_dev_get_module_eeprom(uint16_t > >> port_id, > >> struct rte_dev_eeprom_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]; > >> @@ -5871,7 +6134,11 @@ rte_eth_dev_get_module_eeprom(uint16_t > >> port_id, > >> > >> if (*dev->dev_ops->get_module_eeprom == NULL) > >> return -ENOTSUP; > >> - return (*dev->dev_ops->get_module_eeprom)(dev, info); > >> + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); > >> + > >> + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -5879,6 +6146,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, > >> struct rte_eth_dcb_info *dcb_info) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5894,7 +6162,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, > >> > >> if (*dev->dev_ops->get_dcb_info == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, > >> dcb_info)); > >> + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, > >> dcb_info)); > >> + > >> + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); > >> + > >> + return ret; > >> } > >> > >> static void > >> @@ -5930,6 +6202,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t > >> port_id, > >> if (nb_tx_desc != NULL) > >> eth_dev_adjust_nb_desc(nb_tx_desc, > >> &dev_info.tx_desc_lim); > >> > >> + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); > >> + > >> return 0; > >> } > >> > >> @@ -5938,6 +6212,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t > >> port_id, > >> struct rte_eth_hairpin_cap *cap) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5952,13 +6227,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t > >> port_id, > >> if (*dev->dev_ops->hairpin_cap_get == NULL) > >> return -ENOTSUP; > >> memset(cap, 0, sizeof(*cap)); > >> - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, > >> cap)); > >> + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); > >> + > >> + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -5973,7 +6253,11 @@ rte_eth_dev_pool_ops_supported(uint16_t > >> port_id, const char *pool) > >> if (*dev->dev_ops->pool_ops_supported == NULL) > >> return 1; /* all pools are supported */ > >> > >> - return (*dev->dev_ops->pool_ops_supported)(dev, pool); > >> + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); > >> + > >> + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); > >> + > >> + return ret; > >> } > >> > >> static int > >> @@ -6263,19 +6547,25 @@ rte_eth_representor_info_get(uint16_t > port_id, > >> struct rte_eth_representor_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]; > >> > >> if (*dev->dev_ops->representor_info_get == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, > >> info)); > >> + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, > >> info)); > >> + > >> + rte_eth_trace_representor_info_get(port_id, info, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -6294,8 +6584,11 @@ rte_eth_rx_metadata_negotiate(uint16_t > port_id, > >> uint64_t *features) > >> > >> if (*dev->dev_ops->rx_metadata_negotiate == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, > >> - (*dev->dev_ops->rx_metadata_negotiate)(dev, > >> features)); > >> + ret = eth_err(port_id, (*dev->dev_ops->rx_metadata_negotiate)(dev, > >> features)); > >> + > >> + rte_eth_trace_rx_metadata_negotiate(port_id, features, *features, > >> ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -6303,6 +6596,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t > >> port_id, > >> struct rte_eth_ip_reassembly_params *reassembly_capa) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -6324,8 +6618,12 @@ > rte_eth_ip_reassembly_capability_get(uint16_t > >> port_id, > >> return -ENOTSUP; > >> memset(reassembly_capa, 0, sizeof(struct > >> rte_eth_ip_reassembly_params)); > >> > >> - return eth_err(port_id, (*dev->dev_ops- > >> >ip_reassembly_capability_get) > >> + ret = eth_err(port_id, (*dev->dev_ops- > >> >ip_reassembly_capability_get) > >> (dev, reassembly_capa)); > >> + > >> + rte_eth_trace_ip_reassembly_capability_get(port_id, > >> reassembly_capa, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -6333,6 +6631,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t > port_id, > >> struct rte_eth_ip_reassembly_params *conf) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -6353,8 +6652,11 @@ rte_eth_ip_reassembly_conf_get(uint16_t > >> port_id, > >> if (*dev->dev_ops->ip_reassembly_conf_get == NULL) > >> return -ENOTSUP; > >> memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); > >> - return eth_err(port_id, > >> - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); > >> + ret = eth_err(port_id, (*dev->dev_ops- > >> >ip_reassembly_conf_get)(dev, conf)); > >> + > >> + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -6362,6 +6664,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t > port_id, > >> const struct rte_eth_ip_reassembly_params *conf) > >> { > >> struct rte_eth_dev *dev; > >> + int ret; > >> > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > >> dev = &rte_eth_devices[port_id]; > >> @@ -6390,8 +6693,11 @@ rte_eth_ip_reassembly_conf_set(uint16_t > >> port_id, > >> > >> if (*dev->dev_ops->ip_reassembly_conf_set == NULL) > >> return -ENOTSUP; > >> - return eth_err(port_id, > >> - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); > >> + ret = eth_err(port_id, (*dev->dev_ops- > >> >ip_reassembly_conf_set)(dev, conf)); > >> + > >> + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); > >> + > >> + return ret; > >> } > >> > >> int > >> @@ -6489,8 +6795,10 @@ > >> rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, > uint32_t > >> *ptypes > >> return 0; > >> > >> for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { > >> - if (j < num) > >> + if (j < num) { > >> ptypes[j] = all_types[i]; > >> + > >> rte_eth_trace_buffer_split_get_supported_hdr_ptypes(port_id, j, > >> ptypes[j]); > >> + } > >> j++; > >> } > >> > >> diff --git a/lib/ethdev/rte_ethdev_cman.c > b/lib/ethdev/rte_ethdev_cman.c > >> index 4a1bdd7bd0..c4d877d878 100644 > >> --- a/lib/ethdev/rte_ethdev_cman.c > >> +++ b/lib/ethdev/rte_ethdev_cman.c > >> @@ -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; > >> } > >> diff --git a/lib/ethdev/rte_ethdev_trace.h > b/lib/ethdev/rte_ethdev_trace.h > >> index bc3b3d2a1b..4c66834290 100644 > >> --- a/lib/ethdev/rte_ethdev_trace.h > >> +++ b/lib/ethdev/rte_ethdev_trace.h > >> @@ -373,6 +373,535 @@ 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, > >> + 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, 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_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_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_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_set, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, 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_configure, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, > >> + 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, > >> + 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, 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, 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, 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, > >> + 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_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, struct rte_ether_addr > >> *addr, > >> + uint32_t pool, int ret), > >> + uint16_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, struct rte_ether_addr > >> *addr), > >> + uint16_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, struct rte_ether_addr > >> *addr), > >> + uint16_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, 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, 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, > >> + 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, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int > >> epfd, > >> + int op, 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_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); > >> +) > >> + > >> +RTE_TRACE_POINT( > >> + 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); > >> +) > >> + > >> +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, > >> + 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, void *user_param, > >> + 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, void *user_param, > >> + 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_ethdev_trace_set_mc_addr_list, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, > >> + 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_ethdev_trace_set_eeprom, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_hairpin_capability_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, > >> + 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_rx_metadata_negotiate, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, > >> + 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_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_cman_config_init, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); > >> +) > >> + > >> #ifdef __cplusplus > >> } > >> #endif > >> diff --git a/lib/ethdev/rte_ethdev_trace_fp.h > >> b/lib/ethdev/rte_ethdev_trace_fp.h > >> index 9f1d3d5a1b..3dbcc30c0a 100644 > >> --- a/lib/ethdev/rte_ethdev_trace_fp.h > >> +++ b/lib/ethdev/rte_ethdev_trace_fp.h > >> @@ -304,6 +304,348 @@ RTE_TRACE_POINT_FP( > >> rte_trace_point_emit_int(ret); > >> ) > >> > >> +RTE_TRACE_POINT_FP( > >> + 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_FP( > >> + 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_FP( > >> + rte_eth_trace_macaddr_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_ether_addr > >> *mac_addr), > >> + uint16_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); > >> +) > >> + > >> +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); > >> +) > >> + > >> +RTE_TRACE_POINT_FP( > >> + 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_FP( > >> + rte_ethdev_trace_flow_ctrl_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > >> + rte_ethdev_trace_priority_flow_ctrl_queue_info_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, > >> + 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_FP( > >> + rte_ethdev_trace_rss_reta_query, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > >> + rte_ethdev_trace_rss_hash_conf_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > >> + rte_eth_trace_fec_get, > >> + 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_ptr(fec_capa); > >> + rte_trace_point_emit_int(ret); > >> +) > >> + > >> +RTE_TRACE_POINT_FP( > >> + 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_FP( > >> + rte_eth_trace_rx_queue_info_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > >> + 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_FP( > >> + rte_eth_trace_tx_queue_info_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > >> + 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_FP( > >> + rte_eth_trace_rx_burst_mode_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > >> + 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_FP( > >> + rte_eth_trace_tx_burst_mode_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > >> + 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_FP( > >> + rte_eth_trace_get_monitor_addr, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > >> + 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_FP( > >> + rte_eth_trace_timesync_read_rx_timestamp, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_u64(timestamp->tv_sec); > >> + rte_trace_point_emit_u64(timestamp->tv_nsec); > >> + rte_trace_point_emit_u32(flags); > >> + rte_trace_point_emit_int(ret); > >> +) > >> + > >> +RTE_TRACE_POINT_FP( > >> + rte_eth_trace_timesync_read_tx_timestamp, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec > >> *timestamp, int ret), > >> + rte_trace_point_emit_u16(port_id); > >> + rte_trace_point_emit_ptr(timestamp); > >> + rte_trace_point_emit_u64(timestamp->tv_sec); > >> + rte_trace_point_emit_u64(timestamp->tv_nsec); > >> + rte_trace_point_emit_int(ret); > >> +) > >> + > >> +RTE_TRACE_POINT_FP( > >> + rte_eth_trace_timesync_read_time, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct timespec *time, int > >> ret), > >> + rte_trace_point_emit_u16(port_id); > >> + rte_trace_point_emit_ptr(time); > >> + rte_trace_point_emit_u64(time->tv_sec); > >> + rte_trace_point_emit_u64(time->tv_nsec); > >> + rte_trace_point_emit_int(ret); > >> +) > >> + > >> +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); > >> +) > >> + > >> +RTE_TRACE_POINT_FP( > >> + 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_u64(time->tv_sec); > >> + rte_trace_point_emit_u64(time->tv_nsec); > >> + rte_trace_point_emit_int(ret); > >> +) > >> + > >> +RTE_TRACE_POINT_FP( > >> + rte_eth_trace_read_clock, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > >> + rte_ethdev_trace_get_reg_info, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > >> + 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_FP( > >> + rte_ethdev_trace_get_eeprom, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( > >> + rte_ethdev_trace_get_module_info, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, > >> + 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_FP( > >> + rte_ethdev_trace_get_module_eeprom, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, > >> + 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_FP( > >> + rte_ethdev_trace_get_dcb_info, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_dcb_info > >> *dcb_info, > >> + int ret), > >> + uint16_t num_user_priorities = > >> RTE_ETH_DCB_NUM_USER_PRIORITIES; > >> + uint16_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_FP( > >> + 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_FP( > >> + rte_eth_trace_representor_info_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, > >> + 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_FP( > >> + rte_eth_trace_ip_reassembly_conf_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, > >> + 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_FP( > >> + 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_FP( > >> + rte_eth_trace_cman_info_get, > >> + RTE_TRACE_POINT_ARGS(uint16_t port_id, > >> + 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_FP( > >> + 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); > >> +) > >> + > >> #ifdef __cplusplus > >> } > >> #endif > >> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > >> index c7ba2e3dc8..c7c6bcd42b 100644 > >> --- a/lib/ethdev/version.map > >> +++ b/lib/ethdev/version.map > >> @@ -300,36 +300,71 @@ EXPERIMENTAL { > >> rte_mtr_meter_profile_get; > >> > >> # added in 23.03 > >> + __rte_eth_trace_add_first_rx_callback; > >> + __rte_eth_trace_add_rx_callback; > >> + __rte_eth_trace_add_tx_callback; > >> __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_cman_config_get; > >> + __rte_eth_trace_cman_config_init; > >> + __rte_eth_trace_cman_config_set; > >> + __rte_eth_trace_cman_info_get; > >> + __rte_eth_trace_fec_get_capability; > >> + __rte_eth_trace_fec_get; > >> + __rte_eth_trace_fec_set; > >> __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_get_monitor_addr; > >> __rte_eth_trace_hairpin_bind; > >> __rte_eth_trace_hairpin_get_peer_ports; > >> __rte_eth_trace_hairpin_unbind; > >> + __rte_eth_trace_ip_reassembly_capability_get; > >> + __rte_eth_trace_ip_reassembly_conf_get; > >> + __rte_eth_trace_ip_reassembly_conf_set; > >> __rte_eth_trace_iterator_cleanup; > >> __rte_eth_trace_iterator_init; > >> __rte_eth_trace_iterator_next; > >> + __rte_eth_trace_led_off; > >> + __rte_eth_trace_led_on; > >> __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_macaddr_get; > >> + __rte_eth_trace_macaddrs_get; > >> __rte_eth_trace_promiscuous_disable; > >> __rte_eth_trace_promiscuous_enable; > >> __rte_eth_trace_promiscuous_get; > >> + __rte_eth_trace_remove_rx_callback; > >> + __rte_eth_trace_remove_tx_callback; > >> + __rte_eth_trace_representor_info_get; > >> + __rte_eth_trace_rx_avail_thresh_query; > >> + __rte_eth_trace_rx_avail_thresh_set; > >> + __rte_eth_trace_rx_burst_mode_get; > >> __rte_eth_trace_rx_hairpin_queue_setup; > >> + __rte_eth_trace_rx_metadata_negotiate; > >> + __rte_eth_trace_rx_queue_info_get; > >> + __rte_eth_trace_set_queue_rate_limit; > >> __rte_eth_trace_speed_bitflag; > >> __rte_eth_trace_stats_get; > >> __rte_eth_trace_stats_reset; > >> + __rte_eth_trace_timesync_adjust_time; > >> + __rte_eth_trace_timesync_disable; > >> + __rte_eth_trace_timesync_enable; > >> + __rte_eth_trace_timesync_read_rx_timestamp; > >> + __rte_eth_trace_timesync_read_time; > >> + __rte_eth_trace_timesync_read_tx_timestamp; > >> + __rte_eth_trace_timesync_write_time; > >> __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_burst_mode_get; > >> __rte_eth_trace_tx_done_cleanup; > >> __rte_eth_trace_tx_hairpin_queue_setup; > >> __rte_eth_trace_xstats_get; > >> @@ -338,32 +373,78 @@ EXPERIMENTAL { > >> __rte_eth_trace_xstats_get_names; > >> __rte_eth_trace_xstats_get_names_by_id; > >> __rte_eth_trace_xstats_reset; > >> + __rte_ethdev_trace_adjust_nb_rx_tx_desc; > >> + __rte_ethdev_trace_callback_register; > >> + __rte_ethdev_trace_callback_unregister; > >> __rte_ethdev_trace_capability_name; > >> + __rte_ethdev_trace_conf_get; > >> __rte_ethdev_trace_count_avail; > >> __rte_ethdev_trace_count_total; > >> + __rte_ethdev_trace_default_mac_addr_set; > >> + __rte_ethdev_trace_flow_ctrl_get; > >> + __rte_ethdev_trace_flow_ctrl_set; > >> __rte_ethdev_trace_fw_version_get; > >> + __rte_ethdev_trace_get_dcb_info; > >> + __rte_ethdev_trace_get_eeprom; > >> + __rte_ethdev_trace_get_eeprom_length; > >> + __rte_ethdev_trace_get_module_eeprom; > >> + __rte_ethdev_trace_get_module_info; > >> + __rte_ethdev_trace_get_mtu; > >> __rte_ethdev_trace_get_name_by_port; > >> __rte_ethdev_trace_get_port_by_name; > >> + __rte_ethdev_trace_get_reg_info; > >> __rte_ethdev_trace_get_sec_ctx; > >> + __rte_ethdev_trace_get_supported_ptypes; > >> + __rte_ethdev_trace_get_vlan_offload; > >> + __rte_ethdev_trace_hairpin_capability_get; > >> + __rte_ethdev_trace_info_get; > >> __rte_ethdev_trace_is_removed; > >> __rte_ethdev_trace_is_valid_port; > >> + __rte_ethdev_trace_mac_addr_add; > >> + __rte_ethdev_trace_mac_addr_remove; > >> __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_pool_ops_supported; > >> + __rte_ethdev_trace_priority_flow_ctrl_queue_configure; > >> + __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; > >> + __rte_ethdev_trace_priority_flow_ctrl_set; > >> __rte_ethdev_trace_reset; > >> + __rte_ethdev_trace_rss_hash_conf_get; > >> + __rte_ethdev_trace_rss_hash_update; > >> + __rte_ethdev_trace_rss_reta_query; > >> + __rte_ethdev_trace_rss_reta_update; > >> + __rte_ethdev_trace_rx_intr_ctl; > >> + __rte_ethdev_trace_rx_intr_ctl_q; > >> + __rte_ethdev_trace_rx_intr_ctl_q_get_fd; > >> + __rte_ethdev_trace_rx_intr_disable; > >> + __rte_ethdev_trace_rx_intr_enable; > >> __rte_ethdev_trace_rx_offload_name; > >> __rte_ethdev_trace_rx_queue_start; > >> __rte_ethdev_trace_rx_queue_stop; > >> + __rte_ethdev_trace_set_eeprom; > >> __rte_ethdev_trace_set_link_down; > >> __rte_ethdev_trace_set_link_up; > >> + __rte_ethdev_trace_set_mc_addr_list; > >> + __rte_ethdev_trace_set_mtu; > >> + __rte_ethdev_trace_set_ptypes; > >> __rte_ethdev_trace_set_rx_queue_stats_mapping; > >> __rte_ethdev_trace_set_tx_queue_stats_mapping; > >> + __rte_ethdev_trace_set_vlan_ether_type; > >> + __rte_ethdev_trace_set_vlan_offload; > >> + __rte_ethdev_trace_set_vlan_pvid; > >> + __rte_ethdev_trace_set_vlan_strip_on_queue; > >> __rte_ethdev_trace_socket_id; > >> __rte_ethdev_trace_tx_offload_name; > >> __rte_ethdev_trace_tx_queue_start; > >> __rte_ethdev_trace_tx_queue_stop; > >> + __rte_ethdev_trace_uc_all_hash_table_set; > >> + __rte_ethdev_trace_uc_hash_table_set; > >> + __rte_ethdev_trace_udp_tunnel_port_add; > >> + __rte_ethdev_trace_udp_tunnel_port_delete; > >> + __rte_ethdev_trace_vlan_filter; > >> }; > >> > >> INTERNAL { > >> -- > >> 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v5 4/6] ethdev: add trace points for flow 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi ` (2 preceding siblings ...) 2023-01-12 11:21 ` [PATCH v5 3/6] ethdev: add trace points for remaining functions Ankur Dwivedi @ 2023-01-12 11:21 ` Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 5/6] ethdev: add trace points for mtr Ankur Dwivedi ` (3 subsequent siblings) 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-12 11:21 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 102a18fcc1..1953d90a5a 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 4c66834290..5bf7ffec6c 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -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); + 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_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); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_destroy, + 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); + 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_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); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_int(action->type); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + 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, + struct rte_flow_pattern_template *template), + 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(template); +) + +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), + 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, + struct rte_flow_actions_template *template), + 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(template); +) + +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), + 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), + 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 diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 3dbcc30c0a..57b98a3994 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -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 diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 7d0c24366c..43f13f79b4 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -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, @@ -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; } 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; } 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 @@ -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 @@ -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, 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, 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, + error), + error); + + rte_flow_trace_tunnel_action_decap_release(port_id, actions, + num_of_actions, ret); + + 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; } 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)) 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 * @@ -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 @@ -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; } 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; } 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; } 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; } 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); + 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; } 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; } 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; } 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); + 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 @@ -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 @@ -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, + action_handle, data, user_data, + ret); + + return ret; } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c7c6bcd42b..0cb8222ad9 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v5 5/6] ethdev: add trace points for mtr 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi ` (3 preceding siblings ...) 2023-01-12 11:21 ` [PATCH v5 4/6] ethdev: add trace points for flow Ankur Dwivedi @ 2023-01-12 11:21 ` Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 6/6] ethdev: add trace points for tm Ankur Dwivedi ` (2 subsequent siblings) 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-12 11:21 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 1953d90a5a..067e5fdab4 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 5bf7ffec6c..71994a9ab4 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1285,6 +1286,117 @@ 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, + struct rte_mtr_capabilities *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_mtr_trace_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + 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); +) + +RTE_TRACE_POINT( + 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); +) + +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_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_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id, + 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_policy_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + 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( + rte_mtr_trace_meter_policy_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(policy_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_policy_validate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_int(actions->type); + rte_trace_point_emit_ptr(actions->conf); +) + +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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 57b98a3994..d7ab85f938 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT_FP( rte_eth_trace_call_rx_callbacks, @@ -759,6 +760,105 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + rte_mtr_trace_meter_profile_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id, 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_FP( + rte_mtr_trace_meter_policy_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, + 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_FP( + 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_FP( + 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_FP( + 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_FP( + rte_mtr_trace_meter_vlan_table_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + 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_FP( + 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_FP( + 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_FP( + rte_mtr_trace_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + 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_ptr(stats_mask); + rte_trace_point_emit_int(clear); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index 3954839531..da092cd939 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -6,6 +6,8 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -82,8 +84,14 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, capabilities_get)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_mtr_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* MTR meter profile add */ @@ -94,8 +102,14 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); + + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile, ret); + + return ret; } /** MTR meter profile delete */ @@ -105,8 +119,14 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id, ret); + + return ret; } /** MTR meter profile get */ @@ -116,8 +136,14 @@ rte_mtr_meter_profile_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, + struct rte_flow_meter_profile *ret; + + ret = RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_get(port_id, meter_profile_id, ret); + + return ret; } /* MTR meter policy validate */ @@ -127,6 +153,10 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_validate(port_id, policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); } @@ -139,6 +169,11 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_add(port_id, policy_id, + policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); } @@ -150,6 +185,7 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_delete(port_id, policy_id); return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); } @@ -161,8 +197,14 @@ rte_mtr_meter_policy_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, + struct rte_flow_meter_policy *ret; + + ret = RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_get(port_id, policy_id, ret); + + return ret; } /** MTR object create */ @@ -174,8 +216,14 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, create)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); + + rte_mtr_trace_create(port_id, mtr_id, params, shared, ret); + + return ret; } /** MTR object destroy */ @@ -185,8 +233,14 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, destroy)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); + + rte_mtr_trace_destroy(port_id, mtr_id, ret); + + return ret; } /** MTR object meter enable */ @@ -196,8 +250,14 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_enable)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); + + rte_mtr_trace_meter_enable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter disable */ @@ -207,8 +267,14 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_disable)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); + + rte_mtr_trace_meter_disable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter profile update */ @@ -219,8 +285,14 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); + + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id, ret); + + return ret; } /** MTR object meter policy update */ @@ -231,8 +303,14 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); + + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id, ret); + + return ret; } /** MTR object meter DSCP table update */ @@ -243,8 +321,14 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, proto, dscp_table, error); + + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table, ret); + + return ret; } /** MTR object meter VLAN table update */ @@ -255,8 +339,14 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, proto, vlan_table, error); + + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table, ret); + + return ret; } /** Set the input color protocol on MTR object */ @@ -268,8 +358,14 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_set)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority, ret); + + return ret; } /** Get input color protocols of MTR object */ @@ -280,8 +376,14 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_get)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); + + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id, ret); + + return ret; } /** Get input color protocol priority of MTR object */ @@ -293,8 +395,14 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto, ret); + + return ret; } /** MTR object enabled stats update */ @@ -305,8 +413,14 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); + + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask, ret); + + return ret; } /** MTR object stats read */ @@ -319,6 +433,12 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_read)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); + + rte_mtr_trace_stats_read(port_id, mtr_id, stats, stats_mask, clear, ret); + + return ret; } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 0cb8222ad9..c1a6e4d30a 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v5 6/6] ethdev: add trace points for tm 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi ` (4 preceding siblings ...) 2023-01-12 11:21 ` [PATCH v5 5/6] ethdev: add trace points for mtr Ankur Dwivedi @ 2023-01-12 11:21 ` Ankur Dwivedi 2023-01-12 17:03 ` [PATCH v5 0/6] add trace points in ethdev library Ferruh Yigit 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-12 11:21 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 067e5fdab4..af66a139df 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 71994a9ab4..fd14e86d13 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1397,6 +1398,146 @@ RTE_TRACE_POINT( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT( + rte_tm_trace_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_tm_capabilities *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_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_level_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t level_id, + 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_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, + 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_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + 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(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_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_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_shaper_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id, + 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_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_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_wred_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id, + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index d7ab85f938..db8dae0e5a 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT_FP( rte_eth_trace_call_rx_callbacks, @@ -859,6 +860,176 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + 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_FP( + 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_ptr(is_leaf); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + rte_tm_trace_node_wfq_weight_mode_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + 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_FP( + 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_FP( + 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_FP( + rte_tm_trace_node_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + 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_ptr(stats_mask); + rte_trace_point_emit_int(clear); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + 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_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..eb4c8f103f 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -6,6 +6,8 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +81,9 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); + return 0; } @@ -90,8 +95,14 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_type_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); + + rte_tm_trace_node_type_get(port_id, node_id, is_leaf, ret); + + return ret; } /* Get capabilities */ @@ -100,8 +111,14 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_tm_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* Get level capabilities */ @@ -111,8 +128,14 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); + + rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret); + + return ret; } /* Get node capabilities */ @@ -122,8 +145,14 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); + + rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret); + + return ret; } /* Add WRED profile */ @@ -133,8 +162,14 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); + + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -143,8 +178,14 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); + + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret); + + return ret; } /* Add/update shared WRED context */ @@ -154,8 +195,15 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); + + rte_tm_trace_shared_wred_context_add_update(port_id, shared_wred_context_id, + wred_profile_id, ret); + + return ret; } /* Delete shared WRED context */ @@ -164,8 +212,14 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); + + rte_tm_trace_shared_wred_context_delete(port_id, shared_wred_context_id, ret); + + return ret; } /* Add shaper profile */ @@ -175,8 +229,14 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); + + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -185,8 +245,14 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); + + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, ret); + + return ret; } /* Add shared shaper */ @@ -196,8 +262,15 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); + + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id, ret); + + return ret; } /* Delete shared shaper */ @@ -206,8 +279,14 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); + + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, ret); + + return ret; } /* Add node to port traffic manager hierarchy */ @@ -221,9 +300,16 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); + + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + + return ret; } /* Delete node from traffic manager hierarchy */ @@ -232,8 +318,14 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); + + rte_tm_trace_node_delete(port_id, node_id, ret); + + return ret; } /* Suspend node */ @@ -242,8 +334,14 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_suspend)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); + + rte_tm_trace_node_suspend(port_id, node_id, ret); + + return ret; } /* Resume node */ @@ -252,8 +350,14 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_resume)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); + + rte_tm_trace_node_resume(port_id, node_id, ret); + + return ret; } /* Commit the initial port traffic manager hierarchy */ @@ -262,8 +366,14 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); + + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret); + + return ret; } /* Update node parent */ @@ -275,8 +385,15 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_parent_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); + + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight, ret); + + return ret; } /* Update node private shaper */ @@ -286,8 +403,14 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shaper_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); + + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id, ret); + + return ret; } /* Update node shared shapers */ @@ -298,8 +421,15 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); + + rte_tm_trace_node_shared_shaper_update(port_id, node_id, shared_shaper_id, + add, ret); + + return ret; } /* Update node stats */ @@ -309,8 +439,14 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); + + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, ret); + + return ret; } /* Update WFQ weight mode */ @@ -321,8 +457,15 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); + + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, wfq_weight_mode, + n_sp_priorities, ret); + + return ret; } /* Update node congestion management mode */ @@ -332,8 +475,14 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_cman_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); + + rte_tm_trace_node_cman_update(port_id, node_id, cman, ret); + + return ret; } /* Update node private WRED context */ @@ -343,8 +492,15 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); + + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id, + ret); + + return ret; } /* Update node shared WRED context */ @@ -355,8 +511,16 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); + + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add, ret); + + return ret; } /* Read and/or clear stats counters for specific node */ @@ -368,8 +532,15 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_read)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); + + rte_tm_trace_node_stats_read(port_id, node_id, stats, stats_mask, + clear, ret); + + return ret; } /* Packet marking - VLAN DEI */ @@ -380,8 +551,14 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } /* Packet marking - IPv4/IPv6 ECN */ @@ -392,8 +569,14 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } /* Packet marking - IPv4/IPv6 DSCP */ @@ -404,6 +587,12 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c1a6e4d30a..112b2b1039 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v5 0/6] add trace points in ethdev library 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi ` (5 preceding siblings ...) 2023-01-12 11:21 ` [PATCH v5 6/6] ethdev: add trace points for tm Ankur Dwivedi @ 2023-01-12 17:03 ` Ferruh Yigit 2023-01-13 6:32 ` [EXT] " Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi 7 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-01-12 17:03 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 1/12/2023 11:21 AM, Ankur Dwivedi wrote: > This series adds trace points for functions in the ethdev library. > The trace points are added in ethdev, flow, mtr and tm files. > > 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 > ethdev: add trace points for remaining functions > ethdev: add trace points for flow > ethdev: add trace points for mtr > ethdev: add trace points for tm Hi Ankur, Build seems failing with set, can you please check: https://mails.dpdk.org/archives/test-report/2023-January/339696.html I can reproduce build failures via 32bit and debugoptimized builds. ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v5 0/6] add trace points in ethdev library 2023-01-12 17:03 ` [PATCH v5 0/6] add trace points in ethdev library Ferruh Yigit @ 2023-01-13 6:32 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-13 6:32 UTC (permalink / raw) To: Ferruh Yigit, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb Hi Ferruh, My comments are inline. >-----Original Message----- >From: Ferruh Yigit <ferruh.yigit@amd.com> >Sent: Thursday, January 12, 2023 10:33 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; >orika@nvidia.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor Russkikh ><irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; yisen.zhuang@huawei.com; >xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; >zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; >qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; >xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; >rosen.xu@intel.com; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; >Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori ><skori@marvell.com>; Satha Koteswara Rao Kottidi ><skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara ><sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; jgrajcia@cisco.com; >mb@smartsharesystems.com >Subject: [EXT] Re: [PATCH v5 0/6] add trace points in ethdev library > >External Email > >---------------------------------------------------------------------- >On 1/12/2023 11:21 AM, Ankur Dwivedi wrote: >> This series adds trace points for functions in the ethdev library. >> The trace points are added in ethdev, flow, mtr and tm files. >> >> 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 >> ethdev: add trace points for remaining functions >> ethdev: add trace points for flow >> ethdev: add trace points for mtr >> ethdev: add trace points for tm > >Hi Ankur, > >Build seems failing with set, can you please check: >https://urldefense.proofpoint.com/v2/url?u=https- >3A__mails.dpdk.org_archives_test-2Dreport_2023- >2DJanuary_339696.html&d=DwICaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=ILjiNF3 >GF25y6QdHZUxMl6JrStU0MIuCtO5dMzn3Ybk&m=FhQtWKgLxBWQ7rF_fkPm7V >K5-efg3NcVDA6cTbGsoNZmX7WvvZKas2o4xnsIxj5D&s=HDHVPZX4YsLz- >DsRwK3mRisxOk9U8FK7fStn7gCgsXk&e= > >I can reproduce build failures via 32bit and debugoptimized builds. Sure, I will check. ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v6 0/6] add trace points in ethdev library 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi ` (6 preceding siblings ...) 2023-01-12 17:03 ` [PATCH v5 0/6] add trace points in ethdev library Ferruh Yigit @ 2023-01-20 8:40 ` Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi ` (7 more replies) 7 siblings, 8 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-20 8:40 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. 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 | 32 + 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, 4754 insertions(+), 236 deletions(-) create mode 100644 lib/ethdev/rte_ethdev_trace_fp_burst.h -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v6 1/6] eal: trace: add trace point emit for blob 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi @ 2023-01-20 8:40 ` Ankur Dwivedi 2023-01-20 10:11 ` Morten Brørup 2023-01-23 17:27 ` Ferruh Yigit 2023-01-20 8:40 ` [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi ` (6 subsequent siblings) 7 siblings, 2 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-20 8:40 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(+) diff --git a/app/test/test_trace.c b/app/test/test_trace.c index 6bedf14024..ad4a394a29 100644 --- a/app/test/test_trace.c +++ b/app/test/test_trace.c @@ -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; diff --git a/doc/guides/prog_guide/trace_lib.rst b/doc/guides/prog_guide/trace_lib.rst index 9a8f38073d..3e0ea5835c 100644 --- a/doc/guides/prog_guide/trace_lib.rst +++ b/doc/guides/prog_guide/trace_lib.rst @@ -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. diff --git a/lib/eal/common/eal_common_trace_points.c b/lib/eal/common/eal_common_trace_points.c index 0b0b254615..051f89809c 100644 --- a/lib/eal/common/eal_common_trace_points.c +++ b/lib/eal/common/eal_common_trace_points.c @@ -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) diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h index 5ef4398230..e0b836eb2f 100644 --- a/lib/eal/include/rte_eal_trace.h +++ b/lib/eal/include/rte_eal_trace.h @@ -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 */ diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index 0f8700974f..aca8344dbf 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -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,31 @@ 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); \ + 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); \ +} 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_ */ diff --git a/lib/eal/include/rte_trace_point_register.h b/lib/eal/include/rte_trace_point_register.h index a32f4d731b..7efbac8a72 100644 --- a/lib/eal/include/rte_trace_point_register.h +++ b/lib/eal/include/rte_trace_point_register.h @@ -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 diff --git a/lib/eal/version.map b/lib/eal/version.map index 7ad12a7dc9..67be24686a 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v6 1/6] eal: trace: add trace point emit for blob 2023-01-20 8:40 ` [PATCH v6 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-01-20 10:11 ` Morten Brørup 2023-01-23 17:27 ` Ferruh Yigit 1 sibling, 0 replies; 172+ messages in thread From: Morten Brørup @ 2023-01-20 10:11 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia > From: Ankur Dwivedi [mailto:adwivedi@marvell.com] > Sent: Friday, 20 January 2023 09.41 > > 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. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- [...] > +/** 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,31 @@ 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); \ > + 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); \ Alternatively (just a suggestion): 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); \ (If memset() is annotated to inform the compiler that the mem pointer is constant, the compiler should generate exactly the same code.) > +} 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_ */ > diff --git a/lib/eal/include/rte_trace_point_register.h > b/lib/eal/include/rte_trace_point_register.h > index a32f4d731b..7efbac8a72 100644 > --- a/lib/eal/include/rte_trace_point_register.h > +++ b/lib/eal/include/rte_trace_point_register.h > @@ -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) I guess the variable sized trace entry couldn't be implemented. Anyway, this BLOB implementation is still very useful! Acked-by: Morten Brørup <mb@smartsharesystems.com> ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob 2023-01-20 8:40 ` [PATCH v6 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-01-20 10:11 ` Morten Brørup @ 2023-01-23 17:27 ` Ferruh Yigit 2023-01-25 15:02 ` [EXT] " Ankur Dwivedi 1 sibling, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-01-23 17:27 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 1/20/2023 8:40 AM, Ankur Dwivedi wrote: > 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. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > 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(+) > > diff --git a/app/test/test_trace.c b/app/test/test_trace.c > index 6bedf14024..ad4a394a29 100644 > --- a/app/test/test_trace.c > +++ b/app/test/test_trace.c > @@ -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; > diff --git a/doc/guides/prog_guide/trace_lib.rst b/doc/guides/prog_guide/trace_lib.rst > index 9a8f38073d..3e0ea5835c 100644 > --- a/doc/guides/prog_guide/trace_lib.rst > +++ b/doc/guides/prog_guide/trace_lib.rst > @@ -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. > diff --git a/lib/eal/common/eal_common_trace_points.c b/lib/eal/common/eal_common_trace_points.c > index 0b0b254615..051f89809c 100644 > --- a/lib/eal/common/eal_common_trace_points.c > +++ b/lib/eal/common/eal_common_trace_points.c > @@ -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) > diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h > index 5ef4398230..e0b836eb2f 100644 > --- a/lib/eal/include/rte_eal_trace.h > +++ b/lib/eal/include/rte_eal_trace.h > @@ -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 */ > diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h > index 0f8700974f..aca8344dbf 100644 > --- a/lib/eal/include/rte_trace_point.h > +++ b/lib/eal/include/rte_trace_point.h > @@ -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) > This is just for doxygen right, why doxygen comments are not above the actual macros but there is a separate #if block for it? > #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,31 @@ 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); \ > + 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? > +} 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_ */ > diff --git a/lib/eal/include/rte_trace_point_register.h b/lib/eal/include/rte_trace_point_register.h > index a32f4d731b..7efbac8a72 100644 > --- a/lib/eal/include/rte_trace_point_register.h > +++ b/lib/eal/include/rte_trace_point_register.h > @@ -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()'? > #ifdef __cplusplus > } > #endif > diff --git a/lib/eal/version.map b/lib/eal/version.map > index 7ad12a7dc9..67be24686a 100644 > --- a/lib/eal/version.map > +++ b/lib/eal/version.map > @@ -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? ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob 2023-01-23 17:27 ` Ferruh Yigit @ 2023-01-25 15:02 ` Ankur Dwivedi 2023-01-25 16:09 ` Ferruh Yigit 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-25 15:02 UTC (permalink / raw) To: Ferruh Yigit, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >-----Original Message----- >From: Ferruh Yigit <ferruh.yigit@amd.com> >Sent: Monday, January 23, 2023 10:58 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; >orika@nvidia.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; >chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; >apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >Rasesh Mody <rmody@marvell.com>; Shahed Shaikh ><shshaikh@marvell.com>; Devendra Singh Rawat ><dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; >jbehrens@vmware.com; maxime.coquelin@redhat.com; >chenbo.xia@intel.com; steven.webster@windriver.com; >matt.peters@windriver.com; bruce.richardson@intel.com; >mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; >cristian.dumitrescu@intel.com; jgrajcia@cisco.com; >mb@smartsharesystems.com >Subject: [EXT] Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob > >External Email > >---------------------------------------------------------------------- >On 1/20/2023 8:40 AM, Ankur Dwivedi wrote: >> 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. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> --- >> 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(+) >> >> diff --git a/app/test/test_trace.c b/app/test/test_trace.c index >> 6bedf14024..ad4a394a29 100644 >> --- a/app/test/test_trace.c >> +++ b/app/test/test_trace.c >> @@ -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; >> diff --git a/doc/guides/prog_guide/trace_lib.rst >> b/doc/guides/prog_guide/trace_lib.rst >> index 9a8f38073d..3e0ea5835c 100644 >> --- a/doc/guides/prog_guide/trace_lib.rst >> +++ b/doc/guides/prog_guide/trace_lib.rst >> @@ -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. >> diff --git a/lib/eal/common/eal_common_trace_points.c >> b/lib/eal/common/eal_common_trace_points.c >> index 0b0b254615..051f89809c 100644 >> --- a/lib/eal/common/eal_common_trace_points.c >> +++ b/lib/eal/common/eal_common_trace_points.c >> @@ -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) >> diff --git a/lib/eal/include/rte_eal_trace.h >> b/lib/eal/include/rte_eal_trace.h index 5ef4398230..e0b836eb2f 100644 >> --- a/lib/eal/include/rte_eal_trace.h >> +++ b/lib/eal/include/rte_eal_trace.h >> @@ -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 */ >> diff --git a/lib/eal/include/rte_trace_point.h >> b/lib/eal/include/rte_trace_point.h >> index 0f8700974f..aca8344dbf 100644 >> --- a/lib/eal/include/rte_trace_point.h >> +++ b/lib/eal/include/rte_trace_point.h >> @@ -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) >> > >This is just for doxygen right, why doxygen comments are not above the actual >macros but there is a separate #if block for it? The actual macro is within a #ifndef __DOXYGEN__ block. I think that is the reason for including Doxygen comments here. > >> #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,31 @@ 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); \ >> + 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? The memset sets to 0 the unused bytes (RTE_TRACE_BLOB_LEN_MAX - len). So memset is done after memcpy. > >> +} 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_ */ diff --git >> a/lib/eal/include/rte_trace_point_register.h >> b/lib/eal/include/rte_trace_point_register.h >> index a32f4d731b..7efbac8a72 100644 >> --- a/lib/eal/include/rte_trace_point_register.h >> +++ b/lib/eal/include/rte_trace_point_register.h >> @@ -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()'? Yes the register happens in this function. > >> #ifdef __cplusplus >> } >> #endif >> diff --git a/lib/eal/version.map b/lib/eal/version.map index >> 7ad12a7dc9..67be24686a 100644 >> --- a/lib/eal/version.map >> +++ b/lib/eal/version.map >> @@ -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? Yes the export in version.map can be removed. Will remove it in next patch series. > > > > ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob 2023-01-25 15:02 ` [EXT] " Ankur Dwivedi @ 2023-01-25 16:09 ` Ferruh Yigit 2023-01-30 13:35 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-01-25 16:09 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 1/25/2023 3:02 PM, Ankur Dwivedi wrote: > >> >> ---------------------------------------------------------------------- >> On 1/20/2023 8:40 AM, Ankur Dwivedi wrote: >>> 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. >>> >>> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >>> --- >>> 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(+) >>> >>> diff --git a/app/test/test_trace.c b/app/test/test_trace.c index >>> 6bedf14024..ad4a394a29 100644 >>> --- a/app/test/test_trace.c >>> +++ b/app/test/test_trace.c >>> @@ -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; >>> diff --git a/doc/guides/prog_guide/trace_lib.rst >>> b/doc/guides/prog_guide/trace_lib.rst >>> index 9a8f38073d..3e0ea5835c 100644 >>> --- a/doc/guides/prog_guide/trace_lib.rst >>> +++ b/doc/guides/prog_guide/trace_lib.rst >>> @@ -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. >>> diff --git a/lib/eal/common/eal_common_trace_points.c >>> b/lib/eal/common/eal_common_trace_points.c >>> index 0b0b254615..051f89809c 100644 >>> --- a/lib/eal/common/eal_common_trace_points.c >>> +++ b/lib/eal/common/eal_common_trace_points.c >>> @@ -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) >>> diff --git a/lib/eal/include/rte_eal_trace.h >>> b/lib/eal/include/rte_eal_trace.h index 5ef4398230..e0b836eb2f 100644 >>> --- a/lib/eal/include/rte_eal_trace.h >>> +++ b/lib/eal/include/rte_eal_trace.h >>> @@ -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 */ >>> diff --git a/lib/eal/include/rte_trace_point.h >>> b/lib/eal/include/rte_trace_point.h >>> index 0f8700974f..aca8344dbf 100644 >>> --- a/lib/eal/include/rte_trace_point.h >>> +++ b/lib/eal/include/rte_trace_point.h >>> @@ -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) >>> >> >> This is just for doxygen right, why doxygen comments are not above the actual >> macros but there is a separate #if block for it? > > 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? >> >>> #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,31 @@ 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); \ >>> + 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? > > 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. >> >>> +} 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_ */ diff --git >>> a/lib/eal/include/rte_trace_point_register.h >>> b/lib/eal/include/rte_trace_point_register.h >>> index a32f4d731b..7efbac8a72 100644 >>> --- a/lib/eal/include/rte_trace_point_register.h >>> +++ b/lib/eal/include/rte_trace_point_register.h >>> @@ -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()'? > > 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? >> >>> #ifdef __cplusplus >>> } >>> #endif >>> diff --git a/lib/eal/version.map b/lib/eal/version.map index >>> 7ad12a7dc9..67be24686a 100644 >>> --- a/lib/eal/version.map >>> +++ b/lib/eal/version.map >>> @@ -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? > > 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. ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob 2023-01-25 16:09 ` Ferruh Yigit @ 2023-01-30 13:35 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-30 13:35 UTC (permalink / raw) To: Ferruh Yigit, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >-----Original Message----- >From: Ferruh Yigit <ferruh.yigit@amd.com> >Sent: Wednesday, January 25, 2023 9:40 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org >Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; >orika@nvidia.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; >chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; >apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >Rasesh Mody <rmody@marvell.com>; Shahed Shaikh ><shshaikh@marvell.com>; Devendra Singh Rawat ><dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; >jbehrens@vmware.com; maxime.coquelin@redhat.com; >chenbo.xia@intel.com; steven.webster@windriver.com; >matt.peters@windriver.com; bruce.richardson@intel.com; >mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; >cristian.dumitrescu@intel.com; jgrajcia@cisco.com; >mb@smartsharesystems.com >Subject: Re: [EXT] Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob > >On 1/25/2023 3:02 PM, Ankur Dwivedi wrote: >> >>> >>> --------------------------------------------------------------------- >>> - On 1/20/2023 8:40 AM, Ankur Dwivedi wrote: >>>> 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. >>>> >>>> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >>>> --- >>>> 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(+) >>>> >>>> diff --git a/app/test/test_trace.c b/app/test/test_trace.c index >>>> 6bedf14024..ad4a394a29 100644 >>>> --- a/app/test/test_trace.c >>>> +++ b/app/test/test_trace.c >>>> @@ -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; >>>> diff --git a/doc/guides/prog_guide/trace_lib.rst >>>> b/doc/guides/prog_guide/trace_lib.rst >>>> index 9a8f38073d..3e0ea5835c 100644 >>>> --- a/doc/guides/prog_guide/trace_lib.rst >>>> +++ b/doc/guides/prog_guide/trace_lib.rst >>>> @@ -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. >>>> diff --git a/lib/eal/common/eal_common_trace_points.c >>>> b/lib/eal/common/eal_common_trace_points.c >>>> index 0b0b254615..051f89809c 100644 >>>> --- a/lib/eal/common/eal_common_trace_points.c >>>> +++ b/lib/eal/common/eal_common_trace_points.c >>>> @@ -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) >>>> diff --git a/lib/eal/include/rte_eal_trace.h >>>> b/lib/eal/include/rte_eal_trace.h index 5ef4398230..e0b836eb2f >>>> 100644 >>>> --- a/lib/eal/include/rte_eal_trace.h >>>> +++ b/lib/eal/include/rte_eal_trace.h >>>> @@ -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 */ >>>> diff --git a/lib/eal/include/rte_trace_point.h >>>> b/lib/eal/include/rte_trace_point.h >>>> index 0f8700974f..aca8344dbf 100644 >>>> --- a/lib/eal/include/rte_trace_point.h >>>> +++ b/lib/eal/include/rte_trace_point.h >>>> @@ -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) >>>> >>> >>> This is just for doxygen right, why doxygen comments are not above >>> the actual macros but there is a separate #if block for it? >> >> 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. > >>> >>>> #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,31 @@ 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); \ >>>> + 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? >> >> 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? 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. > >btw, I want to remind that size of the 'len' can be max 64 bytes. > >>> >>>> +} 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_ */ diff --git >>>> a/lib/eal/include/rte_trace_point_register.h >>>> b/lib/eal/include/rte_trace_point_register.h >>>> index a32f4d731b..7efbac8a72 100644 >>>> --- a/lib/eal/include/rte_trace_point_register.h >>>> +++ b/lib/eal/include/rte_trace_point_register.h >>>> @@ -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()'? >> >> 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. >>> >>>> #ifdef __cplusplus >>>> } >>>> #endif >>>> diff --git a/lib/eal/version.map b/lib/eal/version.map index >>>> 7ad12a7dc9..67be24686a 100644 >>>> --- a/lib/eal/version.map >>>> +++ b/lib/eal/version.map >>>> @@ -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? >> >> 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. ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-01-20 8:40 ` Ankur Dwivedi 2023-01-23 17:28 ` Ferruh Yigit 2023-01-20 8:40 ` [PATCH v6 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi ` (5 subsequent siblings) 7 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-20 8:40 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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 diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index 48090c879a..fd16b25e55 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,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; } diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2919409a15..4fea76e0ff 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -5,6 +5,7 @@ #include <rte_trace_point_register.h> #include <rte_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_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + 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..f5c0865023 100644 --- a/lib/ethdev/meson.build +++ b/lib/ethdev/meson.build @@ -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', diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 5d5e18db1e..40897ad94d 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -27,8 +27,9 @@ #include <rte_ether.h> #include <rte_telemetry.h> -#include "rte_ethdev_trace.h" #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "ethdev_driver.h" #include "ethdev_profile.h" #include "ethdev_private.h" @@ -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; @@ -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 @@ 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 */ + } } 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); 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); + 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); 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) { 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); + 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); + 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; - else + } else { + rte_ethdev_trace_is_valid_port(port_id, 1); return 1; + } } static int @@ -395,6 +420,7 @@ 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 +439,7 @@ 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 +503,7 @@ 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 +521,7 @@ 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 +555,7 @@ 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 +585,7 @@ 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 +601,21 @@ 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 +629,7 @@ rte_eth_dev_count_avail(void) RTE_ETH_FOREACH_DEV(p) count++; + rte_ethdev_trace_count_avail(count); return count; } @@ -602,6 +641,7 @@ rte_eth_dev_count_total(void) RTE_ETH_FOREACH_VALID_DEV(port) count++; + rte_ethdev_trace_count_total(count); return count; } @@ -622,6 +662,7 @@ 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 +685,7 @@ 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 +787,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 +824,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 +868,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,12 +905,17 @@ 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) { + rte_eth_trace_speed_bitflag(speed, duplex); switch (speed) { case RTE_ETH_SPEED_NUM_10M: return duplex ? RTE_ETH_LINK_SPEED_10M : RTE_ETH_LINK_SPEED_10M_HD; @@ -902,6 +961,8 @@ rte_eth_dev_rx_offload_name(uint64_t offload) } } + rte_ethdev_trace_rx_offload_name(offload, name); + return name; } @@ -918,6 +979,8 @@ rte_eth_dev_tx_offload_name(uint64_t offload) } } + rte_ethdev_trace_tx_offload_name(offload, name); + return name; } @@ -934,6 +997,8 @@ rte_eth_dev_capability_name(uint64_t capability) } } + rte_ethdev_trace_capability_name(capability, name); + return name; } @@ -1554,26 +1619,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 +1703,12 @@ 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); - return eth_err(port_id, ret); + ret = eth_err(port_id, dev->dev_ops->dev_reset(dev)); + + rte_ethdev_trace_reset(port_id, ret); + + return ret; } int @@ -1653,6 +1731,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 +2231,13 @@ 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 +2426,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 +2456,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 +2483,7 @@ 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 +2520,8 @@ 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; } @@ -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); rte_pktmbuf_free_bulk(pkts, unsent); } @@ -2444,6 +2541,7 @@ 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(pkts, unsent, *count); } int @@ -2458,6 +2556,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 +2578,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 +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); + + rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt, ret); + + return ret; } int @@ -2516,7 +2624,11 @@ 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 +2651,11 @@ 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 +2666,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 +2688,11 @@ 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 +2714,11 @@ 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 +2729,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 +2757,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,12 +2785,16 @@ 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) { + rte_eth_trace_link_speed_to_str(link_speed); + switch (link_speed) { case RTE_ETH_SPEED_NUM_NONE: return "None"; case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; @@ -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); + 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) 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 +2892,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 +2977,7 @@ 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 +3131,8 @@ 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); @@ -3025,6 +3172,8 @@ rte_eth_xstats_get_names(uint16_t port_id, cnt_used_entries += cnt_driver_entries; } + rte_eth_trace_xstats_get_names(port_id, xstats_names, size, cnt_used_entries); + return cnt_used_entries; } @@ -3174,6 +3323,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 +3373,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], i); + return count + xcount; } @@ -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]; /* 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)); + + 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) { - 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 +3473,13 @@ 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.h b/lib/ethdev/rte_ethdev.h index 96d0650d0c..6340a84c10 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -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; diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 1491c815c3..bc3b3d2a1b 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -88,6 +88,291 @@ RTE_TRACE_POINT( 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(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); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_cleanup, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), + 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( + 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(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), + 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(const 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), + rte_trace_point_emit_u32(speed); + rte_trace_point_emit_int(duplex); +) + +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), + 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(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); +) + +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); + 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); +) + +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(struct rte_eth_dev_tx_buffer *buffer), + rte_trace_point_emit_ptr(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 diag), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(promiscuous); + rte_trace_point_emit_int(diag); +) + +RTE_TRACE_POINT( + rte_eth_trace_promiscuous_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int promiscuous, int diag), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(promiscuous); + rte_trace_point_emit_int(diag); +) + +RTE_TRACE_POINT( + rte_eth_trace_allmulticast_enable, + 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); +) + +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); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_speed_to_str, + RTE_TRACE_POINT_ARGS(uint32_t link_speed), + rte_trace_point_emit_u32(link_speed); +) + +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, 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 40084d1929..9f1d3d5a1b 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -17,26 +17,293 @@ extern "C" { #include <rte_trace_point.h> +#include "rte_ethdev.h" + RTE_TRACE_POINT_FP( - rte_ethdev_trace_rx_burst, + rte_eth_trace_call_rx_callbacks, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, - void **pkt_tbl, uint16_t nb_rx), + struct rte_mbuf **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(pkt_tbl); + 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_ethdev_trace_tx_burst, + rte_eth_trace_call_tx_callbacks, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, - void **pkts_tbl, uint16_t nb_pkts), + struct rte_mbuf **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(pkts_tbl); + rte_trace_point_emit_ptr(tx_pkts); rte_trace_point_emit_u16(nb_pkts); ) +RTE_TRACE_POINT_FP( + rte_eth_trace_find_next, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_find_next_sibling, + RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t ref_port_id), + rte_trace_point_emit_u16(port_id_start); + rte_trace_point_emit_u16(ref_port_id); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_find_next_owned_by, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const uint64_t owner_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(owner_id); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_owner_get, + RTE_TRACE_POINT_ARGS(const uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_sec_ctx, + RTE_TRACE_POINT_ARGS(uint16_t port_id, void *ctx), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(ctx); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_count_avail, + RTE_TRACE_POINT_ARGS(uint16_t count), + rte_trace_point_emit_u16(count); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_count_total, + RTE_TRACE_POINT_ARGS(uint16_t count), + rte_trace_point_emit_u16(count); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_get_name_by_port, + RTE_TRACE_POINT_ARGS(uint16_t port_id, char *name), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_string(name); +) + +RTE_TRACE_POINT_FP( + 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_FP( + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_tx_buffer_drop_callback, + RTE_TRACE_POINT_ARGS(struct rte_mbuf **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(struct rte_mbuf **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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_tx_buffer_init, + RTE_TRACE_POINT_ARGS(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_FP( + 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_FP( + 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_FP( + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_link_get_nowait, + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_link_to_str, + RTE_TRACE_POINT_ARGS(size_t len, const 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_size_t(len); + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_stats_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats *stats, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(stats); + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_stats_reset, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_xstats_get_names_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_xstats_get_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, + 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_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); +) + +RTE_TRACE_POINT_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp_burst.h b/lib/ethdev/rte_ethdev_trace_fp_burst.h new file mode 100644 index 0000000000..899b4ed070 --- /dev/null +++ b/lib/ethdev/rte_ethdev_trace_fp_burst.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2022 Marvell International Ltd. + */ + +#ifndef _RTE_ETHDEV_TRACE_FP_BURST_H_ +#define _RTE_ETHDEV_TRACE_FP_BURST_H_ + +/** + * @file + * + * API for ethdev burst trace support + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <rte_trace_point.h> + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_rx_burst, + 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); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pkt_tbl); + rte_trace_point_emit_u16(nb_rx); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_tx_burst, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + void **pkts_tbl, uint16_t nb_pkts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pkts_tbl); + rte_trace_point_emit_u16(nb_pkts); +) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_ETHDEV_TRACE_FP_BURST_H_ */ diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 17201fbe0f..c7ba2e3dc8 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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; + __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; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-01-20 8:40 ` [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi @ 2023-01-23 17:28 ` Ferruh Yigit 2023-01-30 16:01 ` [EXT] " Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-01-23 17:28 UTC (permalink / raw) To: Ankur Dwivedi, dev, David Marchand Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 1/20/2023 8:40 AM, Ankur Dwivedi wrote: > 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. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> <...> > +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/ ? > +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/ ? <...> > diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build > index 39250b5da1..f5c0865023 100644 > --- a/lib/ethdev/meson.build > +++ b/lib/ethdev/meson.build > @@ -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? <...> > @@ -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; `` > > @@ -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 @@ 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 */ } > + } > } 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. > 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). > 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? > 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) > { > 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. > 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. > 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; > - 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? <...> > 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. <...> > @@ -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. <...> > @@ -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. <...> > @@ -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. > 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) > 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. <...> > @@ -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]; > > /* 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)); `` > + > + 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) > { > - 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. <...> > +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. <...> > +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); > + 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); `` > +) > + > +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); > + 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. <...> > +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'. <...> > +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. > +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? <...> > +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. <...> > +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'? <...> > +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()' <...> > +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. <...> > @@ -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; > + __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? ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-01-23 17:28 ` Ferruh Yigit @ 2023-01-30 16:01 ` Ankur Dwivedi 2023-01-31 18:38 ` Ferruh Yigit 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-30 16:01 UTC (permalink / raw) To: Ferruh Yigit, dev, David Marchand Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >-----Original Message----- >From: Ferruh Yigit <ferruh.yigit@amd.com> >Sent: Monday, January 23, 2023 10:59 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org; David >Marchand <david.marchand@redhat.com> >Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; >orika@nvidia.com; chas3@att.com; humin29@huawei.com; >linville@tuxdriver.com; ciara.loftus@intel.com; qi.z.zhang@intel.com; >mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; Igor >Russkikh <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; >chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; >apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >Rasesh Mody <rmody@marvell.com>; Shahed Shaikh ><shshaikh@marvell.com>; Devendra Singh Rawat ><dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; >jbehrens@vmware.com; maxime.coquelin@redhat.com; >chenbo.xia@intel.com; steven.webster@windriver.com; >matt.peters@windriver.com; bruce.richardson@intel.com; >mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; >cristian.dumitrescu@intel.com; jgrajcia@cisco.com; >mb@smartsharesystems.com >Subject: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part >one) > >External Email > >---------------------------------------------------------------------- >On 1/20/2023 8:40 AM, Ankur Dwivedi wrote: >> 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. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > ><...> > >> +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/ ? > >> +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. > ><...> > >> diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index >> 39250b5da1..f5c0865023 100644 >> --- a/lib/ethdev/meson.build >> +++ b/lib/ethdev/meson.build >> @@ -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. > >@David, what do you think? > ><...> > >> @@ -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: Ok. >`` > end: > iter->cls = rte_class_find_by_name("eth"); > rte_devargs_reset(&devargs); > > rte_eth_trace_iterator_init(devargs_str); > > return 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 >> @@ 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: Ok. > >`` >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 +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. Have missed to make few functions as separate block. Majority of the functions are made as separate block. Will make these as separate block. > >> 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). OK. > >> 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? This can be kept as the function returns with RTE_MAX_ETHPORTS here. > >> return RTE_MAX_ETHPORTS; >> + } >> + >> + rte_eth_trace_find_next(port_id); This can be also kept. >> >> 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); >> >> + rte_eth_trace_find_next_of(port_id); >> + > >Same here, lets keep only the last one. Ok. > >> 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. Will make this change. > >> 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; >> - 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. > ><...> > >> 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. Ok. > ><...> > >> @@ -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. > ><...> > >> @@ -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. Ok. > ><...> > >> @@ -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. Ok. > >> 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) >> 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. > ><...> > >> @@ -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]; >> >> /* 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. > >`` >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 +3429,37 @@ 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); >> + > >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. > ><...> > >> +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. >`` >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. > ><...> > >> +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); >> + 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: 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)); \ >`` >rte_trace_point_emit_u32(conf->peer_count); >`` > >> +) >> + >> +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); >> + 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. > ><...> > >> +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. > ><...> > >> +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. > >> +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. > ><...> > >> +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. > ><...> > >> +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'? nink_duplex, link_autoneg and link_status are bit fields. Same reason as mentioned in earlier comment. > > ><...> > >> +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. > ><...> > >> +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. > ><...> > >> @@ -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; >> + __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. > ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-01-30 16:01 ` [EXT] " Ankur Dwivedi @ 2023-01-31 18:38 ` Ferruh Yigit 2023-01-31 18:46 ` Jerin Jacob 2023-02-01 15:42 ` Ankur Dwivedi 0 siblings, 2 replies; 172+ messages in thread From: Ferruh Yigit @ 2023-01-31 18:38 UTC (permalink / raw) To: Ankur Dwivedi, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko Cc: thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 1/30/2023 4:01 PM, Ankur Dwivedi wrote: <...> >>> diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index >>> 39250b5da1..f5c0865023 100644 >>> --- a/lib/ethdev/meson.build >>> +++ b/lib/ethdev/meson.build >>> @@ -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. 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 <...> >>> - 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. <...> >>> +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); >>> + 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: > 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)); \ > 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? <...> >>> +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. > 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. ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-01-31 18:38 ` Ferruh Yigit @ 2023-01-31 18:46 ` Jerin Jacob 2023-01-31 22:20 ` Ferruh Yigit 2023-02-01 15:42 ` Ankur Dwivedi 1 sibling, 1 reply; 172+ messages in thread From: Jerin Jacob @ 2023-01-31 18:46 UTC (permalink / raw) To: Ferruh Yigit Cc: Ankur Dwivedi, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko, thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On Wed, Feb 1, 2023 at 12:09 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote: > > On 1/30/2023 4:01 PM, Ankur Dwivedi wrote: > > <...> > > >>> diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index > >>> 39250b5da1..f5c0865023 100644 > >>> --- a/lib/ethdev/meson.build > >>> +++ b/lib/ethdev/meson.build > >>> @@ -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. > > 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 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. > 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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-01-31 18:46 ` Jerin Jacob @ 2023-01-31 22:20 ` Ferruh Yigit 2023-02-01 8:31 ` Jerin Jacob 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-01-31 22:20 UTC (permalink / raw) To: Jerin Jacob Cc: Ankur Dwivedi, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko, thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 1/31/2023 6:46 PM, Jerin Jacob wrote: > On Wed, Feb 1, 2023 at 12:09 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote: >> >> On 1/30/2023 4:01 PM, Ankur Dwivedi wrote: >> >> <...> >> >>>>> diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index >>>>> 39250b5da1..f5c0865023 100644 >>>>> --- a/lib/ethdev/meson.build >>>>> +++ b/lib/ethdev/meson.build >>>>> @@ -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. >> >> 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 > > 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. > >> 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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-01-31 22:20 ` Ferruh Yigit @ 2023-02-01 8:31 ` Jerin Jacob 2023-02-01 10:50 ` Ferruh Yigit 0 siblings, 1 reply; 172+ messages in thread From: Jerin Jacob @ 2023-02-01 8:31 UTC (permalink / raw) To: Ferruh Yigit Cc: Ankur Dwivedi, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko, thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On Wed, Feb 1, 2023 at 3:50 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote: > > On 1/31/2023 6:46 PM, Jerin Jacob wrote: > > On Wed, Feb 1, 2023 at 12:09 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote: > >> > >> On 1/30/2023 4:01 PM, Ankur Dwivedi wrote: > >> > >> <...> > >> > >>>>> diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index > >>>>> 39250b5da1..f5c0865023 100644 > >>>>> --- a/lib/ethdev/meson.build > >>>>> +++ b/lib/ethdev/meson.build > >>>>> @@ -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. > >> > >> 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 > > > > 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. 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. > 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 > > > > >> 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 > ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-02-01 8:31 ` Jerin Jacob @ 2023-02-01 10:50 ` Ferruh Yigit 0 siblings, 0 replies; 172+ messages in thread From: Ferruh Yigit @ 2023-02-01 10:50 UTC (permalink / raw) To: Jerin Jacob Cc: Ankur Dwivedi, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko, thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/1/2023 8:31 AM, Jerin Jacob wrote: > On Wed, Feb 1, 2023 at 3:50 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote: >> >> On 1/31/2023 6:46 PM, Jerin Jacob wrote: >>> On Wed, Feb 1, 2023 at 12:09 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote: >>>> >>>> On 1/30/2023 4:01 PM, Ankur Dwivedi wrote: >>>> >>>> <...> >>>> >>>>>>> diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index >>>>>>> 39250b5da1..f5c0865023 100644 >>>>>>> --- a/lib/ethdev/meson.build >>>>>>> +++ b/lib/ethdev/meson.build >>>>>>> @@ -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. >>>> >>>> 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 >>> >>> 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. > > 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. > >> 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. >> >>> >>>> 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 >> ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-01-31 18:38 ` Ferruh Yigit 2023-01-31 18:46 ` Jerin Jacob @ 2023-02-01 15:42 ` Ankur Dwivedi 2023-02-02 8:56 ` Ferruh Yigit 1 sibling, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-01 15:42 UTC (permalink / raw) To: Ferruh Yigit, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko Cc: thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >-----Original Message----- >From: Ferruh Yigit <ferruh.yigit@amd.com> >Sent: Wednesday, February 1, 2023 12:08 AM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org; David >Marchand <david.marchand@redhat.com>; Jerin Jacob Kollanukkaran ><jerinj@marvell.com>; Andrew Rybchenko ><andrew.rybchenko@oktetlabs.ru> >Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >chas3@att.com; humin29@huawei.com; linville@tuxdriver.com; >ciara.loftus@intel.com; qi.z.zhang@intel.com; mw@semihalf.com; >mk@semihalf.com; shaibran@amazon.com; evgenys@amazon.com; >igorch@amazon.com; chandu@amd.com; Igor Russkikh ><irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] ><mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; >chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; >apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >Rasesh Mody <rmody@marvell.com>; Shahed Shaikh ><shshaikh@marvell.com>; Devendra Singh Rawat ><dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; >jbehrens@vmware.com; maxime.coquelin@redhat.com; >chenbo.xia@intel.com; steven.webster@windriver.com; >matt.peters@windriver.com; bruce.richardson@intel.com; >mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; >cristian.dumitrescu@intel.com; jgrajcia@cisco.com; >mb@smartsharesystems.com >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: > ><...> > >>>> diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index >>>> 39250b5da1..f5c0865023 100644 >>>> --- a/lib/ethdev/meson.build >>>> +++ b/lib/ethdev/meson.build >>>> @@ -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. > >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 > ><...> > >>>> - 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. Ok. > ><...> > >>>> +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); >>>> + 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: >> 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)); \ >> > >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? 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)); \ | ^ > > > >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. > ><...> > >>>> +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. >> > >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', 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) > >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. > >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. ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-02-01 15:42 ` Ankur Dwivedi @ 2023-02-02 8:56 ` Ferruh Yigit 2023-02-02 10:20 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-02-02 8:56 UTC (permalink / raw) To: Ankur Dwivedi, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko Cc: thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/1/2023 3:42 PM, Ankur Dwivedi wrote: > > >> -----Original Message----- >> From: Ferruh Yigit <ferruh.yigit@amd.com> >> Sent: Wednesday, February 1, 2023 12:08 AM >> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org; David >> Marchand <david.marchand@redhat.com>; Jerin Jacob Kollanukkaran >> <jerinj@marvell.com>; Andrew Rybchenko >> <andrew.rybchenko@oktetlabs.ru> >> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >> chas3@att.com; humin29@huawei.com; linville@tuxdriver.com; >> ciara.loftus@intel.com; qi.z.zhang@intel.com; mw@semihalf.com; >> mk@semihalf.com; shaibran@amazon.com; evgenys@amazon.com; >> igorch@amazon.com; chandu@amd.com; Igor Russkikh >> <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin Jacob >> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >> hyonkim@cisco.com; liudongdong3@huawei.com; >> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >> Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda >> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi >> <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla >> <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >> Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >> viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; >> chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >> hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; >> apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >> Rasesh Mody <rmody@marvell.com>; Shahed Shaikh >> <shshaikh@marvell.com>; Devendra Singh Rawat >> <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >> jiawenwu@trustnetic.com; jianwang@trustnetic.com; >> jbehrens@vmware.com; maxime.coquelin@redhat.com; >> chenbo.xia@intel.com; steven.webster@windriver.com; >> matt.peters@windriver.com; bruce.richardson@intel.com; >> mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; >> cristian.dumitrescu@intel.com; jgrajcia@cisco.com; >> mb@smartsharesystems.com >> 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: >> >> <...> >> >>>>> diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index >>>>> 39250b5da1..f5c0865023 100644 >>>>> --- a/lib/ethdev/meson.build >>>>> +++ b/lib/ethdev/meson.build >>>>> @@ -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. >> >> 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 >> >> <...> >> >>>>> - 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. > Ok. >> >> <...> >> >>>>> +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); >>>>> + 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: >>> 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)); \ >>> >> >> 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? > > 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? >> >> >> >> 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 >> >> <...> >> >>>>> +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. >>> >> >> 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', > > 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 >> >> 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) > 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? > 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. > 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. > >> >> 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. > ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-02-02 8:56 ` Ferruh Yigit @ 2023-02-02 10:20 ` Ankur Dwivedi 2023-02-02 12:52 ` Ferruh Yigit 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-02 10:20 UTC (permalink / raw) To: Ferruh Yigit, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko Cc: thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >-----Original Message----- >From: Ferruh Yigit <ferruh.yigit@amd.com> >Sent: Thursday, February 2, 2023 2:27 PM >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org; David >Marchand <david.marchand@redhat.com>; Jerin Jacob Kollanukkaran ><jerinj@marvell.com>; Andrew Rybchenko ><andrew.rybchenko@oktetlabs.ru> >Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >chas3@att.com; humin29@huawei.com; linville@tuxdriver.com; >ciara.loftus@intel.com; qi.z.zhang@intel.com; mw@semihalf.com; >mk@semihalf.com; shaibran@amazon.com; evgenys@amazon.com; >igorch@amazon.com; chandu@amd.com; Igor Russkikh ><irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >ed.czeck@atomicrules.com; john.miller@atomicrules.com; >ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Maciej >Czekaj [C] <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra ><hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; johndale@cisco.com; >hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; Nithin >Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda ><kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha >Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi ><lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla ><radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; >Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; >viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; >chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; >apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >Rasesh Mody <rmody@marvell.com>; Shahed Shaikh ><shshaikh@marvell.com>; Devendra Singh Rawat ><dsinghrawat@marvell.com>; jiawenwu@trustnetic.com; >jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; >jgrajcia@cisco.com; mb@smartsharesystems.com >Subject: Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part >one) > >On 2/1/2023 3:42 PM, Ankur Dwivedi wrote: >> >> >>> -----Original Message----- >>> From: Ferruh Yigit <ferruh.yigit@amd.com> >>> Sent: Wednesday, February 1, 2023 12:08 AM >>> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org; David >>> Marchand <david.marchand@redhat.com>; Jerin Jacob Kollanukkaran >>> <jerinj@marvell.com>; Andrew Rybchenko >>> <andrew.rybchenko@oktetlabs.ru> >>> Cc: thomas@monjalon.net; mdr@ashroe.eu; orika@nvidia.com; >>> chas3@att.com; humin29@huawei.com; linville@tuxdriver.com; >>> ciara.loftus@intel.com; qi.z.zhang@intel.com; mw@semihalf.com; >>> mk@semihalf.com; shaibran@amazon.com; evgenys@amazon.com; >>> igorch@amazon.com; chandu@amd.com; Igor Russkikh >>> <irusskikh@marvell.com>; shepard.siegel@atomicrules.com; >>> ed.czeck@atomicrules.com; john.miller@atomicrules.com; >>> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Jerin >Jacob >>> Kollanukkaran <jerinj@marvell.com>; Maciej Czekaj [C] >>> <mczekaj@marvell.com>; Shijith Thotton <sthotton@marvell.com>; >>> Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Harman Kalra >>> <hkalra@marvell.com>; rahul.lakkireddy@chelsio.com; >>> johndale@cisco.com; hyonkim@cisco.com; liudongdong3@huawei.com; >>> yisen.zhuang@huawei.com; xuanziyang2@huawei.com; >>> cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; >>> simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; >>> Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; >>> jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; >>> Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar >>> Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori >>> <skori@marvell.com>; Satha Koteswara Rao Kottidi >>> <skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >>> zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >>> Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara >>> <sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >>> longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; >>> niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >>> sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >>> sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody >>> <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; >Devendra >>> Singh Rawat <dsinghrawat@marvell.com>; >andrew.rybchenko@oktetlabs.ru; >>> jiawenwu@trustnetic.com; jianwang@trustnetic.com; >>> jbehrens@vmware.com; maxime.coquelin@redhat.com; >>> chenbo.xia@intel.com; steven.webster@windriver.com; >>> matt.peters@windriver.com; bruce.richardson@intel.com; >>> mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; >>> cristian.dumitrescu@intel.com; jgrajcia@cisco.com; >>> mb@smartsharesystems.com >>> 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: >>> >>> <...> >>> >>>>>> diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index >>>>>> 39250b5da1..f5c0865023 100644 >>>>>> --- a/lib/ethdev/meson.build >>>>>> +++ b/lib/ethdev/meson.build >>>>>> @@ -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. >>> >>> 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 >>> >>> <...> >>> >>>>>> - 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. >> Ok. >>> >>> <...> >>> >>>>>> +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); >>>>>> + 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: >>>> 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)); \ >>>> >>> >>> 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? >> >> 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. Yes. > >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. > > >>> >>> >>> >>> 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 > >>> >>> <...> >>> >>>>>> +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. >>>> >>> >>> 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', >> >> 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 > >>> >>> 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) >> > >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? > >> 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 ? >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. > >Thanks. > >> 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. >> >>> >>> 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. >> ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-02-02 10:20 ` Ankur Dwivedi @ 2023-02-02 12:52 ` Ferruh Yigit 2023-02-02 13:40 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-02-02 12:52 UTC (permalink / raw) To: Ankur Dwivedi, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko Cc: thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/2/2023 10:20 AM, Ankur Dwivedi wrote: >>>>>>> +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. >>>>> >>>> >>>> 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', >>> >>> 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 >> >>>> >>>> 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) >>> >> >> 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? >> >>> 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 ? 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. ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-02-02 12:52 ` Ferruh Yigit @ 2023-02-02 13:40 ` Ankur Dwivedi 2023-02-02 13:44 ` Ferruh Yigit 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-02 13:40 UTC (permalink / raw) To: Ferruh Yigit, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko Cc: thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb > >On 2/2/2023 10:20 AM, Ankur Dwivedi wrote: > >>>>>>>> +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. >>>>>> >>>>> >>>>> 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', >>>> >>>> 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 >>> >>>>> >>>>> 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) >>>> >>> >>> 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? >>> >>>> 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 ? > >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 > >It is possible to group and comment them as slowpath/fastpath within the >internal header. ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-02-02 13:40 ` Ankur Dwivedi @ 2023-02-02 13:44 ` Ferruh Yigit 2023-02-02 13:53 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-02-02 13:44 UTC (permalink / raw) To: Ankur Dwivedi, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko Cc: thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/2/2023 1:40 PM, Ankur Dwivedi wrote: >> >> On 2/2/2023 10:20 AM, Ankur Dwivedi wrote: >> >>>>>>>>> +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. >>>>>>> >>>>>> >>>>>> 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', >>>>> >>>>> 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 >>>> >>>>>> >>>>>> 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) >>>>> >>>> >>>> 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? >>>> >>>>> 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 ? >> >> 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? ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) 2023-02-02 13:44 ` Ferruh Yigit @ 2023-02-02 13:53 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-02 13:53 UTC (permalink / raw) To: Ferruh Yigit, dev, David Marchand, Jerin Jacob Kollanukkaran, Andrew Rybchenko Cc: thomas, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb > >On 2/2/2023 1:40 PM, Ankur Dwivedi wrote: >>> >>> On 2/2/2023 10:20 AM, Ankur Dwivedi wrote: >>> >>>>>>>>>> +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. >>>>>>>> >>>>>>> >>>>>>> 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', >>>>>> >>>>>> 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 >>>>> >>>>>>> >>>>>>> 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) >>>>>> >>>>> >>>>> 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? >>>>> >>>>>> 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 ? >>> >>> 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? There is no downside. Will merge [2] and [3], with file named as ethdev_trace.h. ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v6 3/6] ethdev: add trace points for ethdev (part two) 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi @ 2023-01-20 8:40 ` Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 4/6] ethdev: add trace points for flow Ankur Dwivedi ` (4 subsequent siblings) 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-20 8:40 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for remaining ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 4fea76e0ff..102a18fcc1 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 40897ad94d..60d2ab47ea 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -3539,6 +3539,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); + return 0; } @@ -3559,6 +3561,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct rte_eth_conf)); + rte_ethdev_trace_conf_get(port_id, dev_conf); + return 0; } @@ -3589,8 +3593,10 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) if (all_ptypes[i] & ptype_mask) { - if (j < num) + if (j < num) { ptypes[j] = all_ptypes[i]; + rte_ethdev_trace_get_supported_ptypes(port_id, j, num, ptypes[j]); + } j++; } @@ -3668,6 +3674,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, if (ptype_mask & all_ptypes[i]) { if (j < num - 1) { set_ptypes[j] = all_ptypes[i]; + rte_ethdev_trace_set_ptypes(port_id, j, num, set_ptypes[j]); j++; continue; } @@ -3709,6 +3716,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, num = RTE_MIN(dev_info.max_mac_addrs, num); memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); + rte_eth_trace_macaddrs_get(port_id, num); + return num; } @@ -3729,6 +3738,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); + rte_eth_trace_macaddr_get(port_id, mac_addr); + return 0; } @@ -3747,6 +3758,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + + rte_ethdev_trace_get_mtu(port_id, *mtu); + return 0; } @@ -3789,7 +3803,11 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_mtu(port_id, mtu, ret); + + return ret; } int @@ -3832,7 +3850,11 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) vfc->ids[vidx] &= ~RTE_BIT64(vbit); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); + + return ret; } int @@ -3851,8 +3873,11 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, if (*dev->dev_ops->vlan_strip_queue_set == NULL) return -ENOTSUP; + (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); + return 0; } @@ -3862,14 +3887,18 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, uint16_t tpid) { 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->vlan_tpid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, - tpid)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, tpid)); + + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); + + return ret; } int @@ -3961,7 +3990,11 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) dev->data->dev_conf.rxmode.offloads = orig_offloads; } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); + + return ret; } int @@ -3987,6 +4020,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); + return ret; } @@ -3994,19 +4029,25 @@ int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { 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->vlan_pvid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); + + return ret; } int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4021,13 +4062,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_get == NULL) return -ENOTSUP; memset(fc_conf, 0, sizeof(*fc_conf)); - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); + + return ret; } int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4046,7 +4092,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); + + return ret; } int @@ -4054,6 +4104,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4071,9 +4122,14 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, } /* High water, low water validation are device specific */ - if (*dev->dev_ops->priority_flow_ctrl_set) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) - (dev, pfc_conf)); + if (*dev->dev_ops->priority_flow_ctrl_set) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) + (dev, pfc_conf)); + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, ret); + + return ret; + } + return -ENOTSUP; } @@ -4132,6 +4188,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, struct rte_eth_pfc_queue_info *pfc_queue_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4142,9 +4199,13 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, pfc_queue_info, + ret); + return ret; + } return -ENOTSUP; } @@ -4213,10 +4274,16 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, return ret; } - if (*dev->dev_ops->priority_flow_ctrl_queue_config) - return eth_err(port_id, - (*dev->dev_ops->priority_flow_ctrl_queue_config)( - dev, pfc_queue_conf)); + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { + ret = eth_err(port_id, + (*dev->dev_ops->priority_flow_ctrl_queue_config)( + dev, pfc_queue_conf)); + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf, + ret); + return ret; + } + return -ENOTSUP; } @@ -4308,8 +4375,12 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, if (*dev->dev_ops->reta_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4337,8 +4408,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, if (*dev->dev_ops->reta_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4382,8 +4457,11 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, if (*dev->dev_ops->rss_hash_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, rss_conf)); + + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); + + return ret; } int @@ -4391,6 +4469,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4404,8 +4483,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, if (*dev->dev_ops->rss_hash_conf_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); + + return ret; } int @@ -4413,6 +4496,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4431,8 +4515,11 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_add == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, - udp_tunnel)); + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); + + return ret; } int @@ -4440,6 +4527,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4458,34 +4546,47 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_del == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, - udp_tunnel)); + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); + + return ret; } int rte_eth_led_on(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_led_on == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + + rte_eth_trace_led_on(port_id, ret); + + return ret; } int rte_eth_led_off(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_led_off == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + + rte_eth_trace_led_off(port_id, ret); + + return ret; } int @@ -4510,6 +4611,8 @@ rte_eth_fec_get_capability(uint16_t port_id, return -ENOTSUP; ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, num); + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); + return ret; } @@ -4517,6 +4620,7 @@ int rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4530,20 +4634,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) if (*dev->dev_ops->fec_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + + rte_eth_trace_fec_get(port_id, fec_capa, ret); + + return ret; } int rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) { 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->fec_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + + rte_eth_trace_fec_set(port_id, fec_capa, ret); + + return ret; } /* @@ -4631,7 +4744,11 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); + + return ret; } int @@ -4671,6 +4788,8 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) /* reset pool bitmap */ dev->data->mac_pool_sel[index] = 0; + rte_ethdev_trace_mac_addr_remove(port_id, addr); + return 0; } @@ -4703,6 +4822,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) /* Update default address in NIC data structure */ rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); + rte_ethdev_trace_default_mac_addr_set(port_id, addr); + return 0; } @@ -4793,21 +4914,29 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, &dev->data->hash_mac_addrs[index]); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { 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->uc_all_hash_table_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, - on)); + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, on)); + + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, @@ -4843,14 +4972,18 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (*dev->dev_ops->set_queue_rate_limit == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, - queue_idx, tx_rate)); + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate)); + + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, ret); + + return ret; } int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, uint8_t avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4870,14 +5003,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, } if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, - queue_id, avail_thresh)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, queue_id, + avail_thresh)); + + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, ret); + + return ret; } int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, uint8_t *avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4889,8 +5027,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, - queue_id, avail_thresh)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, + avail_thresh)); + + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); + + return ret; } RTE_INIT(eth_dev_init_fp_ops) @@ -4972,6 +5114,10 @@ rte_eth_dev_callback_register(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, next_port, + last_port); + return 0; } @@ -5033,6 +5179,9 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, ret); + return ret; } @@ -5062,6 +5211,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { vec = rte_intr_vec_list_index_get(intr_handle, qid); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5105,6 +5257,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); + return fd; } @@ -5138,6 +5292,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, vec = rte_intr_vec_list_index_get(intr_handle, queue_id); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5164,7 +5321,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); + + return ret; } int @@ -5183,7 +5344,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); + + return ret; } @@ -5241,6 +5406,8 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5280,6 +5447,8 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, cb, __ATOMIC_RELEASE); rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5339,6 +5508,8 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5373,6 +5544,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5407,6 +5580,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5453,6 +5628,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5499,6 +5676,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5507,6 +5686,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5526,8 +5706,11 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->rx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5535,6 +5718,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5554,8 +5738,11 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->tx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5563,6 +5750,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, struct rte_power_monitor_cond *pmc) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5581,8 +5769,11 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->get_monitor_addr == NULL) return -ENOTSUP; - return eth_err(port_id, - dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); + + return ret; } int @@ -5591,40 +5782,54 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, uint32_t nb_mc_addr) { 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->set_mc_addr_list == NULL) return -ENOTSUP; - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, - mc_addr_set, nb_mc_addr)); + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, mc_addr_set, nb_mc_addr)); + + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr, ret); + + return ret; } int rte_eth_timesync_enable(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->timesync_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + + rte_eth_trace_timesync_enable(port_id, ret); + + return ret; } int rte_eth_timesync_disable(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->timesync_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + + rte_eth_trace_timesync_disable(port_id, ret); + + return ret; } int @@ -5632,6 +5837,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5645,8 +5851,13 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) - (dev, timestamp, flags)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) + (dev, timestamp, flags)); + + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags, ret); + + return ret; } int @@ -5654,6 +5865,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5667,27 +5879,39 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) - (dev, timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) + (dev, timestamp)); + + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, ret); + + return ret; + } int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { 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->timesync_adjust_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); + + return ret; } int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5701,14 +5925,19 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) if (*dev->dev_ops->timesync_read_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, - timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, timestamp)); + + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); + + return ret; } int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5722,14 +5951,18 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) if (*dev->dev_ops->timesync_write_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, - timestamp)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, timestamp)); + + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); + + return ret; } int rte_eth_read_clock(uint16_t port_id, uint64_t *clock) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5742,13 +5975,18 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) if (*dev->dev_ops->read_clock == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + + rte_eth_trace_read_clock(port_id, clock, ret); + + return ret; } int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; @@ -5762,26 +6000,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) if (*dev->dev_ops->get_reg == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + + rte_ethdev_trace_get_reg_info(port_id, info, ret); + + return ret; } int rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + + rte_ethdev_trace_get_eeprom_length(port_id, ret); + + return ret; } int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5795,13 +6043,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->get_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + + rte_ethdev_trace_get_eeprom(port_id, info, ret); + + return ret; } int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5815,7 +6068,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->set_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + + rte_ethdev_trace_set_eeprom(port_id, info, ret); + + return ret; } int @@ -5823,6 +6080,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5836,7 +6094,11 @@ rte_eth_dev_get_module_info(uint16_t port_id, if (*dev->dev_ops->get_module_info == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_info)(dev, modinfo); + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); + + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); + + return ret; } int @@ -5844,6 +6106,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5871,7 +6134,11 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, if (*dev->dev_ops->get_module_eeprom == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_eeprom)(dev, info); + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); + + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); + + return ret; } int @@ -5879,6 +6146,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5894,7 +6162,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, if (*dev->dev_ops->get_dcb_info == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); + + return ret; } static void @@ -5930,6 +6202,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); + return 0; } @@ -5938,6 +6212,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, struct rte_eth_hairpin_cap *cap) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5952,13 +6227,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, if (*dev->dev_ops->hairpin_cap_get == NULL) return -ENOTSUP; memset(cap, 0, sizeof(*cap)); - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); + + return ret; } int rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5973,7 +6253,11 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) if (*dev->dev_ops->pool_ops_supported == NULL) return 1; /* all pools are supported */ - return (*dev->dev_ops->pool_ops_supported)(dev, pool); + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); + + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); + + return ret; } static int @@ -6263,19 +6547,25 @@ rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_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]; if (*dev->dev_ops->representor_info_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + + rte_eth_trace_representor_info_get(port_id, info, ret); + + return ret; } int rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6294,8 +6584,11 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) if (*dev->dev_ops->rx_metadata_negotiate == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + ret = eth_err(port_id, (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + + rte_eth_trace_rx_metadata_negotiate(port_id, features, *features, ret); + + return ret; } int @@ -6303,6 +6596,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *reassembly_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6324,8 +6618,12 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, return -ENOTSUP; memset(reassembly_capa, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) (dev, reassembly_capa)); + + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa, ret); + + return ret; } int @@ -6333,6 +6631,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6353,8 +6652,11 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_get == NULL) return -ENOTSUP; memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); + + return ret; } int @@ -6362,6 +6664,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, const struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6390,8 +6693,11 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_set == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); + + return ret; } int @@ -6489,8 +6795,10 @@ rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes return 0; for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { - if (j < num) + if (j < num) { ptypes[j] = all_types[i]; + rte_eth_trace_buffer_split_get_supported_hdr_ptypes(port_id, j, ptypes[j]); + } j++; } diff --git a/lib/ethdev/rte_ethdev_cman.c b/lib/ethdev/rte_ethdev_cman.c index 4a1bdd7bd0..c4d877d878 100644 --- a/lib/ethdev/rte_ethdev_cman.c +++ b/lib/ethdev/rte_ethdev_cman.c @@ -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; } diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index bc3b3d2a1b..fa195c5cde 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -373,6 +373,535 @@ 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, + 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, 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_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_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_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_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, 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_configure, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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, + 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, 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, 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, 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, + 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_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, 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, 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, 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, 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, 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, + 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, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int epfd, + int op, 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_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); +) + +RTE_TRACE_POINT( + 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); +) + +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, + 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, void *user_param, + 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, void *user_param, + 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_ethdev_trace_set_mc_addr_list, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_ethdev_trace_set_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_hairpin_capability_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_rx_metadata_negotiate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, + 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_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_cman_config_init, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 9f1d3d5a1b..35036e6825 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -304,6 +304,348 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + 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_FP( + 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_FP( + rte_eth_trace_macaddr_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); +) + +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); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_ethdev_trace_flow_ctrl_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_priority_flow_ctrl_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_rss_reta_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_rss_hash_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_eth_trace_fec_get, + 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_ptr(fec_capa); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_rx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_tx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_rx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_tx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_get_monitor_addr, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_timesync_read_rx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_size_t(timestamp->tv_nsec); + rte_trace_point_emit_u32(flags); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_timesync_read_tx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_size_t(timestamp->tv_nsec); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_timesync_read_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_size_t(time->tv_nsec); + rte_trace_point_emit_int(ret); +) + +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); +) + +RTE_TRACE_POINT_FP( + 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_size_t(time->tv_nsec); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_read_clock, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_get_reg_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + 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_FP( + rte_ethdev_trace_get_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_get_module_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_module_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_dcb_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + 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_FP( + rte_eth_trace_representor_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_eth_trace_ip_reassembly_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + 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_FP( + rte_eth_trace_cman_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c7ba2e3dc8..c7c6bcd42b 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -300,36 +300,71 @@ EXPERIMENTAL { rte_mtr_meter_profile_get; # added in 23.03 + __rte_eth_trace_add_first_rx_callback; + __rte_eth_trace_add_rx_callback; + __rte_eth_trace_add_tx_callback; __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_cman_config_get; + __rte_eth_trace_cman_config_init; + __rte_eth_trace_cman_config_set; + __rte_eth_trace_cman_info_get; + __rte_eth_trace_fec_get_capability; + __rte_eth_trace_fec_get; + __rte_eth_trace_fec_set; __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_get_monitor_addr; __rte_eth_trace_hairpin_bind; __rte_eth_trace_hairpin_get_peer_ports; __rte_eth_trace_hairpin_unbind; + __rte_eth_trace_ip_reassembly_capability_get; + __rte_eth_trace_ip_reassembly_conf_get; + __rte_eth_trace_ip_reassembly_conf_set; __rte_eth_trace_iterator_cleanup; __rte_eth_trace_iterator_init; __rte_eth_trace_iterator_next; + __rte_eth_trace_led_off; + __rte_eth_trace_led_on; __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_macaddr_get; + __rte_eth_trace_macaddrs_get; __rte_eth_trace_promiscuous_disable; __rte_eth_trace_promiscuous_enable; __rte_eth_trace_promiscuous_get; + __rte_eth_trace_remove_rx_callback; + __rte_eth_trace_remove_tx_callback; + __rte_eth_trace_representor_info_get; + __rte_eth_trace_rx_avail_thresh_query; + __rte_eth_trace_rx_avail_thresh_set; + __rte_eth_trace_rx_burst_mode_get; __rte_eth_trace_rx_hairpin_queue_setup; + __rte_eth_trace_rx_metadata_negotiate; + __rte_eth_trace_rx_queue_info_get; + __rte_eth_trace_set_queue_rate_limit; __rte_eth_trace_speed_bitflag; __rte_eth_trace_stats_get; __rte_eth_trace_stats_reset; + __rte_eth_trace_timesync_adjust_time; + __rte_eth_trace_timesync_disable; + __rte_eth_trace_timesync_enable; + __rte_eth_trace_timesync_read_rx_timestamp; + __rte_eth_trace_timesync_read_time; + __rte_eth_trace_timesync_read_tx_timestamp; + __rte_eth_trace_timesync_write_time; __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_burst_mode_get; __rte_eth_trace_tx_done_cleanup; __rte_eth_trace_tx_hairpin_queue_setup; __rte_eth_trace_xstats_get; @@ -338,32 +373,78 @@ EXPERIMENTAL { __rte_eth_trace_xstats_get_names; __rte_eth_trace_xstats_get_names_by_id; __rte_eth_trace_xstats_reset; + __rte_ethdev_trace_adjust_nb_rx_tx_desc; + __rte_ethdev_trace_callback_register; + __rte_ethdev_trace_callback_unregister; __rte_ethdev_trace_capability_name; + __rte_ethdev_trace_conf_get; __rte_ethdev_trace_count_avail; __rte_ethdev_trace_count_total; + __rte_ethdev_trace_default_mac_addr_set; + __rte_ethdev_trace_flow_ctrl_get; + __rte_ethdev_trace_flow_ctrl_set; __rte_ethdev_trace_fw_version_get; + __rte_ethdev_trace_get_dcb_info; + __rte_ethdev_trace_get_eeprom; + __rte_ethdev_trace_get_eeprom_length; + __rte_ethdev_trace_get_module_eeprom; + __rte_ethdev_trace_get_module_info; + __rte_ethdev_trace_get_mtu; __rte_ethdev_trace_get_name_by_port; __rte_ethdev_trace_get_port_by_name; + __rte_ethdev_trace_get_reg_info; __rte_ethdev_trace_get_sec_ctx; + __rte_ethdev_trace_get_supported_ptypes; + __rte_ethdev_trace_get_vlan_offload; + __rte_ethdev_trace_hairpin_capability_get; + __rte_ethdev_trace_info_get; __rte_ethdev_trace_is_removed; __rte_ethdev_trace_is_valid_port; + __rte_ethdev_trace_mac_addr_add; + __rte_ethdev_trace_mac_addr_remove; __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_pool_ops_supported; + __rte_ethdev_trace_priority_flow_ctrl_queue_configure; + __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; + __rte_ethdev_trace_priority_flow_ctrl_set; __rte_ethdev_trace_reset; + __rte_ethdev_trace_rss_hash_conf_get; + __rte_ethdev_trace_rss_hash_update; + __rte_ethdev_trace_rss_reta_query; + __rte_ethdev_trace_rss_reta_update; + __rte_ethdev_trace_rx_intr_ctl; + __rte_ethdev_trace_rx_intr_ctl_q; + __rte_ethdev_trace_rx_intr_ctl_q_get_fd; + __rte_ethdev_trace_rx_intr_disable; + __rte_ethdev_trace_rx_intr_enable; __rte_ethdev_trace_rx_offload_name; __rte_ethdev_trace_rx_queue_start; __rte_ethdev_trace_rx_queue_stop; + __rte_ethdev_trace_set_eeprom; __rte_ethdev_trace_set_link_down; __rte_ethdev_trace_set_link_up; + __rte_ethdev_trace_set_mc_addr_list; + __rte_ethdev_trace_set_mtu; + __rte_ethdev_trace_set_ptypes; __rte_ethdev_trace_set_rx_queue_stats_mapping; __rte_ethdev_trace_set_tx_queue_stats_mapping; + __rte_ethdev_trace_set_vlan_ether_type; + __rte_ethdev_trace_set_vlan_offload; + __rte_ethdev_trace_set_vlan_pvid; + __rte_ethdev_trace_set_vlan_strip_on_queue; __rte_ethdev_trace_socket_id; __rte_ethdev_trace_tx_offload_name; __rte_ethdev_trace_tx_queue_start; __rte_ethdev_trace_tx_queue_stop; + __rte_ethdev_trace_uc_all_hash_table_set; + __rte_ethdev_trace_uc_hash_table_set; + __rte_ethdev_trace_udp_tunnel_port_add; + __rte_ethdev_trace_udp_tunnel_port_delete; + __rte_ethdev_trace_vlan_filter; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v6 4/6] ethdev: add trace points for flow 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi ` (2 preceding siblings ...) 2023-01-20 8:40 ` [PATCH v6 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi @ 2023-01-20 8:40 ` Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 5/6] ethdev: add trace points for mtr Ankur Dwivedi ` (3 subsequent siblings) 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-20 8:40 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 102a18fcc1..1953d90a5a 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index fa195c5cde..fd4fbaf6de 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -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); + 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_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); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_destroy, + 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); + 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_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); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_int(action->type); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + 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), + 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), + 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), + 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 diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 35036e6825..8e77675557 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -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 diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 7d0c24366c..43f13f79b4 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -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, @@ -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; } 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; } 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 @@ -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 @@ -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, 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, 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, + error), + error); + + rte_flow_trace_tunnel_action_decap_release(port_id, actions, + num_of_actions, ret); + + 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; } 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)) 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 * @@ -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 @@ -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; } 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; } 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; } 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; } 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); + 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; } 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; } 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; } 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); + 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 @@ -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 @@ -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, + action_handle, data, user_data, + ret); + + return ret; } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c7c6bcd42b..0cb8222ad9 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v6 5/6] ethdev: add trace points for mtr 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi ` (3 preceding siblings ...) 2023-01-20 8:40 ` [PATCH v6 4/6] ethdev: add trace points for flow Ankur Dwivedi @ 2023-01-20 8:40 ` Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 6/6] ethdev: add trace points for tm Ankur Dwivedi ` (2 subsequent siblings) 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-20 8:40 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 1953d90a5a..067e5fdab4 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index fd4fbaf6de..2a0516e10d 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1285,6 +1286,117 @@ 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, + struct rte_mtr_capabilities *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_mtr_trace_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + 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); +) + +RTE_TRACE_POINT( + 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); +) + +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_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_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id, + 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_policy_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + 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( + rte_mtr_trace_meter_policy_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(policy_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_policy_validate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_int(actions->type); + rte_trace_point_emit_ptr(actions->conf); +) + +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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 8e77675557..173e9c9e48 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT_FP( rte_eth_trace_call_rx_callbacks, @@ -759,6 +760,105 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + rte_mtr_trace_meter_profile_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id, 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_FP( + rte_mtr_trace_meter_policy_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, + 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_FP( + 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_FP( + 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_FP( + 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_FP( + rte_mtr_trace_meter_vlan_table_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + 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_FP( + 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_FP( + 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_FP( + rte_mtr_trace_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + 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_ptr(stats_mask); + rte_trace_point_emit_int(clear); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index 3954839531..da092cd939 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -6,6 +6,8 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -82,8 +84,14 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, capabilities_get)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_mtr_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* MTR meter profile add */ @@ -94,8 +102,14 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); + + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile, ret); + + return ret; } /** MTR meter profile delete */ @@ -105,8 +119,14 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id, ret); + + return ret; } /** MTR meter profile get */ @@ -116,8 +136,14 @@ rte_mtr_meter_profile_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, + struct rte_flow_meter_profile *ret; + + ret = RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_get(port_id, meter_profile_id, ret); + + return ret; } /* MTR meter policy validate */ @@ -127,6 +153,10 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_validate(port_id, policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); } @@ -139,6 +169,11 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_add(port_id, policy_id, + policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); } @@ -150,6 +185,7 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_delete(port_id, policy_id); return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); } @@ -161,8 +197,14 @@ rte_mtr_meter_policy_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, + struct rte_flow_meter_policy *ret; + + ret = RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_get(port_id, policy_id, ret); + + return ret; } /** MTR object create */ @@ -174,8 +216,14 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, create)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); + + rte_mtr_trace_create(port_id, mtr_id, params, shared, ret); + + return ret; } /** MTR object destroy */ @@ -185,8 +233,14 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, destroy)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); + + rte_mtr_trace_destroy(port_id, mtr_id, ret); + + return ret; } /** MTR object meter enable */ @@ -196,8 +250,14 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_enable)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); + + rte_mtr_trace_meter_enable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter disable */ @@ -207,8 +267,14 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_disable)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); + + rte_mtr_trace_meter_disable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter profile update */ @@ -219,8 +285,14 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); + + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id, ret); + + return ret; } /** MTR object meter policy update */ @@ -231,8 +303,14 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); + + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id, ret); + + return ret; } /** MTR object meter DSCP table update */ @@ -243,8 +321,14 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, proto, dscp_table, error); + + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table, ret); + + return ret; } /** MTR object meter VLAN table update */ @@ -255,8 +339,14 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, proto, vlan_table, error); + + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table, ret); + + return ret; } /** Set the input color protocol on MTR object */ @@ -268,8 +358,14 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_set)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority, ret); + + return ret; } /** Get input color protocols of MTR object */ @@ -280,8 +376,14 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_get)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); + + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id, ret); + + return ret; } /** Get input color protocol priority of MTR object */ @@ -293,8 +395,14 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto, ret); + + return ret; } /** MTR object enabled stats update */ @@ -305,8 +413,14 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); + + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask, ret); + + return ret; } /** MTR object stats read */ @@ -319,6 +433,12 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_read)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); + + rte_mtr_trace_stats_read(port_id, mtr_id, stats, stats_mask, clear, ret); + + return ret; } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 0cb8222ad9..c1a6e4d30a 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v6 6/6] ethdev: add trace points for tm 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi ` (4 preceding siblings ...) 2023-01-20 8:40 ` [PATCH v6 5/6] ethdev: add trace points for mtr Ankur Dwivedi @ 2023-01-20 8:40 ` Ankur Dwivedi 2023-01-23 9:02 ` [PATCH v7 0/6] add trace points in ethdev library Ankur Dwivedi 2023-01-23 17:30 ` [PATCH v6 " Ferruh Yigit 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-20 8:40 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 067e5fdab4..af66a139df 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 2a0516e10d..694ab0c731 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1397,6 +1398,146 @@ RTE_TRACE_POINT( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT( + rte_tm_trace_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_tm_capabilities *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_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_level_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t level_id, + 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_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, + 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_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + 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(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_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_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_shaper_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id, + 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_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_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_wred_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id, + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 173e9c9e48..73ebad7152 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT_FP( rte_eth_trace_call_rx_callbacks, @@ -859,6 +860,176 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + 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_FP( + 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_ptr(is_leaf); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + rte_tm_trace_node_wfq_weight_mode_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + 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_FP( + 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_FP( + 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_FP( + rte_tm_trace_node_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + 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_ptr(stats_mask); + rte_trace_point_emit_int(clear); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + 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_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..eb4c8f103f 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -6,6 +6,8 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +81,9 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); + return 0; } @@ -90,8 +95,14 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_type_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); + + rte_tm_trace_node_type_get(port_id, node_id, is_leaf, ret); + + return ret; } /* Get capabilities */ @@ -100,8 +111,14 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_tm_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* Get level capabilities */ @@ -111,8 +128,14 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); + + rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret); + + return ret; } /* Get node capabilities */ @@ -122,8 +145,14 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); + + rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret); + + return ret; } /* Add WRED profile */ @@ -133,8 +162,14 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); + + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -143,8 +178,14 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); + + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret); + + return ret; } /* Add/update shared WRED context */ @@ -154,8 +195,15 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); + + rte_tm_trace_shared_wred_context_add_update(port_id, shared_wred_context_id, + wred_profile_id, ret); + + return ret; } /* Delete shared WRED context */ @@ -164,8 +212,14 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); + + rte_tm_trace_shared_wred_context_delete(port_id, shared_wred_context_id, ret); + + return ret; } /* Add shaper profile */ @@ -175,8 +229,14 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); + + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -185,8 +245,14 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); + + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, ret); + + return ret; } /* Add shared shaper */ @@ -196,8 +262,15 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); + + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id, ret); + + return ret; } /* Delete shared shaper */ @@ -206,8 +279,14 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); + + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, ret); + + return ret; } /* Add node to port traffic manager hierarchy */ @@ -221,9 +300,16 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); + + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + + return ret; } /* Delete node from traffic manager hierarchy */ @@ -232,8 +318,14 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); + + rte_tm_trace_node_delete(port_id, node_id, ret); + + return ret; } /* Suspend node */ @@ -242,8 +334,14 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_suspend)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); + + rte_tm_trace_node_suspend(port_id, node_id, ret); + + return ret; } /* Resume node */ @@ -252,8 +350,14 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_resume)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); + + rte_tm_trace_node_resume(port_id, node_id, ret); + + return ret; } /* Commit the initial port traffic manager hierarchy */ @@ -262,8 +366,14 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); + + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret); + + return ret; } /* Update node parent */ @@ -275,8 +385,15 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_parent_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); + + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight, ret); + + return ret; } /* Update node private shaper */ @@ -286,8 +403,14 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shaper_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); + + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id, ret); + + return ret; } /* Update node shared shapers */ @@ -298,8 +421,15 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); + + rte_tm_trace_node_shared_shaper_update(port_id, node_id, shared_shaper_id, + add, ret); + + return ret; } /* Update node stats */ @@ -309,8 +439,14 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); + + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, ret); + + return ret; } /* Update WFQ weight mode */ @@ -321,8 +457,15 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); + + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, wfq_weight_mode, + n_sp_priorities, ret); + + return ret; } /* Update node congestion management mode */ @@ -332,8 +475,14 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_cman_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); + + rte_tm_trace_node_cman_update(port_id, node_id, cman, ret); + + return ret; } /* Update node private WRED context */ @@ -343,8 +492,15 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); + + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id, + ret); + + return ret; } /* Update node shared WRED context */ @@ -355,8 +511,16 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); + + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add, ret); + + return ret; } /* Read and/or clear stats counters for specific node */ @@ -368,8 +532,15 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_read)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); + + rte_tm_trace_node_stats_read(port_id, node_id, stats, stats_mask, + clear, ret); + + return ret; } /* Packet marking - VLAN DEI */ @@ -380,8 +551,14 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } /* Packet marking - IPv4/IPv6 ECN */ @@ -392,8 +569,14 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } /* Packet marking - IPv4/IPv6 DSCP */ @@ -404,6 +587,12 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c1a6e4d30a..112b2b1039 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v7 0/6] add trace points in ethdev library 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi ` (5 preceding siblings ...) 2023-01-20 8:40 ` [PATCH v6 6/6] ethdev: add trace points for tm Ankur Dwivedi @ 2023-01-23 9:02 ` Ankur Dwivedi 2023-01-23 9:02 ` [PATCH v7 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi ` (6 more replies) 2023-01-23 17:30 ` [PATCH v6 " Ferruh Yigit 7 siblings, 7 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-23 9:02 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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 -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v7 1/6] eal: trace: add trace point emit for blob 2023-01-23 9:02 ` [PATCH v7 0/6] add trace points in ethdev library Ankur Dwivedi @ 2023-01-23 9:02 ` Ankur Dwivedi 2023-01-23 13:01 ` Jerin Jacob 2023-01-30 7:30 ` Sunil Kumar Kori 2023-01-23 9:02 ` [PATCH v7 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi ` (5 subsequent siblings) 6 siblings, 2 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-23 9:02 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(+) diff --git a/app/test/test_trace.c b/app/test/test_trace.c index 6bedf14024..ad4a394a29 100644 --- a/app/test/test_trace.c +++ b/app/test/test_trace.c @@ -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; diff --git a/doc/guides/prog_guide/trace_lib.rst b/doc/guides/prog_guide/trace_lib.rst index 9a8f38073d..3e0ea5835c 100644 --- a/doc/guides/prog_guide/trace_lib.rst +++ b/doc/guides/prog_guide/trace_lib.rst @@ -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. diff --git a/lib/eal/common/eal_common_trace_points.c b/lib/eal/common/eal_common_trace_points.c index 0b0b254615..051f89809c 100644 --- a/lib/eal/common/eal_common_trace_points.c +++ b/lib/eal/common/eal_common_trace_points.c @@ -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) diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h index 5ef4398230..e0b836eb2f 100644 --- a/lib/eal/include/rte_eal_trace.h +++ b/lib/eal/include/rte_eal_trace.h @@ -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 */ diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index 0f8700974f..4d6b5700dd 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -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_ */ diff --git a/lib/eal/include/rte_trace_point_register.h b/lib/eal/include/rte_trace_point_register.h index a32f4d731b..a9682d3f22 100644 --- a/lib/eal/include/rte_trace_point_register.h +++ b/lib/eal/include/rte_trace_point_register.h @@ -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 diff --git a/lib/eal/version.map b/lib/eal/version.map index 7ad12a7dc9..67be24686a 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v7 1/6] eal: trace: add trace point emit for blob 2023-01-23 9:02 ` [PATCH v7 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-01-23 13:01 ` Jerin Jacob 2023-01-23 13:08 ` Morten Brørup 2023-01-30 7:30 ` Sunil Kumar Kori 1 sibling, 1 reply; 172+ messages in thread From: Jerin Jacob @ 2023-01-23 13:01 UTC (permalink / raw) To: Ankur Dwivedi Cc: dev, thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On Mon, Jan 23, 2023 at 2:35 PM Ankur Dwivedi <adwivedi@marvell.com> wrote: > > 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. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com> > --- > 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(+) > > diff --git a/app/test/test_trace.c b/app/test/test_trace.c > index 6bedf14024..ad4a394a29 100644 > --- a/app/test/test_trace.c > +++ b/app/test/test_trace.c > @@ -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; > diff --git a/doc/guides/prog_guide/trace_lib.rst b/doc/guides/prog_guide/trace_lib.rst > index 9a8f38073d..3e0ea5835c 100644 > --- a/doc/guides/prog_guide/trace_lib.rst > +++ b/doc/guides/prog_guide/trace_lib.rst > @@ -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. > diff --git a/lib/eal/common/eal_common_trace_points.c b/lib/eal/common/eal_common_trace_points.c > index 0b0b254615..051f89809c 100644 > --- a/lib/eal/common/eal_common_trace_points.c > +++ b/lib/eal/common/eal_common_trace_points.c > @@ -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) > diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h > index 5ef4398230..e0b836eb2f 100644 > --- a/lib/eal/include/rte_eal_trace.h > +++ b/lib/eal/include/rte_eal_trace.h > @@ -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 */ > diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h > index 0f8700974f..4d6b5700dd 100644 > --- a/lib/eal/include/rte_trace_point.h > +++ b/lib/eal/include/rte_trace_point.h > @@ -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_ */ > diff --git a/lib/eal/include/rte_trace_point_register.h b/lib/eal/include/rte_trace_point_register.h > index a32f4d731b..a9682d3f22 100644 > --- a/lib/eal/include/rte_trace_point_register.h > +++ b/lib/eal/include/rte_trace_point_register.h > @@ -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 > diff --git a/lib/eal/version.map b/lib/eal/version.map > index 7ad12a7dc9..67be24686a 100644 > --- a/lib/eal/version.map > +++ b/lib/eal/version.map > @@ -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 > ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob 2023-01-23 13:01 ` Jerin Jacob @ 2023-01-23 13:08 ` Morten Brørup 2023-01-23 13:39 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Morten Brørup @ 2023-01-23 13:08 UTC (permalink / raw) To: Jerin Jacob, Ankur Dwivedi Cc: dev, thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia > From: Jerin Jacob [mailto:jerinjacobk@gmail.com] > Sent: Monday, 23 January 2023 14.01 > > On Mon, Jan 23, 2023 at 2:35 PM Ankur Dwivedi <adwivedi@marvell.com> > wrote: > > > > 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. > > > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> 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: Acked-by: Morten Brørup <mb@smartsharesystems.com> ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob 2023-01-23 13:08 ` Morten Brørup @ 2023-01-23 13:39 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-23 13:39 UTC (permalink / raw) To: Morten Brørup, Jerin Jacob Cc: dev, thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia >-----Original Message----- >From: Morten Brørup <mb@smartsharesystems.com> >Sent: Monday, January 23, 2023 6:39 PM >To: Jerin Jacob <jerinjacobk@gmail.com>; Ankur Dwivedi ><adwivedi@marvell.com> >Cc: dev@dpdk.org; thomas@monjalon.net; david.marchand@redhat.com; >mdr@ashroe.eu; orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; >humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; >qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; >shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; >chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; >shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; >john.miller@atomicrules.com; ajit.khaparde@broadcom.com; >somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran ><jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith >Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan ><srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; >rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; >liudongdong3@huawei.com; yisen.zhuang@huawei.com; >xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; >zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; >qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; >xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; >rosen.xu@intel.com; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; >Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori ><skori@marvell.com>; Satha Koteswara Rao Kottidi ><skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; >zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; >Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara ><sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; >longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; >niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; >sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; >sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody ><rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra >Singh Rawat <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; >jiawenwu@trustnetic.com; jianwang@trustnetic.com; jbehrens@vmware.com; >maxime.coquelin@redhat.com; chenbo.xia@intel.com; >steven.webster@windriver.com; matt.peters@windriver.com; >bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; >jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; jgrajcia@cisco.com >Subject: [EXT] RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob > >External Email > >---------------------------------------------------------------------- >> From: Jerin Jacob [mailto:jerinjacobk@gmail.com] >> Sent: Monday, 23 January 2023 14.01 >> >> On Mon, Jan 23, 2023 at 2:35 PM Ankur Dwivedi <adwivedi@marvell.com> >> wrote: >> > >> > 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. >> > >> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > >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. > >For the benefit of Patchwork, here it is again: > >Acked-by: Morten Brørup <mb@smartsharesystems.com> Thanks. ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob 2023-01-23 9:02 ` [PATCH v7 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-01-23 13:01 ` Jerin Jacob @ 2023-01-30 7:30 ` Sunil Kumar Kori 2023-01-30 8:15 ` Morten Brørup 1 sibling, 1 reply; 172+ messages in thread From: Sunil Kumar Kori @ 2023-01-30 7:30 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Monday, January 23, 2023 2:32 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha > Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi > <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla > <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; > Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; > viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > Rasesh Mody <rmody@marvell.com>; Shahed Shaikh > <shshaikh@marvell.com>; Devendra Singh Rawat > <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; > mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > 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. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > 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(+) > Acked-by: Sunil Kumar Kori <skori@marvell.com> > diff --git a/app/test/test_trace.c b/app/test/test_trace.c index > 6bedf14024..ad4a394a29 100644 > --- a/app/test/test_trace.c > +++ b/app/test/test_trace.c > @@ -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; > diff --git a/doc/guides/prog_guide/trace_lib.rst > b/doc/guides/prog_guide/trace_lib.rst > index 9a8f38073d..3e0ea5835c 100644 > --- a/doc/guides/prog_guide/trace_lib.rst > +++ b/doc/guides/prog_guide/trace_lib.rst > @@ -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. > diff --git a/lib/eal/common/eal_common_trace_points.c > b/lib/eal/common/eal_common_trace_points.c > index 0b0b254615..051f89809c 100644 > --- a/lib/eal/common/eal_common_trace_points.c > +++ b/lib/eal/common/eal_common_trace_points.c > @@ -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) > diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h > index 5ef4398230..e0b836eb2f 100644 > --- a/lib/eal/include/rte_eal_trace.h > +++ b/lib/eal/include/rte_eal_trace.h > @@ -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. > #define RTE_EAL_TRACE_GENERIC_FUNC > rte_eal_trace_generic_func(__func__) > > /* Interrupt */ [snipped] > 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob 2023-01-30 7:30 ` Sunil Kumar Kori @ 2023-01-30 8:15 ` Morten Brørup 2023-01-30 8:40 ` Sunil Kumar Kori 0 siblings, 1 reply; 172+ messages in thread From: Morten Brørup @ 2023-01-30 8:15 UTC (permalink / raw) To: Sunil Kumar Kori, Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi > From: Sunil Kumar Kori [mailto:skori@marvell.com] > Sent: Monday, 30 January 2023 08.31 > > > From: Ankur Dwivedi <adwivedi@marvell.com> > > Sent: Monday, January 23, 2023 2:32 PM > > [...] > > +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. 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), > > Rest is fine. Already acked above. > > > #define RTE_EAL_TRACE_GENERIC_FUNC > > rte_eal_trace_generic_func(__func__) > > > > /* Interrupt */ > > [snipped] > > > 2.25.1 > ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob 2023-01-30 8:15 ` Morten Brørup @ 2023-01-30 8:40 ` Sunil Kumar Kori 0 siblings, 0 replies; 172+ messages in thread From: Sunil Kumar Kori @ 2023-01-30 8:40 UTC (permalink / raw) To: Morten Brørup, Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, Ankur Dwivedi > -----Original Message----- > From: Morten Brørup <mb@smartsharesystems.com> > Sent: Monday, January 30, 2023 1:45 PM > To: Sunil Kumar Kori <skori@marvell.com>; Ankur Dwivedi > <adwivedi@marvell.com>; dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Satha Koteswara Rao Kottidi > <skoteshwar@marvell.com>; Liron Himi <lironh@marvell.com>; > zr@semihalf.com; Radha Chintakuntla <radhac@marvell.com>; > Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara > <sedara@marvell.com>; matan@nvidia.com; viacheslavo@nvidia.com; > longli@microsoft.com; spinler@cesnet.cz; chaoyong.he@corigine.com; > niklas.soderlund@corigine.com; hemant.agrawal@nxp.com; > sachin.saxena@oss.nxp.com; g.singh@nxp.com; apeksha.gupta@nxp.com; > sachin.saxena@nxp.com; aboyer@pensando.io; Rasesh Mody > <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Devendra > Singh Rawat <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; Ankur Dwivedi > <adwivedi@marvell.com> > Subject: [EXT] RE: [PATCH v7 1/6] eal: trace: add trace point emit for blob > > External Email > > ---------------------------------------------------------------------- > > From: Sunil Kumar Kori [mailto:skori@marvell.com] > > Sent: Monday, 30 January 2023 08.31 > > > > > From: Ankur Dwivedi <adwivedi@marvell.com> > > > Sent: Monday, January 23, 2023 2:32 PM > > > > > [...] > > > > +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. > > 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. > > > > Rest is fine. Already acked above. > > > > > #define RTE_EAL_TRACE_GENERIC_FUNC > > > rte_eal_trace_generic_func(__func__) > > > > > > /* Interrupt */ > > > > [snipped] > > > > > 2.25.1 > > ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v7 2/6] ethdev: add trace points for ethdev (part one) 2023-01-23 9:02 ` [PATCH v7 0/6] add trace points in ethdev library Ankur Dwivedi 2023-01-23 9:02 ` [PATCH v7 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-01-23 9:02 ` Ankur Dwivedi 2023-01-30 8:45 ` Sunil Kumar Kori 2023-01-23 9:02 ` [PATCH v7 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi ` (4 subsequent siblings) 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-23 9:02 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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 diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index 48090c879a..fd16b25e55 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,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; } diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2919409a15..4fea76e0ff 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -5,6 +5,7 @@ #include <rte_trace_point_register.h> #include <rte_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_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + 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..f5c0865023 100644 --- a/lib/ethdev/meson.build +++ b/lib/ethdev/meson.build @@ -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', diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 5d5e18db1e..40897ad94d 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -27,8 +27,9 @@ #include <rte_ether.h> #include <rte_telemetry.h> -#include "rte_ethdev_trace.h" #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "ethdev_driver.h" #include "ethdev_profile.h" #include "ethdev_private.h" @@ -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; @@ -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 @@ 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 */ + } } 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); 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); + 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); 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) { 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); + 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); + 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; - else + } else { + rte_ethdev_trace_is_valid_port(port_id, 1); return 1; + } } static int @@ -395,6 +420,7 @@ 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 +439,7 @@ 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 +503,7 @@ 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 +521,7 @@ 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 +555,7 @@ 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 +585,7 @@ 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 +601,21 @@ 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 +629,7 @@ rte_eth_dev_count_avail(void) RTE_ETH_FOREACH_DEV(p) count++; + rte_ethdev_trace_count_avail(count); return count; } @@ -602,6 +641,7 @@ rte_eth_dev_count_total(void) RTE_ETH_FOREACH_VALID_DEV(port) count++; + rte_ethdev_trace_count_total(count); return count; } @@ -622,6 +662,7 @@ 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 +685,7 @@ 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 +787,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 +824,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 +868,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,12 +905,17 @@ 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) { + rte_eth_trace_speed_bitflag(speed, duplex); switch (speed) { case RTE_ETH_SPEED_NUM_10M: return duplex ? RTE_ETH_LINK_SPEED_10M : RTE_ETH_LINK_SPEED_10M_HD; @@ -902,6 +961,8 @@ rte_eth_dev_rx_offload_name(uint64_t offload) } } + rte_ethdev_trace_rx_offload_name(offload, name); + return name; } @@ -918,6 +979,8 @@ rte_eth_dev_tx_offload_name(uint64_t offload) } } + rte_ethdev_trace_tx_offload_name(offload, name); + return name; } @@ -934,6 +997,8 @@ rte_eth_dev_capability_name(uint64_t capability) } } + rte_ethdev_trace_capability_name(capability, name); + return name; } @@ -1554,26 +1619,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 +1703,12 @@ 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); - return eth_err(port_id, ret); + ret = eth_err(port_id, dev->dev_ops->dev_reset(dev)); + + rte_ethdev_trace_reset(port_id, ret); + + return ret; } int @@ -1653,6 +1731,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 +2231,13 @@ 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 +2426,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 +2456,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 +2483,7 @@ 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 +2520,8 @@ 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; } @@ -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); rte_pktmbuf_free_bulk(pkts, unsent); } @@ -2444,6 +2541,7 @@ 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(pkts, unsent, *count); } int @@ -2458,6 +2556,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 +2578,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 +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); + + rte_eth_trace_tx_done_cleanup(port_id, queue_id, free_cnt, ret); + + return ret; } int @@ -2516,7 +2624,11 @@ 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 +2651,11 @@ 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 +2666,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 +2688,11 @@ 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 +2714,11 @@ 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 +2729,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 +2757,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,12 +2785,16 @@ 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) { + rte_eth_trace_link_speed_to_str(link_speed); + switch (link_speed) { case RTE_ETH_SPEED_NUM_NONE: return "None"; case RTE_ETH_SPEED_NUM_10M: return "10 Mbps"; @@ -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); + 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) 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 +2892,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 +2977,7 @@ 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 +3131,8 @@ 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); @@ -3025,6 +3172,8 @@ rte_eth_xstats_get_names(uint16_t port_id, cnt_used_entries += cnt_driver_entries; } + rte_eth_trace_xstats_get_names(port_id, xstats_names, size, cnt_used_entries); + return cnt_used_entries; } @@ -3174,6 +3323,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 +3373,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], i); + return count + xcount; } @@ -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]; /* 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)); + + 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) { - 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 +3473,13 @@ 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.h b/lib/ethdev/rte_ethdev.h index 96d0650d0c..6340a84c10 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -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; diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 1491c815c3..bc3b3d2a1b 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -88,6 +88,291 @@ RTE_TRACE_POINT( 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(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); +) + +RTE_TRACE_POINT( + rte_eth_trace_iterator_cleanup, + RTE_TRACE_POINT_ARGS(struct rte_dev_iterator *iter), + 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( + 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(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), + 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(const 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), + rte_trace_point_emit_u32(speed); + rte_trace_point_emit_int(duplex); +) + +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), + 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(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); +) + +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); + 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); +) + +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(struct rte_eth_dev_tx_buffer *buffer), + rte_trace_point_emit_ptr(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 diag), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(promiscuous); + rte_trace_point_emit_int(diag); +) + +RTE_TRACE_POINT( + rte_eth_trace_promiscuous_disable, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int promiscuous, int diag), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(promiscuous); + rte_trace_point_emit_int(diag); +) + +RTE_TRACE_POINT( + rte_eth_trace_allmulticast_enable, + 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); +) + +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); +) + +RTE_TRACE_POINT( + rte_eth_trace_link_speed_to_str, + RTE_TRACE_POINT_ARGS(uint32_t link_speed), + rte_trace_point_emit_u32(link_speed); +) + +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, 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 40084d1929..9f1d3d5a1b 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -17,26 +17,293 @@ extern "C" { #include <rte_trace_point.h> +#include "rte_ethdev.h" + RTE_TRACE_POINT_FP( - rte_ethdev_trace_rx_burst, + rte_eth_trace_call_rx_callbacks, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, - void **pkt_tbl, uint16_t nb_rx), + struct rte_mbuf **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(pkt_tbl); + 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_ethdev_trace_tx_burst, + rte_eth_trace_call_tx_callbacks, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, - void **pkts_tbl, uint16_t nb_pkts), + struct rte_mbuf **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(pkts_tbl); + rte_trace_point_emit_ptr(tx_pkts); rte_trace_point_emit_u16(nb_pkts); ) +RTE_TRACE_POINT_FP( + rte_eth_trace_find_next, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_find_next_sibling, + RTE_TRACE_POINT_ARGS(uint16_t port_id_start, uint16_t ref_port_id), + rte_trace_point_emit_u16(port_id_start); + rte_trace_point_emit_u16(ref_port_id); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_find_next_owned_by, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const uint64_t owner_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u64(owner_id); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_owner_get, + RTE_TRACE_POINT_ARGS(const uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_sec_ctx, + RTE_TRACE_POINT_ARGS(uint16_t port_id, void *ctx), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(ctx); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_count_avail, + RTE_TRACE_POINT_ARGS(uint16_t count), + rte_trace_point_emit_u16(count); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_count_total, + RTE_TRACE_POINT_ARGS(uint16_t count), + rte_trace_point_emit_u16(count); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_get_name_by_port, + RTE_TRACE_POINT_ARGS(uint16_t port_id, char *name), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_string(name); +) + +RTE_TRACE_POINT_FP( + 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_FP( + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_tx_buffer_drop_callback, + RTE_TRACE_POINT_ARGS(struct rte_mbuf **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(struct rte_mbuf **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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_tx_buffer_init, + RTE_TRACE_POINT_ARGS(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_FP( + 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_FP( + 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_FP( + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_link_get_nowait, + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_link_to_str, + RTE_TRACE_POINT_ARGS(size_t len, const 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_size_t(len); + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_stats_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_eth_stats *stats, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(stats); + 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_stats_reset, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_xstats_get_names_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_xstats_get_by_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const uint64_t *ids, + 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_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); +) + +RTE_TRACE_POINT_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp_burst.h b/lib/ethdev/rte_ethdev_trace_fp_burst.h new file mode 100644 index 0000000000..899b4ed070 --- /dev/null +++ b/lib/ethdev/rte_ethdev_trace_fp_burst.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2022 Marvell International Ltd. + */ + +#ifndef _RTE_ETHDEV_TRACE_FP_BURST_H_ +#define _RTE_ETHDEV_TRACE_FP_BURST_H_ + +/** + * @file + * + * API for ethdev burst trace support + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <rte_trace_point.h> + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_rx_burst, + 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); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pkt_tbl); + rte_trace_point_emit_u16(nb_rx); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_tx_burst, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + void **pkts_tbl, uint16_t nb_pkts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pkts_tbl); + rte_trace_point_emit_u16(nb_pkts); +) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_ETHDEV_TRACE_FP_BURST_H_ */ diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 17201fbe0f..c7ba2e3dc8 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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; + __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; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 2/6] ethdev: add trace points for ethdev (part one) 2023-01-23 9:02 ` [PATCH v7 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi @ 2023-01-30 8:45 ` Sunil Kumar Kori 0 siblings, 0 replies; 172+ messages in thread From: Sunil Kumar Kori @ 2023-01-30 8:45 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Monday, January 23, 2023 2:32 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha > Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi > <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla > <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; > Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; > viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > Rasesh Mody <rmody@marvell.com>; Shahed Shaikh > <shshaikh@marvell.com>; Devendra Singh Rawat > <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; > mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > 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. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > 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 > Acked-by: Sunil Kumar Kori <skori@marvell.com> > diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c > index 48090c879a..fd16b25e55 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" > > -- > 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v7 3/6] ethdev: add trace points for ethdev (part two) 2023-01-23 9:02 ` [PATCH v7 0/6] add trace points in ethdev library Ankur Dwivedi 2023-01-23 9:02 ` [PATCH v7 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-01-23 9:02 ` [PATCH v7 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi @ 2023-01-23 9:02 ` Ankur Dwivedi 2023-01-30 8:47 ` Sunil Kumar Kori 2023-01-23 9:02 ` [PATCH v7 4/6] ethdev: add trace points for flow Ankur Dwivedi ` (3 subsequent siblings) 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-23 9:02 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for remaining ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 4fea76e0ff..102a18fcc1 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 40897ad94d..60d2ab47ea 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -3539,6 +3539,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); + return 0; } @@ -3559,6 +3561,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct rte_eth_conf)); + rte_ethdev_trace_conf_get(port_id, dev_conf); + return 0; } @@ -3589,8 +3593,10 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) if (all_ptypes[i] & ptype_mask) { - if (j < num) + if (j < num) { ptypes[j] = all_ptypes[i]; + rte_ethdev_trace_get_supported_ptypes(port_id, j, num, ptypes[j]); + } j++; } @@ -3668,6 +3674,7 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, if (ptype_mask & all_ptypes[i]) { if (j < num - 1) { set_ptypes[j] = all_ptypes[i]; + rte_ethdev_trace_set_ptypes(port_id, j, num, set_ptypes[j]); j++; continue; } @@ -3709,6 +3716,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, num = RTE_MIN(dev_info.max_mac_addrs, num); memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); + rte_eth_trace_macaddrs_get(port_id, num); + return num; } @@ -3729,6 +3738,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); + rte_eth_trace_macaddr_get(port_id, mac_addr); + return 0; } @@ -3747,6 +3758,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + + rte_ethdev_trace_get_mtu(port_id, *mtu); + return 0; } @@ -3789,7 +3803,11 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_mtu(port_id, mtu, ret); + + return ret; } int @@ -3832,7 +3850,11 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) vfc->ids[vidx] &= ~RTE_BIT64(vbit); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); + + return ret; } int @@ -3851,8 +3873,11 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, if (*dev->dev_ops->vlan_strip_queue_set == NULL) return -ENOTSUP; + (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); + return 0; } @@ -3862,14 +3887,18 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, uint16_t tpid) { 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->vlan_tpid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, - tpid)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, tpid)); + + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); + + return ret; } int @@ -3961,7 +3990,11 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) dev->data->dev_conf.rxmode.offloads = orig_offloads; } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); + + return ret; } int @@ -3987,6 +4020,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); + return ret; } @@ -3994,19 +4029,25 @@ int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { 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->vlan_pvid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); + + return ret; } int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4021,13 +4062,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_get == NULL) return -ENOTSUP; memset(fc_conf, 0, sizeof(*fc_conf)); - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); + + return ret; } int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4046,7 +4092,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); + + return ret; } int @@ -4054,6 +4104,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4071,9 +4122,14 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, } /* High water, low water validation are device specific */ - if (*dev->dev_ops->priority_flow_ctrl_set) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) - (dev, pfc_conf)); + if (*dev->dev_ops->priority_flow_ctrl_set) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) + (dev, pfc_conf)); + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, ret); + + return ret; + } + return -ENOTSUP; } @@ -4132,6 +4188,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, struct rte_eth_pfc_queue_info *pfc_queue_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4142,9 +4199,13 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, pfc_queue_info, + ret); + return ret; + } return -ENOTSUP; } @@ -4213,10 +4274,16 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, return ret; } - if (*dev->dev_ops->priority_flow_ctrl_queue_config) - return eth_err(port_id, - (*dev->dev_ops->priority_flow_ctrl_queue_config)( - dev, pfc_queue_conf)); + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { + ret = eth_err(port_id, + (*dev->dev_ops->priority_flow_ctrl_queue_config)( + dev, pfc_queue_conf)); + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf, + ret); + return ret; + } + return -ENOTSUP; } @@ -4308,8 +4375,12 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, if (*dev->dev_ops->reta_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4337,8 +4408,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, if (*dev->dev_ops->reta_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4382,8 +4457,11 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, if (*dev->dev_ops->rss_hash_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, rss_conf)); + + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); + + return ret; } int @@ -4391,6 +4469,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4404,8 +4483,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, if (*dev->dev_ops->rss_hash_conf_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); + + return ret; } int @@ -4413,6 +4496,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4431,8 +4515,11 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_add == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, - udp_tunnel)); + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); + + return ret; } int @@ -4440,6 +4527,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4458,34 +4546,47 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_del == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, - udp_tunnel)); + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); + + return ret; } int rte_eth_led_on(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_led_on == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + + rte_eth_trace_led_on(port_id, ret); + + return ret; } int rte_eth_led_off(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_led_off == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + + rte_eth_trace_led_off(port_id, ret); + + return ret; } int @@ -4510,6 +4611,8 @@ rte_eth_fec_get_capability(uint16_t port_id, return -ENOTSUP; ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, num); + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); + return ret; } @@ -4517,6 +4620,7 @@ int rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4530,20 +4634,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) if (*dev->dev_ops->fec_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + + rte_eth_trace_fec_get(port_id, fec_capa, ret); + + return ret; } int rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) { 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->fec_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + + rte_eth_trace_fec_set(port_id, fec_capa, ret); + + return ret; } /* @@ -4631,7 +4744,11 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); + + return ret; } int @@ -4671,6 +4788,8 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) /* reset pool bitmap */ dev->data->mac_pool_sel[index] = 0; + rte_ethdev_trace_mac_addr_remove(port_id, addr); + return 0; } @@ -4703,6 +4822,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) /* Update default address in NIC data structure */ rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); + rte_ethdev_trace_default_mac_addr_set(port_id, addr); + return 0; } @@ -4793,21 +4914,29 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, &dev->data->hash_mac_addrs[index]); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { 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->uc_all_hash_table_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, - on)); + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, on)); + + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, @@ -4843,14 +4972,18 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (*dev->dev_ops->set_queue_rate_limit == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, - queue_idx, tx_rate)); + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate)); + + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, ret); + + return ret; } int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, uint8_t avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4870,14 +5003,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, } if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, - queue_id, avail_thresh)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, queue_id, + avail_thresh)); + + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, ret); + + return ret; } int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, uint8_t *avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4889,8 +5027,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, - queue_id, avail_thresh)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, + avail_thresh)); + + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); + + return ret; } RTE_INIT(eth_dev_init_fp_ops) @@ -4972,6 +5114,10 @@ rte_eth_dev_callback_register(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, next_port, + last_port); + return 0; } @@ -5033,6 +5179,9 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, ret); + return ret; } @@ -5062,6 +5211,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { vec = rte_intr_vec_list_index_get(intr_handle, qid); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5105,6 +5257,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); + return fd; } @@ -5138,6 +5292,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, vec = rte_intr_vec_list_index_get(intr_handle, queue_id); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5164,7 +5321,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); + + return ret; } int @@ -5183,7 +5344,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); + + return ret; } @@ -5241,6 +5406,8 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5280,6 +5447,8 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, cb, __ATOMIC_RELEASE); rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5339,6 +5508,8 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5373,6 +5544,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5407,6 +5580,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5453,6 +5628,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5499,6 +5676,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5507,6 +5686,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5526,8 +5706,11 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->rx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5535,6 +5718,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5554,8 +5738,11 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->tx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5563,6 +5750,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, struct rte_power_monitor_cond *pmc) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5581,8 +5769,11 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->get_monitor_addr == NULL) return -ENOTSUP; - return eth_err(port_id, - dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); + + return ret; } int @@ -5591,40 +5782,54 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, uint32_t nb_mc_addr) { 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->set_mc_addr_list == NULL) return -ENOTSUP; - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, - mc_addr_set, nb_mc_addr)); + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, mc_addr_set, nb_mc_addr)); + + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr, ret); + + return ret; } int rte_eth_timesync_enable(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->timesync_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + + rte_eth_trace_timesync_enable(port_id, ret); + + return ret; } int rte_eth_timesync_disable(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->timesync_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + + rte_eth_trace_timesync_disable(port_id, ret); + + return ret; } int @@ -5632,6 +5837,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5645,8 +5851,13 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) - (dev, timestamp, flags)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) + (dev, timestamp, flags)); + + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags, ret); + + return ret; } int @@ -5654,6 +5865,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5667,27 +5879,39 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) - (dev, timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) + (dev, timestamp)); + + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, ret); + + return ret; + } int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { 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->timesync_adjust_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); + + return ret; } int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5701,14 +5925,19 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) if (*dev->dev_ops->timesync_read_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, - timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, timestamp)); + + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); + + return ret; } int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5722,14 +5951,18 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) if (*dev->dev_ops->timesync_write_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, - timestamp)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, timestamp)); + + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); + + return ret; } int rte_eth_read_clock(uint16_t port_id, uint64_t *clock) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5742,13 +5975,18 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) if (*dev->dev_ops->read_clock == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + + rte_eth_trace_read_clock(port_id, clock, ret); + + return ret; } int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; @@ -5762,26 +6000,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) if (*dev->dev_ops->get_reg == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + + rte_ethdev_trace_get_reg_info(port_id, info, ret); + + return ret; } int rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + + rte_ethdev_trace_get_eeprom_length(port_id, ret); + + return ret; } int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5795,13 +6043,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->get_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + + rte_ethdev_trace_get_eeprom(port_id, info, ret); + + return ret; } int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5815,7 +6068,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->set_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + + rte_ethdev_trace_set_eeprom(port_id, info, ret); + + return ret; } int @@ -5823,6 +6080,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5836,7 +6094,11 @@ rte_eth_dev_get_module_info(uint16_t port_id, if (*dev->dev_ops->get_module_info == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_info)(dev, modinfo); + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); + + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); + + return ret; } int @@ -5844,6 +6106,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5871,7 +6134,11 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, if (*dev->dev_ops->get_module_eeprom == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_eeprom)(dev, info); + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); + + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); + + return ret; } int @@ -5879,6 +6146,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5894,7 +6162,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, if (*dev->dev_ops->get_dcb_info == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); + + return ret; } static void @@ -5930,6 +6202,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); + return 0; } @@ -5938,6 +6212,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, struct rte_eth_hairpin_cap *cap) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5952,13 +6227,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, if (*dev->dev_ops->hairpin_cap_get == NULL) return -ENOTSUP; memset(cap, 0, sizeof(*cap)); - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); + + return ret; } int rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5973,7 +6253,11 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) if (*dev->dev_ops->pool_ops_supported == NULL) return 1; /* all pools are supported */ - return (*dev->dev_ops->pool_ops_supported)(dev, pool); + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); + + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); + + return ret; } static int @@ -6263,19 +6547,25 @@ rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_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]; if (*dev->dev_ops->representor_info_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + + rte_eth_trace_representor_info_get(port_id, info, ret); + + return ret; } int rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6294,8 +6584,11 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) if (*dev->dev_ops->rx_metadata_negotiate == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + ret = eth_err(port_id, (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + + rte_eth_trace_rx_metadata_negotiate(port_id, features, *features, ret); + + return ret; } int @@ -6303,6 +6596,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *reassembly_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6324,8 +6618,12 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, return -ENOTSUP; memset(reassembly_capa, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) (dev, reassembly_capa)); + + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa, ret); + + return ret; } int @@ -6333,6 +6631,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6353,8 +6652,11 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_get == NULL) return -ENOTSUP; memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); + + return ret; } int @@ -6362,6 +6664,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, const struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6390,8 +6693,11 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_set == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); + + return ret; } int @@ -6489,8 +6795,10 @@ rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes return 0; for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { - if (j < num) + if (j < num) { ptypes[j] = all_types[i]; + rte_eth_trace_buffer_split_get_supported_hdr_ptypes(port_id, j, ptypes[j]); + } j++; } diff --git a/lib/ethdev/rte_ethdev_cman.c b/lib/ethdev/rte_ethdev_cman.c index 4a1bdd7bd0..c4d877d878 100644 --- a/lib/ethdev/rte_ethdev_cman.c +++ b/lib/ethdev/rte_ethdev_cman.c @@ -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; } diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index bc3b3d2a1b..fa195c5cde 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -373,6 +373,535 @@ 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, + 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, 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_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_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_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_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, 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_configure, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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, + 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, 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, 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, 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, + 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_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, 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, 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, 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, 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, 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, + 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, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, int epfd, + int op, 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_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); +) + +RTE_TRACE_POINT( + 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); +) + +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, + 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, void *user_param, + 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, void *user_param, + 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_ethdev_trace_set_mc_addr_list, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_ethdev_trace_set_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_hairpin_capability_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_rx_metadata_negotiate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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, + 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_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_cman_config_init, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 9f1d3d5a1b..d4b2e4b312 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -304,6 +304,348 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + 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_FP( + 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_FP( + rte_eth_trace_macaddr_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); +) + +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); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_ethdev_trace_flow_ctrl_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_priority_flow_ctrl_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_rss_reta_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_rss_hash_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_eth_trace_fec_get, + 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_ptr(fec_capa); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_rx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_tx_queue_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_rx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_tx_burst_mode_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_get_monitor_addr, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + 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_FP( + rte_eth_trace_timesync_read_rx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_timesync_read_tx_timestamp, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_timesync_read_time, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_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); +) + +RTE_TRACE_POINT_FP( + 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_FP( + rte_eth_trace_read_clock, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_get_reg_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + 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_FP( + rte_ethdev_trace_get_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + rte_ethdev_trace_get_module_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_module_eeprom, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_ethdev_trace_get_dcb_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, 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_FP( + 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_FP( + rte_eth_trace_representor_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + rte_eth_trace_ip_reassembly_conf_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + 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_FP( + rte_eth_trace_cman_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + 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_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c7ba2e3dc8..c7c6bcd42b 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -300,36 +300,71 @@ EXPERIMENTAL { rte_mtr_meter_profile_get; # added in 23.03 + __rte_eth_trace_add_first_rx_callback; + __rte_eth_trace_add_rx_callback; + __rte_eth_trace_add_tx_callback; __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_cman_config_get; + __rte_eth_trace_cman_config_init; + __rte_eth_trace_cman_config_set; + __rte_eth_trace_cman_info_get; + __rte_eth_trace_fec_get_capability; + __rte_eth_trace_fec_get; + __rte_eth_trace_fec_set; __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_get_monitor_addr; __rte_eth_trace_hairpin_bind; __rte_eth_trace_hairpin_get_peer_ports; __rte_eth_trace_hairpin_unbind; + __rte_eth_trace_ip_reassembly_capability_get; + __rte_eth_trace_ip_reassembly_conf_get; + __rte_eth_trace_ip_reassembly_conf_set; __rte_eth_trace_iterator_cleanup; __rte_eth_trace_iterator_init; __rte_eth_trace_iterator_next; + __rte_eth_trace_led_off; + __rte_eth_trace_led_on; __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_macaddr_get; + __rte_eth_trace_macaddrs_get; __rte_eth_trace_promiscuous_disable; __rte_eth_trace_promiscuous_enable; __rte_eth_trace_promiscuous_get; + __rte_eth_trace_remove_rx_callback; + __rte_eth_trace_remove_tx_callback; + __rte_eth_trace_representor_info_get; + __rte_eth_trace_rx_avail_thresh_query; + __rte_eth_trace_rx_avail_thresh_set; + __rte_eth_trace_rx_burst_mode_get; __rte_eth_trace_rx_hairpin_queue_setup; + __rte_eth_trace_rx_metadata_negotiate; + __rte_eth_trace_rx_queue_info_get; + __rte_eth_trace_set_queue_rate_limit; __rte_eth_trace_speed_bitflag; __rte_eth_trace_stats_get; __rte_eth_trace_stats_reset; + __rte_eth_trace_timesync_adjust_time; + __rte_eth_trace_timesync_disable; + __rte_eth_trace_timesync_enable; + __rte_eth_trace_timesync_read_rx_timestamp; + __rte_eth_trace_timesync_read_time; + __rte_eth_trace_timesync_read_tx_timestamp; + __rte_eth_trace_timesync_write_time; __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_burst_mode_get; __rte_eth_trace_tx_done_cleanup; __rte_eth_trace_tx_hairpin_queue_setup; __rte_eth_trace_xstats_get; @@ -338,32 +373,78 @@ EXPERIMENTAL { __rte_eth_trace_xstats_get_names; __rte_eth_trace_xstats_get_names_by_id; __rte_eth_trace_xstats_reset; + __rte_ethdev_trace_adjust_nb_rx_tx_desc; + __rte_ethdev_trace_callback_register; + __rte_ethdev_trace_callback_unregister; __rte_ethdev_trace_capability_name; + __rte_ethdev_trace_conf_get; __rte_ethdev_trace_count_avail; __rte_ethdev_trace_count_total; + __rte_ethdev_trace_default_mac_addr_set; + __rte_ethdev_trace_flow_ctrl_get; + __rte_ethdev_trace_flow_ctrl_set; __rte_ethdev_trace_fw_version_get; + __rte_ethdev_trace_get_dcb_info; + __rte_ethdev_trace_get_eeprom; + __rte_ethdev_trace_get_eeprom_length; + __rte_ethdev_trace_get_module_eeprom; + __rte_ethdev_trace_get_module_info; + __rte_ethdev_trace_get_mtu; __rte_ethdev_trace_get_name_by_port; __rte_ethdev_trace_get_port_by_name; + __rte_ethdev_trace_get_reg_info; __rte_ethdev_trace_get_sec_ctx; + __rte_ethdev_trace_get_supported_ptypes; + __rte_ethdev_trace_get_vlan_offload; + __rte_ethdev_trace_hairpin_capability_get; + __rte_ethdev_trace_info_get; __rte_ethdev_trace_is_removed; __rte_ethdev_trace_is_valid_port; + __rte_ethdev_trace_mac_addr_add; + __rte_ethdev_trace_mac_addr_remove; __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_pool_ops_supported; + __rte_ethdev_trace_priority_flow_ctrl_queue_configure; + __rte_ethdev_trace_priority_flow_ctrl_queue_info_get; + __rte_ethdev_trace_priority_flow_ctrl_set; __rte_ethdev_trace_reset; + __rte_ethdev_trace_rss_hash_conf_get; + __rte_ethdev_trace_rss_hash_update; + __rte_ethdev_trace_rss_reta_query; + __rte_ethdev_trace_rss_reta_update; + __rte_ethdev_trace_rx_intr_ctl; + __rte_ethdev_trace_rx_intr_ctl_q; + __rte_ethdev_trace_rx_intr_ctl_q_get_fd; + __rte_ethdev_trace_rx_intr_disable; + __rte_ethdev_trace_rx_intr_enable; __rte_ethdev_trace_rx_offload_name; __rte_ethdev_trace_rx_queue_start; __rte_ethdev_trace_rx_queue_stop; + __rte_ethdev_trace_set_eeprom; __rte_ethdev_trace_set_link_down; __rte_ethdev_trace_set_link_up; + __rte_ethdev_trace_set_mc_addr_list; + __rte_ethdev_trace_set_mtu; + __rte_ethdev_trace_set_ptypes; __rte_ethdev_trace_set_rx_queue_stats_mapping; __rte_ethdev_trace_set_tx_queue_stats_mapping; + __rte_ethdev_trace_set_vlan_ether_type; + __rte_ethdev_trace_set_vlan_offload; + __rte_ethdev_trace_set_vlan_pvid; + __rte_ethdev_trace_set_vlan_strip_on_queue; __rte_ethdev_trace_socket_id; __rte_ethdev_trace_tx_offload_name; __rte_ethdev_trace_tx_queue_start; __rte_ethdev_trace_tx_queue_stop; + __rte_ethdev_trace_uc_all_hash_table_set; + __rte_ethdev_trace_uc_hash_table_set; + __rte_ethdev_trace_udp_tunnel_port_add; + __rte_ethdev_trace_udp_tunnel_port_delete; + __rte_ethdev_trace_vlan_filter; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 3/6] ethdev: add trace points for ethdev (part two) 2023-01-23 9:02 ` [PATCH v7 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi @ 2023-01-30 8:47 ` Sunil Kumar Kori 0 siblings, 0 replies; 172+ messages in thread From: Sunil Kumar Kori @ 2023-01-30 8:47 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Monday, January 23, 2023 2:32 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha > Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi > <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla > <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; > Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; > viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > Rasesh Mody <rmody@marvell.com>; Shahed Shaikh > <shshaikh@marvell.com>; Devendra Singh Rawat > <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; > mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > Subject: [PATCH v7 3/6] ethdev: add trace points for ethdev (part two) > > Adds trace points for remaining ethdev functions. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > 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(-) > Acked-by: Sunil Kumar Kori <skori@marvell.com> > diff --git a/lib/ethdev/ethdev_trace_points.c > b/lib/ethdev/ethdev_trace_points.c > index 4fea76e0ff..102a18fcc1 100644 > --- a/lib/ethdev/ethdev_trace_points.c > +++ b/lib/ethdev/ethdev_trace_points.c > @@ -222,3 +222,255 @@ > -- > 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v7 4/6] ethdev: add trace points for flow 2023-01-23 9:02 ` [PATCH v7 0/6] add trace points in ethdev library Ankur Dwivedi ` (2 preceding siblings ...) 2023-01-23 9:02 ` [PATCH v7 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi @ 2023-01-23 9:02 ` Ankur Dwivedi 2023-02-02 13:52 ` Ori Kam 2023-01-23 9:02 ` [PATCH v7 5/6] ethdev: add trace points for mtr Ankur Dwivedi ` (2 subsequent siblings) 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-23 9:02 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 102a18fcc1..1953d90a5a 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index fa195c5cde..fd4fbaf6de 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -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); + 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_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); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_destroy, + 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); + 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_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); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_int(action->type); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + 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), + 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), + 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), + 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 diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index d4b2e4b312..c5b8083de2 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -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 diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 7d0c24366c..43f13f79b4 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -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, @@ -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; } 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; } 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 @@ -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 @@ -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, 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, 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, + error), + error); + + rte_flow_trace_tunnel_action_decap_release(port_id, actions, + num_of_actions, ret); + + 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; } 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)) 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 * @@ -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 @@ -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; } 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; } 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; } 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; } 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); + 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; } 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; } 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; } 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); + 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 @@ -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 @@ -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, + action_handle, data, user_data, + ret); + + return ret; } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c7c6bcd42b..0cb8222ad9 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 4/6] ethdev: add trace points for flow 2023-01-23 9:02 ` [PATCH v7 4/6] ethdev: add trace points for flow Ankur Dwivedi @ 2023-02-02 13:52 ` Ori Kam 2023-02-02 13:56 ` Ori Kam 0 siblings, 1 reply; 172+ messages in thread From: Ori Kam @ 2023-02-02 13:52 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: NBU-Contact-Thomas Monjalon (EXTERNAL), david.marchand, mdr, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, Matan Azrad, Slava Ovsiienko, NBU-Contact-longli (EXTERNAL), spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb Hi Ankur, > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Monday, 23 January 2023 11:02 > > Adds trace points for rte_flow specific functions in ethdev lib. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > 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(-) > > diff --git a/lib/ethdev/ethdev_trace_points.c > b/lib/ethdev/ethdev_trace_points.c > index 102a18fcc1..1953d90a5a 100644 > --- a/lib/ethdev/ethdev_trace_points.c > +++ b/lib/ethdev/ethdev_trace_points.c > @@ -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.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.flow.async_action_handle_create) > + > +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_destr > oy, > + lib.ethdev.flow.async_action_handle_destroy) > + > +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_updat > e, > + 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) > diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h > index fa195c5cde..fd4fbaf6de 100644 > --- a/lib/ethdev/rte_ethdev_trace.h > +++ b/lib/ethdev/rte_ethdev_trace.h > @@ -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); > + 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 > + 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); > + 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 > + 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); > + 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 > + 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); > + 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 > + 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), > + 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), > + 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), > + 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 > diff --git a/lib/ethdev/rte_ethdev_trace_fp.h > b/lib/ethdev/rte_ethdev_trace_fp.h > index d4b2e4b312..c5b8083de2 100644 > --- a/lib/ethdev/rte_ethdev_trace_fp.h > +++ b/lib/ethdev/rte_ethdev_trace_fp.h > @@ -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 > diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c > index 7d0c24366c..43f13f79b4 100644 > --- a/lib/ethdev/rte_flow.c > +++ b/lib/ethdev/rte_flow.c > @@ -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, > @@ -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; > } > 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; > } > 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 > @@ -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 > @@ -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, > 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, > 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, > + error), > + error); > + > + rte_flow_trace_tunnel_action_decap_release(port_id, > actions, > + num_of_actions, > ret); > + > + 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; > } > 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)) > 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 * > @@ -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 > @@ -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; > } > 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; > } > 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; > } > 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; > } > 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); > + > 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; > } > 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; > } > 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; > } > 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); > + > 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 > @@ -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 > @@ -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, > + action_handle, data, > user_data, > + ret); > + > + return ret; > } > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > index c7c6bcd42b..0cb8222ad9 100644 > --- a/lib/ethdev/version.map > +++ b/lib/ethdev/version.map > @@ -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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 4/6] ethdev: add trace points for flow 2023-02-02 13:52 ` Ori Kam @ 2023-02-02 13:56 ` Ori Kam 2023-02-02 15:45 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ori Kam @ 2023-02-02 13:56 UTC (permalink / raw) To: Ori Kam, Ankur Dwivedi, dev Cc: NBU-Contact-Thomas Monjalon (EXTERNAL), david.marchand, mdr, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, Matan Azrad, Slava Ovsiienko, NBU-Contact-longli (EXTERNAL), spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb Sorry sent before all comments, Adding missing comments > -----Original Message----- > From: Ori Kam <orika@nvidia.com> > Sent: Thursday, 2 February 2023 15:52 > > Hi Ankur, > > > -----Original Message----- > > From: Ankur Dwivedi <adwivedi@marvell.com> > > Sent: Monday, 23 January 2023 11:02 > > > > Adds trace points for rte_flow specific functions in ethdev lib. > > > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > > --- > > 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(-) > > > > diff --git a/lib/ethdev/ethdev_trace_points.c > > b/lib/ethdev/ethdev_trace_points.c > > index 102a18fcc1..1953d90a5a 100644 > > --- a/lib/ethdev/ethdev_trace_points.c > > +++ b/lib/ethdev/ethdev_trace_points.c > > @@ -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.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.flow.async_action_handle_create) > > + > > > +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_destr > > oy, > > + lib.ethdev.flow.async_action_handle_destroy) > > + > > > +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_updat > > e, > > + 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) > > diff --git a/lib/ethdev/rte_ethdev_trace.h > b/lib/ethdev/rte_ethdev_trace.h > > index fa195c5cde..fd4fbaf6de 100644 > > --- a/lib/ethdev/rte_ethdev_trace.h > > +++ b/lib/ethdev/rte_ethdev_trace.h > > @@ -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); > > + 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 > > > + 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); > > + 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 > > > + 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); > > + 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 > > > + 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); > > + 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 > > + 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), > > + 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), > > + 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( Part of the datapath should be _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, > > + 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), > > + 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 > > + 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 > > + 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( Part of the datapath should be _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, > > + 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 > > diff --git a/lib/ethdev/rte_ethdev_trace_fp.h > > b/lib/ethdev/rte_ethdev_trace_fp.h > > index d4b2e4b312..c5b8083de2 100644 > > --- a/lib/ethdev/rte_ethdev_trace_fp.h > > +++ b/lib/ethdev/rte_ethdev_trace_fp.h > > @@ -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 > > diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c > > index 7d0c24366c..43f13f79b4 100644 > > --- a/lib/ethdev/rte_flow.c > > +++ b/lib/ethdev/rte_flow.c > > @@ -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, > > @@ -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; > > } > > 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; > > } > > 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 > > @@ -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 > > @@ -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, > > 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, > > 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, > > + error), > > + error); > > + > > + rte_flow_trace_tunnel_action_decap_release(port_id, > > actions, > > + num_of_actions, > > ret); > > + > > + 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; > > } > > 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)) > > 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 * > > @@ -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 > > @@ -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; > > } > > 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; > > } > > 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; > > } > > 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; > > } > > 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); > > + > > 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; > > } > > 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; > > } > > 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; > > } > > 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); > > + > > 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 > > @@ -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 > > @@ -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, > > + action_handle, data, > > user_data, > > + ret); > > + > > + return ret; > > } > > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > > index c7c6bcd42b..0cb8222ad9 100644 > > --- a/lib/ethdev/version.map > > +++ b/lib/ethdev/version.map > > @@ -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 Thanks, Ori ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 4/6] ethdev: add trace points for flow 2023-02-02 13:56 ` Ori Kam @ 2023-02-02 15:45 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-02 15:45 UTC (permalink / raw) To: Ori Kam, dev Cc: NBU-Contact-Thomas Monjalon (EXTERNAL), david.marchand, mdr, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, Matan Azrad, Slava Ovsiienko, NBU-Contact-longli (EXTERNAL), spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >Subject: [EXT] RE: [PATCH v7 4/6] ethdev: add trace points for flow > >External Email > >---------------------------------------------------------------------- >Sorry sent before all comments, >Adding missing comments > >> -----Original Message----- >> From: Ori Kam <orika@nvidia.com> >> Sent: Thursday, 2 February 2023 15:52 >> >> Hi Ankur, >> >> > -----Original Message----- >> > From: Ankur Dwivedi <adwivedi@marvell.com> >> > Sent: Monday, 23 January 2023 11:02 >> > >> > Adds trace points for rte_flow specific functions in ethdev lib. >> > >> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> > --- >> > 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(-) >> > >> > diff --git a/lib/ethdev/ethdev_trace_points.c >> > b/lib/ethdev/ethdev_trace_points.c >> > index 102a18fcc1..1953d90a5a 100644 >> > --- a/lib/ethdev/ethdev_trace_points.c >> > +++ b/lib/ethdev/ethdev_trace_points.c >> > @@ -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.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.flow.async_action_handle_create) >> > + >> > >> +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_destr >> > oy, >> > + lib.ethdev.flow.async_action_handle_destroy) >> > + >> > >> +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_updat >> > e, >> > + 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) >> > diff --git a/lib/ethdev/rte_ethdev_trace.h >> b/lib/ethdev/rte_ethdev_trace.h >> > index fa195c5cde..fd4fbaf6de 100644 >> > --- a/lib/ethdev/rte_ethdev_trace.h >> > +++ b/lib/ethdev/rte_ethdev_trace.h >> > @@ -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); >> > + 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. >> >> > + 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); >> > + 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. >> >> > + 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); >> > + 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. >> >> > + 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); >> > + 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. >> > + 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), >> > + 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), >> > + 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( > >Part of the datapath should be _FP > Will make it as fastpath. >> > + 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), >> > + 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. >> > + 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 > Will make it as fastpath. >> > + 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( > >Part of the datapath should be _FP > Will make it as fastpath. >> > + 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 >> > diff --git a/lib/ethdev/rte_ethdev_trace_fp.h >> > b/lib/ethdev/rte_ethdev_trace_fp.h >> > index d4b2e4b312..c5b8083de2 100644 >> > --- a/lib/ethdev/rte_ethdev_trace_fp.h >> > +++ b/lib/ethdev/rte_ethdev_trace_fp.h >> > @@ -646,6 +646,119 @@ RTE_TRACE_POINT_FP( >> > rte_trace_point_emit_int(ret); >> > ) >> > Is the below fastpath function list correct ? >> > +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 > >Thanks, >Ori ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v7 5/6] ethdev: add trace points for mtr 2023-01-23 9:02 ` [PATCH v7 0/6] add trace points in ethdev library Ankur Dwivedi ` (3 preceding siblings ...) 2023-01-23 9:02 ` [PATCH v7 4/6] ethdev: add trace points for flow Ankur Dwivedi @ 2023-01-23 9:02 ` Ankur Dwivedi 2023-01-30 8:50 ` Sunil Kumar Kori 2023-01-23 9:02 ` [PATCH v7 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 0/6] add trace points in ethdev library Ankur Dwivedi 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-23 9:02 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 1953d90a5a..067e5fdab4 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index fd4fbaf6de..2a0516e10d 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1285,6 +1286,117 @@ 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, + struct rte_mtr_capabilities *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_mtr_trace_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + 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); +) + +RTE_TRACE_POINT( + 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); +) + +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_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_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id, + 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_policy_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + 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( + rte_mtr_trace_meter_policy_delete, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(policy_id); +) + +RTE_TRACE_POINT( + rte_mtr_trace_meter_policy_validate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_int(actions->type); + rte_trace_point_emit_ptr(actions->conf); +) + +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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index c5b8083de2..a57a4d1dbf 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -18,6 +18,7 @@ extern "C" { #include <rte_trace_point.h> #include "rte_ethdev.h" +#include "rte_mtr.h" RTE_TRACE_POINT_FP( rte_eth_trace_call_rx_callbacks, @@ -759,6 +760,105 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + rte_mtr_trace_meter_profile_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + uint32_t meter_profile_id, 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_FP( + rte_mtr_trace_meter_policy_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t policy_id, + 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_FP( + 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_FP( + 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_FP( + 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_FP( + rte_mtr_trace_meter_vlan_table_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + 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_FP( + 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_FP( + 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_FP( + rte_mtr_trace_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t mtr_id, + 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_ptr(stats_mask); + rte_trace_point_emit_int(clear); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index 3954839531..da092cd939 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -6,6 +6,8 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -82,8 +84,14 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, capabilities_get)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_mtr_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* MTR meter profile add */ @@ -94,8 +102,14 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); + + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile, ret); + + return ret; } /** MTR meter profile delete */ @@ -105,8 +119,14 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id, ret); + + return ret; } /** MTR meter profile get */ @@ -116,8 +136,14 @@ rte_mtr_meter_profile_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, + struct rte_flow_meter_profile *ret; + + ret = RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_get(port_id, meter_profile_id, ret); + + return ret; } /* MTR meter policy validate */ @@ -127,6 +153,10 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_validate(port_id, policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); } @@ -139,6 +169,11 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int i; + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_add(port_id, policy_id, + policy->actions[i]); return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); } @@ -150,6 +185,7 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + rte_mtr_trace_meter_policy_delete(port_id, policy_id); return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); } @@ -161,8 +197,14 @@ rte_mtr_meter_policy_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, + struct rte_flow_meter_policy *ret; + + ret = RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_get(port_id, policy_id, ret); + + return ret; } /** MTR object create */ @@ -174,8 +216,14 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, create)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); + + rte_mtr_trace_create(port_id, mtr_id, params, shared, ret); + + return ret; } /** MTR object destroy */ @@ -185,8 +233,14 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, destroy)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); + + rte_mtr_trace_destroy(port_id, mtr_id, ret); + + return ret; } /** MTR object meter enable */ @@ -196,8 +250,14 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_enable)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); + + rte_mtr_trace_meter_enable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter disable */ @@ -207,8 +267,14 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_disable)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); + + rte_mtr_trace_meter_disable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter profile update */ @@ -219,8 +285,14 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); + + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id, ret); + + return ret; } /** MTR object meter policy update */ @@ -231,8 +303,14 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); + + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id, ret); + + return ret; } /** MTR object meter DSCP table update */ @@ -243,8 +321,14 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, proto, dscp_table, error); + + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table, ret); + + return ret; } /** MTR object meter VLAN table update */ @@ -255,8 +339,14 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, proto, vlan_table, error); + + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table, ret); + + return ret; } /** Set the input color protocol on MTR object */ @@ -268,8 +358,14 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_set)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority, ret); + + return ret; } /** Get input color protocols of MTR object */ @@ -280,8 +376,14 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_get)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); + + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id, ret); + + return ret; } /** Get input color protocol priority of MTR object */ @@ -293,8 +395,14 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto, ret); + + return ret; } /** MTR object enabled stats update */ @@ -305,8 +413,14 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_update)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); + + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask, ret); + + return ret; } /** MTR object stats read */ @@ -319,6 +433,12 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_read)(dev, + int ret; + + ret = RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); + + rte_mtr_trace_stats_read(port_id, mtr_id, stats, stats_mask, clear, ret); + + return ret; } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 0cb8222ad9..c1a6e4d30a 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v7 5/6] ethdev: add trace points for mtr 2023-01-23 9:02 ` [PATCH v7 5/6] ethdev: add trace points for mtr Ankur Dwivedi @ 2023-01-30 8:50 ` Sunil Kumar Kori 0 siblings, 0 replies; 172+ messages in thread From: Sunil Kumar Kori @ 2023-01-30 8:50 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Monday, January 23, 2023 2:32 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; Igor Russkikh <irusskikh@marvell.com>; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Maciej Czekaj [C] <mczekaj@marvell.com>; Shijith > Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan > <srinivasan@marvell.com>; Harman Kalra <hkalra@marvell.com>; > rahul.lakkireddy@chelsio.com; johndale@cisco.com; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; simei.su@intel.com; wenjun1.wu@intel.com; > qiming.yang@intel.com; Yuying.Zhang@intel.com; beilei.xing@intel.com; > xiao.w.wang@intel.com; jingjing.wu@intel.com; junfeng.guo@intel.com; > rosen.xu@intel.com; Nithin Kumar Dabilpuram > <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda > <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha > Koteswara Rao Kottidi <skoteshwar@marvell.com>; Liron Himi > <lironh@marvell.com>; zr@semihalf.com; Radha Chintakuntla > <radhac@marvell.com>; Veerasenareddy Burru <vburru@marvell.com>; > Sathesh B Edara <sedara@marvell.com>; matan@nvidia.com; > viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > Rasesh Mody <rmody@marvell.com>; Shahed Shaikh > <shshaikh@marvell.com>; Devendra Singh Rawat > <dsinghrawat@marvell.com>; andrew.rybchenko@oktetlabs.ru; > jiawenwu@trustnetic.com; jianwang@trustnetic.com; > jbehrens@vmware.com; maxime.coquelin@redhat.com; > chenbo.xia@intel.com; steven.webster@windriver.com; > matt.peters@windriver.com; bruce.richardson@intel.com; > mtetsuyah@gmail.com; grive@u256.net; jasvinder.singh@intel.com; > cristian.dumitrescu@intel.com; jgrajcia@cisco.com; > mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > Subject: [PATCH v7 5/6] ethdev: add trace points for mtr > > Adds trace points for rte_mtr specific functions in ethdev lib. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > 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(-) > Acked-by: Sunil Kumar Kori <skori@marvell.com> > diff --git a/lib/ethdev/ethdev_trace_points.c > b/lib/ethdev/ethdev_trace_points.c > index 1953d90a5a..067e5fdab4 100644 > --- a/lib/ethdev/ethdev_trace_points.c > +++ b/lib/ethdev/ethdev_trace_points.c > @@ -591,3 +591,66 @@ > -- > 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v7 6/6] ethdev: add trace points for tm 2023-01-23 9:02 ` [PATCH v7 0/6] add trace points in ethdev library Ankur Dwivedi ` (4 preceding siblings ...) 2023-01-23 9:02 ` [PATCH v7 5/6] ethdev: add trace points for mtr Ankur Dwivedi @ 2023-01-23 9:02 ` Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 0/6] add trace points in ethdev library Ankur Dwivedi 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-01-23 9:02 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 067e5fdab4..af66a139df 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index 2a0516e10d..694ab0c731 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT( rte_ethdev_trace_configure, @@ -1397,6 +1398,146 @@ RTE_TRACE_POINT( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT( + rte_tm_trace_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_tm_capabilities *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_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_level_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t level_id, + 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_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, + 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_capabilities_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + 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(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_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_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_shaper_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t shaper_profile_id, + 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_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_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_wred_profile_add, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t wred_profile_id, + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index a57a4d1dbf..f1cba5cedf 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -19,6 +19,7 @@ extern "C" { #include "rte_ethdev.h" #include "rte_mtr.h" +#include "rte_tm.h" RTE_TRACE_POINT_FP( rte_eth_trace_call_rx_callbacks, @@ -859,6 +860,176 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(ret); ) +RTE_TRACE_POINT_FP( + 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_FP( + 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_ptr(is_leaf); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + 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_FP( + rte_tm_trace_node_wfq_weight_mode_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + 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_FP( + 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_FP( + 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_FP( + rte_tm_trace_node_stats_read, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t node_id, + 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_ptr(stats_mask); + rte_trace_point_emit_int(clear); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + 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_FP( + 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_FP( + 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); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..eb4c8f103f 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -6,6 +6,8 @@ #include <rte_errno.h> #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" +#include "rte_ethdev_trace_fp.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +81,9 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); + return 0; } @@ -90,8 +95,14 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_type_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); + + rte_tm_trace_node_type_get(port_id, node_id, is_leaf, ret); + + return ret; } /* Get capabilities */ @@ -100,8 +111,14 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_tm_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* Get level capabilities */ @@ -111,8 +128,14 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); + + rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret); + + return ret; } /* Get node capabilities */ @@ -122,8 +145,14 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); + + rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret); + + return ret; } /* Add WRED profile */ @@ -133,8 +162,14 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); + + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -143,8 +178,14 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); + + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret); + + return ret; } /* Add/update shared WRED context */ @@ -154,8 +195,15 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); + + rte_tm_trace_shared_wred_context_add_update(port_id, shared_wred_context_id, + wred_profile_id, ret); + + return ret; } /* Delete shared WRED context */ @@ -164,8 +212,14 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); + + rte_tm_trace_shared_wred_context_delete(port_id, shared_wred_context_id, ret); + + return ret; } /* Add shaper profile */ @@ -175,8 +229,14 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); + + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -185,8 +245,14 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); + + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, ret); + + return ret; } /* Add shared shaper */ @@ -196,8 +262,15 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); + + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id, ret); + + return ret; } /* Delete shared shaper */ @@ -206,8 +279,14 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); + + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, ret); + + return ret; } /* Add node to port traffic manager hierarchy */ @@ -221,9 +300,16 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_add)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); + + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + + return ret; } /* Delete node from traffic manager hierarchy */ @@ -232,8 +318,14 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_delete)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); + + rte_tm_trace_node_delete(port_id, node_id, ret); + + return ret; } /* Suspend node */ @@ -242,8 +334,14 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_suspend)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); + + rte_tm_trace_node_suspend(port_id, node_id, ret); + + return ret; } /* Resume node */ @@ -252,8 +350,14 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_resume)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); + + rte_tm_trace_node_resume(port_id, node_id, ret); + + return ret; } /* Commit the initial port traffic manager hierarchy */ @@ -262,8 +366,14 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); + + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret); + + return ret; } /* Update node parent */ @@ -275,8 +385,15 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_parent_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); + + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight, ret); + + return ret; } /* Update node private shaper */ @@ -286,8 +403,14 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shaper_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); + + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id, ret); + + return ret; } /* Update node shared shapers */ @@ -298,8 +421,15 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); + + rte_tm_trace_node_shared_shaper_update(port_id, node_id, shared_shaper_id, + add, ret); + + return ret; } /* Update node stats */ @@ -309,8 +439,14 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); + + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, ret); + + return ret; } /* Update WFQ weight mode */ @@ -321,8 +457,15 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); + + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, wfq_weight_mode, + n_sp_priorities, ret); + + return ret; } /* Update node congestion management mode */ @@ -332,8 +475,14 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_cman_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); + + rte_tm_trace_node_cman_update(port_id, node_id, cman, ret); + + return ret; } /* Update node private WRED context */ @@ -343,8 +492,15 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); + + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id, + ret); + + return ret; } /* Update node shared WRED context */ @@ -355,8 +511,16 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); + + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add, ret); + + return ret; } /* Read and/or clear stats counters for specific node */ @@ -368,8 +532,15 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_read)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); + + rte_tm_trace_node_stats_read(port_id, node_id, stats, stats_mask, + clear, ret); + + return ret; } /* Packet marking - VLAN DEI */ @@ -380,8 +551,14 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } /* Packet marking - IPv4/IPv6 ECN */ @@ -392,8 +569,14 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } /* Packet marking - IPv4/IPv6 DSCP */ @@ -404,6 +587,12 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, + int ret; + + ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red, ret); + + return ret; } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c1a6e4d30a..112b2b1039 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -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 { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v8 0/6] add trace points in ethdev library 2023-01-23 9:02 ` [PATCH v7 0/6] add trace points in ethdev library Ankur Dwivedi ` (5 preceding siblings ...) 2023-01-23 9:02 ` [PATCH v7 6/6] ethdev: add trace points for tm Ankur Dwivedi @ 2023-02-06 11:58 ` Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi ` (6 more replies) 6 siblings, 7 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-06 11:58 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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 -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v8 1/6] eal: trace: add trace point emit for blob 2023-02-06 11:58 ` [PATCH v8 0/6] add trace points in ethdev library Ankur Dwivedi @ 2023-02-06 11:58 ` Ankur Dwivedi 2023-02-06 14:48 ` David Marchand 2023-02-06 11:58 ` [PATCH v8 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi ` (5 subsequent siblings) 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-06 11:58 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com> --- 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(+) diff --git a/app/test/test_trace.c b/app/test/test_trace.c index 6bedf14024..ad4a394a29 100644 --- a/app/test/test_trace.c +++ b/app/test/test_trace.c @@ -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; diff --git a/doc/guides/prog_guide/trace_lib.rst b/doc/guides/prog_guide/trace_lib.rst index 9a8f38073d..3e0ea5835c 100644 --- a/doc/guides/prog_guide/trace_lib.rst +++ b/doc/guides/prog_guide/trace_lib.rst @@ -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. diff --git a/lib/eal/common/eal_common_trace_points.c b/lib/eal/common/eal_common_trace_points.c index 0b0b254615..051f89809c 100644 --- a/lib/eal/common/eal_common_trace_points.c +++ b/lib/eal/common/eal_common_trace_points.c @@ -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) diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h index 5ef4398230..6f5c022558 100644 --- a/lib/eal/include/rte_eal_trace.h +++ b/lib/eal/include/rte_eal_trace.h @@ -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 */ diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index 0f8700974f..4d6b5700dd 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -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_ */ diff --git a/lib/eal/include/rte_trace_point_register.h b/lib/eal/include/rte_trace_point_register.h index a32f4d731b..a9682d3f22 100644 --- a/lib/eal/include/rte_trace_point_register.h +++ b/lib/eal/include/rte_trace_point_register.h @@ -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 -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v8 1/6] eal: trace: add trace point emit for blob 2023-02-06 11:58 ` [PATCH v8 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-02-06 14:48 ` David Marchand 2023-02-07 5:08 ` [EXT] " Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: David Marchand @ 2023-02-06 14:48 UTC (permalink / raw) To: Ankur Dwivedi Cc: dev, thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On Mon, Feb 6, 2023 at 12:59 PM Ankur Dwivedi <adwivedi@marvell.com> wrote: > > 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. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > Acked-by: Morten Brørup <mb@smartsharesystems.com> > Acked-by: Sunil Kumar Kori <skori@marvell.com> > Acked-by: Jerin Jacob <jerinj@marvell.com> I came accross this patch while looking at CI failures. Giving my two cents. > diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h > index 5ef4398230..6f5c022558 100644 > --- a/lib/eal/include/rte_eal_trace.h > +++ b/lib/eal/include/rte_eal_trace.h > @@ -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). -- David Marchand ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v8 1/6] eal: trace: add trace point emit for blob 2023-02-06 14:48 ` David Marchand @ 2023-02-07 5:08 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-07 5:08 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >On Mon, Feb 6, 2023 at 12:59 PM Ankur Dwivedi <adwivedi@marvell.com> >wrote: >> >> 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. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> Acked-by: Morten Brørup <mb@smartsharesystems.com> >> Acked-by: Sunil Kumar Kori <skori@marvell.com> >> Acked-by: Jerin Jacob <jerinj@marvell.com> > >I came accross this patch while looking at CI failures. >Giving my two cents. > > >> diff --git a/lib/eal/include/rte_eal_trace.h >> b/lib/eal/include/rte_eal_trace.h index 5ef4398230..6f5c022558 100644 >> --- a/lib/eal/include/rte_eal_trace.h >> +++ b/lib/eal/include/rte_eal_trace.h >> @@ -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). 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. > > >-- >David Marchand ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v8 2/6] ethdev: add trace points for ethdev (part one) 2023-02-06 11:58 ` [PATCH v8 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-02-06 11:58 ` Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi ` (4 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-06 11:58 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> --- 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 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..a5058f97ea --- /dev/null +++ b/lib/ethdev/ethdev_trace.h @@ -0,0 +1,642 @@ +/* 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_ptr(iter); + 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_ptr(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(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), + 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(const 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_ptr(conf); + 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_ptr(conf); + 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); + 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, const 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(const 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_ptr(stats); + 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_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + 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 5d5e18db1e..731ce7f27e 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); @@ -3025,6 +3257,10 @@ rte_eth_xstats_get_names(uint16_t port_id, cnt_used_entries += cnt_driver_entries; } + for (int 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 +3410,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 +3460,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 +3476,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 +3515,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 +3561,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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v8 3/6] ethdev: add trace points for ethdev (part two) 2023-02-06 11:58 ` [PATCH v8 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi @ 2023-02-06 11:58 ` Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 4/6] ethdev: add trace points for flow Ankur Dwivedi ` (3 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-06 11:58 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for remaining ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index a5058f97ea..9039446b5f 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 3e58c679c3..7a08104dc9 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 731ce7f27e..233de4e7f5 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -3626,6 +3626,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); + return 0; } @@ -3646,6 +3648,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct rte_eth_conf)); + rte_ethdev_trace_conf_get(port_id, dev_conf); + return 0; } @@ -3676,8 +3680,12 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) if (all_ptypes[i] & ptype_mask) { - if (j < num) + if (j < num) { ptypes[j] = all_ptypes[i]; + + rte_ethdev_trace_get_supported_ptypes(port_id, + j, num, ptypes[j]); + } j++; } @@ -3755,6 +3763,10 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, if (ptype_mask & all_ptypes[i]) { if (j < num - 1) { set_ptypes[j] = all_ptypes[i]; + + rte_ethdev_trace_set_ptypes(port_id, j, num, + set_ptypes[j]); + j++; continue; } @@ -3796,6 +3808,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, num = RTE_MIN(dev_info.max_mac_addrs, num); memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); + rte_eth_trace_macaddrs_get(port_id, num); + return num; } @@ -3816,6 +3830,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); + rte_eth_trace_macaddr_get(port_id, mac_addr); + return 0; } @@ -3834,6 +3850,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + + rte_ethdev_trace_get_mtu(port_id, *mtu); + return 0; } @@ -3876,7 +3895,11 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_mtu(port_id, mtu, ret); + + return ret; } int @@ -3919,7 +3942,11 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) vfc->ids[vidx] &= ~RTE_BIT64(vbit); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); + + return ret; } int @@ -3940,6 +3967,8 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, return -ENOTSUP; (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); + return 0; } @@ -3949,14 +3978,19 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, uint16_t tpid) { 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->vlan_tpid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, - tpid)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, + tpid)); + + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); + + return ret; } int @@ -4048,7 +4082,11 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) dev->data->dev_conf.rxmode.offloads = orig_offloads; } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); + + return ret; } int @@ -4074,6 +4112,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); + return ret; } @@ -4081,19 +4121,25 @@ int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { 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->vlan_pvid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); + + return ret; } int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4108,13 +4154,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_get == NULL) return -ENOTSUP; memset(fc_conf, 0, sizeof(*fc_conf)); - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); + + return ret; } int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4133,7 +4184,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); + + return ret; } int @@ -4141,6 +4196,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4158,9 +4214,15 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, } /* High water, low water validation are device specific */ - if (*dev->dev_ops->priority_flow_ctrl_set) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) - (dev, pfc_conf)); + if (*dev->dev_ops->priority_flow_ctrl_set) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) + (dev, pfc_conf)); + + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, ret); + + return ret; + } + return -ENOTSUP; } @@ -4219,6 +4281,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, struct rte_eth_pfc_queue_info *pfc_queue_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4229,9 +4292,15 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); + + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, + pfc_queue_info, ret); + + return ret; + } return -ENOTSUP; } @@ -4300,10 +4369,17 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, return ret; } - if (*dev->dev_ops->priority_flow_ctrl_queue_config) - return eth_err(port_id, - (*dev->dev_ops->priority_flow_ctrl_queue_config)( - dev, pfc_queue_conf)); + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { + ret = eth_err(port_id, + (*dev->dev_ops->priority_flow_ctrl_queue_config)( + dev, pfc_queue_conf)); + + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf, ret); + + return ret; + } + return -ENOTSUP; } @@ -4395,8 +4471,12 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, if (*dev->dev_ops->reta_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4424,8 +4504,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, if (*dev->dev_ops->reta_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4469,8 +4553,12 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, if (*dev->dev_ops->rss_hash_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); + + return ret; } int @@ -4478,6 +4566,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4491,8 +4580,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, if (*dev->dev_ops->rss_hash_conf_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); + + return ret; } int @@ -4500,6 +4593,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4518,8 +4612,12 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_add == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); + + return ret; } int @@ -4527,6 +4625,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4545,34 +4644,48 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_del == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); + + return ret; } int rte_eth_led_on(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_led_on == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + + rte_eth_trace_led_on(port_id, ret); + + return ret; } int rte_eth_led_off(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_led_off == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + + rte_eth_trace_led_off(port_id, ret); + + return ret; } int @@ -4597,6 +4710,8 @@ rte_eth_fec_get_capability(uint16_t port_id, return -ENOTSUP; ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, num); + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); + return ret; } @@ -4604,6 +4719,7 @@ int rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4617,20 +4733,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) if (*dev->dev_ops->fec_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + + rte_eth_trace_fec_get(port_id, fec_capa, ret); + + return ret; } int rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) { 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->fec_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + + rte_eth_trace_fec_set(port_id, fec_capa, ret); + + return ret; } /* @@ -4718,7 +4843,11 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); + + return ret; } int @@ -4758,6 +4887,8 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) /* reset pool bitmap */ dev->data->mac_pool_sel[index] = 0; + rte_ethdev_trace_mac_addr_remove(port_id, addr); + return 0; } @@ -4790,6 +4921,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) /* Update default address in NIC data structure */ rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); + rte_ethdev_trace_default_mac_addr_set(port_id, addr); + return 0; } @@ -4880,21 +5013,29 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, &dev->data->hash_mac_addrs[index]); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { 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->uc_all_hash_table_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, - on)); + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, on)); + + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, @@ -4930,14 +5071,19 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (*dev->dev_ops->set_queue_rate_limit == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate)); + + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, ret); + + return ret; } int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, uint8_t avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4957,14 +5103,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, } if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, queue_id, avail_thresh)); + + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, ret); + + return ret; } int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, uint8_t *avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4976,8 +5127,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, avail_thresh)); + + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); + + return ret; } RTE_INIT(eth_dev_init_fp_ops) @@ -5059,6 +5214,10 @@ rte_eth_dev_callback_register(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, + next_port, last_port); + return 0; } @@ -5120,6 +5279,10 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, + ret); + return ret; } @@ -5149,6 +5312,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { vec = rte_intr_vec_list_index_get(intr_handle, qid); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5192,6 +5358,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); + return fd; } @@ -5225,6 +5393,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, vec = rte_intr_vec_list_index_get(intr_handle, queue_id); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5251,7 +5422,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); + + return ret; } int @@ -5270,7 +5445,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); + + return ret; } @@ -5328,6 +5507,8 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5367,6 +5548,9 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, cb, __ATOMIC_RELEASE); rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param, + cb); + return cb; } @@ -5426,6 +5610,8 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5460,6 +5646,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5494,6 +5682,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5540,6 +5730,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5586,6 +5778,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5594,6 +5788,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5613,8 +5808,12 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->rx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, + dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5622,6 +5821,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5641,8 +5841,12 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->tx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, + dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5650,6 +5854,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, struct rte_power_monitor_cond *pmc) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5668,8 +5873,12 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->get_monitor_addr == NULL) return -ENOTSUP; - return eth_err(port_id, + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); + + return ret; } int @@ -5678,40 +5887,56 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, uint32_t nb_mc_addr) { 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->set_mc_addr_list == NULL) return -ENOTSUP; - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, mc_addr_set, nb_mc_addr)); + + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr, + ret); + + return ret; } int rte_eth_timesync_enable(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->timesync_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + + rte_eth_trace_timesync_enable(port_id, ret); + + return ret; } int rte_eth_timesync_disable(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->timesync_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + + rte_eth_trace_timesync_disable(port_id, ret); + + return ret; } int @@ -5719,6 +5944,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5732,8 +5958,14 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) - (dev, timestamp, flags)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) + (dev, timestamp, flags)); + + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags, + ret); + + return ret; } int @@ -5741,6 +5973,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5754,27 +5987,39 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) - (dev, timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) + (dev, timestamp)); + + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, ret); + + return ret; + } int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { 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->timesync_adjust_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); + + return ret; } int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5788,14 +6033,19 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) if (*dev->dev_ops->timesync_read_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, timestamp)); + + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); + + return ret; } int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5809,14 +6059,19 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) if (*dev->dev_ops->timesync_write_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, timestamp)); + + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); + + return ret; } int rte_eth_read_clock(uint16_t port_id, uint64_t *clock) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5829,13 +6084,18 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) if (*dev->dev_ops->read_clock == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + + rte_eth_trace_read_clock(port_id, clock, ret); + + return ret; } int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; @@ -5849,26 +6109,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) if (*dev->dev_ops->get_reg == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + + rte_ethdev_trace_get_reg_info(port_id, info, ret); + + return ret; } int rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + + rte_ethdev_trace_get_eeprom_length(port_id, ret); + + return ret; } int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5882,13 +6152,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->get_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + + rte_ethdev_trace_get_eeprom(port_id, info, ret); + + return ret; } int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5902,7 +6177,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->set_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + + rte_ethdev_trace_set_eeprom(port_id, info, ret); + + return ret; } int @@ -5910,6 +6189,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5923,7 +6203,11 @@ rte_eth_dev_get_module_info(uint16_t port_id, if (*dev->dev_ops->get_module_info == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_info)(dev, modinfo); + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); + + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); + + return ret; } int @@ -5931,6 +6215,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5958,7 +6243,11 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, if (*dev->dev_ops->get_module_eeprom == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_eeprom)(dev, info); + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); + + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); + + return ret; } int @@ -5966,6 +6255,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5981,7 +6271,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, if (*dev->dev_ops->get_dcb_info == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); + + return ret; } static void @@ -6017,6 +6311,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); + return 0; } @@ -6025,6 +6321,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, struct rte_eth_hairpin_cap *cap) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6039,13 +6336,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, if (*dev->dev_ops->hairpin_cap_get == NULL) return -ENOTSUP; memset(cap, 0, sizeof(*cap)); - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); + + return ret; } int rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6060,7 +6362,11 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) if (*dev->dev_ops->pool_ops_supported == NULL) return 1; /* all pools are supported */ - return (*dev->dev_ops->pool_ops_supported)(dev, pool); + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); + + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); + + return ret; } static int @@ -6350,19 +6656,25 @@ rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_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]; if (*dev->dev_ops->representor_info_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + + rte_eth_trace_representor_info_get(port_id, info, ret); + + return ret; } int rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6381,8 +6693,12 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) if (*dev->dev_ops->rx_metadata_negotiate == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + ret = eth_err(port_id, + (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + + rte_eth_trace_rx_metadata_negotiate(port_id, features, *features, ret); + + return ret; } int @@ -6390,6 +6706,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *reassembly_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6411,8 +6728,13 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, return -ENOTSUP; memset(reassembly_capa, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) (dev, reassembly_capa)); + + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa, + ret); + + return ret; } int @@ -6420,6 +6742,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6440,8 +6763,12 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_get == NULL) return -ENOTSUP; memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + ret = eth_err(port_id, + (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); + + return ret; } int @@ -6449,6 +6776,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, const struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6477,8 +6805,12 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_set == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + ret = eth_err(port_id, + (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); + + return ret; } int @@ -6576,8 +6908,12 @@ rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes return 0; for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { - if (j < num) + if (j < num) { ptypes[j] = all_types[i]; + + rte_eth_trace_buffer_split_get_supported_hdr_ptypes( + port_id, j, ptypes[j]); + } j++; } diff --git a/lib/ethdev/rte_ethdev_cman.c b/lib/ethdev/rte_ethdev_cman.c index 4a1bdd7bd0..a9c4637521 100644 --- a/lib/ethdev/rte_ethdev_cman.c +++ b/lib/ethdev/rte_ethdev_cman.c @@ -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; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v8 4/6] ethdev: add trace points for flow 2023-02-06 11:58 ` [PATCH v8 0/6] add trace points in ethdev library Ankur Dwivedi ` (2 preceding siblings ...) 2023-02-06 11:58 ` [PATCH v8 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi @ 2023-02-06 11:58 ` Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 5/6] ethdev: add trace points for mtr Ankur Dwivedi ` (2 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-06 11:58 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 9039446b5f..0604c0290e 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 7a08104dc9..b8cbb285de 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 7d0c24366c..58b5162f39 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -16,6 +16,8 @@ #include "rte_flow_driver.h" #include "rte_flow.h" +#include "ethdev_trace.h" + /* Mbuf dynamic field name for metadata. */ int32_t rte_flow_dynf_metadata_offs = -1; @@ -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, @@ -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,39 +1031,57 @@ rte_flow_conv(enum rte_flow_conv_op op, const void *src, struct rte_flow_error *error) { + int ret; + switch (op) { const struct rte_flow_attr *attr; case RTE_FLOW_CONV_OP_NONE: - return 0; + ret = 0; + break; case RTE_FLOW_CONV_OP_ATTR: attr = src; if (size > sizeof(*attr)) size = sizeof(*attr); rte_memcpy(dst, attr, size); - return sizeof(*attr); + ret = sizeof(*attr); + break; case RTE_FLOW_CONV_OP_ITEM: - return rte_flow_conv_pattern(dst, size, src, 1, error); + ret = rte_flow_conv_pattern(dst, size, src, 1, error); + break; case RTE_FLOW_CONV_OP_ACTION: - return rte_flow_conv_actions(dst, size, src, 1, error); + ret = rte_flow_conv_actions(dst, size, src, 1, error); + break; case RTE_FLOW_CONV_OP_PATTERN: - return rte_flow_conv_pattern(dst, size, src, 0, error); + ret = rte_flow_conv_pattern(dst, size, src, 0, error); + break; case RTE_FLOW_CONV_OP_ACTIONS: - return rte_flow_conv_actions(dst, size, src, 0, error); + ret = rte_flow_conv_actions(dst, size, src, 0, error); + break; case RTE_FLOW_CONV_OP_RULE: - return rte_flow_conv_rule(dst, size, src, error); + ret = rte_flow_conv_rule(dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ITEM_NAME: - return rte_flow_conv_name(0, 0, dst, size, src, error); + ret = rte_flow_conv_name(0, 0, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ACTION_NAME: - return rte_flow_conv_name(1, 0, dst, size, src, error); + ret = rte_flow_conv_name(1, 0, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ITEM_NAME_PTR: - return rte_flow_conv_name(0, 1, dst, size, src, error); + ret = rte_flow_conv_name(0, 1, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ACTION_NAME_PTR: - return rte_flow_conv_name(1, 1, dst, size, src, error); - } - return rte_flow_error_set + ret = rte_flow_conv_name(1, 1, dst, size, src, error); + break; + default: + ret = rte_flow_error_set (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "unknown object conversion operation"); + } + + rte_flow_trace_conv(op, dst, size, src, ret); + + return ret; } /** Store a full rte_flow description. */ @@ -1087,6 +1133,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 +1174,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1147,7 +1200,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1175,6 +1233,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 +1255,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 @@ -1214,7 +1279,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 @@ -1234,7 +1303,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 +1319,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 +1348,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, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1291,14 +1376,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, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1313,15 +1403,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, + error), + error); + + rte_flow_trace_tunnel_action_decap_release(port_id, actions, + num_of_actions, ret); + + return ret; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1336,14 +1432,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1356,6 +1457,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)) return -rte_errno; @@ -1367,9 +1469,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 * @@ -1392,6 +1498,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 +1518,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 @@ -1420,6 +1533,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 +1548,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1480,7 +1598,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1531,6 +1653,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; } rte_flow_error_set(error, ENOTSUP, @@ -1546,17 +1672,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1617,6 +1749,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); + return template; } rte_flow_error_set(error, ENOTSUP, @@ -1632,17 +1768,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1707,6 +1849,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; } rte_flow_error_set(error, ENOTSUP, @@ -1722,17 +1871,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1762,6 +1917,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 +1935,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 +1956,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 +1977,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 +2004,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); + return handle; } @@ -1845,7 +2026,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 @@ -1863,7 +2049,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 @@ -1881,5 +2073,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, + action_handle, data, user_data, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v8 5/6] ethdev: add trace points for mtr 2023-02-06 11:58 ` [PATCH v8 0/6] add trace points in ethdev library Ankur Dwivedi ` (3 preceding siblings ...) 2023-02-06 11:58 ` [PATCH v8 4/6] ethdev: add trace points for flow Ankur Dwivedi @ 2023-02-06 11:58 ` Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 0/6] add trace points in ethdev library Ankur Dwivedi 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-06 11:58 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 0604c0290e..5285a04c67 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index b8cbb285de..c34c06941c 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index 3954839531..e957f52db5 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -5,6 +5,7 @@ #include <stdint.h> #include <rte_errno.h> +#include "ethdev_trace.h" #include "rte_ethdev.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -82,8 +83,13 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, capabilities_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_mtr_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* MTR meter profile add */ @@ -94,8 +100,14 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); + + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile, + ret); + + return ret; } /** MTR meter profile delete */ @@ -105,8 +117,13 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id, ret); + + return ret; } /** MTR meter profile get */ @@ -116,8 +133,13 @@ rte_mtr_meter_profile_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, + struct rte_flow_meter_profile *ret; + ret = RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_get(port_id, meter_profile_id, ret); + + return ret; } /* MTR meter policy validate */ @@ -127,8 +149,16 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, + int ret; + int i; + ret = RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_validate(port_id, i, + policy->actions[i], ret); + + return ret; } /* MTR meter policy add */ @@ -139,8 +169,16 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, + int ret; + int i; + ret = RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_add(port_id, policy_id, i, + policy->actions[i], ret); + + return ret; } /** MTR meter policy delete */ @@ -150,8 +188,13 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_delete(port_id, policy_id, ret); + + return ret; } /** MTR meter policy get */ @@ -161,8 +204,13 @@ rte_mtr_meter_policy_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, + struct rte_flow_meter_policy *ret; + ret = RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_get(port_id, policy_id, ret); + + return ret; } /** MTR object create */ @@ -174,8 +222,13 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, create)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); + + rte_mtr_trace_create(port_id, mtr_id, params, shared, ret); + + return ret; } /** MTR object destroy */ @@ -185,8 +238,13 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, destroy)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); + + rte_mtr_trace_destroy(port_id, mtr_id, ret); + + return ret; } /** MTR object meter enable */ @@ -196,8 +254,13 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_enable)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); + + rte_mtr_trace_meter_enable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter disable */ @@ -207,8 +270,13 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_disable)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); + + rte_mtr_trace_meter_disable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter profile update */ @@ -219,8 +287,13 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); + + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id, ret); + + return ret; } /** MTR object meter policy update */ @@ -231,8 +304,13 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); + + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id, ret); + + return ret; } /** MTR object meter DSCP table update */ @@ -243,8 +321,13 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, proto, dscp_table, error); + + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table, ret); + + return ret; } /** MTR object meter VLAN table update */ @@ -255,8 +338,13 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, proto, vlan_table, error); + + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table, ret); + + return ret; } /** Set the input color protocol on MTR object */ @@ -268,8 +356,13 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_set)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority, ret); + + return ret; } /** Get input color protocols of MTR object */ @@ -280,8 +373,13 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); + + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id, ret); + + return ret; } /** Get input color protocol priority of MTR object */ @@ -293,8 +391,13 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto, ret); + + return ret; } /** MTR object enabled stats update */ @@ -305,8 +408,13 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); + + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask, ret); + + return ret; } /** MTR object stats read */ @@ -319,6 +427,12 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_read)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); + + rte_mtr_trace_stats_read(port_id, mtr_id, stats, *stats_mask, clear, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v8 6/6] ethdev: add trace points for tm 2023-02-06 11:58 ` [PATCH v8 0/6] add trace points in ethdev library Ankur Dwivedi ` (4 preceding siblings ...) 2023-02-06 11:58 ` [PATCH v8 5/6] ethdev: add trace points for mtr Ankur Dwivedi @ 2023-02-06 11:58 ` Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 0/6] add trace points in ethdev library Ankur Dwivedi 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-06 11:58 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 5285a04c67..ffad9fd872 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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 */ diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index c34c06941c..34d12e2859 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..2d08141133 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -5,6 +5,7 @@ #include <stdint.h> #include <rte_errno.h> +#include "ethdev_trace.h" #include "rte_ethdev.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +80,9 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); + return 0; } @@ -90,8 +94,13 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_type_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); + + rte_tm_trace_node_type_get(port_id, node_id, *is_leaf, ret); + + return ret; } /* Get capabilities */ @@ -100,8 +109,13 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_tm_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* Get level capabilities */ @@ -111,8 +125,13 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); + + rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret); + + return ret; } /* Get node capabilities */ @@ -122,8 +141,13 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); + + rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret); + + return ret; } /* Add WRED profile */ @@ -133,8 +157,13 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); + + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -143,8 +172,13 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); + + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret); + + return ret; } /* Add/update shared WRED context */ @@ -154,8 +188,15 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); + + rte_tm_trace_shared_wred_context_add_update(port_id, + shared_wred_context_id, + wred_profile_id, ret); + + return ret; } /* Delete shared WRED context */ @@ -164,8 +205,14 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); + + rte_tm_trace_shared_wred_context_delete(port_id, + shared_wred_context_id, ret); + + return ret; } /* Add shaper profile */ @@ -175,8 +222,14 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); + + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile, + ret); + + return ret; } /* Delete WRED profile */ @@ -185,8 +238,13 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); + + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, ret); + + return ret; } /* Add shared shaper */ @@ -196,8 +254,14 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); + + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id, ret); + + return ret; } /* Delete shared shaper */ @@ -206,8 +270,13 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); + + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, ret); + + return ret; } /* Add node to port traffic manager hierarchy */ @@ -221,9 +290,15 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); + + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + + return ret; } /* Delete node from traffic manager hierarchy */ @@ -232,8 +307,13 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); + + rte_tm_trace_node_delete(port_id, node_id, ret); + + return ret; } /* Suspend node */ @@ -242,8 +322,13 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_suspend)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); + + rte_tm_trace_node_suspend(port_id, node_id, ret); + + return ret; } /* Resume node */ @@ -252,8 +337,13 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_resume)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); + + rte_tm_trace_node_resume(port_id, node_id, ret); + + return ret; } /* Commit the initial port traffic manager hierarchy */ @@ -262,8 +352,13 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); + + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret); + + return ret; } /* Update node parent */ @@ -275,8 +370,14 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_parent_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); + + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight, ret); + + return ret; } /* Update node private shaper */ @@ -286,8 +387,14 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shaper_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); + + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id, + ret); + + return ret; } /* Update node shared shapers */ @@ -298,8 +405,14 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); + + rte_tm_trace_node_shared_shaper_update(port_id, node_id, + shared_shaper_id, add, ret); + + return ret; } /* Update node stats */ @@ -309,8 +422,13 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); + + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, ret); + + return ret; } /* Update WFQ weight mode */ @@ -321,8 +439,15 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); + + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, + wfq_weight_mode, + n_sp_priorities, ret); + + return ret; } /* Update node congestion management mode */ @@ -332,8 +457,13 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_cman_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); + + rte_tm_trace_node_cman_update(port_id, node_id, cman, ret); + + return ret; } /* Update node private WRED context */ @@ -343,8 +473,14 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); + + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id, + ret); + + return ret; } /* Update node shared WRED context */ @@ -355,8 +491,15 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); + + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add, ret); + + return ret; } /* Read and/or clear stats counters for specific node */ @@ -368,8 +511,14 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_read)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); + + rte_tm_trace_node_stats_read(port_id, node_id, stats, *stats_mask, + clear, ret); + + return ret; } /* Packet marking - VLAN DEI */ @@ -380,8 +529,14 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } /* Packet marking - IPv4/IPv6 ECN */ @@ -392,8 +547,14 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } /* Packet marking - IPv4/IPv6 DSCP */ @@ -404,6 +565,12 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v9 0/6] add trace points in ethdev library 2023-02-06 11:58 ` [PATCH v8 0/6] add trace points in ethdev library Ankur Dwivedi ` (5 preceding siblings ...) 2023-02-06 11:58 ` [PATCH v8 6/6] ethdev: add trace points for tm Ankur Dwivedi @ 2023-02-07 6:32 ` Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi ` (6 more replies) 6 siblings, 7 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-07 6:32 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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 -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v9 1/6] eal: trace: add trace point emit for blob 2023-02-07 6:32 ` [PATCH v9 0/6] add trace points in ethdev library Ankur Dwivedi @ 2023-02-07 6:32 ` Ankur Dwivedi 2023-02-08 1:16 ` Ferruh Yigit 2023-02-07 6:32 ` [PATCH v9 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi ` (5 subsequent siblings) 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-07 6:32 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com> --- 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(+) diff --git a/app/test/test_trace.c b/app/test/test_trace.c index 6bedf14024..ad4a394a29 100644 --- a/app/test/test_trace.c +++ b/app/test/test_trace.c @@ -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; diff --git a/doc/guides/prog_guide/trace_lib.rst b/doc/guides/prog_guide/trace_lib.rst index 9a8f38073d..3e0ea5835c 100644 --- a/doc/guides/prog_guide/trace_lib.rst +++ b/doc/guides/prog_guide/trace_lib.rst @@ -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. diff --git a/lib/eal/common/eal_common_trace_points.c b/lib/eal/common/eal_common_trace_points.c index 0b0b254615..051f89809c 100644 --- a/lib/eal/common/eal_common_trace_points.c +++ b/lib/eal/common/eal_common_trace_points.c @@ -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) diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h index 5ef4398230..6f5c022558 100644 --- a/lib/eal/include/rte_eal_trace.h +++ b/lib/eal/include/rte_eal_trace.h @@ -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 */ diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index 0f8700974f..4d6b5700dd 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -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_ */ diff --git a/lib/eal/include/rte_trace_point_register.h b/lib/eal/include/rte_trace_point_register.h index a32f4d731b..a9682d3f22 100644 --- a/lib/eal/include/rte_trace_point_register.h +++ b/lib/eal/include/rte_trace_point_register.h @@ -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 diff --git a/lib/eal/version.map b/lib/eal/version.map index 6523102157..21aa1b8ce3 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -442,6 +442,7 @@ EXPERIMENTAL { # added in 23.03 rte_thread_set_name; + __rte_eal_trace_generic_blob; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v9 1/6] eal: trace: add trace point emit for blob 2023-02-07 6:32 ` [PATCH v9 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-02-08 1:16 ` Ferruh Yigit 0 siblings, 0 replies; 172+ messages in thread From: Ferruh Yigit @ 2023-02-08 1:16 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/7/2023 6:32 AM, Ankur Dwivedi wrote: > 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. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > Acked-by: Morten Brørup <mb@smartsharesystems.com> > Acked-by: Sunil Kumar Kori <skori@marvell.com> > Acked-by: Jerin Jacob <jerinj@marvell.com> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com> ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v9 2/6] ethdev: add trace points for ethdev (part one) 2023-02-07 6:32 ` [PATCH v9 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-02-07 6:32 ` Ankur Dwivedi 2023-02-08 1:16 ` Ferruh Yigit 2023-02-07 6:32 ` [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi ` (4 subsequent siblings) 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-07 6:32 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> --- 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 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..a5058f97ea --- /dev/null +++ b/lib/ethdev/ethdev_trace.h @@ -0,0 +1,642 @@ +/* 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_ptr(iter); + 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_ptr(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(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), + 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(const 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_ptr(conf); + 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_ptr(conf); + 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); + 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, const 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(const 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_ptr(stats); + 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_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + 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 5d5e18db1e..731ce7f27e 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); @@ -3025,6 +3257,10 @@ rte_eth_xstats_get_names(uint16_t port_id, cnt_used_entries += cnt_driver_entries; } + for (int 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 +3410,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 +3460,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 +3476,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 +3515,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 +3561,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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v9 2/6] ethdev: add trace points for ethdev (part one) 2023-02-07 6:32 ` [PATCH v9 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi @ 2023-02-08 1:16 ` Ferruh Yigit 2023-02-08 10:30 ` [EXT] " Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-02-08 1:16 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/7/2023 6:32 AM, Ankur Dwivedi wrote: > 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 <adwivedi@marvell.com> > Acked-by: Sunil Kumar Kori <skori@marvell.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com> <...> > +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), > + 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. ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v9 2/6] ethdev: add trace points for ethdev (part one) 2023-02-08 1:16 ` Ferruh Yigit @ 2023-02-08 10:30 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 10:30 UTC (permalink / raw) To: Ferruh Yigit, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >Subject: [EXT] Re: [PATCH v9 2/6] ethdev: add trace points for ethdev (part >one) > >External Email > >---------------------------------------------------------------------- >On 2/7/2023 6:32 AM, Ankur Dwivedi wrote: >> 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 <adwivedi@marvell.com> >> Acked-by: Sunil Kumar Kori <skori@marvell.com> > >Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com> > ><...> > >> +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), >> + 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. ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) 2023-02-07 6:32 ` [PATCH v9 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi @ 2023-02-07 6:32 ` Ankur Dwivedi 2023-02-08 1:20 ` Ferruh Yigit 2023-02-07 6:32 ` [PATCH v9 4/6] ethdev: add trace points for flow Ankur Dwivedi ` (3 subsequent siblings) 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-07 6:32 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for remaining ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index a5058f97ea..9039446b5f 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 3e58c679c3..7a08104dc9 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 731ce7f27e..233de4e7f5 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -3626,6 +3626,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); + return 0; } @@ -3646,6 +3648,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct rte_eth_conf)); + rte_ethdev_trace_conf_get(port_id, dev_conf); + return 0; } @@ -3676,8 +3680,12 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) if (all_ptypes[i] & ptype_mask) { - if (j < num) + if (j < num) { ptypes[j] = all_ptypes[i]; + + rte_ethdev_trace_get_supported_ptypes(port_id, + j, num, ptypes[j]); + } j++; } @@ -3755,6 +3763,10 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, if (ptype_mask & all_ptypes[i]) { if (j < num - 1) { set_ptypes[j] = all_ptypes[i]; + + rte_ethdev_trace_set_ptypes(port_id, j, num, + set_ptypes[j]); + j++; continue; } @@ -3796,6 +3808,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, num = RTE_MIN(dev_info.max_mac_addrs, num); memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); + rte_eth_trace_macaddrs_get(port_id, num); + return num; } @@ -3816,6 +3830,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); + rte_eth_trace_macaddr_get(port_id, mac_addr); + return 0; } @@ -3834,6 +3850,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + + rte_ethdev_trace_get_mtu(port_id, *mtu); + return 0; } @@ -3876,7 +3895,11 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_mtu(port_id, mtu, ret); + + return ret; } int @@ -3919,7 +3942,11 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) vfc->ids[vidx] &= ~RTE_BIT64(vbit); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); + + return ret; } int @@ -3940,6 +3967,8 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, return -ENOTSUP; (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); + return 0; } @@ -3949,14 +3978,19 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, uint16_t tpid) { 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->vlan_tpid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, - tpid)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, + tpid)); + + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); + + return ret; } int @@ -4048,7 +4082,11 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) dev->data->dev_conf.rxmode.offloads = orig_offloads; } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); + + return ret; } int @@ -4074,6 +4112,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); + return ret; } @@ -4081,19 +4121,25 @@ int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { 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->vlan_pvid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); + + return ret; } int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4108,13 +4154,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_get == NULL) return -ENOTSUP; memset(fc_conf, 0, sizeof(*fc_conf)); - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); + + return ret; } int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4133,7 +4184,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); + + return ret; } int @@ -4141,6 +4196,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4158,9 +4214,15 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, } /* High water, low water validation are device specific */ - if (*dev->dev_ops->priority_flow_ctrl_set) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) - (dev, pfc_conf)); + if (*dev->dev_ops->priority_flow_ctrl_set) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) + (dev, pfc_conf)); + + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, ret); + + return ret; + } + return -ENOTSUP; } @@ -4219,6 +4281,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, struct rte_eth_pfc_queue_info *pfc_queue_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4229,9 +4292,15 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); + + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, + pfc_queue_info, ret); + + return ret; + } return -ENOTSUP; } @@ -4300,10 +4369,17 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, return ret; } - if (*dev->dev_ops->priority_flow_ctrl_queue_config) - return eth_err(port_id, - (*dev->dev_ops->priority_flow_ctrl_queue_config)( - dev, pfc_queue_conf)); + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { + ret = eth_err(port_id, + (*dev->dev_ops->priority_flow_ctrl_queue_config)( + dev, pfc_queue_conf)); + + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf, ret); + + return ret; + } + return -ENOTSUP; } @@ -4395,8 +4471,12 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, if (*dev->dev_ops->reta_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4424,8 +4504,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, if (*dev->dev_ops->reta_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4469,8 +4553,12 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, if (*dev->dev_ops->rss_hash_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); + + return ret; } int @@ -4478,6 +4566,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4491,8 +4580,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, if (*dev->dev_ops->rss_hash_conf_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); + + return ret; } int @@ -4500,6 +4593,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4518,8 +4612,12 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_add == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); + + return ret; } int @@ -4527,6 +4625,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4545,34 +4644,48 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_del == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); + + return ret; } int rte_eth_led_on(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_led_on == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + + rte_eth_trace_led_on(port_id, ret); + + return ret; } int rte_eth_led_off(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_led_off == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + + rte_eth_trace_led_off(port_id, ret); + + return ret; } int @@ -4597,6 +4710,8 @@ rte_eth_fec_get_capability(uint16_t port_id, return -ENOTSUP; ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, num); + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); + return ret; } @@ -4604,6 +4719,7 @@ int rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4617,20 +4733,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) if (*dev->dev_ops->fec_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + + rte_eth_trace_fec_get(port_id, fec_capa, ret); + + return ret; } int rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) { 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->fec_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + + rte_eth_trace_fec_set(port_id, fec_capa, ret); + + return ret; } /* @@ -4718,7 +4843,11 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); + + return ret; } int @@ -4758,6 +4887,8 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) /* reset pool bitmap */ dev->data->mac_pool_sel[index] = 0; + rte_ethdev_trace_mac_addr_remove(port_id, addr); + return 0; } @@ -4790,6 +4921,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) /* Update default address in NIC data structure */ rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); + rte_ethdev_trace_default_mac_addr_set(port_id, addr); + return 0; } @@ -4880,21 +5013,29 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, &dev->data->hash_mac_addrs[index]); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { 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->uc_all_hash_table_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, - on)); + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, on)); + + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, @@ -4930,14 +5071,19 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (*dev->dev_ops->set_queue_rate_limit == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate)); + + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, ret); + + return ret; } int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, uint8_t avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4957,14 +5103,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, } if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, queue_id, avail_thresh)); + + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, ret); + + return ret; } int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, uint8_t *avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4976,8 +5127,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, avail_thresh)); + + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); + + return ret; } RTE_INIT(eth_dev_init_fp_ops) @@ -5059,6 +5214,10 @@ rte_eth_dev_callback_register(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg, + next_port, last_port); + return 0; } @@ -5120,6 +5279,10 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, + ret); + return ret; } @@ -5149,6 +5312,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { vec = rte_intr_vec_list_index_get(intr_handle, qid); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5192,6 +5358,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); + return fd; } @@ -5225,6 +5393,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, vec = rte_intr_vec_list_index_get(intr_handle, queue_id); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5251,7 +5422,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); + + return ret; } int @@ -5270,7 +5445,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); + + return ret; } @@ -5328,6 +5507,8 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5367,6 +5548,9 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, cb, __ATOMIC_RELEASE); rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param, + cb); + return cb; } @@ -5426,6 +5610,8 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5460,6 +5646,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5494,6 +5682,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5540,6 +5730,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5586,6 +5778,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5594,6 +5788,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5613,8 +5808,12 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->rx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, + dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5622,6 +5821,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5641,8 +5841,12 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->tx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, + dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5650,6 +5854,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, struct rte_power_monitor_cond *pmc) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5668,8 +5873,12 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->get_monitor_addr == NULL) return -ENOTSUP; - return eth_err(port_id, + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); + + return ret; } int @@ -5678,40 +5887,56 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, uint32_t nb_mc_addr) { 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->set_mc_addr_list == NULL) return -ENOTSUP; - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, mc_addr_set, nb_mc_addr)); + + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr, + ret); + + return ret; } int rte_eth_timesync_enable(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->timesync_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + + rte_eth_trace_timesync_enable(port_id, ret); + + return ret; } int rte_eth_timesync_disable(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->timesync_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + + rte_eth_trace_timesync_disable(port_id, ret); + + return ret; } int @@ -5719,6 +5944,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5732,8 +5958,14 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) - (dev, timestamp, flags)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) + (dev, timestamp, flags)); + + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags, + ret); + + return ret; } int @@ -5741,6 +5973,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5754,27 +5987,39 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) - (dev, timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) + (dev, timestamp)); + + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, ret); + + return ret; + } int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { 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->timesync_adjust_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); + + return ret; } int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5788,14 +6033,19 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) if (*dev->dev_ops->timesync_read_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, timestamp)); + + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); + + return ret; } int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5809,14 +6059,19 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) if (*dev->dev_ops->timesync_write_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, timestamp)); + + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); + + return ret; } int rte_eth_read_clock(uint16_t port_id, uint64_t *clock) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5829,13 +6084,18 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) if (*dev->dev_ops->read_clock == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + + rte_eth_trace_read_clock(port_id, clock, ret); + + return ret; } int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; @@ -5849,26 +6109,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) if (*dev->dev_ops->get_reg == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + + rte_ethdev_trace_get_reg_info(port_id, info, ret); + + return ret; } int rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + + rte_ethdev_trace_get_eeprom_length(port_id, ret); + + return ret; } int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5882,13 +6152,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->get_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + + rte_ethdev_trace_get_eeprom(port_id, info, ret); + + return ret; } int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5902,7 +6177,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->set_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + + rte_ethdev_trace_set_eeprom(port_id, info, ret); + + return ret; } int @@ -5910,6 +6189,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5923,7 +6203,11 @@ rte_eth_dev_get_module_info(uint16_t port_id, if (*dev->dev_ops->get_module_info == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_info)(dev, modinfo); + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); + + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); + + return ret; } int @@ -5931,6 +6215,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5958,7 +6243,11 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, if (*dev->dev_ops->get_module_eeprom == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_eeprom)(dev, info); + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); + + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); + + return ret; } int @@ -5966,6 +6255,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5981,7 +6271,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, if (*dev->dev_ops->get_dcb_info == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); + + return ret; } static void @@ -6017,6 +6311,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); + return 0; } @@ -6025,6 +6321,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, struct rte_eth_hairpin_cap *cap) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6039,13 +6336,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, if (*dev->dev_ops->hairpin_cap_get == NULL) return -ENOTSUP; memset(cap, 0, sizeof(*cap)); - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); + + return ret; } int rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6060,7 +6362,11 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) if (*dev->dev_ops->pool_ops_supported == NULL) return 1; /* all pools are supported */ - return (*dev->dev_ops->pool_ops_supported)(dev, pool); + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); + + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); + + return ret; } static int @@ -6350,19 +6656,25 @@ rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_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]; if (*dev->dev_ops->representor_info_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + + rte_eth_trace_representor_info_get(port_id, info, ret); + + return ret; } int rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6381,8 +6693,12 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) if (*dev->dev_ops->rx_metadata_negotiate == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + ret = eth_err(port_id, + (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + + rte_eth_trace_rx_metadata_negotiate(port_id, features, *features, ret); + + return ret; } int @@ -6390,6 +6706,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *reassembly_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6411,8 +6728,13 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, return -ENOTSUP; memset(reassembly_capa, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) (dev, reassembly_capa)); + + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa, + ret); + + return ret; } int @@ -6420,6 +6742,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6440,8 +6763,12 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_get == NULL) return -ENOTSUP; memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + ret = eth_err(port_id, + (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); + + return ret; } int @@ -6449,6 +6776,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, const struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6477,8 +6805,12 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_set == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + ret = eth_err(port_id, + (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); + + return ret; } int @@ -6576,8 +6908,12 @@ rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes return 0; for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { - if (j < num) + if (j < num) { ptypes[j] = all_types[i]; + + rte_eth_trace_buffer_split_get_supported_hdr_ptypes( + port_id, j, ptypes[j]); + } j++; } diff --git a/lib/ethdev/rte_ethdev_cman.c b/lib/ethdev/rte_ethdev_cman.c index 4a1bdd7bd0..a9c4637521 100644 --- a/lib/ethdev/rte_ethdev_cman.c +++ b/lib/ethdev/rte_ethdev_cman.c @@ -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; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) 2023-02-07 6:32 ` [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi @ 2023-02-08 1:20 ` Ferruh Yigit 2023-02-08 10:42 ` [EXT] " Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-02-08 1:20 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/7/2023 6:32 AM, Ankur Dwivedi wrote: > Subject: > [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) > From: > Ankur Dwivedi <adwivedi@marvell.com> > Date: > 2/7/2023, 6:32 AM > > To: > <dev@dpdk.org> > CC: > > > Adds trace points for remaining ethdev functions. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > Acked-by: Sunil Kumar Kori <skori@marvell.com> <...> > +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); > +) > + Recording a pointer value of a struct may not be so useful but at least it helps to identify different instances used by calls, and this is done by multiple trace, that is OK. But for this case some values of the struct is already recorded, so is there a need to record pointer value of struct too? Like in 'rte_ethdev_trace_rss_hash_update()', 'rss_conf' pointer value is not recorded but some of its fields are, or 'rte_eth_trace_rx_queue_info_get()', I think this makes sense. What do you think as general rule, if some fields of struct is recorded, don't record its pointer value, else at least record structs pointer value? This applies a few trace points, I have commented some of them but I may missed some, can you please check all? <...> > +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); > +) 'next_port' and 'last_port' are internal variables, and 'next_port' is increased in while loop, so its final value is always "last_port + 1" if "port_id == RTE_ETH_ALL". And if "port_id != RTE_ETH_ALL", next_port = last_port = port_id 'next_port' and 'last_port' derived from 'port_id', hence as 'port_id' is already recorded, I think 'next_port' and 'last_port' can be dropped. <...> > +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); > +) > + Another sample of what mentioned above, if 'pmc' fields are recorded, can we drop recording 'pmc' pointer value? > +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); What about recording this as blob? But 'mc_addr_set' is array of addresses, so length needs to be 'RTE_ETHER_ADDR_LEN * nb_mc_addr'. <...> > +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); > +) > + ditto for 'time' > +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); > +) > + ditto for 'clk' > +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); > +) > + ditto for 'info' > +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); > +) > + ditto for 'info' > +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); > +) > + ditto for 'modinfo' > +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); > +) > + ditto for 'dcb_info' <...> > +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); > +) > + ditto for 'features' <...> > +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); > +) > + Can you please align recorded fields for conf_get and conf_set? <...> > +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); > +) > + ditto for 'info' > +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); > +) > + ditto for 'config' > +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); > +) > + ditto for 'config' > +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); > +) > + ditto for 'config' <...> > +/* 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); > +) > + ditto for 'timestamp' > +/* 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); > +) > + ditto for 'timestamp' > +/* 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); > +) > + ditto for 'time' <...> > @@ -4141,6 +4196,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, > struct rte_eth_pfc_conf *pfc_conf) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4158,9 +4214,15 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, > } > > /* High water, low water validation are device specific */ > - if (*dev->dev_ops->priority_flow_ctrl_set) > - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) > - (dev, pfc_conf)); > + if (*dev->dev_ops->priority_flow_ctrl_set) { > + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) > + (dev, pfc_conf)); > + > + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, ret); > + > + return ret; > + } > + > return -ENOTSUP; > } > > @@ -4219,6 +4281,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, > struct rte_eth_pfc_queue_info *pfc_queue_info) > { > struct rte_eth_dev *dev; > + int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -4229,9 +4292,15 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, > return -EINVAL; > } > > - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) > - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) > + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { > + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) > (dev, pfc_queue_info)); > + > + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, > + pfc_queue_info, ret); > + > + return ret; > + } > return -ENOTSUP; > } > > @@ -4300,10 +4369,17 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, > return ret; > } > > - if (*dev->dev_ops->priority_flow_ctrl_queue_config) > - return eth_err(port_id, > - (*dev->dev_ops->priority_flow_ctrl_queue_config)( > - dev, pfc_queue_conf)); > + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { > + ret = eth_err(port_id, > + (*dev->dev_ops->priority_flow_ctrl_queue_config)( > + dev, pfc_queue_conf)); > + > + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, > + pfc_queue_conf, ret); > + > + return ret; > + } > + Not really related with this patch, but dev_ops check logic is reverse (unconventional) in these functions. Most of the time what we have is: ``` if (*dev->dev_ops->xxx == NULL) return -ENOTSUP; rest_of_the_function; ``` But after change these functions become: ``` if (*dev->dev_ops->xxx) { do_whatever_action_needs; ... return ret; } return -ENOTSUP; ``` Since it is updating these lines, can you please fix this check too? This seems valid for: rte_eth_dev_priority_flow_ctrl_set rte_eth_dev_priority_flow_ctrl_queue_info_get rte_eth_dev_priority_flow_ctrl_queue_configure ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) 2023-02-08 1:20 ` Ferruh Yigit @ 2023-02-08 10:42 ` Ankur Dwivedi 2023-02-08 11:00 ` Ferruh Yigit 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 10:42 UTC (permalink / raw) To: Ferruh Yigit, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >Subject: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part >two) > >External Email > >---------------------------------------------------------------------- >On 2/7/2023 6:32 AM, Ankur Dwivedi wrote: >> Subject: >> [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) >> From: >> Ankur Dwivedi <adwivedi@marvell.com> >> Date: >> 2/7/2023, 6:32 AM >> >> To: >> <dev@dpdk.org> >> CC: >> >> >> Adds trace points for remaining ethdev functions. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> Acked-by: Sunil Kumar Kori <skori@marvell.com> > ><...> > >> +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); >> +) >> + > >Recording a pointer value of a struct may not be so useful but at least it helps >to identify different instances used by calls, and this is done by multiple trace, >that is OK. > >But for this case some values of the struct is already recorded, so is there a >need to record pointer value of struct too? >Like in 'rte_ethdev_trace_rss_hash_update()', 'rss_conf' pointer value is not >recorded but some of its fields are, or 'rte_eth_trace_rx_queue_info_get()', I >think this makes sense. > > >What do you think as general rule, if some fields of struct is recorded, don't >record its pointer value, else at least record structs pointer value? Ok. > >This applies a few trace points, I have commented some of them but I may >missed some, can you please check all? > ><...> > >> +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); >> +) > >'next_port' and 'last_port' are internal variables, and 'next_port' is increased >in while loop, so its final value is always "last_port + 1" if "port_id == >RTE_ETH_ALL". >And if "port_id != RTE_ETH_ALL", next_port = last_port = port_id > >'next_port' and 'last_port' derived from 'port_id', hence as 'port_id' >is already recorded, I think 'next_port' and 'last_port' can be dropped. Ok. > ><...> > >> +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); >> +) >> + > >Another sample of what mentioned above, if 'pmc' fields are recorded, can >we drop recording 'pmc' pointer value? Ok. > >> +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); > >What about recording this as blob? >But 'mc_addr_set' is array of addresses, so length needs to be >'RTE_ETHER_ADDR_LEN * nb_mc_addr'. The mc_addr_set pointer can be NULL in rte_eth_dev_set_mc_addr_list. In that case the blob function will give seg fault. Hence I think blob cannot be used here. > ><...> > >> +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); >> +) >> + > >ditto for 'time' Ok. > >> +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); >> +) >> + > >ditto for 'clk' Ok. > >> +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); >> +) >> + > >ditto for 'info' Ok. > >> +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); >> +) >> + > >ditto for 'info' Ok. > >> +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); >> +) >> + > >ditto for 'modinfo' Ok. > >> +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); >> +) >> + > >ditto for 'dcb_info' Ok. > ><...> > >> +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); >> +) >> + > >ditto for 'features' Ok. > ><...> > >> +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); >> +) >> + > >Can you please align recorded fields for conf_get and conf_set? Ok. > ><...> > >> +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); >> +) >> + > >ditto for 'info' Ok. > >> +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); >> +) >> + > >ditto for 'config' Ok. > >> +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); >> +) >> + > >ditto for 'config' Ok. > >> +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); >> +) >> + > >ditto for 'config' Ok. > ><...> > >> +/* 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); >> +) >> + > >ditto for 'timestamp' Ok. > >> +/* 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); >> +) >> + > >ditto for 'timestamp' Ok. > >> +/* 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); >> +) >> + > >ditto for 'time' Ok. > ><...> > >> @@ -4141,6 +4196,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t >port_id, >> struct rte_eth_pfc_conf *pfc_conf) { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4158,9 +4214,15 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t >port_id, >> } >> >> /* High water, low water validation are device specific */ >> - if (*dev->dev_ops->priority_flow_ctrl_set) >> - return eth_err(port_id, (*dev->dev_ops- >>priority_flow_ctrl_set) >> - (dev, pfc_conf)); >> + if (*dev->dev_ops->priority_flow_ctrl_set) { >> + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) >> + (dev, pfc_conf)); >> + >> + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, >ret); >> + >> + return ret; >> + } >> + >> return -ENOTSUP; >> } >> >> @@ -4219,6 +4281,7 @@ >rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, >> struct rte_eth_pfc_queue_info *pfc_queue_info) { >> struct rte_eth_dev *dev; >> + int ret; >> >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> dev = &rte_eth_devices[port_id]; >> @@ -4229,9 +4292,15 @@ >rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, >> return -EINVAL; >> } >> >> - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) >> - return eth_err(port_id, (*dev->dev_ops- >>priority_flow_ctrl_queue_info_get) >> + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) { >> + ret = eth_err(port_id, >> +(*dev->dev_ops->priority_flow_ctrl_queue_info_get) >> (dev, pfc_queue_info)); >> + >> + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, >> + pfc_queue_info, ret); >> + >> + return ret; >> + } >> return -ENOTSUP; >> } >> >> @@ -4300,10 +4369,17 @@ >rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, >> return ret; >> } >> >> - if (*dev->dev_ops->priority_flow_ctrl_queue_config) >> - return eth_err(port_id, >> - (*dev->dev_ops- >>priority_flow_ctrl_queue_config)( >> - dev, pfc_queue_conf)); >> + if (*dev->dev_ops->priority_flow_ctrl_queue_config) { >> + ret = eth_err(port_id, >> + (*dev->dev_ops- >>priority_flow_ctrl_queue_config)( >> + dev, pfc_queue_conf)); >> + >> + > rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, >> + pfc_queue_conf, ret); >> + >> + return ret; >> + } >> + > > >Not really related with this patch, but dev_ops check logic is reverse >(unconventional) in these functions. > >Most of the time what we have is: >``` >if (*dev->dev_ops->xxx == NULL) > return -ENOTSUP; > >rest_of_the_function; >``` > >But after change these functions become: >``` >if (*dev->dev_ops->xxx) { > do_whatever_action_needs; > ... > > return ret; >} > >return -ENOTSUP; >``` > > >Since it is updating these lines, can you please fix this check too? Ok. > >This seems valid for: >rte_eth_dev_priority_flow_ctrl_set >rte_eth_dev_priority_flow_ctrl_queue_info_get >rte_eth_dev_priority_flow_ctrl_queue_configure ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) 2023-02-08 10:42 ` [EXT] " Ankur Dwivedi @ 2023-02-08 11:00 ` Ferruh Yigit 2023-02-08 11:04 ` Ferruh Yigit 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-02-08 11:00 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/8/2023 10:42 AM, Ankur Dwivedi wrote: >>> +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); >> What about recording this as blob? >> But 'mc_addr_set' is array of addresses, so length needs to be >> 'RTE_ETHER_ADDR_LEN * nb_mc_addr'. > The mc_addr_set pointer can be NULL in rte_eth_dev_set_mc_addr_list. In that case the > blob function will give seg fault. Hence I think blob cannot be used here. Does it make sense to make 'rte_trace_point_emit_blob()' accept NULL and fill all array with 0 in that case to cover this kind of cases? ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) 2023-02-08 11:00 ` Ferruh Yigit @ 2023-02-08 11:04 ` Ferruh Yigit 2023-02-08 14:15 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-02-08 11:04 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/8/2023 11:00 AM, Ferruh Yigit wrote: > On 2/8/2023 10:42 AM, Ankur Dwivedi wrote: >>>> +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); >>> What about recording this as blob? >>> But 'mc_addr_set' is array of addresses, so length needs to be >>> 'RTE_ETHER_ADDR_LEN * nb_mc_addr'. >> The mc_addr_set pointer can be NULL in rte_eth_dev_set_mc_addr_list. In that case the >> blob function will give seg fault. Hence I think blob cannot be used here. > Does it make sense to make 'rte_trace_point_emit_blob()' accept NULL and > fill all array with 0 in that case to cover this kind of cases? btw, 'rte_trace_point_emit_blob()' already checks for NULL, so expect it won't give segmentation fault, but won't record the value. Not sure if not recording the value cause problem later when parsing the trace file. ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) 2023-02-08 11:04 ` Ferruh Yigit @ 2023-02-08 14:15 ` Ankur Dwivedi 2023-02-08 15:05 ` Ferruh Yigit 0 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 14:15 UTC (permalink / raw) To: Ferruh Yigit, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >Subject: Re: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part >two) > >On 2/8/2023 11:00 AM, Ferruh Yigit wrote: >> On 2/8/2023 10:42 AM, Ankur Dwivedi wrote: >>>>> +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); >>>> What about recording this as blob? >>>> But 'mc_addr_set' is array of addresses, so length needs to be >>>> 'RTE_ETHER_ADDR_LEN * nb_mc_addr'. >>> The mc_addr_set pointer can be NULL in rte_eth_dev_set_mc_addr_list. >>> In that case the blob function will give seg fault. Hence I think blob cannot >be used here. >> Does it make sense to make 'rte_trace_point_emit_blob()' accept NULL >> and fill all array with 0 in that case to cover this kind of cases? > > >btw, 'rte_trace_point_emit_blob()' already checks for NULL, so expect it won't >give segmentation fault, but won't record the value. The blob function will be called as rte_trace_point_emit_blob(mc_addr_set->addr_bytes, len). If mc_addr_set is NULL then it will result in a segmentation fault. >Not sure if not recording the value cause problem later when parsing the trace >file. Wont recording the value is not a issue as the value will not be copied in trace memory in rte_trace_point_emit_blob() (lib/eal/include/rte_trace_point.h). ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) 2023-02-08 14:15 ` Ankur Dwivedi @ 2023-02-08 15:05 ` Ferruh Yigit 2023-02-08 15:11 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Ferruh Yigit @ 2023-02-08 15:05 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/8/2023 2:15 PM, Ankur Dwivedi wrote: >> Subject: Re: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part >> two) >> >> On 2/8/2023 11:00 AM, Ferruh Yigit wrote: >>> On 2/8/2023 10:42 AM, Ankur Dwivedi wrote: >>>>>> +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); >>>>> What about recording this as blob? >>>>> But 'mc_addr_set' is array of addresses, so length needs to be >>>>> 'RTE_ETHER_ADDR_LEN * nb_mc_addr'. >>>> The mc_addr_set pointer can be NULL in rte_eth_dev_set_mc_addr_list. >>>> In that case the blob function will give seg fault. Hence I think blob cannot >> be used here. >>> Does it make sense to make 'rte_trace_point_emit_blob()' accept NULL >>> and fill all array with 0 in that case to cover this kind of cases? >> >> >> btw, 'rte_trace_point_emit_blob()' already checks for NULL, so expect it won't >> give segmentation fault, but won't record the value. > The blob function will be called as rte_trace_point_emit_blob(mc_addr_set->addr_bytes, len). > If mc_addr_set is NULL then it will result in a segmentation fault. > Of course trying to access the field 'mc_addr_set->addr_bytes' will cause problem for null pointer, why not: rte_trace_point_emit_blob(mc_addr_set, len); >> Not sure if not recording the value cause problem later when parsing the trace >> file. > Wont recording the value is not a issue as the value will not be copied in trace memory in rte_trace_point_emit_blob() (lib/eal/include/rte_trace_point.h). > ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) 2023-02-08 15:05 ` Ferruh Yigit @ 2023-02-08 15:11 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 15:11 UTC (permalink / raw) To: Ferruh Yigit, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >Subject: Re: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for ethdev (part >two) > >On 2/8/2023 2:15 PM, Ankur Dwivedi wrote: >>> Subject: Re: [EXT] Re: [PATCH v9 3/6] ethdev: add trace points for >>> ethdev (part >>> two) >>> >>> On 2/8/2023 11:00 AM, Ferruh Yigit wrote: >>>> On 2/8/2023 10:42 AM, Ankur Dwivedi wrote: >>>>>>> +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); >>>>>> What about recording this as blob? >>>>>> But 'mc_addr_set' is array of addresses, so length needs to be >>>>>> 'RTE_ETHER_ADDR_LEN * nb_mc_addr'. >>>>> The mc_addr_set pointer can be NULL in rte_eth_dev_set_mc_addr_list. >>>>> In that case the blob function will give seg fault. Hence I think >>>>> blob cannot >>> be used here. >>>> Does it make sense to make 'rte_trace_point_emit_blob()' accept NULL >>>> and fill all array with 0 in that case to cover this kind of cases? >>> >>> >>> btw, 'rte_trace_point_emit_blob()' already checks for NULL, so expect >>> it won't give segmentation fault, but won't record the value. >> The blob function will be called as rte_trace_point_emit_blob(mc_addr_set- >>addr_bytes, len). >> If mc_addr_set is NULL then it will result in a segmentation fault. >> > >Of course trying to access the field 'mc_addr_set->addr_bytes' will cause >problem for null pointer, why not: > >rte_trace_point_emit_blob(mc_addr_set, len); This should work. > >>> Not sure if not recording the value cause problem later when parsing >>> the trace file. >> Wont recording the value is not a issue as the value will not be copied in >trace memory in rte_trace_point_emit_blob() >(lib/eal/include/rte_trace_point.h). >> ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v9 4/6] ethdev: add trace points for flow 2023-02-07 6:32 ` [PATCH v9 0/6] add trace points in ethdev library Ankur Dwivedi ` (2 preceding siblings ...) 2023-02-07 6:32 ` [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi @ 2023-02-07 6:32 ` Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 5/6] ethdev: add trace points for mtr Ankur Dwivedi ` (2 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-07 6:32 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 9039446b5f..0604c0290e 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 7a08104dc9..b8cbb285de 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 4da581146e..e52dcb1760 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -16,6 +16,8 @@ #include "rte_flow_driver.h" #include "rte_flow.h" +#include "ethdev_trace.h" + /* Mbuf dynamic field name for metadata. */ int32_t rte_flow_dynf_metadata_offs = -1; @@ -277,6 +279,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: @@ -363,7 +368,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, @@ -390,6 +399,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, @@ -413,7 +425,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, @@ -435,7 +451,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, @@ -460,7 +480,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, @@ -483,7 +507,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, @@ -1004,39 +1032,57 @@ rte_flow_conv(enum rte_flow_conv_op op, const void *src, struct rte_flow_error *error) { + int ret; + switch (op) { const struct rte_flow_attr *attr; case RTE_FLOW_CONV_OP_NONE: - return 0; + ret = 0; + break; case RTE_FLOW_CONV_OP_ATTR: attr = src; if (size > sizeof(*attr)) size = sizeof(*attr); rte_memcpy(dst, attr, size); - return sizeof(*attr); + ret = sizeof(*attr); + break; case RTE_FLOW_CONV_OP_ITEM: - return rte_flow_conv_pattern(dst, size, src, 1, error); + ret = rte_flow_conv_pattern(dst, size, src, 1, error); + break; case RTE_FLOW_CONV_OP_ACTION: - return rte_flow_conv_actions(dst, size, src, 1, error); + ret = rte_flow_conv_actions(dst, size, src, 1, error); + break; case RTE_FLOW_CONV_OP_PATTERN: - return rte_flow_conv_pattern(dst, size, src, 0, error); + ret = rte_flow_conv_pattern(dst, size, src, 0, error); + break; case RTE_FLOW_CONV_OP_ACTIONS: - return rte_flow_conv_actions(dst, size, src, 0, error); + ret = rte_flow_conv_actions(dst, size, src, 0, error); + break; case RTE_FLOW_CONV_OP_RULE: - return rte_flow_conv_rule(dst, size, src, error); + ret = rte_flow_conv_rule(dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ITEM_NAME: - return rte_flow_conv_name(0, 0, dst, size, src, error); + ret = rte_flow_conv_name(0, 0, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ACTION_NAME: - return rte_flow_conv_name(1, 0, dst, size, src, error); + ret = rte_flow_conv_name(1, 0, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ITEM_NAME_PTR: - return rte_flow_conv_name(0, 1, dst, size, src, error); + ret = rte_flow_conv_name(0, 1, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ACTION_NAME_PTR: - return rte_flow_conv_name(1, 1, dst, size, src, error); - } - return rte_flow_error_set + ret = rte_flow_conv_name(1, 1, dst, size, src, error); + break; + default: + ret = rte_flow_error_set (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "unknown object conversion operation"); + } + + rte_flow_trace_conv(op, dst, size, src, ret); + + return ret; } /** Store a full rte_flow description. */ @@ -1088,6 +1134,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; } @@ -1126,7 +1175,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1148,7 +1201,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1176,6 +1234,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; } @@ -1195,7 +1256,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 @@ -1215,7 +1280,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 @@ -1235,7 +1304,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 @@ -1247,14 +1320,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, @@ -1270,14 +1349,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, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1292,14 +1377,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, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1314,15 +1404,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, + error), + error); + + rte_flow_trace_tunnel_action_decap_release(port_id, actions, + num_of_actions, ret); + + return ret; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1337,14 +1433,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1357,6 +1458,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)) return -rte_errno; @@ -1368,9 +1470,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 * @@ -1393,6 +1499,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; } @@ -1410,7 +1519,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 @@ -1421,6 +1534,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; @@ -1435,9 +1549,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1481,7 +1599,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1532,6 +1654,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; } rte_flow_error_set(error, ENOTSUP, @@ -1547,17 +1673,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1618,6 +1750,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); + return template; } rte_flow_error_set(error, ENOTSUP, @@ -1633,17 +1769,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1708,6 +1850,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; } rte_flow_error_set(error, ENOTSUP, @@ -1723,17 +1872,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1763,6 +1918,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; } @@ -1776,12 +1936,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 @@ -1791,10 +1957,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 @@ -1807,9 +1978,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 * @@ -1829,6 +2005,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); + return handle; } @@ -1846,7 +2027,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 @@ -1864,7 +2050,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 @@ -1882,5 +2074,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, + action_handle, data, user_data, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v9 5/6] ethdev: add trace points for mtr 2023-02-07 6:32 ` [PATCH v9 0/6] add trace points in ethdev library Ankur Dwivedi ` (3 preceding siblings ...) 2023-02-07 6:32 ` [PATCH v9 4/6] ethdev: add trace points for flow Ankur Dwivedi @ 2023-02-07 6:32 ` Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 0/6] add trace points in ethdev library Ankur Dwivedi 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-07 6:32 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 0604c0290e..5285a04c67 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index b8cbb285de..c34c06941c 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index 3954839531..e957f52db5 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -5,6 +5,7 @@ #include <stdint.h> #include <rte_errno.h> +#include "ethdev_trace.h" #include "rte_ethdev.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -82,8 +83,13 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, capabilities_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_mtr_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* MTR meter profile add */ @@ -94,8 +100,14 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); + + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile, + ret); + + return ret; } /** MTR meter profile delete */ @@ -105,8 +117,13 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id, ret); + + return ret; } /** MTR meter profile get */ @@ -116,8 +133,13 @@ rte_mtr_meter_profile_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, + struct rte_flow_meter_profile *ret; + ret = RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_get(port_id, meter_profile_id, ret); + + return ret; } /* MTR meter policy validate */ @@ -127,8 +149,16 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, + int ret; + int i; + ret = RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_validate(port_id, i, + policy->actions[i], ret); + + return ret; } /* MTR meter policy add */ @@ -139,8 +169,16 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, + int ret; + int i; + ret = RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); + + for (i = 0; i < RTE_COLORS; i++) + rte_mtr_trace_meter_policy_add(port_id, policy_id, i, + policy->actions[i], ret); + + return ret; } /** MTR meter policy delete */ @@ -150,8 +188,13 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_delete(port_id, policy_id, ret); + + return ret; } /** MTR meter policy get */ @@ -161,8 +204,13 @@ rte_mtr_meter_policy_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, + struct rte_flow_meter_policy *ret; + ret = RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_get(port_id, policy_id, ret); + + return ret; } /** MTR object create */ @@ -174,8 +222,13 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, create)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); + + rte_mtr_trace_create(port_id, mtr_id, params, shared, ret); + + return ret; } /** MTR object destroy */ @@ -185,8 +238,13 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, destroy)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); + + rte_mtr_trace_destroy(port_id, mtr_id, ret); + + return ret; } /** MTR object meter enable */ @@ -196,8 +254,13 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_enable)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); + + rte_mtr_trace_meter_enable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter disable */ @@ -207,8 +270,13 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_disable)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); + + rte_mtr_trace_meter_disable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter profile update */ @@ -219,8 +287,13 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); + + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id, ret); + + return ret; } /** MTR object meter policy update */ @@ -231,8 +304,13 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); + + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id, ret); + + return ret; } /** MTR object meter DSCP table update */ @@ -243,8 +321,13 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, proto, dscp_table, error); + + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table, ret); + + return ret; } /** MTR object meter VLAN table update */ @@ -255,8 +338,13 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, proto, vlan_table, error); + + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table, ret); + + return ret; } /** Set the input color protocol on MTR object */ @@ -268,8 +356,13 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_set)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority, ret); + + return ret; } /** Get input color protocols of MTR object */ @@ -280,8 +373,13 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); + + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id, ret); + + return ret; } /** Get input color protocol priority of MTR object */ @@ -293,8 +391,13 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto, ret); + + return ret; } /** MTR object enabled stats update */ @@ -305,8 +408,13 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); + + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask, ret); + + return ret; } /** MTR object stats read */ @@ -319,6 +427,12 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_read)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); + + rte_mtr_trace_stats_read(port_id, mtr_id, stats, *stats_mask, clear, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v9 6/6] ethdev: add trace points for tm 2023-02-07 6:32 ` [PATCH v9 0/6] add trace points in ethdev library Ankur Dwivedi ` (4 preceding siblings ...) 2023-02-07 6:32 ` [PATCH v9 5/6] ethdev: add trace points for mtr Ankur Dwivedi @ 2023-02-07 6:32 ` Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 0/6] add trace points in ethdev library Ankur Dwivedi 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-07 6:32 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- 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(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 5285a04c67..ffad9fd872 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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 */ diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index c34c06941c..34d12e2859 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..2d08141133 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -5,6 +5,7 @@ #include <stdint.h> #include <rte_errno.h> +#include "ethdev_trace.h" #include "rte_ethdev.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +80,9 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); + return 0; } @@ -90,8 +94,13 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_type_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); + + rte_tm_trace_node_type_get(port_id, node_id, *is_leaf, ret); + + return ret; } /* Get capabilities */ @@ -100,8 +109,13 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_tm_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* Get level capabilities */ @@ -111,8 +125,13 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); + + rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret); + + return ret; } /* Get node capabilities */ @@ -122,8 +141,13 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); + + rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret); + + return ret; } /* Add WRED profile */ @@ -133,8 +157,13 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); + + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -143,8 +172,13 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); + + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret); + + return ret; } /* Add/update shared WRED context */ @@ -154,8 +188,15 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); + + rte_tm_trace_shared_wred_context_add_update(port_id, + shared_wred_context_id, + wred_profile_id, ret); + + return ret; } /* Delete shared WRED context */ @@ -164,8 +205,14 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); + + rte_tm_trace_shared_wred_context_delete(port_id, + shared_wred_context_id, ret); + + return ret; } /* Add shaper profile */ @@ -175,8 +222,14 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); + + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile, + ret); + + return ret; } /* Delete WRED profile */ @@ -185,8 +238,13 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); + + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, ret); + + return ret; } /* Add shared shaper */ @@ -196,8 +254,14 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); + + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id, ret); + + return ret; } /* Delete shared shaper */ @@ -206,8 +270,13 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); + + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, ret); + + return ret; } /* Add node to port traffic manager hierarchy */ @@ -221,9 +290,15 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); + + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + + return ret; } /* Delete node from traffic manager hierarchy */ @@ -232,8 +307,13 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); + + rte_tm_trace_node_delete(port_id, node_id, ret); + + return ret; } /* Suspend node */ @@ -242,8 +322,13 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_suspend)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); + + rte_tm_trace_node_suspend(port_id, node_id, ret); + + return ret; } /* Resume node */ @@ -252,8 +337,13 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_resume)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); + + rte_tm_trace_node_resume(port_id, node_id, ret); + + return ret; } /* Commit the initial port traffic manager hierarchy */ @@ -262,8 +352,13 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); + + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret); + + return ret; } /* Update node parent */ @@ -275,8 +370,14 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_parent_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); + + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight, ret); + + return ret; } /* Update node private shaper */ @@ -286,8 +387,14 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shaper_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); + + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id, + ret); + + return ret; } /* Update node shared shapers */ @@ -298,8 +405,14 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); + + rte_tm_trace_node_shared_shaper_update(port_id, node_id, + shared_shaper_id, add, ret); + + return ret; } /* Update node stats */ @@ -309,8 +422,13 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); + + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, ret); + + return ret; } /* Update WFQ weight mode */ @@ -321,8 +439,15 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); + + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, + wfq_weight_mode, + n_sp_priorities, ret); + + return ret; } /* Update node congestion management mode */ @@ -332,8 +457,13 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_cman_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); + + rte_tm_trace_node_cman_update(port_id, node_id, cman, ret); + + return ret; } /* Update node private WRED context */ @@ -343,8 +473,14 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); + + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id, + ret); + + return ret; } /* Update node shared WRED context */ @@ -355,8 +491,15 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); + + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add, ret); + + return ret; } /* Read and/or clear stats counters for specific node */ @@ -368,8 +511,14 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_read)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); + + rte_tm_trace_node_stats_read(port_id, node_id, stats, *stats_mask, + clear, ret); + + return ret; } /* Packet marking - VLAN DEI */ @@ -380,8 +529,14 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } /* Packet marking - IPv4/IPv6 ECN */ @@ -392,8 +547,14 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } /* Packet marking - IPv4/IPv6 DSCP */ @@ -404,6 +565,12 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v10 0/6] add trace points in ethdev library 2023-02-07 6:32 ` [PATCH v9 0/6] add trace points in ethdev library Ankur Dwivedi ` (5 preceding siblings ...) 2023-02-07 6:32 ` [PATCH v9 6/6] ethdev: add trace points for tm Ankur Dwivedi @ 2023-02-08 13:28 ` Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi ` (6 more replies) 6 siblings, 7 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 13:28 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. v10: - Removed const in basic types in tracepoint. - Removed capture of pointer value where some fields in structure are captured. - Resolved RHEL 7 failure: ../lib/ethdev/rte_ethdev.c:3260:2: error: 'for' loop initial declarations are only allowed in C99 mode - In patch (3/6) removed next_port and last_port in rte_ethdev_trace_callback_register. - In patch (3/6) simplified the return logic in rte_eth_dev_priority_flow_ctrl_set, rte_eth_dev_priority_flow_ctrl_queue_info_get and rte_eth_dev_priority_flow_ctrl_queue_configure. - In patch (4/6, 5/6 and 6/6), removed capture of structure fields in tracepoint where the structure pointer can be null. 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 | 2523 ++++++++++++++++++++ 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 | 150 +- lib/ethdev/rte_tm.c | 225 +- 18 files changed, 4716 insertions(+), 368 deletions(-) create mode 100644 lib/ethdev/ethdev_trace.h delete mode 100644 lib/ethdev/rte_ethdev_trace.h -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v10 1/6] eal: trace: add trace point emit for blob 2023-02-08 13:28 ` [PATCH v10 0/6] add trace points in ethdev library Ankur Dwivedi @ 2023-02-08 13:28 ` Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi ` (5 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 13:28 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com> --- 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(+) diff --git a/app/test/test_trace.c b/app/test/test_trace.c index 6bedf14024..ad4a394a29 100644 --- a/app/test/test_trace.c +++ b/app/test/test_trace.c @@ -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; diff --git a/doc/guides/prog_guide/trace_lib.rst b/doc/guides/prog_guide/trace_lib.rst index 9a8f38073d..3e0ea5835c 100644 --- a/doc/guides/prog_guide/trace_lib.rst +++ b/doc/guides/prog_guide/trace_lib.rst @@ -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. diff --git a/lib/eal/common/eal_common_trace_points.c b/lib/eal/common/eal_common_trace_points.c index 0b0b254615..051f89809c 100644 --- a/lib/eal/common/eal_common_trace_points.c +++ b/lib/eal/common/eal_common_trace_points.c @@ -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) diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h index 5ef4398230..6f5c022558 100644 --- a/lib/eal/include/rte_eal_trace.h +++ b/lib/eal/include/rte_eal_trace.h @@ -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 */ diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index 0f8700974f..4d6b5700dd 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -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_ */ diff --git a/lib/eal/include/rte_trace_point_register.h b/lib/eal/include/rte_trace_point_register.h index a32f4d731b..a9682d3f22 100644 --- a/lib/eal/include/rte_trace_point_register.h +++ b/lib/eal/include/rte_trace_point_register.h @@ -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 diff --git a/lib/eal/version.map b/lib/eal/version.map index 6523102157..21aa1b8ce3 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -442,6 +442,7 @@ EXPERIMENTAL { # added in 23.03 rte_thread_set_name; + __rte_eal_trace_generic_blob; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v10 2/6] ethdev: add trace points for ethdev (part one) 2023-02-08 13:28 ` [PATCH v10 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-02-08 13:28 ` Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi ` (4 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 13:28 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@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_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + 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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v10 3/6] ethdev: add trace points for ethdev (part two) 2023-02-08 13:28 ` [PATCH v10 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi @ 2023-02-08 13:28 ` Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 4/6] ethdev: add trace points for flow Ankur Dwivedi ` (3 subsequent siblings) 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 13:28 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for remaining ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> --- lib/ethdev/ethdev_trace.h | 875 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 252 +++++++++ lib/ethdev/rte_ethdev.c | 485 ++++++++++++++--- lib/ethdev/rte_ethdev_cman.c | 29 +- 4 files changed, 1559 insertions(+), 82 deletions(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index d88ad60ec8..1a4b7c3a9b 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -586,6 +586,801 @@ 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_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_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_u8(pfc_queue_info->tc_max); + rte_trace_point_emit_int(pfc_queue_info->mode_capa); + 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_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_u64(reta_conf->mask); + 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_u64(reta_conf->mask); + 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_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_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_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_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), + 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( + 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_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_u64(mode->flags); + 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->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_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_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->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->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_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->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_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_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_u16(cap->max_nb_queues); + rte_trace_point_emit_u16(cap->max_rx_2_tx); + rte_trace_point_emit_u16(cap->max_tx_2_rx); + rte_trace_point_emit_u16(cap->max_nb_desc); + 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, uint64_t features_val, int ret), + rte_trace_point_emit_u16(port_id); + 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_u32(capa->timeout_ms); + rte_trace_point_emit_u16(capa->max_frags); + rte_trace_point_emit_u16(capa->flags); + 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_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_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_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_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_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_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_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 */ @@ -628,6 +1423,86 @@ 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_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_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_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_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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 3e58c679c3..7a08104dc9 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 6aaae66b83..dc0a4eb12c 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -3627,6 +3627,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); + return 0; } @@ -3647,6 +3649,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct rte_eth_conf)); + rte_ethdev_trace_conf_get(port_id, dev_conf); + return 0; } @@ -3677,8 +3681,12 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) if (all_ptypes[i] & ptype_mask) { - if (j < num) + if (j < num) { ptypes[j] = all_ptypes[i]; + + rte_ethdev_trace_get_supported_ptypes(port_id, + j, num, ptypes[j]); + } j++; } @@ -3756,6 +3764,10 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, if (ptype_mask & all_ptypes[i]) { if (j < num - 1) { set_ptypes[j] = all_ptypes[i]; + + rte_ethdev_trace_set_ptypes(port_id, j, num, + set_ptypes[j]); + j++; continue; } @@ -3797,6 +3809,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, num = RTE_MIN(dev_info.max_mac_addrs, num); memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); + rte_eth_trace_macaddrs_get(port_id, num); + return num; } @@ -3817,6 +3831,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); + rte_eth_trace_macaddr_get(port_id, mac_addr); + return 0; } @@ -3835,6 +3851,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + + rte_ethdev_trace_get_mtu(port_id, *mtu); + return 0; } @@ -3877,7 +3896,11 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_mtu(port_id, mtu, ret); + + return ret; } int @@ -3920,7 +3943,11 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) vfc->ids[vidx] &= ~RTE_BIT64(vbit); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); + + return ret; } int @@ -3941,6 +3968,8 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, return -ENOTSUP; (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); + return 0; } @@ -3950,14 +3979,19 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, uint16_t tpid) { 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->vlan_tpid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, - tpid)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, + tpid)); + + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); + + return ret; } int @@ -4049,7 +4083,11 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) dev->data->dev_conf.rxmode.offloads = orig_offloads; } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); + + return ret; } int @@ -4075,6 +4113,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); + return ret; } @@ -4082,19 +4122,25 @@ int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { 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->vlan_pvid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); + + return ret; } int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4109,13 +4155,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_get == NULL) return -ENOTSUP; memset(fc_conf, 0, sizeof(*fc_conf)); - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); + + return ret; } int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4134,7 +4185,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); + + return ret; } int @@ -4142,6 +4197,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4159,10 +4215,14 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, } /* High water, low water validation are device specific */ - if (*dev->dev_ops->priority_flow_ctrl_set) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) - (dev, pfc_conf)); - return -ENOTSUP; + if (*dev->dev_ops->priority_flow_ctrl_set == NULL) + return -ENOTSUP; + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) + (dev, pfc_conf)); + + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, ret); + + return ret; } static int @@ -4220,6 +4280,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, struct rte_eth_pfc_queue_info *pfc_queue_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4230,10 +4291,15 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get == NULL) + return -ENOTSUP; + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); - return -ENOTSUP; + + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, + pfc_queue_info, ret); + + return ret; } int @@ -4301,11 +4367,15 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, return ret; } - if (*dev->dev_ops->priority_flow_ctrl_queue_config) - return eth_err(port_id, - (*dev->dev_ops->priority_flow_ctrl_queue_config)( - dev, pfc_queue_conf)); - return -ENOTSUP; + if (*dev->dev_ops->priority_flow_ctrl_queue_config == NULL) + return -ENOTSUP; + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_config) + (dev, pfc_queue_conf)); + + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf, ret); + + return ret; } static int @@ -4396,8 +4466,12 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, if (*dev->dev_ops->reta_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4425,8 +4499,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, if (*dev->dev_ops->reta_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4470,8 +4548,12 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, if (*dev->dev_ops->rss_hash_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); + + return ret; } int @@ -4479,6 +4561,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4492,8 +4575,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, if (*dev->dev_ops->rss_hash_conf_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); + + return ret; } int @@ -4501,6 +4588,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4519,8 +4607,12 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_add == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); + + return ret; } int @@ -4528,6 +4620,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4546,34 +4639,48 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_del == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); + + return ret; } int rte_eth_led_on(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_led_on == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + + rte_eth_trace_led_on(port_id, ret); + + return ret; } int rte_eth_led_off(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_led_off == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + + rte_eth_trace_led_off(port_id, ret); + + return ret; } int @@ -4598,6 +4705,8 @@ rte_eth_fec_get_capability(uint16_t port_id, return -ENOTSUP; ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, num); + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); + return ret; } @@ -4605,6 +4714,7 @@ int rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4618,20 +4728,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) if (*dev->dev_ops->fec_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + + rte_eth_trace_fec_get(port_id, fec_capa, ret); + + return ret; } int rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) { 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->fec_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + + rte_eth_trace_fec_set(port_id, fec_capa, ret); + + return ret; } /* @@ -4719,7 +4838,11 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); + + return ret; } int @@ -4759,6 +4882,8 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) /* reset pool bitmap */ dev->data->mac_pool_sel[index] = 0; + rte_ethdev_trace_mac_addr_remove(port_id, addr); + return 0; } @@ -4791,6 +4916,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) /* Update default address in NIC data structure */ rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); + rte_ethdev_trace_default_mac_addr_set(port_id, addr); + return 0; } @@ -4881,21 +5008,29 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, &dev->data->hash_mac_addrs[index]); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { 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->uc_all_hash_table_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, - on)); + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, on)); + + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, @@ -4931,14 +5066,19 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (*dev->dev_ops->set_queue_rate_limit == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate)); + + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, ret); + + return ret; } int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, uint8_t avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4958,14 +5098,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, } if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, queue_id, avail_thresh)); + + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, ret); + + return ret; } int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, uint8_t *avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4977,8 +5122,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, avail_thresh)); + + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); + + return ret; } RTE_INIT(eth_dev_init_fp_ops) @@ -5060,6 +5209,9 @@ rte_eth_dev_callback_register(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg); + return 0; } @@ -5121,6 +5273,10 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, + ret); + return ret; } @@ -5150,6 +5306,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { vec = rte_intr_vec_list_index_get(intr_handle, qid); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5193,6 +5352,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); + return fd; } @@ -5226,6 +5387,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, vec = rte_intr_vec_list_index_get(intr_handle, queue_id); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5252,7 +5416,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); + + return ret; } int @@ -5271,7 +5439,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); + + return ret; } @@ -5329,6 +5501,8 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5368,6 +5542,9 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, cb, __ATOMIC_RELEASE); rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param, + cb); + return cb; } @@ -5427,6 +5604,8 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5461,6 +5640,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5495,6 +5676,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5541,6 +5724,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5587,6 +5772,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5595,6 +5782,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5614,8 +5802,12 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->rx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, + dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5623,6 +5815,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5642,8 +5835,12 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->tx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, + dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5651,6 +5848,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, struct rte_power_monitor_cond *pmc) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5669,8 +5867,12 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->get_monitor_addr == NULL) return -ENOTSUP; - return eth_err(port_id, + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); + + return ret; } int @@ -5679,40 +5881,56 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, uint32_t nb_mc_addr) { 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->set_mc_addr_list == NULL) return -ENOTSUP; - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, mc_addr_set, nb_mc_addr)); + + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr, + ret); + + return ret; } int rte_eth_timesync_enable(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->timesync_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + + rte_eth_trace_timesync_enable(port_id, ret); + + return ret; } int rte_eth_timesync_disable(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->timesync_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + + rte_eth_trace_timesync_disable(port_id, ret); + + return ret; } int @@ -5720,6 +5938,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5733,8 +5952,14 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) - (dev, timestamp, flags)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) + (dev, timestamp, flags)); + + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags, + ret); + + return ret; } int @@ -5742,6 +5967,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5755,27 +5981,39 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) - (dev, timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) + (dev, timestamp)); + + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, ret); + + return ret; + } int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { 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->timesync_adjust_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); + + return ret; } int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5789,14 +6027,19 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) if (*dev->dev_ops->timesync_read_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, timestamp)); + + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); + + return ret; } int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5810,14 +6053,19 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) if (*dev->dev_ops->timesync_write_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, timestamp)); + + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); + + return ret; } int rte_eth_read_clock(uint16_t port_id, uint64_t *clock) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5830,13 +6078,18 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) if (*dev->dev_ops->read_clock == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + + rte_eth_trace_read_clock(port_id, clock, ret); + + return ret; } int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; @@ -5850,26 +6103,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) if (*dev->dev_ops->get_reg == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + + rte_ethdev_trace_get_reg_info(port_id, info, ret); + + return ret; } int rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + + rte_ethdev_trace_get_eeprom_length(port_id, ret); + + return ret; } int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5883,13 +6146,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->get_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + + rte_ethdev_trace_get_eeprom(port_id, info, ret); + + return ret; } int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5903,7 +6171,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->set_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + + rte_ethdev_trace_set_eeprom(port_id, info, ret); + + return ret; } int @@ -5911,6 +6183,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5924,7 +6197,11 @@ rte_eth_dev_get_module_info(uint16_t port_id, if (*dev->dev_ops->get_module_info == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_info)(dev, modinfo); + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); + + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); + + return ret; } int @@ -5932,6 +6209,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5959,7 +6237,11 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, if (*dev->dev_ops->get_module_eeprom == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_eeprom)(dev, info); + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); + + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); + + return ret; } int @@ -5967,6 +6249,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5982,7 +6265,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, if (*dev->dev_ops->get_dcb_info == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); + + return ret; } static void @@ -6018,6 +6305,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); + return 0; } @@ -6026,6 +6315,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, struct rte_eth_hairpin_cap *cap) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6040,13 +6330,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, if (*dev->dev_ops->hairpin_cap_get == NULL) return -ENOTSUP; memset(cap, 0, sizeof(*cap)); - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); + + return ret; } int rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6061,7 +6356,11 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) if (*dev->dev_ops->pool_ops_supported == NULL) return 1; /* all pools are supported */ - return (*dev->dev_ops->pool_ops_supported)(dev, pool); + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); + + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); + + return ret; } static int @@ -6352,19 +6651,25 @@ rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_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]; if (*dev->dev_ops->representor_info_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + + rte_eth_trace_representor_info_get(port_id, info, ret); + + return ret; } int rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6383,8 +6688,12 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) if (*dev->dev_ops->rx_metadata_negotiate == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + ret = eth_err(port_id, + (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + + rte_eth_trace_rx_metadata_negotiate(port_id, *features, ret); + + return ret; } int @@ -6392,6 +6701,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *reassembly_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6413,8 +6723,13 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, return -ENOTSUP; memset(reassembly_capa, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) (dev, reassembly_capa)); + + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa, + ret); + + return ret; } int @@ -6422,6 +6737,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6442,8 +6758,12 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_get == NULL) return -ENOTSUP; memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + ret = eth_err(port_id, + (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); + + return ret; } int @@ -6451,6 +6771,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, const struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6479,8 +6800,12 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_set == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + ret = eth_err(port_id, + (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); + + return ret; } int @@ -6578,8 +6903,12 @@ rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes return 0; for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { - if (j < num) + if (j < num) { ptypes[j] = all_types[i]; + + rte_eth_trace_buffer_split_get_supported_hdr_ptypes( + port_id, j, ptypes[j]); + } j++; } diff --git a/lib/ethdev/rte_ethdev_cman.c b/lib/ethdev/rte_ethdev_cman.c index 4a1bdd7bd0..a9c4637521 100644 --- a/lib/ethdev/rte_ethdev_cman.c +++ b/lib/ethdev/rte_ethdev_cman.c @@ -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; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v10 4/6] ethdev: add trace points for flow 2023-02-08 13:28 ` [PATCH v10 0/6] add trace points in ethdev library Ankur Dwivedi ` (2 preceding siblings ...) 2023-02-08 13:28 ` [PATCH v10 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi @ 2023-02-08 13:28 ` Ankur Dwivedi 2023-02-08 16:15 ` Ori Kam 2023-02-08 13:28 ` [PATCH v10 5/6] ethdev: add trace points for mtr Ankur Dwivedi ` (2 subsequent siblings) 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 13:28 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace.h | 503 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 117 +++++++ lib/ethdev/rte_flow.c | 356 +++++++++++++++++----- 3 files changed, 897 insertions(+), 79 deletions(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 1a4b7c3a9b..be231b408b 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -1381,6 +1381,280 @@ 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_ptr(actions); + 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_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_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_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), + uint8_t ingress = table_attr->flow_attr.ingress; + uint8_t egress = table_attr->flow_attr.egress; + uint8_t transfer = table_attr->flow_attr.transfer; + + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(table_attr->nb_flows); + rte_trace_point_emit_u32(table_attr->flow_attr.group); + rte_trace_point_emit_u32(table_attr->flow_attr.priority); + rte_trace_point_emit_u8(ingress); + rte_trace_point_emit_u8(egress); + rte_trace_point_emit_u8(transfer); + 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 */ @@ -1503,6 +1777,235 @@ 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_int(action->type); + rte_trace_point_emit_ptr(action->conf); + 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_u8(ingress); + rte_trace_point_emit_u8(egress); + rte_trace_point_emit_u8(transfer); + rte_trace_point_emit_ptr(action); + 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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 7a08104dc9..b8cbb285de 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 4da581146e..e52dcb1760 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -16,6 +16,8 @@ #include "rte_flow_driver.h" #include "rte_flow.h" +#include "ethdev_trace.h" + /* Mbuf dynamic field name for metadata. */ int32_t rte_flow_dynf_metadata_offs = -1; @@ -277,6 +279,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: @@ -363,7 +368,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, @@ -390,6 +399,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, @@ -413,7 +425,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, @@ -435,7 +451,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, @@ -460,7 +480,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, @@ -483,7 +507,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, @@ -1004,39 +1032,57 @@ rte_flow_conv(enum rte_flow_conv_op op, const void *src, struct rte_flow_error *error) { + int ret; + switch (op) { const struct rte_flow_attr *attr; case RTE_FLOW_CONV_OP_NONE: - return 0; + ret = 0; + break; case RTE_FLOW_CONV_OP_ATTR: attr = src; if (size > sizeof(*attr)) size = sizeof(*attr); rte_memcpy(dst, attr, size); - return sizeof(*attr); + ret = sizeof(*attr); + break; case RTE_FLOW_CONV_OP_ITEM: - return rte_flow_conv_pattern(dst, size, src, 1, error); + ret = rte_flow_conv_pattern(dst, size, src, 1, error); + break; case RTE_FLOW_CONV_OP_ACTION: - return rte_flow_conv_actions(dst, size, src, 1, error); + ret = rte_flow_conv_actions(dst, size, src, 1, error); + break; case RTE_FLOW_CONV_OP_PATTERN: - return rte_flow_conv_pattern(dst, size, src, 0, error); + ret = rte_flow_conv_pattern(dst, size, src, 0, error); + break; case RTE_FLOW_CONV_OP_ACTIONS: - return rte_flow_conv_actions(dst, size, src, 0, error); + ret = rte_flow_conv_actions(dst, size, src, 0, error); + break; case RTE_FLOW_CONV_OP_RULE: - return rte_flow_conv_rule(dst, size, src, error); + ret = rte_flow_conv_rule(dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ITEM_NAME: - return rte_flow_conv_name(0, 0, dst, size, src, error); + ret = rte_flow_conv_name(0, 0, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ACTION_NAME: - return rte_flow_conv_name(1, 0, dst, size, src, error); + ret = rte_flow_conv_name(1, 0, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ITEM_NAME_PTR: - return rte_flow_conv_name(0, 1, dst, size, src, error); + ret = rte_flow_conv_name(0, 1, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ACTION_NAME_PTR: - return rte_flow_conv_name(1, 1, dst, size, src, error); - } - return rte_flow_error_set + ret = rte_flow_conv_name(1, 1, dst, size, src, error); + break; + default: + ret = rte_flow_error_set (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "unknown object conversion operation"); + } + + rte_flow_trace_conv(op, dst, size, src, ret); + + return ret; } /** Store a full rte_flow description. */ @@ -1088,6 +1134,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; } @@ -1126,7 +1175,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1148,7 +1201,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1176,6 +1234,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; } @@ -1195,7 +1256,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 @@ -1215,7 +1280,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 @@ -1235,7 +1304,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 @@ -1247,14 +1320,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, @@ -1270,14 +1349,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, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1292,14 +1377,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, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1314,15 +1404,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, + error), + error); + + rte_flow_trace_tunnel_action_decap_release(port_id, actions, + num_of_actions, ret); + + return ret; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1337,14 +1433,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1357,6 +1458,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)) return -rte_errno; @@ -1368,9 +1470,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 * @@ -1393,6 +1499,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; } @@ -1410,7 +1519,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 @@ -1421,6 +1534,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; @@ -1435,9 +1549,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1481,7 +1599,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1532,6 +1654,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; } rte_flow_error_set(error, ENOTSUP, @@ -1547,17 +1673,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1618,6 +1750,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); + return template; } rte_flow_error_set(error, ENOTSUP, @@ -1633,17 +1769,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1708,6 +1850,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; } rte_flow_error_set(error, ENOTSUP, @@ -1723,17 +1872,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1763,6 +1918,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; } @@ -1776,12 +1936,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 @@ -1791,10 +1957,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 @@ -1807,9 +1978,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 * @@ -1829,6 +2005,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); + return handle; } @@ -1846,7 +2027,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 @@ -1864,7 +2050,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 @@ -1882,5 +2074,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, + action_handle, data, user_data, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v10 4/6] ethdev: add trace points for flow 2023-02-08 13:28 ` [PATCH v10 4/6] ethdev: add trace points for flow Ankur Dwivedi @ 2023-02-08 16:15 ` Ori Kam 0 siblings, 0 replies; 172+ messages in thread From: Ori Kam @ 2023-02-08 16:15 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: NBU-Contact-Thomas Monjalon (EXTERNAL), david.marchand, mdr, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, Matan Azrad, Slava Ovsiienko, NBU-Contact-longli (EXTERNAL), spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb Hi Ankur, > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Wednesday, 8 February 2023 15:28 > > Adds trace points for rte_flow specific functions in ethdev lib. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- Acked-by: Ori Kam <orika@nvidia.com> Best, Ori ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v10 5/6] ethdev: add trace points for mtr 2023-02-08 13:28 ` [PATCH v10 0/6] add trace points in ethdev library Ankur Dwivedi ` (3 preceding siblings ...) 2023-02-08 13:28 ` [PATCH v10 4/6] ethdev: add trace points for flow Ankur Dwivedi @ 2023-02-08 13:28 ` Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi 6 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 13:28 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> --- lib/ethdev/ethdev_trace.h | 206 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 63 ++++++++++ lib/ethdev/rte_mtr.c | 150 ++++++++++++++++++---- 3 files changed, 398 insertions(+), 21 deletions(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index be231b408b..973e2ac6d4 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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, @@ -1655,6 +1656,181 @@ 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_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_ptr(profile); + 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, + const struct rte_mtr_meter_policy_params *policy, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(policy); + 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, + const struct rte_mtr_meter_policy_params *policy, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(policy_id); + rte_trace_point_emit_ptr(policy); + 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 */ @@ -2006,6 +2182,36 @@ 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_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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index b8cbb285de..c34c06941c 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index 3954839531..4e94af9d9f 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -5,6 +5,7 @@ #include <stdint.h> #include <rte_errno.h> +#include "ethdev_trace.h" #include "rte_ethdev.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -82,8 +83,13 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, capabilities_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_mtr_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* MTR meter profile add */ @@ -94,8 +100,14 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); + + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile, + ret); + + return ret; } /** MTR meter profile delete */ @@ -105,8 +117,13 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id, ret); + + return ret; } /** MTR meter profile get */ @@ -116,8 +133,13 @@ rte_mtr_meter_profile_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, + struct rte_flow_meter_profile *ret; + ret = RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_get(port_id, meter_profile_id, ret); + + return ret; } /* MTR meter policy validate */ @@ -127,8 +149,13 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); + + rte_mtr_trace_meter_policy_validate(port_id, policy, ret); + + return ret; } /* MTR meter policy add */ @@ -139,8 +166,13 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); + + rte_mtr_trace_meter_policy_add(port_id, policy_id, policy, ret); + + return ret; } /** MTR meter policy delete */ @@ -150,8 +182,13 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_delete(port_id, policy_id, ret); + + return ret; } /** MTR meter policy get */ @@ -161,8 +198,13 @@ rte_mtr_meter_policy_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, + struct rte_flow_meter_policy *ret; + ret = RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_get(port_id, policy_id, ret); + + return ret; } /** MTR object create */ @@ -174,8 +216,13 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, create)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); + + rte_mtr_trace_create(port_id, mtr_id, params, shared, ret); + + return ret; } /** MTR object destroy */ @@ -185,8 +232,13 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, destroy)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); + + rte_mtr_trace_destroy(port_id, mtr_id, ret); + + return ret; } /** MTR object meter enable */ @@ -196,8 +248,13 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_enable)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); + + rte_mtr_trace_meter_enable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter disable */ @@ -207,8 +264,13 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_disable)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); + + rte_mtr_trace_meter_disable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter profile update */ @@ -219,8 +281,13 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); + + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id, ret); + + return ret; } /** MTR object meter policy update */ @@ -231,8 +298,13 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); + + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id, ret); + + return ret; } /** MTR object meter DSCP table update */ @@ -243,8 +315,13 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, proto, dscp_table, error); + + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table, ret); + + return ret; } /** MTR object meter VLAN table update */ @@ -255,8 +332,13 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, proto, vlan_table, error); + + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table, ret); + + return ret; } /** Set the input color protocol on MTR object */ @@ -268,8 +350,13 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_set)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority, ret); + + return ret; } /** Get input color protocols of MTR object */ @@ -280,8 +367,13 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); + + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id, ret); + + return ret; } /** Get input color protocol priority of MTR object */ @@ -293,8 +385,13 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto, ret); + + return ret; } /** MTR object enabled stats update */ @@ -305,8 +402,13 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); + + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask, ret); + + return ret; } /** MTR object stats read */ @@ -319,6 +421,12 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_read)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); + + rte_mtr_trace_stats_read(port_id, mtr_id, stats, *stats_mask, clear, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v10 6/6] ethdev: add trace points for tm 2023-02-08 13:28 ` [PATCH v10 0/6] add trace points in ethdev library Ankur Dwivedi ` (4 preceding siblings ...) 2023-02-08 13:28 ` [PATCH v10 5/6] ethdev: add trace points for mtr Ankur Dwivedi @ 2023-02-08 13:28 ` Ankur Dwivedi 2023-03-15 7:14 ` Yuan, DukaiX 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi 6 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 13:28 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace.h | 304 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 90 +++++++++ lib/ethdev/rte_tm.c | 225 ++++++++++++++++++++--- 3 files changed, 590 insertions(+), 29 deletions(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 973e2ac6d4..0b0a791aeb 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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, @@ -1831,6 +1832,309 @@ 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_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_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(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(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_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_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_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 */ diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index c34c06941c..34d12e2859 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..2d08141133 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -5,6 +5,7 @@ #include <stdint.h> #include <rte_errno.h> +#include "ethdev_trace.h" #include "rte_ethdev.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +80,9 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); + return 0; } @@ -90,8 +94,13 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_type_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); + + rte_tm_trace_node_type_get(port_id, node_id, *is_leaf, ret); + + return ret; } /* Get capabilities */ @@ -100,8 +109,13 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_tm_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* Get level capabilities */ @@ -111,8 +125,13 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); + + rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret); + + return ret; } /* Get node capabilities */ @@ -122,8 +141,13 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); + + rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret); + + return ret; } /* Add WRED profile */ @@ -133,8 +157,13 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); + + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -143,8 +172,13 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); + + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret); + + return ret; } /* Add/update shared WRED context */ @@ -154,8 +188,15 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); + + rte_tm_trace_shared_wred_context_add_update(port_id, + shared_wred_context_id, + wred_profile_id, ret); + + return ret; } /* Delete shared WRED context */ @@ -164,8 +205,14 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); + + rte_tm_trace_shared_wred_context_delete(port_id, + shared_wred_context_id, ret); + + return ret; } /* Add shaper profile */ @@ -175,8 +222,14 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); + + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile, + ret); + + return ret; } /* Delete WRED profile */ @@ -185,8 +238,13 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); + + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, ret); + + return ret; } /* Add shared shaper */ @@ -196,8 +254,14 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); + + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id, ret); + + return ret; } /* Delete shared shaper */ @@ -206,8 +270,13 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); + + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, ret); + + return ret; } /* Add node to port traffic manager hierarchy */ @@ -221,9 +290,15 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); + + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + + return ret; } /* Delete node from traffic manager hierarchy */ @@ -232,8 +307,13 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); + + rte_tm_trace_node_delete(port_id, node_id, ret); + + return ret; } /* Suspend node */ @@ -242,8 +322,13 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_suspend)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); + + rte_tm_trace_node_suspend(port_id, node_id, ret); + + return ret; } /* Resume node */ @@ -252,8 +337,13 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_resume)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); + + rte_tm_trace_node_resume(port_id, node_id, ret); + + return ret; } /* Commit the initial port traffic manager hierarchy */ @@ -262,8 +352,13 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); + + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret); + + return ret; } /* Update node parent */ @@ -275,8 +370,14 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_parent_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); + + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight, ret); + + return ret; } /* Update node private shaper */ @@ -286,8 +387,14 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shaper_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); + + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id, + ret); + + return ret; } /* Update node shared shapers */ @@ -298,8 +405,14 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); + + rte_tm_trace_node_shared_shaper_update(port_id, node_id, + shared_shaper_id, add, ret); + + return ret; } /* Update node stats */ @@ -309,8 +422,13 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); + + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, ret); + + return ret; } /* Update WFQ weight mode */ @@ -321,8 +439,15 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); + + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, + wfq_weight_mode, + n_sp_priorities, ret); + + return ret; } /* Update node congestion management mode */ @@ -332,8 +457,13 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_cman_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); + + rte_tm_trace_node_cman_update(port_id, node_id, cman, ret); + + return ret; } /* Update node private WRED context */ @@ -343,8 +473,14 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); + + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id, + ret); + + return ret; } /* Update node shared WRED context */ @@ -355,8 +491,15 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); + + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add, ret); + + return ret; } /* Read and/or clear stats counters for specific node */ @@ -368,8 +511,14 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_read)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); + + rte_tm_trace_node_stats_read(port_id, node_id, stats, *stats_mask, + clear, ret); + + return ret; } /* Packet marking - VLAN DEI */ @@ -380,8 +529,14 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } /* Packet marking - IPv4/IPv6 ECN */ @@ -392,8 +547,14 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } /* Packet marking - IPv4/IPv6 DSCP */ @@ -404,6 +565,12 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v10 6/6] ethdev: add trace points for tm 2023-02-08 13:28 ` [PATCH v10 6/6] ethdev: add trace points for tm Ankur Dwivedi @ 2023-03-15 7:14 ` Yuan, DukaiX 2023-03-16 9:58 ` Ankur Dwivedi 0 siblings, 1 reply; 172+ messages in thread From: Yuan, DukaiX @ 2023-03-15 7:14 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, Loftus, Ciara, Zhang, Qi Z, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, Shepard Siegel, Czeck, Ed, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, Daley, John, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, Su, Simei, Wu, Wenjun1, Yang, Qiming, Zhang, Yuying, Xing, Beilei, Wang, Xiao W, Wu, Jingjing, Guo, Junfeng, Xu, Rosen, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, Behrens, Jochen, maxime.coquelin, Xia, Chenbo, Webster, Steven, Peters, Matt, Richardson, Bruce, mtetsuyah, grive, Singh, Jasvinder, Dumitrescu, Cristian, jgrajcia, mb Hi Ankur, I get an error message when I launch testpmd with Asan, I need your help to confirm this issue. For more information please refer to https://bugs.dpdk.org/show_bug.cgi?id=1184. Waiting for your reply. Best regards, Dukai,Yuan > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: 2023年2月8日 21:28 > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; Loftus, Ciara > <ciara.loftus@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; > mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; > evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; > irusskikh@marvell.com; Shepard Siegel <shepard.siegel@atomicrules.com>; > Czeck, Ed <ed.czeck@atomicrules.com>; john.miller@atomicrules.com; > ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; > jerinj@marvell.com; mczekaj@marvell.com; sthotton@marvell.com; > srinivasan@marvell.com; hkalra@marvell.com; rahul.lakkireddy@chelsio.com; > Daley, John <johndale@cisco.com>; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; Su, Simei <simei.su@intel.com>; Wu, Wenjun1 > <wenjun1.wu@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Zhang, > Yuying <yuying.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>; > Wang, Xiao W <xiao.w.wang@intel.com>; Wu, Jingjing > <jingjing.wu@intel.com>; Guo, Junfeng <junfeng.guo@intel.com>; Xu, > Rosen <rosen.xu@intel.com>; ndabilpuram@marvell.com; > kirankumark@marvell.com; skori@marvell.com; skoteshwar@marvell.com; > lironh@marvell.com; zr@semihalf.com; radhac@marvell.com; > vburru@marvell.com; sedara@marvell.com; matan@nvidia.com; > viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > rmody@marvell.com; shshaikh@marvell.com; dsinghrawat@marvell.com; > andrew.rybchenko@oktetlabs.ru; jiawenwu@trustnetic.com; > jianwang@trustnetic.com; Behrens, Jochen <jbehrens@vmware.com>; > maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; > Webster, Steven <steven.webster@windriver.com>; Peters, Matt > <matt.peters@windriver.com>; Richardson, Bruce > <bruce.richardson@intel.com>; mtetsuyah@gmail.com; grive@u256.net; > Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian > <cristian.dumitrescu@intel.com>; jgrajcia@cisco.com; > mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> > Subject: [PATCH v10 6/6] ethdev: add trace points for tm > > Adds trace points for rte_tm specific functions in ethdev lib. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > --- > lib/ethdev/ethdev_trace.h | 304 > +++++++++++++++++++++++++++++++ > lib/ethdev/ethdev_trace_points.c | 90 +++++++++ > lib/ethdev/rte_tm.c | 225 ++++++++++++++++++++--- > 3 files changed, 590 insertions(+), 29 deletions(-) > > diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index > 973e2ac6d4..0b0a791aeb 100644 > --- a/lib/ethdev/ethdev_trace.h > +++ b/lib/ethdev/ethdev_trace.h > @@ -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, > @@ -1831,6 +1832,309 @@ 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_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_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(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(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_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_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_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 */ diff -- > git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c > index c34c06941c..34d12e2859 100644 > --- a/lib/ethdev/ethdev_trace_points.c > +++ b/lib/ethdev/ethdev_trace_points.c > @@ -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_up > date, > + 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_u > pdate, > + 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) > diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index > 9709454f35..2d08141133 100644 > --- a/lib/ethdev/rte_tm.c > +++ b/lib/ethdev/rte_tm.c > @@ -5,6 +5,7 @@ > #include <stdint.h> > > #include <rte_errno.h> > +#include "ethdev_trace.h" > #include "rte_ethdev.h" > #include "rte_tm_driver.h" > #include "rte_tm.h" > @@ -79,6 +80,9 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, > } > > *n_leaf_nodes = dev->data->nb_tx_queues; > + > + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); > + > return 0; > } > > @@ -90,8 +94,13 @@ rte_tm_node_type_get(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_type_get)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_type_get)(dev, > node_id, is_leaf, error); > + > + rte_tm_trace_node_type_get(port_id, node_id, *is_leaf, ret); > + > + return ret; > } > > /* Get capabilities */ > @@ -100,8 +109,13 @@ int rte_tm_capabilities_get(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, capabilities_get)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, capabilities_get)(dev, > cap, error); > + > + rte_tm_trace_capabilities_get(port_id, cap, ret); > + > + return ret; > } > > /* Get level capabilities */ > @@ -111,8 +125,13 @@ int rte_tm_level_capabilities_get(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev, > level_id, cap, error); > + > + rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret); > + > + return ret; > } > > /* Get node capabilities */ > @@ -122,8 +141,13 @@ int rte_tm_node_capabilities_get(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev, > node_id, cap, error); > + > + rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret); > + > + return ret; > } > > /* Add WRED profile */ > @@ -133,8 +157,13 @@ int rte_tm_wred_profile_add(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, wred_profile_add)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev, > wred_profile_id, profile, error); > + > + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, > ret); > + > + return ret; > } > > /* Delete WRED profile */ > @@ -143,8 +172,13 @@ int rte_tm_wred_profile_delete(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev, > wred_profile_id, error); > + > + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret); > + > + return ret; > } > > /* Add/update shared WRED context */ > @@ -154,8 +188,15 @@ int > rte_tm_shared_wred_context_add_update(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, > shared_wred_context_add_update)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, > shared_wred_context_add_update)(dev, > shared_wred_context_id, wred_profile_id, error); > + > + rte_tm_trace_shared_wred_context_add_update(port_id, > + shared_wred_context_id, > + wred_profile_id, ret); > + > + return ret; > } > > /* Delete shared WRED context */ > @@ -164,8 +205,14 @@ int rte_tm_shared_wred_context_delete(uint16_t > port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, > shared_wred_context_id, error); > + > + rte_tm_trace_shared_wred_context_delete(port_id, > + shared_wred_context_id, > ret); > + > + return ret; > } > > /* Add shaper profile */ > @@ -175,8 +222,14 @@ int rte_tm_shaper_profile_add(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev, > shaper_profile_id, profile, error); > + > + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, > profile, > + ret); > + > + return ret; > } > > /* Delete WRED profile */ > @@ -185,8 +238,13 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, > shaper_profile_id, error); > + > + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, > ret); > + > + return ret; > } > > /* Add shared shaper */ > @@ -196,8 +254,14 @@ int rte_tm_shared_shaper_add_update(uint16_t > port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, > shared_shaper_id, shaper_profile_id, error); > + > + rte_tm_trace_shared_shaper_add_update(port_id, > shared_shaper_id, > + shaper_profile_id, ret); > + > + return ret; > } > > /* Delete shared shaper */ > @@ -206,8 +270,13 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, > shared_shaper_id, error); > + > + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, > ret); > + > + return ret; > } > > /* Add node to port traffic manager hierarchy */ @@ -221,9 +290,15 @@ int > rte_tm_node_add(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_add)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_add)(dev, > node_id, parent_node_id, priority, weight, level_id, > params, error); > + > + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, > + weight, level_id, params, ret); > + > + return ret; > } > > /* Delete node from traffic manager hierarchy */ @@ -232,8 +307,13 @@ int > rte_tm_node_delete(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_delete)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_delete)(dev, > node_id, error); > + > + rte_tm_trace_node_delete(port_id, node_id, ret); > + > + return ret; > } > > /* Suspend node */ > @@ -242,8 +322,13 @@ int rte_tm_node_suspend(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_suspend)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_suspend)(dev, > node_id, error); > + > + rte_tm_trace_node_suspend(port_id, node_id, ret); > + > + return ret; > } > > /* Resume node */ > @@ -252,8 +337,13 @@ int rte_tm_node_resume(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_resume)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_resume)(dev, > node_id, error); > + > + rte_tm_trace_node_resume(port_id, node_id, ret); > + > + return ret; > } > > /* Commit the initial port traffic manager hierarchy */ @@ -262,8 +352,13 > @@ int rte_tm_hierarchy_commit(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev, > clear_on_fail, error); > + > + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret); > + > + return ret; > } > > /* Update node parent */ > @@ -275,8 +370,14 @@ int rte_tm_node_parent_update(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_parent_update)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_parent_update)(dev, > node_id, parent_node_id, priority, weight, error); > + > + rte_tm_trace_node_parent_update(port_id, node_id, > parent_node_id, > + priority, weight, ret); > + > + return ret; > } > > /* Update node private shaper */ > @@ -286,8 +387,14 @@ int rte_tm_node_shaper_update(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_shaper_update)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev, > node_id, shaper_profile_id, error); > + > + rte_tm_trace_node_shaper_update(port_id, node_id, > shaper_profile_id, > + ret); > + > + return ret; > } > > /* Update node shared shapers */ > @@ -298,8 +405,14 @@ int rte_tm_node_shared_shaper_update(uint16_t > port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, > node_id, shared_shaper_id, add, error); > + > + rte_tm_trace_node_shared_shaper_update(port_id, node_id, > + shared_shaper_id, add, ret); > + > + return ret; > } > > /* Update node stats */ > @@ -309,8 +422,13 @@ int rte_tm_node_stats_update(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_stats_update)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_stats_update)(dev, > node_id, stats_mask, error); > + > + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, > ret); > + > + return ret; > } > > /* Update WFQ weight mode */ > @@ -321,8 +439,15 @@ int > rte_tm_node_wfq_weight_mode_update(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, > node_wfq_weight_mode_update)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, > node_wfq_weight_mode_update)(dev, > node_id, wfq_weight_mode, n_sp_priorities, error); > + > + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, > + wfq_weight_mode, > + n_sp_priorities, ret); > + > + return ret; > } > > /* Update node congestion management mode */ @@ -332,8 +457,13 @@ > int rte_tm_node_cman_update(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_cman_update)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_cman_update)(dev, > node_id, cman, error); > + > + rte_tm_trace_node_cman_update(port_id, node_id, cman, ret); > + > + return ret; > } > > /* Update node private WRED context */ > @@ -343,8 +473,14 @@ int rte_tm_node_wred_context_update(uint16_t > port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev, > node_id, wred_profile_id, error); > + > + rte_tm_trace_node_wred_context_update(port_id, node_id, > wred_profile_id, > + ret); > + > + return ret; > } > > /* Update node shared WRED context */ > @@ -355,8 +491,15 @@ int > rte_tm_node_shared_wred_context_update(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, > node_shared_wred_context_update)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, > node_shared_wred_context_update)(dev, > node_id, shared_wred_context_id, add, error); > + > + rte_tm_trace_node_shared_wred_context_update(port_id, > node_id, > + shared_wred_context_id, > + add, ret); > + > + return ret; > } > > /* Read and/or clear stats counters for specific node */ @@ -368,8 +511,14 > @@ int rte_tm_node_stats_read(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, node_stats_read)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, node_stats_read)(dev, > node_id, stats, stats_mask, clear, error); > + > + rte_tm_trace_node_stats_read(port_id, node_id, stats, > *stats_mask, > + clear, ret); > + > + return ret; > } > > /* Packet marking - VLAN DEI */ > @@ -380,8 +529,14 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, > mark_green, mark_yellow, mark_red, error); > + > + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, > mark_red, > + ret); > + > + return ret; > } > > /* Packet marking - IPv4/IPv6 ECN */ > @@ -392,8 +547,14 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, > mark_green, mark_yellow, mark_red, error); > + > + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, > mark_red, > + ret); > + > + return ret; > } > > /* Packet marking - IPv4/IPv6 DSCP */ > @@ -404,6 +565,12 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > - return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, > + int ret; > + ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, > mark_green, mark_yellow, mark_red, error); > + > + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, > mark_red, > + ret); > + > + return ret; > } > -- > 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v10 6/6] ethdev: add trace points for tm 2023-03-15 7:14 ` Yuan, DukaiX @ 2023-03-16 9:58 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-03-16 9:58 UTC (permalink / raw) To: Yuan, DukaiX, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, Loftus, Ciara, Zhang, Qi Z, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, Shepard Siegel, Czeck, Ed, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, Daley, John, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, Su, Simei, Wu, Wenjun1, Yang, Qiming, Zhang, Yuying, Xing, Beilei, Wang, Xiao W, Wu, Jingjing, Guo, Junfeng, Xu, Rosen, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, Behrens, Jochen, maxime.coquelin, Xia, Chenbo, Webster, Steven, Peters, Matt, Richardson, Bruce, mtetsuyah, grive, Singh, Jasvinder, Dumitrescu, Cristian, jgrajcia, mb >Hi Ankur, > >I get an error message when I launch testpmd with Asan, I need your help to >confirm this issue. >For more information please refer to >https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.dpdk.org_show- >5Fbug.cgi-3Fid- >3D1184&d=DwIFJg&c=nKjWec2b6R0mOyPaz7xtfQ&r=ILjiNF3GF25y6QdHZUxMl >6JrStU0MIuCtO5dMzn3Ybk&m=iJXvZTgkVUt077WhptysM_vjUBfDR03DyP2zwu >xwH0EU5LK5mDPR8UX_R8LwrXgW&s=9Q4JEF7FpzXLRHZ09w4hJqdhgF_ncJ8HF >jCGqX0sVFc&e= . >Waiting for your reply. I could recreate this issue with clang-10 compilation. I have up streamed a patch in dpdk patchworks, which resolves this issue as a workaround. The following is the link of the patch: https://patches.dpdk.org/project/dpdk/list/?series=27418 > >Best regards, >Dukai,Yuan > >> -----Original Message----- >> From: Ankur Dwivedi <adwivedi@marvell.com> >> Sent: 2023年2月8日 21:28 >> To: dev@dpdk.org >> Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; >> orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; >> humin29@huawei.com; linville@tuxdriver.com; Loftus, Ciara >> <ciara.loftus@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; >> mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; >> evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; >> irusskikh@marvell.com; Shepard Siegel >> <shepard.siegel@atomicrules.com>; Czeck, Ed >> <ed.czeck@atomicrules.com>; john.miller@atomicrules.com; >> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; >> jerinj@marvell.com; mczekaj@marvell.com; sthotton@marvell.com; >> srinivasan@marvell.com; hkalra@marvell.com; >> rahul.lakkireddy@chelsio.com; Daley, John <johndale@cisco.com>; >> hyonkim@cisco.com; liudongdong3@huawei.com; >yisen.zhuang@huawei.com; >> xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; >> zhouguoyang@huawei.com; Su, Simei <simei.su@intel.com>; Wu, Wenjun1 >> <wenjun1.wu@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Zhang, >> Yuying <yuying.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>; >> Wang, Xiao W <xiao.w.wang@intel.com>; Wu, Jingjing >> <jingjing.wu@intel.com>; Guo, Junfeng <junfeng.guo@intel.com>; Xu, >> Rosen <rosen.xu@intel.com>; ndabilpuram@marvell.com; >> kirankumark@marvell.com; skori@marvell.com; skoteshwar@marvell.com; >> lironh@marvell.com; zr@semihalf.com; radhac@marvell.com; >> vburru@marvell.com; sedara@marvell.com; matan@nvidia.com; >> viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; >> chaoyong.he@corigine.com; niklas.soderlund@corigine.com; >> hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; >g.singh@nxp.com; >> apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; >> rmody@marvell.com; shshaikh@marvell.com; dsinghrawat@marvell.com; >> andrew.rybchenko@oktetlabs.ru; jiawenwu@trustnetic.com; >> jianwang@trustnetic.com; Behrens, Jochen <jbehrens@vmware.com>; >> maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; >> Webster, Steven <steven.webster@windriver.com>; Peters, Matt >> <matt.peters@windriver.com>; Richardson, Bruce >> <bruce.richardson@intel.com>; mtetsuyah@gmail.com; grive@u256.net; >> Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian >> <cristian.dumitrescu@intel.com>; jgrajcia@cisco.com; >> mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@marvell.com> >> Subject: [PATCH v10 6/6] ethdev: add trace points for tm >> >> Adds trace points for rte_tm specific functions in ethdev lib. >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> --- >> lib/ethdev/ethdev_trace.h | 304 >> +++++++++++++++++++++++++++++++ >> lib/ethdev/ethdev_trace_points.c | 90 +++++++++ >> lib/ethdev/rte_tm.c | 225 ++++++++++++++++++++--- >> 3 files changed, 590 insertions(+), 29 deletions(-) >> >> diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h >> index 973e2ac6d4..0b0a791aeb 100644 >> --- a/lib/ethdev/ethdev_trace.h >> +++ b/lib/ethdev/ethdev_trace.h >> @@ -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, >> @@ -1831,6 +1832,309 @@ 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_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_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(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(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_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_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_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 */ >> diff -- git a/lib/ethdev/ethdev_trace_points.c >> b/lib/ethdev/ethdev_trace_points.c >> index c34c06941c..34d12e2859 100644 >> --- a/lib/ethdev/ethdev_trace_points.c >> +++ b/lib/ethdev/ethdev_trace_points.c >> @@ -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_up >> date, >> + 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_u >> pdate, >> + 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) >> diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index >> 9709454f35..2d08141133 100644 >> --- a/lib/ethdev/rte_tm.c >> +++ b/lib/ethdev/rte_tm.c >> @@ -5,6 +5,7 @@ >> #include <stdint.h> >> >> #include <rte_errno.h> >> +#include "ethdev_trace.h" >> #include "rte_ethdev.h" >> #include "rte_tm_driver.h" >> #include "rte_tm.h" >> @@ -79,6 +80,9 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, >> } >> >> *n_leaf_nodes = dev->data->nb_tx_queues; >> + >> + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); >> + >> return 0; >> } >> >> @@ -90,8 +94,13 @@ rte_tm_node_type_get(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_type_get)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_type_get)(dev, >> node_id, is_leaf, error); >> + >> + rte_tm_trace_node_type_get(port_id, node_id, *is_leaf, ret); >> + >> + return ret; >> } >> >> /* Get capabilities */ >> @@ -100,8 +109,13 @@ int rte_tm_capabilities_get(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, capabilities_get)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, capabilities_get)(dev, >> cap, error); >> + >> + rte_tm_trace_capabilities_get(port_id, cap, ret); >> + >> + return ret; >> } >> >> /* Get level capabilities */ >> @@ -111,8 +125,13 @@ int rte_tm_level_capabilities_get(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev, >> level_id, cap, error); >> + >> + rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret); >> + >> + return ret; >> } >> >> /* Get node capabilities */ >> @@ -122,8 +141,13 @@ int rte_tm_node_capabilities_get(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev, >> node_id, cap, error); >> + >> + rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret); >> + >> + return ret; >> } >> >> /* Add WRED profile */ >> @@ -133,8 +157,13 @@ int rte_tm_wred_profile_add(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, wred_profile_add)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev, >> wred_profile_id, profile, error); >> + >> + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, >> ret); >> + >> + return ret; >> } >> >> /* Delete WRED profile */ >> @@ -143,8 +172,13 @@ int rte_tm_wred_profile_delete(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev, >> wred_profile_id, error); >> + >> + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret); >> + >> + return ret; >> } >> >> /* Add/update shared WRED context */ >> @@ -154,8 +188,15 @@ int >> rte_tm_shared_wred_context_add_update(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, >> shared_wred_context_add_update)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, >> shared_wred_context_add_update)(dev, >> shared_wred_context_id, wred_profile_id, error); >> + >> + rte_tm_trace_shared_wred_context_add_update(port_id, >> + shared_wred_context_id, >> + wred_profile_id, ret); >> + >> + return ret; >> } >> >> /* Delete shared WRED context */ >> @@ -164,8 +205,14 @@ int rte_tm_shared_wred_context_delete(uint16_t >> port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, >> shared_wred_context_id, error); >> + >> + rte_tm_trace_shared_wred_context_delete(port_id, >> + shared_wred_context_id, >> ret); >> + >> + return ret; >> } >> >> /* Add shaper profile */ >> @@ -175,8 +222,14 @@ int rte_tm_shaper_profile_add(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev, >> shaper_profile_id, profile, error); >> + >> + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, >> profile, >> + ret); >> + >> + return ret; >> } >> >> /* Delete WRED profile */ >> @@ -185,8 +238,13 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, >> shaper_profile_id, error); >> + >> + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, >> ret); >> + >> + return ret; >> } >> >> /* Add shared shaper */ >> @@ -196,8 +254,14 @@ int rte_tm_shared_shaper_add_update(uint16_t >> port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, >> shared_shaper_id, shaper_profile_id, error); >> + >> + rte_tm_trace_shared_shaper_add_update(port_id, >> shared_shaper_id, >> + shaper_profile_id, ret); >> + >> + return ret; >> } >> >> /* Delete shared shaper */ >> @@ -206,8 +270,13 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, >> shared_shaper_id, error); >> + >> + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, >> ret); >> + >> + return ret; >> } >> >> /* Add node to port traffic manager hierarchy */ @@ -221,9 +290,15 @@ >> int rte_tm_node_add(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_add)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_add)(dev, >> node_id, parent_node_id, priority, weight, level_id, >> params, error); >> + >> + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, >> + weight, level_id, params, ret); >> + >> + return ret; >> } >> >> /* Delete node from traffic manager hierarchy */ @@ -232,8 +307,13 @@ >> int rte_tm_node_delete(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_delete)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_delete)(dev, >> node_id, error); >> + >> + rte_tm_trace_node_delete(port_id, node_id, ret); >> + >> + return ret; >> } >> >> /* Suspend node */ >> @@ -242,8 +322,13 @@ int rte_tm_node_suspend(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_suspend)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_suspend)(dev, >> node_id, error); >> + >> + rte_tm_trace_node_suspend(port_id, node_id, ret); >> + >> + return ret; >> } >> >> /* Resume node */ >> @@ -252,8 +337,13 @@ int rte_tm_node_resume(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_resume)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_resume)(dev, >> node_id, error); >> + >> + rte_tm_trace_node_resume(port_id, node_id, ret); >> + >> + return ret; >> } >> >> /* Commit the initial port traffic manager hierarchy */ @@ -262,8 >> +352,13 @@ int rte_tm_hierarchy_commit(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev, >> clear_on_fail, error); >> + >> + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret); >> + >> + return ret; >> } >> >> /* Update node parent */ >> @@ -275,8 +370,14 @@ int rte_tm_node_parent_update(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_parent_update)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_parent_update)(dev, >> node_id, parent_node_id, priority, weight, error); >> + >> + rte_tm_trace_node_parent_update(port_id, node_id, >> parent_node_id, >> + priority, weight, ret); >> + >> + return ret; >> } >> >> /* Update node private shaper */ >> @@ -286,8 +387,14 @@ int rte_tm_node_shaper_update(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_shaper_update)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev, >> node_id, shaper_profile_id, error); >> + >> + rte_tm_trace_node_shaper_update(port_id, node_id, >> shaper_profile_id, >> + ret); >> + >> + return ret; >> } >> >> /* Update node shared shapers */ >> @@ -298,8 +405,14 @@ int rte_tm_node_shared_shaper_update(uint16_t >> port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, >> node_id, shared_shaper_id, add, error); >> + >> + rte_tm_trace_node_shared_shaper_update(port_id, node_id, >> + shared_shaper_id, add, ret); >> + >> + return ret; >> } >> >> /* Update node stats */ >> @@ -309,8 +422,13 @@ int rte_tm_node_stats_update(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_stats_update)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_stats_update)(dev, >> node_id, stats_mask, error); >> + >> + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, >> ret); >> + >> + return ret; >> } >> >> /* Update WFQ weight mode */ >> @@ -321,8 +439,15 @@ int >> rte_tm_node_wfq_weight_mode_update(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, >> node_wfq_weight_mode_update)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, >> node_wfq_weight_mode_update)(dev, >> node_id, wfq_weight_mode, n_sp_priorities, error); >> + >> + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, >> + wfq_weight_mode, >> + n_sp_priorities, ret); >> + >> + return ret; >> } >> >> /* Update node congestion management mode */ @@ -332,8 +457,13 @@ >int >> rte_tm_node_cman_update(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_cman_update)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_cman_update)(dev, >> node_id, cman, error); >> + >> + rte_tm_trace_node_cman_update(port_id, node_id, cman, ret); >> + >> + return ret; >> } >> >> /* Update node private WRED context */ @@ -343,8 +473,14 @@ int >> rte_tm_node_wred_context_update(uint16_t >> port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev, >> node_id, wred_profile_id, error); >> + >> + rte_tm_trace_node_wred_context_update(port_id, node_id, >> wred_profile_id, >> + ret); >> + >> + return ret; >> } >> >> /* Update node shared WRED context */ @@ -355,8 +491,15 @@ int >> rte_tm_node_shared_wred_context_update(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, >> node_shared_wred_context_update)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, >> node_shared_wred_context_update)(dev, >> node_id, shared_wred_context_id, add, error); >> + >> + rte_tm_trace_node_shared_wred_context_update(port_id, >> node_id, >> + shared_wred_context_id, >> + add, ret); >> + >> + return ret; >> } >> >> /* Read and/or clear stats counters for specific node */ @@ -368,8 >> +511,14 @@ int rte_tm_node_stats_read(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, node_stats_read)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, node_stats_read)(dev, >> node_id, stats, stats_mask, clear, error); >> + >> + rte_tm_trace_node_stats_read(port_id, node_id, stats, >> *stats_mask, >> + clear, ret); >> + >> + return ret; >> } >> >> /* Packet marking - VLAN DEI */ >> @@ -380,8 +529,14 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, >> mark_green, mark_yellow, mark_red, error); >> + >> + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, >> mark_red, >> + ret); >> + >> + return ret; >> } >> >> /* Packet marking - IPv4/IPv6 ECN */ >> @@ -392,8 +547,14 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, >> mark_green, mark_yellow, mark_red, error); >> + >> + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, >> mark_red, >> + ret); >> + >> + return ret; >> } >> >> /* Packet marking - IPv4/IPv6 DSCP */ @@ -404,6 +565,12 @@ int >> rte_tm_mark_ip_dscp(uint16_t port_id, >> struct rte_tm_error *error) >> { >> struct rte_eth_dev *dev = &rte_eth_devices[port_id]; >> - return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, >> + int ret; >> + ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, >> mark_green, mark_yellow, mark_red, error); >> + >> + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, >> mark_red, >> + ret); >> + >> + return ret; >> } >> -- >> 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v11 0/6] add trace points in ethdev library 2023-02-08 13:28 ` [PATCH v10 0/6] add trace points in ethdev library Ankur Dwivedi ` (5 preceding siblings ...) 2023-02-08 13:28 ` [PATCH v10 6/6] ethdev: add trace points for tm Ankur Dwivedi @ 2023-02-08 17:12 ` Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi ` (7 more replies) 6 siblings, 8 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 17:12 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. v11: - Added rte_trace_point_emit_blob to capture mac address list in rte_ethdev_trace_set_mc_addr_list tracepoint. - Added ack by Ori in patch (4/6) ethdev: add trace points for flow. v10: - Removed const in basic types in tracepoint. - Removed capture of pointer value where some fields in structure are captured. - Resolved RHEL 7 failure: ../lib/ethdev/rte_ethdev.c:3260:2: error: 'for' loop initial declarations are only allowed in C99 mode - In patch (3/6) removed next_port and last_port in rte_ethdev_trace_callback_register. - In patch (3/6) simplified the return logic in rte_eth_dev_priority_flow_ctrl_set, rte_eth_dev_priority_flow_ctrl_queue_info_get and rte_eth_dev_priority_flow_ctrl_queue_configure. - In patch (4/6, 5/6 and 6/6), removed capture of structure fields in tracepoint where the structure pointer can be null. 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 | 2525 ++++++++++++++++++++ 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 | 150 +- lib/ethdev/rte_tm.c | 225 +- 18 files changed, 4718 insertions(+), 368 deletions(-) create mode 100644 lib/ethdev/ethdev_trace.h delete mode 100644 lib/ethdev/rte_ethdev_trace.h -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v11 1/6] eal: trace: add trace point emit for blob 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi @ 2023-02-08 17:12 ` Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi ` (6 subsequent siblings) 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 17:12 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com> --- 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(+) diff --git a/app/test/test_trace.c b/app/test/test_trace.c index 6bedf14024..ad4a394a29 100644 --- a/app/test/test_trace.c +++ b/app/test/test_trace.c @@ -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; diff --git a/doc/guides/prog_guide/trace_lib.rst b/doc/guides/prog_guide/trace_lib.rst index 9a8f38073d..3e0ea5835c 100644 --- a/doc/guides/prog_guide/trace_lib.rst +++ b/doc/guides/prog_guide/trace_lib.rst @@ -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. diff --git a/lib/eal/common/eal_common_trace_points.c b/lib/eal/common/eal_common_trace_points.c index 0b0b254615..051f89809c 100644 --- a/lib/eal/common/eal_common_trace_points.c +++ b/lib/eal/common/eal_common_trace_points.c @@ -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) diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h index 5ef4398230..6f5c022558 100644 --- a/lib/eal/include/rte_eal_trace.h +++ b/lib/eal/include/rte_eal_trace.h @@ -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 */ diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index 0f8700974f..4d6b5700dd 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -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_ */ diff --git a/lib/eal/include/rte_trace_point_register.h b/lib/eal/include/rte_trace_point_register.h index a32f4d731b..a9682d3f22 100644 --- a/lib/eal/include/rte_trace_point_register.h +++ b/lib/eal/include/rte_trace_point_register.h @@ -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 diff --git a/lib/eal/version.map b/lib/eal/version.map index 6523102157..21aa1b8ce3 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -442,6 +442,7 @@ EXPERIMENTAL { # added in 23.03 rte_thread_set_name; + __rte_eal_trace_generic_blob; }; INTERNAL { -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v11 2/6] ethdev: add trace points for ethdev (part one) 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi @ 2023-02-08 17:12 ` Ankur Dwivedi 2023-02-17 7:32 ` Li, WeiyuanX 2023-02-08 17:12 ` [PATCH v11 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi ` (5 subsequent siblings) 7 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 17:12 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, 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. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@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_mapping, + lib.ethdev.set_tx_queue_stats_mapping) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_set_rx_queue_stats_mapping, + 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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v11 2/6] ethdev: add trace points for ethdev (part one) 2023-02-08 17:12 ` [PATCH v11 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi @ 2023-02-17 7:32 ` Li, WeiyuanX 0 siblings, 0 replies; 172+ messages in thread From: Li, WeiyuanX @ 2023-02-17 7:32 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, Loftus, Ciara, Zhang, Qi Z, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, Shepard Siegel, Czeck, Ed, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, Daley, John, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, Su, Simei, Wu, Wenjun1, Yang, Qiming, Zhang, Yuying, Xing, Beilei, Wang, Xiao W, Wu, Jingjing, Guo, Junfeng, Xu, Rosen, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, Behrens, Jochen, maxime.coquelin, Xia, Chenbo, Webster, Steven, Peters, Matt, Richardson, Bruce, mtetsuyah, grive, Singh, Jasvinder, Dumitrescu, Cristian, jgrajcia, mb 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 <adwivedi@marvell.com> > Sent: Thursday, February 9, 2023 1:12 AM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; mdr@ashroe.eu; > orika@nvidia.com; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; Loftus, Ciara > <ciara.loftus@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; > mw@semihalf.com; mk@semihalf.com; shaibran@amazon.com; > evgenys@amazon.com; igorch@amazon.com; chandu@amd.com; > irusskikh@marvell.com; Shepard Siegel <shepard.siegel@atomicrules.com>; > Czeck, Ed <ed.czeck@atomicrules.com>; john.miller@atomicrules.com; > ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; > jerinj@marvell.com; mczekaj@marvell.com; sthotton@marvell.com; > srinivasan@marvell.com; hkalra@marvell.com; rahul.lakkireddy@chelsio.com; > Daley, John <johndale@cisco.com>; hyonkim@cisco.com; > liudongdong3@huawei.com; yisen.zhuang@huawei.com; > xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com; > zhouguoyang@huawei.com; Su, Simei <simei.su@intel.com>; Wu, Wenjun1 > <wenjun1.wu@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Zhang, > Yuying <yuying.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>; > Wang, Xiao W <xiao.w.wang@intel.com>; Wu, Jingjing > <jingjing.wu@intel.com>; Guo, Junfeng <junfeng.guo@intel.com>; Xu, > Rosen <rosen.xu@intel.com>; ndabilpuram@marvell.com; > kirankumark@marvell.com; skori@marvell.com; skoteshwar@marvell.com; > lironh@marvell.com; zr@semihalf.com; radhac@marvell.com; > vburru@marvell.com; sedara@marvell.com; matan@nvidia.com; > viacheslavo@nvidia.com; longli@microsoft.com; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > rmody@marvell.com; shshaikh@marvell.com; dsinghrawat@marvell.com; > andrew.rybchenko@oktetlabs.ru; jiawenwu@trustnetic.com; > jianwang@trustnetic.com; Behrens, Jochen <jbehrens@vmware.com>; > maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; > Webster, Steven <steven.webster@windriver.com>; Peters, Matt > <matt.peters@windriver.com>; Richardson, Bruce > <bruce.richardson@intel.com>; mtetsuyah@gmail.com; grive@u256.net; > Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian > <cristian.dumitrescu@intel.com>; jgrajcia@cisco.com; > mb@smartsharesystems.com; Ankur Dwivedi <adwivedi@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 <adwivedi@marvell.com> > Acked-by: Sunil Kumar Kori <skori@marvell.com> > Reviewed-by: Ferruh Yigit <ferruh.yigit@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 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v11 3/6] ethdev: add trace points for ethdev (part two) 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi @ 2023-02-08 17:12 ` Ankur Dwivedi 2023-02-08 20:09 ` Ferruh Yigit 2023-02-08 17:12 ` [PATCH v11 4/6] ethdev: add trace points for flow Ankur Dwivedi ` (4 subsequent siblings) 7 siblings, 1 reply; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 17:12 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for remaining ethdev functions. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> --- lib/ethdev/ethdev_trace.h | 877 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 252 +++++++++ lib/ethdev/rte_ethdev.c | 485 ++++++++++++++--- lib/ethdev/rte_ethdev_cman.c | 29 +- 4 files changed, 1561 insertions(+), 82 deletions(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index d88ad60ec8..aabdb3fbe0 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -586,6 +586,803 @@ 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_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_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_u8(pfc_queue_info->tc_max); + rte_trace_point_emit_int(pfc_queue_info->mode_capa); + 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_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_u64(reta_conf->mask); + 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_u64(reta_conf->mask); + 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_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_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_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_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), + 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( + 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_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_u64(mode->flags); + 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->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), + uint8_t len = nb_mc_addr * RTE_ETHER_ADDR_LEN; + + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(nb_mc_addr); + rte_trace_point_emit_blob(mc_addr_set, len); + 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_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_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->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->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_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->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_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_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_u16(cap->max_nb_queues); + rte_trace_point_emit_u16(cap->max_rx_2_tx); + rte_trace_point_emit_u16(cap->max_tx_2_rx); + rte_trace_point_emit_u16(cap->max_nb_desc); + 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, uint64_t features_val, int ret), + rte_trace_point_emit_u16(port_id); + 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_u32(capa->timeout_ms); + rte_trace_point_emit_u16(capa->max_frags); + rte_trace_point_emit_u16(capa->flags); + 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_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_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_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_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_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_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_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 */ @@ -628,6 +1425,86 @@ 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_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_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_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_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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 3e58c679c3..7a08104dc9 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 6aaae66b83..dc0a4eb12c 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -3627,6 +3627,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->dev_flags = &dev->data->dev_flags; + rte_ethdev_trace_info_get(port_id, dev_info); + return 0; } @@ -3647,6 +3649,8 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) memcpy(dev_conf, &dev->data->dev_conf, sizeof(struct rte_eth_conf)); + rte_ethdev_trace_conf_get(port_id, dev_conf); + return 0; } @@ -3677,8 +3681,12 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) if (all_ptypes[i] & ptype_mask) { - if (j < num) + if (j < num) { ptypes[j] = all_ptypes[i]; + + rte_ethdev_trace_get_supported_ptypes(port_id, + j, num, ptypes[j]); + } j++; } @@ -3756,6 +3764,10 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, if (ptype_mask & all_ptypes[i]) { if (j < num - 1) { set_ptypes[j] = all_ptypes[i]; + + rte_ethdev_trace_set_ptypes(port_id, j, num, + set_ptypes[j]); + j++; continue; } @@ -3797,6 +3809,8 @@ rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, num = RTE_MIN(dev_info.max_mac_addrs, num); memcpy(ma, dev->data->mac_addrs, num * sizeof(ma[0])); + rte_eth_trace_macaddrs_get(port_id, num); + return num; } @@ -3817,6 +3831,8 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr); + rte_eth_trace_macaddr_get(port_id, mac_addr); + return 0; } @@ -3835,6 +3851,9 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) } *mtu = dev->data->mtu; + + rte_ethdev_trace_get_mtu(port_id, *mtu); + return 0; } @@ -3877,7 +3896,11 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) if (ret == 0) dev->data->mtu = mtu; - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_mtu(port_id, mtu, ret); + + return ret; } int @@ -3920,7 +3943,11 @@ rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) vfc->ids[vidx] &= ~RTE_BIT64(vbit); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_vlan_filter(port_id, vlan_id, on, ret); + + return ret; } int @@ -3941,6 +3968,8 @@ rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, return -ENOTSUP; (*dev->dev_ops->vlan_strip_queue_set)(dev, rx_queue_id, on); + rte_ethdev_trace_set_vlan_strip_on_queue(port_id, rx_queue_id, on); + return 0; } @@ -3950,14 +3979,19 @@ rte_eth_dev_set_vlan_ether_type(uint16_t port_id, uint16_t tpid) { 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->vlan_tpid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, - tpid)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, + tpid)); + + rte_ethdev_trace_set_vlan_ether_type(port_id, vlan_type, tpid, ret); + + return ret; } int @@ -4049,7 +4083,11 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) dev->data->dev_conf.rxmode.offloads = orig_offloads; } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_set_vlan_offload(port_id, offload_mask, ret); + + return ret; } int @@ -4075,6 +4113,8 @@ rte_eth_dev_get_vlan_offload(uint16_t port_id) if (*dev_offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) ret |= RTE_ETH_QINQ_STRIP_OFFLOAD; + rte_ethdev_trace_get_vlan_offload(port_id, ret); + return ret; } @@ -4082,19 +4122,25 @@ int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { 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->vlan_pvid_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + ret = eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); + + rte_ethdev_trace_set_vlan_pvid(port_id, pvid, on, ret); + + return ret; } int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4109,13 +4155,18 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_get == NULL) return -ENOTSUP; memset(fc_conf, 0, sizeof(*fc_conf)); - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_get(port_id, fc_conf, ret); + + return ret; } int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4134,7 +4185,11 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) if (*dev->dev_ops->flow_ctrl_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + ret = eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); + + rte_ethdev_trace_flow_ctrl_set(port_id, fc_conf, ret); + + return ret; } int @@ -4142,6 +4197,7 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4159,10 +4215,14 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, } /* High water, low water validation are device specific */ - if (*dev->dev_ops->priority_flow_ctrl_set) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) - (dev, pfc_conf)); - return -ENOTSUP; + if (*dev->dev_ops->priority_flow_ctrl_set == NULL) + return -ENOTSUP; + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) + (dev, pfc_conf)); + + rte_ethdev_trace_priority_flow_ctrl_set(port_id, pfc_conf, ret); + + return ret; } static int @@ -4220,6 +4280,7 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, struct rte_eth_pfc_queue_info *pfc_queue_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4230,10 +4291,15 @@ rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, return -EINVAL; } - if (*dev->dev_ops->priority_flow_ctrl_queue_info_get) - return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) + if (*dev->dev_ops->priority_flow_ctrl_queue_info_get == NULL) + return -ENOTSUP; + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_info_get) (dev, pfc_queue_info)); - return -ENOTSUP; + + rte_ethdev_trace_priority_flow_ctrl_queue_info_get(port_id, + pfc_queue_info, ret); + + return ret; } int @@ -4301,11 +4367,15 @@ rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, return ret; } - if (*dev->dev_ops->priority_flow_ctrl_queue_config) - return eth_err(port_id, - (*dev->dev_ops->priority_flow_ctrl_queue_config)( - dev, pfc_queue_conf)); - return -ENOTSUP; + if (*dev->dev_ops->priority_flow_ctrl_queue_config == NULL) + return -ENOTSUP; + ret = eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_queue_config) + (dev, pfc_queue_conf)); + + rte_ethdev_trace_priority_flow_ctrl_queue_configure(port_id, + pfc_queue_conf, ret); + + return ret; } static int @@ -4396,8 +4466,12 @@ rte_eth_dev_rss_reta_update(uint16_t port_id, if (*dev->dev_ops->reta_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_update(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4425,8 +4499,12 @@ rte_eth_dev_rss_reta_query(uint16_t port_id, if (*dev->dev_ops->reta_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, - reta_size)); + ret = eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, + reta_size)); + + rte_ethdev_trace_rss_reta_query(port_id, reta_conf, reta_size, ret); + + return ret; } int @@ -4470,8 +4548,12 @@ rte_eth_dev_rss_hash_update(uint16_t port_id, if (*dev->dev_ops->rss_hash_update == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_update(port_id, rss_conf, ret); + + return ret; } int @@ -4479,6 +4561,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4492,8 +4575,12 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, if (*dev->dev_ops->rss_hash_conf_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, - rss_conf)); + ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, + rss_conf)); + + rte_ethdev_trace_rss_hash_conf_get(port_id, rss_conf, ret); + + return ret; } int @@ -4501,6 +4588,7 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4519,8 +4607,12 @@ rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_add == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_add(port_id, udp_tunnel, ret); + + return ret; } int @@ -4528,6 +4620,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4546,34 +4639,48 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, if (*dev->dev_ops->udp_tunnel_port_del == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, + ret = eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel)); + + rte_ethdev_trace_udp_tunnel_port_delete(port_id, udp_tunnel, ret); + + return ret; } int rte_eth_led_on(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_led_on == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); + + rte_eth_trace_led_on(port_id, ret); + + return ret; } int rte_eth_led_off(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_led_off == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); + + rte_eth_trace_led_off(port_id, ret); + + return ret; } int @@ -4598,6 +4705,8 @@ rte_eth_fec_get_capability(uint16_t port_id, return -ENOTSUP; ret = (*dev->dev_ops->fec_get_capability)(dev, speed_fec_capa, num); + rte_eth_trace_fec_get_capability(port_id, speed_fec_capa, num, ret); + return ret; } @@ -4605,6 +4714,7 @@ int rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4618,20 +4728,29 @@ rte_eth_fec_get(uint16_t port_id, uint32_t *fec_capa) if (*dev->dev_ops->fec_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_get)(dev, fec_capa)); + + rte_eth_trace_fec_get(port_id, fec_capa, ret); + + return ret; } int rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) { 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->fec_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); + + rte_eth_trace_fec_set(port_id, fec_capa, ret); + + return ret; } /* @@ -4719,7 +4838,11 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, dev->data->mac_pool_sel[index] |= RTE_BIT64(pool); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_mac_addr_add(port_id, addr, pool, ret); + + return ret; } int @@ -4759,6 +4882,8 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) /* reset pool bitmap */ dev->data->mac_pool_sel[index] = 0; + rte_ethdev_trace_mac_addr_remove(port_id, addr); + return 0; } @@ -4791,6 +4916,8 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) /* Update default address in NIC data structure */ rte_ether_addr_copy(addr, &dev->data->mac_addrs[0]); + rte_ethdev_trace_default_mac_addr_set(port_id, addr); + return 0; } @@ -4881,21 +5008,29 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, &dev->data->hash_mac_addrs[index]); } - return eth_err(port_id, ret); + ret = eth_err(port_id, ret); + + rte_ethdev_trace_uc_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { 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->uc_all_hash_table_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, - on)); + ret = eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, on)); + + rte_ethdev_trace_uc_all_hash_table_set(port_id, on, ret); + + return ret; } int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, @@ -4931,14 +5066,19 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, if (*dev->dev_ops->set_queue_rate_limit == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, + ret = eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate)); + + rte_eth_trace_set_queue_rate_limit(port_id, queue_idx, tx_rate, ret); + + return ret; } int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, uint8_t avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4958,14 +5098,19 @@ int rte_eth_rx_avail_thresh_set(uint16_t port_id, uint16_t queue_id, } if (*dev->dev_ops->rx_queue_avail_thresh_set == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_set)(dev, queue_id, avail_thresh)); + + rte_eth_trace_rx_avail_thresh_set(port_id, queue_id, avail_thresh, ret); + + return ret; } int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, uint8_t *avail_thresh) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4977,8 +5122,12 @@ int rte_eth_rx_avail_thresh_query(uint16_t port_id, uint16_t *queue_id, if (*dev->dev_ops->rx_queue_avail_thresh_query == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_avail_thresh_query)(dev, queue_id, avail_thresh)); + + rte_eth_trace_rx_avail_thresh_query(port_id, *queue_id, ret); + + return ret; } RTE_INIT(eth_dev_init_fp_ops) @@ -5060,6 +5209,9 @@ rte_eth_dev_callback_register(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_register(port_id, event, cb_fn, cb_arg); + return 0; } @@ -5121,6 +5273,10 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } while (++next_port <= last_port); rte_spinlock_unlock(ð_dev_cb_lock); + + rte_ethdev_trace_callback_unregister(port_id, event, cb_fn, cb_arg, + ret); + return ret; } @@ -5150,6 +5306,9 @@ rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { vec = rte_intr_vec_list_index_get(intr_handle, qid); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl(port_id, qid, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5193,6 +5352,8 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id) (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec; fd = rte_intr_efds_index_get(intr_handle, efd_idx); + rte_ethdev_trace_rx_intr_ctl_q_get_fd(port_id, queue_id, fd); + return fd; } @@ -5226,6 +5387,9 @@ rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, vec = rte_intr_vec_list_index_get(intr_handle, queue_id); rc = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); + + rte_ethdev_trace_rx_intr_ctl_q(port_id, queue_id, epfd, op, data, rc); + if (rc && rc != -EEXIST) { RTE_ETHDEV_LOG(ERR, "p %u q %u Rx ctl error op %d epfd %d vec %u\n", @@ -5252,7 +5416,11 @@ rte_eth_dev_rx_intr_enable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_enable(port_id, queue_id, ret); + + return ret; } int @@ -5271,7 +5439,11 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, if (*dev->dev_ops->rx_queue_intr_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + ret = eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id)); + + rte_ethdev_trace_rx_intr_disable(port_id, queue_id, ret); + + return ret; } @@ -5329,6 +5501,8 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_rx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5368,6 +5542,9 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, cb, __ATOMIC_RELEASE); rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_add_first_rx_callback(port_id, queue_id, fn, user_param, + cb); + return cb; } @@ -5427,6 +5604,8 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_add_tx_callback(port_id, queue_id, fn, user_param, cb); + return cb; } @@ -5461,6 +5640,8 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_rx_cb_lock); + rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5495,6 +5676,8 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, } rte_spinlock_unlock(ð_dev_tx_cb_lock); + rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret); + return ret; } @@ -5541,6 +5724,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->rxq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->rx_queue_state[queue_id]; + rte_eth_trace_rx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5587,6 +5772,8 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, dev->dev_ops->txq_info_get(dev, queue_id, qinfo); qinfo->queue_state = dev->data->tx_queue_state[queue_id]; + rte_eth_trace_tx_queue_info_get(port_id, queue_id, qinfo); + return 0; } @@ -5595,6 +5782,7 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5614,8 +5802,12 @@ rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->rx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, + dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_rx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5623,6 +5815,7 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5642,8 +5835,12 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->tx_burst_mode_get == NULL) return -ENOTSUP; memset(mode, 0, sizeof(*mode)); - return eth_err(port_id, - dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + ret = eth_err(port_id, + dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); + + rte_eth_trace_tx_burst_mode_get(port_id, queue_id, mode, ret); + + return ret; } int @@ -5651,6 +5848,7 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, struct rte_power_monitor_cond *pmc) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5669,8 +5867,12 @@ rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, if (*dev->dev_ops->get_monitor_addr == NULL) return -ENOTSUP; - return eth_err(port_id, + ret = eth_err(port_id, dev->dev_ops->get_monitor_addr(dev->data->rx_queues[queue_id], pmc)); + + rte_eth_trace_get_monitor_addr(port_id, queue_id, pmc, ret); + + return ret; } int @@ -5679,40 +5881,56 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id, uint32_t nb_mc_addr) { 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->set_mc_addr_list == NULL) return -ENOTSUP; - return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, + ret = eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, mc_addr_set, nb_mc_addr)); + + rte_ethdev_trace_set_mc_addr_list(port_id, mc_addr_set, nb_mc_addr, + ret); + + return ret; } int rte_eth_timesync_enable(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->timesync_enable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); + + rte_eth_trace_timesync_enable(port_id, ret); + + return ret; } int rte_eth_timesync_disable(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->timesync_disable == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); + + rte_eth_trace_timesync_disable(port_id, ret); + + return ret; } int @@ -5720,6 +5938,7 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5733,8 +5952,14 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, if (*dev->dev_ops->timesync_read_rx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) - (dev, timestamp, flags)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) + (dev, timestamp, flags)); + + rte_eth_trace_timesync_read_rx_timestamp(port_id, timestamp, flags, + ret); + + return ret; } int @@ -5742,6 +5967,7 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5755,27 +5981,39 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id, if (*dev->dev_ops->timesync_read_tx_timestamp == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) - (dev, timestamp)); + + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) + (dev, timestamp)); + + rte_eth_trace_timesync_read_tx_timestamp(port_id, timestamp, ret); + + return ret; + } int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { 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->timesync_adjust_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + ret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta)); + + rte_eth_trace_timesync_adjust_time(port_id, delta, ret); + + return ret; } int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5789,14 +6027,19 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) if (*dev->dev_ops->timesync_read_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, + ret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, timestamp)); + + rte_eth_trace_timesync_read_time(port_id, timestamp, ret); + + return ret; } int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5810,14 +6053,19 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) if (*dev->dev_ops->timesync_write_time == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, + ret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, timestamp)); + + rte_eth_trace_timesync_write_time(port_id, timestamp, ret); + + return ret; } int rte_eth_read_clock(uint16_t port_id, uint64_t *clock) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5830,13 +6078,18 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) if (*dev->dev_ops->read_clock == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + ret = eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock)); + + rte_eth_trace_read_clock(port_id, clock, ret); + + return ret; } int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_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]; @@ -5850,26 +6103,36 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) if (*dev->dev_ops->get_reg == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); + + rte_ethdev_trace_get_reg_info(port_id, info, ret); + + return ret; } int rte_eth_dev_get_eeprom_length(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->get_eeprom_length == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); + + rte_ethdev_trace_get_eeprom_length(port_id, ret); + + return ret; } int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5883,13 +6146,18 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->get_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); + + rte_ethdev_trace_get_eeprom(port_id, info, ret); + + return ret; } int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5903,7 +6171,11 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) if (*dev->dev_ops->set_eeprom == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); + + rte_ethdev_trace_set_eeprom(port_id, info, ret); + + return ret; } int @@ -5911,6 +6183,7 @@ rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5924,7 +6197,11 @@ rte_eth_dev_get_module_info(uint16_t port_id, if (*dev->dev_ops->get_module_info == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_info)(dev, modinfo); + ret = (*dev->dev_ops->get_module_info)(dev, modinfo); + + rte_ethdev_trace_get_module_info(port_id, modinfo, ret); + + return ret; } int @@ -5932,6 +6209,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_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]; @@ -5959,7 +6237,11 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, if (*dev->dev_ops->get_module_eeprom == NULL) return -ENOTSUP; - return (*dev->dev_ops->get_module_eeprom)(dev, info); + ret = (*dev->dev_ops->get_module_eeprom)(dev, info); + + rte_ethdev_trace_get_module_eeprom(port_id, info, ret); + + return ret; } int @@ -5967,6 +6249,7 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -5982,7 +6265,11 @@ rte_eth_dev_get_dcb_info(uint16_t port_id, if (*dev->dev_ops->get_dcb_info == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + ret = eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); + + rte_ethdev_trace_get_dcb_info(port_id, dcb_info, ret); + + return ret; } static void @@ -6018,6 +6305,8 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, if (nb_tx_desc != NULL) eth_dev_adjust_nb_desc(nb_tx_desc, &dev_info.tx_desc_lim); + rte_ethdev_trace_adjust_nb_rx_tx_desc(port_id); + return 0; } @@ -6026,6 +6315,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, struct rte_eth_hairpin_cap *cap) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6040,13 +6330,18 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, if (*dev->dev_ops->hairpin_cap_get == NULL) return -ENOTSUP; memset(cap, 0, sizeof(*cap)); - return eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + ret = eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap)); + + rte_ethdev_trace_hairpin_capability_get(port_id, cap, ret); + + return ret; } int rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6061,7 +6356,11 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool) if (*dev->dev_ops->pool_ops_supported == NULL) return 1; /* all pools are supported */ - return (*dev->dev_ops->pool_ops_supported)(dev, pool); + ret = (*dev->dev_ops->pool_ops_supported)(dev, pool); + + rte_ethdev_trace_pool_ops_supported(port_id, pool, ret); + + return ret; } static int @@ -6352,19 +6651,25 @@ rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_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]; if (*dev->dev_ops->representor_info_get == NULL) return -ENOTSUP; - return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + ret = eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); + + rte_eth_trace_representor_info_get(port_id, info, ret); + + return ret; } int rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6383,8 +6688,12 @@ rte_eth_rx_metadata_negotiate(uint16_t port_id, uint64_t *features) if (*dev->dev_ops->rx_metadata_negotiate == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + ret = eth_err(port_id, + (*dev->dev_ops->rx_metadata_negotiate)(dev, features)); + + rte_eth_trace_rx_metadata_negotiate(port_id, *features, ret); + + return ret; } int @@ -6392,6 +6701,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *reassembly_capa) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6413,8 +6723,13 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, return -ENOTSUP; memset(reassembly_capa, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) + ret = eth_err(port_id, (*dev->dev_ops->ip_reassembly_capability_get) (dev, reassembly_capa)); + + rte_eth_trace_ip_reassembly_capability_get(port_id, reassembly_capa, + ret); + + return ret; } int @@ -6422,6 +6737,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6442,8 +6758,12 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_get == NULL) return -ENOTSUP; memset(conf, 0, sizeof(struct rte_eth_ip_reassembly_params)); - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + ret = eth_err(port_id, + (*dev->dev_ops->ip_reassembly_conf_get)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_get(port_id, conf, ret); + + return ret; } int @@ -6451,6 +6771,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, const struct rte_eth_ip_reassembly_params *conf) { struct rte_eth_dev *dev; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -6479,8 +6800,12 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (*dev->dev_ops->ip_reassembly_conf_set == NULL) return -ENOTSUP; - return eth_err(port_id, - (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + ret = eth_err(port_id, + (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); + + rte_eth_trace_ip_reassembly_conf_set(port_id, conf, ret); + + return ret; } int @@ -6578,8 +6903,12 @@ rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes return 0; for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) { - if (j < num) + if (j < num) { ptypes[j] = all_types[i]; + + rte_eth_trace_buffer_split_get_supported_hdr_ptypes( + port_id, j, ptypes[j]); + } j++; } diff --git a/lib/ethdev/rte_ethdev_cman.c b/lib/ethdev/rte_ethdev_cman.c index 4a1bdd7bd0..a9c4637521 100644 --- a/lib/ethdev/rte_ethdev_cman.c +++ b/lib/ethdev/rte_ethdev_cman.c @@ -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; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v11 3/6] ethdev: add trace points for ethdev (part two) 2023-02-08 17:12 ` [PATCH v11 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi @ 2023-02-08 20:09 ` Ferruh Yigit 0 siblings, 0 replies; 172+ messages in thread From: Ferruh Yigit @ 2023-02-08 20:09 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/8/2023 5:12 PM, Ankur Dwivedi wrote: > Adds trace points for remaining ethdev functions. > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > Acked-by: Sunil Kumar Kori <skori@marvell.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com> ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v11 4/6] ethdev: add trace points for flow 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi ` (2 preceding siblings ...) 2023-02-08 17:12 ` [PATCH v11 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi @ 2023-02-08 17:12 ` Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 5/6] ethdev: add trace points for mtr Ankur Dwivedi ` (3 subsequent siblings) 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 17:12 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Ori Kam <orika@nvidia.com> --- lib/ethdev/ethdev_trace.h | 503 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 117 +++++++ lib/ethdev/rte_flow.c | 356 +++++++++++++++++----- 3 files changed, 897 insertions(+), 79 deletions(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index aabdb3fbe0..f4f71a17cc 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -1383,6 +1383,280 @@ 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_ptr(actions); + 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_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_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_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), + uint8_t ingress = table_attr->flow_attr.ingress; + uint8_t egress = table_attr->flow_attr.egress; + uint8_t transfer = table_attr->flow_attr.transfer; + + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(table_attr->nb_flows); + rte_trace_point_emit_u32(table_attr->flow_attr.group); + rte_trace_point_emit_u32(table_attr->flow_attr.priority); + rte_trace_point_emit_u8(ingress); + rte_trace_point_emit_u8(egress); + rte_trace_point_emit_u8(transfer); + 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 */ @@ -1505,6 +1779,235 @@ 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_int(action->type); + rte_trace_point_emit_ptr(action->conf); + 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_u8(ingress); + rte_trace_point_emit_u8(egress); + rte_trace_point_emit_u8(transfer); + rte_trace_point_emit_ptr(action); + 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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 7a08104dc9..b8cbb285de 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 4da581146e..e52dcb1760 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -16,6 +16,8 @@ #include "rte_flow_driver.h" #include "rte_flow.h" +#include "ethdev_trace.h" + /* Mbuf dynamic field name for metadata. */ int32_t rte_flow_dynf_metadata_offs = -1; @@ -277,6 +279,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: @@ -363,7 +368,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, @@ -390,6 +399,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, @@ -413,7 +425,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, @@ -435,7 +451,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, @@ -460,7 +480,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, @@ -483,7 +507,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, @@ -1004,39 +1032,57 @@ rte_flow_conv(enum rte_flow_conv_op op, const void *src, struct rte_flow_error *error) { + int ret; + switch (op) { const struct rte_flow_attr *attr; case RTE_FLOW_CONV_OP_NONE: - return 0; + ret = 0; + break; case RTE_FLOW_CONV_OP_ATTR: attr = src; if (size > sizeof(*attr)) size = sizeof(*attr); rte_memcpy(dst, attr, size); - return sizeof(*attr); + ret = sizeof(*attr); + break; case RTE_FLOW_CONV_OP_ITEM: - return rte_flow_conv_pattern(dst, size, src, 1, error); + ret = rte_flow_conv_pattern(dst, size, src, 1, error); + break; case RTE_FLOW_CONV_OP_ACTION: - return rte_flow_conv_actions(dst, size, src, 1, error); + ret = rte_flow_conv_actions(dst, size, src, 1, error); + break; case RTE_FLOW_CONV_OP_PATTERN: - return rte_flow_conv_pattern(dst, size, src, 0, error); + ret = rte_flow_conv_pattern(dst, size, src, 0, error); + break; case RTE_FLOW_CONV_OP_ACTIONS: - return rte_flow_conv_actions(dst, size, src, 0, error); + ret = rte_flow_conv_actions(dst, size, src, 0, error); + break; case RTE_FLOW_CONV_OP_RULE: - return rte_flow_conv_rule(dst, size, src, error); + ret = rte_flow_conv_rule(dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ITEM_NAME: - return rte_flow_conv_name(0, 0, dst, size, src, error); + ret = rte_flow_conv_name(0, 0, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ACTION_NAME: - return rte_flow_conv_name(1, 0, dst, size, src, error); + ret = rte_flow_conv_name(1, 0, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ITEM_NAME_PTR: - return rte_flow_conv_name(0, 1, dst, size, src, error); + ret = rte_flow_conv_name(0, 1, dst, size, src, error); + break; case RTE_FLOW_CONV_OP_ACTION_NAME_PTR: - return rte_flow_conv_name(1, 1, dst, size, src, error); - } - return rte_flow_error_set + ret = rte_flow_conv_name(1, 1, dst, size, src, error); + break; + default: + ret = rte_flow_error_set (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "unknown object conversion operation"); + } + + rte_flow_trace_conv(op, dst, size, src, ret); + + return ret; } /** Store a full rte_flow description. */ @@ -1088,6 +1134,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; } @@ -1126,7 +1175,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1148,7 +1201,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1176,6 +1234,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; } @@ -1195,7 +1256,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 @@ -1215,7 +1280,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 @@ -1235,7 +1304,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 @@ -1247,14 +1320,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, @@ -1270,14 +1349,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, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1292,14 +1377,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, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1314,15 +1404,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, + error), + error); + + rte_flow_trace_tunnel_action_decap_release(port_id, actions, + num_of_actions, ret); + + return ret; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1337,14 +1433,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1357,6 +1458,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)) return -rte_errno; @@ -1368,9 +1470,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 * @@ -1393,6 +1499,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; } @@ -1410,7 +1519,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 @@ -1421,6 +1534,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; @@ -1435,9 +1549,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1481,7 +1599,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1532,6 +1654,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; } rte_flow_error_set(error, ENOTSUP, @@ -1547,17 +1673,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1618,6 +1750,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); + return template; } rte_flow_error_set(error, ENOTSUP, @@ -1633,17 +1769,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1708,6 +1850,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; } rte_flow_error_set(error, ENOTSUP, @@ -1723,17 +1872,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; } return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -1763,6 +1918,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; } @@ -1776,12 +1936,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 @@ -1791,10 +1957,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 @@ -1807,9 +1978,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 * @@ -1829,6 +2005,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); + return handle; } @@ -1846,7 +2027,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 @@ -1864,7 +2050,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 @@ -1882,5 +2074,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, + action_handle, data, user_data, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v11 5/6] ethdev: add trace points for mtr 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi ` (3 preceding siblings ...) 2023-02-08 17:12 ` [PATCH v11 4/6] ethdev: add trace points for flow Ankur Dwivedi @ 2023-02-08 17:12 ` Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 6/6] ethdev: add trace points for tm Ankur Dwivedi ` (2 subsequent siblings) 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 17:12 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_mtr specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> --- lib/ethdev/ethdev_trace.h | 206 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 63 ++++++++++ lib/ethdev/rte_mtr.c | 150 ++++++++++++++++++---- 3 files changed, 398 insertions(+), 21 deletions(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index f4f71a17cc..49a4bd6981 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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, @@ -1657,6 +1658,181 @@ 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_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_ptr(profile); + 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, + const struct rte_mtr_meter_policy_params *policy, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(policy); + 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, + const struct rte_mtr_meter_policy_params *policy, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(policy_id); + rte_trace_point_emit_ptr(policy); + 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 */ @@ -2008,6 +2184,36 @@ 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_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 diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index b8cbb285de..c34c06941c 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index 3954839531..4e94af9d9f 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -5,6 +5,7 @@ #include <stdint.h> #include <rte_errno.h> +#include "ethdev_trace.h" #include "rte_ethdev.h" #include "rte_mtr_driver.h" #include "rte_mtr.h" @@ -82,8 +83,13 @@ rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, capabilities_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_mtr_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* MTR meter profile add */ @@ -94,8 +100,14 @@ rte_mtr_meter_profile_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_add)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_add)(dev, meter_profile_id, profile, error); + + rte_mtr_trace_meter_profile_add(port_id, meter_profile_id, profile, + ret); + + return ret; } /** MTR meter profile delete */ @@ -105,8 +117,13 @@ rte_mtr_meter_profile_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_delete)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_delete(port_id, meter_profile_id, ret); + + return ret; } /** MTR meter profile get */ @@ -116,8 +133,13 @@ rte_mtr_meter_profile_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, + struct rte_flow_meter_profile *ret; + ret = RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, meter_profile_id, error); + + rte_mtr_trace_meter_profile_get(port_id, meter_profile_id, ret); + + return ret; } /* MTR meter policy validate */ @@ -127,8 +149,13 @@ rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_validate)(dev, policy, error); + + rte_mtr_trace_meter_policy_validate(port_id, policy, ret); + + return ret; } /* MTR meter policy add */ @@ -139,8 +166,13 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_add)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_add)(dev, policy_id, policy, error); + + rte_mtr_trace_meter_policy_add(port_id, policy_id, policy, ret); + + return ret; } /** MTR meter policy delete */ @@ -150,8 +182,13 @@ rte_mtr_meter_policy_delete(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_delete)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_delete(port_id, policy_id, ret); + + return ret; } /** MTR meter policy get */ @@ -161,8 +198,13 @@ rte_mtr_meter_policy_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, + struct rte_flow_meter_policy *ret; + ret = RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, policy_id, error); + + rte_mtr_trace_meter_policy_get(port_id, policy_id, ret); + + return ret; } /** MTR object create */ @@ -174,8 +216,13 @@ rte_mtr_create(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, create)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, create)(dev, mtr_id, params, shared, error); + + rte_mtr_trace_create(port_id, mtr_id, params, shared, ret); + + return ret; } /** MTR object destroy */ @@ -185,8 +232,13 @@ rte_mtr_destroy(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, destroy)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, destroy)(dev, mtr_id, error); + + rte_mtr_trace_destroy(port_id, mtr_id, ret); + + return ret; } /** MTR object meter enable */ @@ -196,8 +248,13 @@ rte_mtr_meter_enable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_enable)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_enable)(dev, mtr_id, error); + + rte_mtr_trace_meter_enable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter disable */ @@ -207,8 +264,13 @@ rte_mtr_meter_disable(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_disable)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_disable)(dev, mtr_id, error); + + rte_mtr_trace_meter_disable(port_id, mtr_id, ret); + + return ret; } /** MTR object meter profile update */ @@ -219,8 +281,13 @@ rte_mtr_meter_profile_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_profile_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_profile_update)(dev, mtr_id, meter_profile_id, error); + + rte_mtr_trace_meter_profile_update(port_id, mtr_id, meter_profile_id, ret); + + return ret; } /** MTR object meter policy update */ @@ -231,8 +298,13 @@ rte_mtr_meter_policy_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_policy_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_policy_update)(dev, mtr_id, meter_policy_id, error); + + rte_mtr_trace_meter_policy_update(port_id, mtr_id, meter_policy_id, ret); + + return ret; } /** MTR object meter DSCP table update */ @@ -243,8 +315,13 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_dscp_table_update)(dev, mtr_id, proto, dscp_table, error); + + rte_mtr_trace_meter_dscp_table_update(port_id, mtr_id, dscp_table, ret); + + return ret; } /** MTR object meter VLAN table update */ @@ -255,8 +332,13 @@ rte_mtr_meter_vlan_table_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, meter_vlan_table_update)(dev, mtr_id, proto, vlan_table, error); + + rte_mtr_trace_meter_vlan_table_update(port_id, mtr_id, vlan_table, ret); + + return ret; } /** Set the input color protocol on MTR object */ @@ -268,8 +350,13 @@ rte_mtr_color_in_protocol_set(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_set)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_set)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_set(port_id, mtr_id, proto, priority, ret); + + return ret; } /** Get input color protocols of MTR object */ @@ -280,8 +367,13 @@ rte_mtr_color_in_protocol_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_get)(dev, mtr_id, proto_mask, error); + + rte_mtr_trace_color_in_protocol_get(port_id, mtr_id, ret); + + return ret; } /** Get input color protocol priority of MTR object */ @@ -293,8 +385,13 @@ rte_mtr_color_in_protocol_priority_get(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, in_proto_prio_get)(dev, mtr_id, proto, priority, error); + + rte_mtr_trace_color_in_protocol_priority_get(port_id, mtr_id, proto, ret); + + return ret; } /** MTR object enabled stats update */ @@ -305,8 +402,13 @@ rte_mtr_stats_update(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_update)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, stats_update)(dev, mtr_id, stats_mask, error); + + rte_mtr_trace_stats_update(port_id, mtr_id, stats_mask, ret); + + return ret; } /** MTR object stats read */ @@ -319,6 +421,12 @@ rte_mtr_stats_read(uint16_t port_id, struct rte_mtr_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_MTR_FUNC(port_id, stats_read)(dev, + int ret; + ret = RTE_MTR_FUNC(port_id, stats_read)(dev, mtr_id, stats, stats_mask, clear, error); + + rte_mtr_trace_stats_read(port_id, mtr_id, stats, *stats_mask, clear, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* [PATCH v11 6/6] ethdev: add trace points for tm 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi ` (4 preceding siblings ...) 2023-02-08 17:12 ` [PATCH v11 5/6] ethdev: add trace points for mtr Ankur Dwivedi @ 2023-02-08 17:12 ` Ankur Dwivedi 2023-02-08 20:09 ` [PATCH v11 0/6] add trace points in ethdev library Ferruh Yigit 2023-02-26 18:34 ` Ali Alnubani 7 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-08 17:12 UTC (permalink / raw) To: dev Cc: thomas, david.marchand, mdr, orika, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb, Ankur Dwivedi Adds trace points for rte_tm specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> --- lib/ethdev/ethdev_trace.h | 304 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 90 +++++++++ lib/ethdev/rte_tm.c | 225 ++++++++++++++++++++--- 3 files changed, 590 insertions(+), 29 deletions(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 49a4bd6981..9fae22c490 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -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, @@ -1833,6 +1834,309 @@ 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_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_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(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(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_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_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_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 */ diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index c34c06941c..34d12e2859 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -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) diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 9709454f35..2d08141133 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -5,6 +5,7 @@ #include <stdint.h> #include <rte_errno.h> +#include "ethdev_trace.h" #include "rte_ethdev.h" #include "rte_tm_driver.h" #include "rte_tm.h" @@ -79,6 +80,9 @@ rte_tm_get_number_of_leaf_nodes(uint16_t port_id, } *n_leaf_nodes = dev->data->nb_tx_queues; + + rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes); + return 0; } @@ -90,8 +94,13 @@ rte_tm_node_type_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_type_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_type_get)(dev, node_id, is_leaf, error); + + rte_tm_trace_node_type_get(port_id, node_id, *is_leaf, ret); + + return ret; } /* Get capabilities */ @@ -100,8 +109,13 @@ int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, capabilities_get)(dev, cap, error); + + rte_tm_trace_capabilities_get(port_id, cap, ret); + + return ret; } /* Get level capabilities */ @@ -111,8 +125,13 @@ int rte_tm_level_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, level_capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev, level_id, cap, error); + + rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret); + + return ret; } /* Get node capabilities */ @@ -122,8 +141,13 @@ int rte_tm_node_capabilities_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_capabilities_get)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev, node_id, cap, error); + + rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret); + + return ret; } /* Add WRED profile */ @@ -133,8 +157,13 @@ int rte_tm_wred_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev, wred_profile_id, profile, error); + + rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, ret); + + return ret; } /* Delete WRED profile */ @@ -143,8 +172,13 @@ int rte_tm_wred_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, wred_profile_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev, wred_profile_id, error); + + rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret); + + return ret; } /* Add/update shared WRED context */ @@ -154,8 +188,15 @@ int rte_tm_shared_wred_context_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev, shared_wred_context_id, wred_profile_id, error); + + rte_tm_trace_shared_wred_context_add_update(port_id, + shared_wred_context_id, + wred_profile_id, ret); + + return ret; } /* Delete shared WRED context */ @@ -164,8 +205,14 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev, shared_wred_context_id, error); + + rte_tm_trace_shared_wred_context_delete(port_id, + shared_wred_context_id, ret); + + return ret; } /* Add shaper profile */ @@ -175,8 +222,14 @@ int rte_tm_shaper_profile_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev, shaper_profile_id, profile, error); + + rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile, + ret); + + return ret; } /* Delete WRED profile */ @@ -185,8 +238,13 @@ int rte_tm_shaper_profile_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev, shaper_profile_id, error); + + rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, ret); + + return ret; } /* Add shared shaper */ @@ -196,8 +254,14 @@ int rte_tm_shared_shaper_add_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev, shared_shaper_id, shaper_profile_id, error); + + rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id, + shaper_profile_id, ret); + + return ret; } /* Delete shared shaper */ @@ -206,8 +270,13 @@ int rte_tm_shared_shaper_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev, shared_shaper_id, error); + + rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, ret); + + return ret; } /* Add node to port traffic manager hierarchy */ @@ -221,9 +290,15 @@ int rte_tm_node_add(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_add)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_add)(dev, node_id, parent_node_id, priority, weight, level_id, params, error); + + rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority, + weight, level_id, params, ret); + + return ret; } /* Delete node from traffic manager hierarchy */ @@ -232,8 +307,13 @@ int rte_tm_node_delete(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_delete)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_delete)(dev, node_id, error); + + rte_tm_trace_node_delete(port_id, node_id, ret); + + return ret; } /* Suspend node */ @@ -242,8 +322,13 @@ int rte_tm_node_suspend(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_suspend)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_suspend)(dev, node_id, error); + + rte_tm_trace_node_suspend(port_id, node_id, ret); + + return ret; } /* Resume node */ @@ -252,8 +337,13 @@ int rte_tm_node_resume(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_resume)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_resume)(dev, node_id, error); + + rte_tm_trace_node_resume(port_id, node_id, ret); + + return ret; } /* Commit the initial port traffic manager hierarchy */ @@ -262,8 +352,13 @@ int rte_tm_hierarchy_commit(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, hierarchy_commit)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev, clear_on_fail, error); + + rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret); + + return ret; } /* Update node parent */ @@ -275,8 +370,14 @@ int rte_tm_node_parent_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_parent_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_parent_update)(dev, node_id, parent_node_id, priority, weight, error); + + rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id, + priority, weight, ret); + + return ret; } /* Update node private shaper */ @@ -286,8 +387,14 @@ int rte_tm_node_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shaper_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev, node_id, shaper_profile_id, error); + + rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id, + ret); + + return ret; } /* Update node shared shapers */ @@ -298,8 +405,14 @@ int rte_tm_node_shared_shaper_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev, node_id, shared_shaper_id, add, error); + + rte_tm_trace_node_shared_shaper_update(port_id, node_id, + shared_shaper_id, add, ret); + + return ret; } /* Update node stats */ @@ -309,8 +422,13 @@ int rte_tm_node_stats_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_stats_update)(dev, node_id, stats_mask, error); + + rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, ret); + + return ret; } /* Update WFQ weight mode */ @@ -321,8 +439,15 @@ int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev, node_id, wfq_weight_mode, n_sp_priorities, error); + + rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id, + wfq_weight_mode, + n_sp_priorities, ret); + + return ret; } /* Update node congestion management mode */ @@ -332,8 +457,13 @@ int rte_tm_node_cman_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_cman_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_cman_update)(dev, node_id, cman, error); + + rte_tm_trace_node_cman_update(port_id, node_id, cman, ret); + + return ret; } /* Update node private WRED context */ @@ -343,8 +473,14 @@ int rte_tm_node_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_wred_context_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev, node_id, wred_profile_id, error); + + rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id, + ret); + + return ret; } /* Update node shared WRED context */ @@ -355,8 +491,15 @@ int rte_tm_node_shared_wred_context_update(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev, node_id, shared_wred_context_id, add, error); + + rte_tm_trace_node_shared_wred_context_update(port_id, node_id, + shared_wred_context_id, + add, ret); + + return ret; } /* Read and/or clear stats counters for specific node */ @@ -368,8 +511,14 @@ int rte_tm_node_stats_read(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, node_stats_read)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, node_stats_read)(dev, node_id, stats, stats_mask, clear, error); + + rte_tm_trace_node_stats_read(port_id, node_id, stats, *stats_mask, + clear, ret); + + return ret; } /* Packet marking - VLAN DEI */ @@ -380,8 +529,14 @@ int rte_tm_mark_vlan_dei(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } /* Packet marking - IPv4/IPv6 ECN */ @@ -392,8 +547,14 @@ int rte_tm_mark_ip_ecn(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } /* Packet marking - IPv4/IPv6 DSCP */ @@ -404,6 +565,12 @@ int rte_tm_mark_ip_dscp(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; - return RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, + int ret; + ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev, mark_green, mark_yellow, mark_red, error); + + rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red, + ret); + + return ret; } -- 2.25.1 ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v11 0/6] add trace points in ethdev library 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi ` (5 preceding siblings ...) 2023-02-08 17:12 ` [PATCH v11 6/6] ethdev: add trace points for tm Ankur Dwivedi @ 2023-02-08 20:09 ` Ferruh Yigit 2023-02-26 18:34 ` Ali Alnubani 7 siblings, 0 replies; 172+ messages in thread From: Ferruh Yigit @ 2023-02-08 20:09 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 2/8/2023 5:12 PM, Ankur Dwivedi wrote: > This series adds trace points for functions in the ethdev library. > The trace points are added in ethdev, flow, mtr and tm files. > > v11: > - Added rte_trace_point_emit_blob to capture mac address list in > rte_ethdev_trace_set_mc_addr_list tracepoint. > - Added ack by Ori in patch (4/6) ethdev: add trace points for flow. > > v10: > - Removed const in basic types in tracepoint. > - Removed capture of pointer value where some fields in structure are > captured. > - Resolved RHEL 7 failure: > ../lib/ethdev/rte_ethdev.c:3260:2: error: 'for' loop initial declarations > are only allowed in C99 mode > - In patch (3/6) removed next_port and last_port in > rte_ethdev_trace_callback_register. > - In patch (3/6) simplified the return logic in > rte_eth_dev_priority_flow_ctrl_set, > rte_eth_dev_priority_flow_ctrl_queue_info_get and > rte_eth_dev_priority_flow_ctrl_queue_configure. > - In patch (4/6, 5/6 and 6/6), removed capture of structure fields in > tracepoint where the structure pointer can be null. > > 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 For series, Acked-by: Ferruh Yigit <ferruh.yigit@amd.com> Series applied to dpdk-next-net/main, thanks. ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v11 0/6] add trace points in ethdev library 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi ` (6 preceding siblings ...) 2023-02-08 20:09 ` [PATCH v11 0/6] add trace points in ethdev library Ferruh Yigit @ 2023-02-26 18:34 ` Ali Alnubani 2023-02-27 9:38 ` Ankur Dwivedi 7 siblings, 1 reply; 172+ messages in thread From: Ali Alnubani @ 2023-02-26 18:34 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: NBU-Contact-Thomas Monjalon (EXTERNAL), david.marchand, mdr, Ori Kam, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, Matan Azrad, Slava Ovsiienko, NBU-Contact-longli (EXTERNAL), spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb > -----Original Message----- > From: Ankur Dwivedi <adwivedi@marvell.com> > Sent: Wednesday, February 8, 2023 7:12 PM > To: dev@dpdk.org > Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>; > david.marchand@redhat.com; mdr@ashroe.eu; Ori Kam > <orika@nvidia.com>; ferruh.yigit@amd.com; chas3@att.com; > humin29@huawei.com; linville@tuxdriver.com; ciara.loftus@intel.com; > qi.z.zhang@intel.com; mw@semihalf.com; mk@semihalf.com; > shaibran@amazon.com; evgenys@amazon.com; igorch@amazon.com; > chandu@amd.com; irusskikh@marvell.com; > shepard.siegel@atomicrules.com; ed.czeck@atomicrules.com; > john.miller@atomicrules.com; ajit.khaparde@broadcom.com; > somnath.kotur@broadcom.com; jerinj@marvell.com; > mczekaj@marvell.com; sthotton@marvell.com; srinivasan@marvell.com; > hkalra@marvell.com; rahul.lakkireddy@chelsio.com; johndale@cisco.com; > hyonkim@cisco.com; liudongdong3@huawei.com; > yisen.zhuang@huawei.com; xuanziyang2@huawei.com; > cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; > simei.su@intel.com; wenjun1.wu@intel.com; qiming.yang@intel.com; > Yuying.Zhang@intel.com; beilei.xing@intel.com; xiao.w.wang@intel.com; > jingjing.wu@intel.com; junfeng.guo@intel.com; rosen.xu@intel.com; > ndabilpuram@marvell.com; kirankumark@marvell.com; skori@marvell.com; > skoteshwar@marvell.com; lironh@marvell.com; zr@semihalf.com; > radhac@marvell.com; vburru@marvell.com; sedara@marvell.com; Matan > Azrad <matan@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; > NBU-Contact-longli (EXTERNAL) <longli@microsoft.com>; spinler@cesnet.cz; > chaoyong.he@corigine.com; niklas.soderlund@corigine.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; g.singh@nxp.com; > apeksha.gupta@nxp.com; sachin.saxena@nxp.com; aboyer@pensando.io; > rmody@marvell.com; shshaikh@marvell.com; dsinghrawat@marvell.com; > andrew.rybchenko@oktetlabs.ru; jiawenwu@trustnetic.com; > jianwang@trustnetic.com; jbehrens@vmware.com; > maxime.coquelin@redhat.com; chenbo.xia@intel.com; > steven.webster@windriver.com; matt.peters@windriver.com; > bruce.richardson@intel.com; mtetsuyah@gmail.com; grive@u256.net; > jasvinder.singh@intel.com; cristian.dumitrescu@intel.com; > jgrajcia@cisco.com; mb@smartsharesystems.com; Ankur Dwivedi > <adwivedi@marvell.com> > Subject: [PATCH v11 0/6] add trace points in ethdev library > > This series adds trace points for functions in the ethdev library. > The trace points are added in ethdev, flow, mtr and tm files. > Hi Ankur, Testpmd segfaults at startup in debug mode on ppc64le, and git-bisect points to this patchset. Can you please have a look at this report and advise? https://bugs.dpdk.org/show_bug.cgi?id=1167 Thanks, Ali ^ permalink raw reply [flat|nested] 172+ messages in thread
* RE: [PATCH v11 0/6] add trace points in ethdev library 2023-02-26 18:34 ` Ali Alnubani @ 2023-02-27 9:38 ` Ankur Dwivedi 0 siblings, 0 replies; 172+ messages in thread From: Ankur Dwivedi @ 2023-02-27 9:38 UTC (permalink / raw) To: Ali Alnubani, dev Cc: NBU-Contact-Thomas Monjalon (EXTERNAL), david.marchand, mdr, Ori Kam, ferruh.yigit, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, Igor Russkikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, Jerin Jacob Kollanukkaran, Maciej Czekaj [C], Shijith Thotton, Srisivasubramanian Srinivasan, Harman Kalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda, Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Liron Himi, zr, Radha Chintakuntla, Veerasenareddy Burru, Sathesh B Edara, Matan Azrad, Slava Ovsiienko, NBU-Contact-longli (EXTERNAL), spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, Rasesh Mody, Shahed Shaikh, Devendra Singh Rawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb >> Subject: [PATCH v11 0/6] add trace points in ethdev library >> >> This series adds trace points for functions in the ethdev library. >> The trace points are added in ethdev, flow, mtr and tm files. >> > >Hi Ankur, > >Testpmd segfaults at startup in debug mode on ppc64le, and git-bisect points >to this patchset. > >Can you please have a look at this report and advise? >https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.dpdk.org_show- >5Fbug.cgi-3Fid- >3D1167&d=DwIGaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=ILjiNF3GF25y6QdHZUx >Ml6JrStU0MIuCtO5dMzn3Ybk&m=ad6ec2gAyVV5afbEEECkli0mGpPEcNRvH- >1nG- >w_L0RL5nEBXxJSx7S8dGsIZtez&s=WnG_4fFPmmCIrVd8C7ybl7UHp3FBwiVtUal >27pGGPY4&e= This bug is caused while assigning the bitfields variables in conf structure to local variables. uint16_t peer_count = conf->peer_count; uint8_t tx_explicit = conf->tx_explicit; ... This happens during trace point registration. The address in conf pointer is 0x1100c which looks like an invalid address. So referencing the pointer causes the segmentation fault. It looks to me, that the bit fields inside a structure cannot be captured like this as structure pointer can contain stale or invalid address at trace point registration. I will send a patch to fix this bug. > >Thanks, >Ali ^ permalink raw reply [flat|nested] 172+ messages in thread
* Re: [PATCH v6 0/6] add trace points in ethdev library 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi ` (6 preceding siblings ...) 2023-01-23 9:02 ` [PATCH v7 0/6] add trace points in ethdev library Ankur Dwivedi @ 2023-01-23 17:30 ` Ferruh Yigit 7 siblings, 0 replies; 172+ messages in thread From: Ferruh Yigit @ 2023-01-23 17:30 UTC (permalink / raw) To: Ankur Dwivedi, dev Cc: thomas, david.marchand, mdr, orika, chas3, humin29, linville, ciara.loftus, qi.z.zhang, mw, mk, shaibran, evgenys, igorch, chandu, irusskikh, shepard.siegel, ed.czeck, john.miller, ajit.khaparde, somnath.kotur, jerinj, mczekaj, sthotton, srinivasan, hkalra, rahul.lakkireddy, johndale, hyonkim, liudongdong3, yisen.zhuang, xuanziyang2, cloud.wangxiaoyun, zhouguoyang, simei.su, wenjun1.wu, qiming.yang, Yuying.Zhang, beilei.xing, xiao.w.wang, jingjing.wu, junfeng.guo, rosen.xu, ndabilpuram, kirankumark, skori, skoteshwar, lironh, zr, radhac, vburru, sedara, matan, viacheslavo, longli, spinler, chaoyong.he, niklas.soderlund, hemant.agrawal, sachin.saxena, g.singh, apeksha.gupta, sachin.saxena, aboyer, rmody, shshaikh, dsinghrawat, andrew.rybchenko, jiawenwu, jianwang, jbehrens, maxime.coquelin, chenbo.xia, steven.webster, matt.peters, bruce.richardson, mtetsuyah, grive, jasvinder.singh, cristian.dumitrescu, jgrajcia, mb On 1/20/2023 8:40 AM, Ankur Dwivedi wrote: > This series adds trace points for functions in the ethdev library. > The trace points are added in ethdev, flow, mtr and tm files. > > 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 > Hi Ankur, I put some comments on 2/6 and some of them are generic comments, can you please apply them to whole series first, later I can continue the review on next versions. Thanks, ferruh ^ permalink raw reply [flat|nested] 172+ messages in thread
end of thread, other threads:[~2023-03-16 10:01 UTC | newest] Thread overview: 172+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-08-04 13:44 [PATCH 0/6] add trace points in ethdev library Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 1/6] ethdev: add trace points Ankur Dwivedi 2022-09-12 11:00 ` Andrew Rybchenko 2022-09-13 6:48 ` [EXT] " Ankur Dwivedi 2022-09-13 7:18 ` Andrew Rybchenko 2022-09-26 15:03 ` Andrew Rybchenko 2022-09-28 4:02 ` Jerin Jacob 2022-08-04 13:44 ` [PATCH 2/6] ethdev: add trace points for flow Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 3/6] ethdev: add trace points for mtr Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 4/6] ethdev: add trace points for tm Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 5/6] ethdev: add trace points for driver Ankur Dwivedi 2022-08-04 13:44 ` [PATCH 6/6] devtools: add trace function check in checkpatch Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 0/4] add trace points in ethdev library Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 1/4] ethdev: add trace points Ankur Dwivedi 2022-10-06 7:09 ` Andrew Rybchenko 2022-10-06 7:24 ` [EXT] " Ankur Dwivedi 2022-10-06 7:27 ` Andrew Rybchenko 2022-10-06 7:43 ` Ankur Dwivedi 2022-10-06 7:50 ` Andrew Rybchenko 2022-10-06 7:57 ` David Marchand 2022-10-12 9:49 ` Jerin Jacob 2022-10-12 9:56 ` David Marchand 2022-09-29 10:29 ` [PATCH v2 2/4] ethdev: add trace points for flow Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 3/4] ethdev: add trace points for mtr Ankur Dwivedi 2022-09-29 10:29 ` [PATCH v2 4/4] ethdev: add trace points for tm Ankur Dwivedi 2022-10-06 7:10 ` [PATCH v2 0/4] add trace points in ethdev library Andrew Rybchenko 2022-10-06 7:26 ` [EXT] " Ankur Dwivedi 2022-10-06 7:28 ` Andrew Rybchenko 2022-10-06 7:47 ` Ankur Dwivedi 2022-10-06 12:55 ` Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 " Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi 2022-10-06 16:03 ` Morten Brørup 2022-10-07 16:23 ` Ankur Dwivedi 2022-10-10 6:39 ` Ankur Dwivedi 2022-12-12 18:34 ` Ferruh Yigit 2022-12-12 18:38 ` Ferruh Yigit 2022-12-14 10:34 ` David Marchand 2022-12-14 11:04 ` Ferruh Yigit 2022-12-13 20:06 ` Ferruh Yigit 2022-12-14 10:40 ` Jerin Jacob 2022-12-14 12:10 ` Ferruh Yigit 2022-12-15 6:49 ` Jerin Jacob 2023-01-12 9:10 ` Thomas Monjalon 2023-01-12 9:43 ` trace point symbols Morten Brørup 2023-01-13 11:22 ` Jerin Jacob 2022-12-14 13:52 ` [EXT] Re: [PATCH v3 1/4] ethdev: add trace points Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 2/4] ethdev: add trace points for flow Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 3/4] ethdev: add trace points for mtr Ankur Dwivedi 2022-10-06 15:18 ` [PATCH v3 4/4] ethdev: add trace points for tm Ankur Dwivedi 2022-12-22 6:32 ` [PATCH v4 0/6] add trace points in ethdev library Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 1/6] eal: trace: add trace point emit for array Ankur Dwivedi 2022-12-22 9:06 ` Sunil Kumar Kori 2022-12-22 10:32 ` Morten Brørup 2022-12-22 15:18 ` Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 2/6] ethdev: add trace points for ethdev Ankur Dwivedi 2022-12-22 10:50 ` Morten Brørup 2022-12-22 6:33 ` [PATCH v4 3/6] ethdev: add trace points for remaining functions Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 4/6] ethdev: add trace points for flow Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 5/6] ethdev: add trace points for mtr Ankur Dwivedi 2022-12-22 6:33 ` [PATCH v4 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 0/6] add trace points in ethdev library Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-01-12 12:38 ` Morten Brørup 2023-01-12 13:22 ` Ankur Dwivedi 2023-01-12 16:29 ` Sunil Kumar Kori 2023-01-12 16:43 ` Sunil Kumar Kori 2023-01-12 11:21 ` [PATCH v5 2/6] ethdev: add trace points for ethdev Ankur Dwivedi 2023-01-12 16:34 ` Sunil Kumar Kori 2023-01-12 11:21 ` [PATCH v5 3/6] ethdev: add trace points for remaining functions Ankur Dwivedi 2023-01-12 16:38 ` Sunil Kumar Kori 2023-01-13 6:31 ` Ankur Dwivedi 2023-01-13 8:11 ` Sunil Kumar Kori 2023-01-12 11:21 ` [PATCH v5 4/6] ethdev: add trace points for flow Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 5/6] ethdev: add trace points for mtr Ankur Dwivedi 2023-01-12 11:21 ` [PATCH v5 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-01-12 17:03 ` [PATCH v5 0/6] add trace points in ethdev library Ferruh Yigit 2023-01-13 6:32 ` [EXT] " Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 " Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-01-20 10:11 ` Morten Brørup 2023-01-23 17:27 ` Ferruh Yigit 2023-01-25 15:02 ` [EXT] " Ankur Dwivedi 2023-01-25 16:09 ` Ferruh Yigit 2023-01-30 13:35 ` Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi 2023-01-23 17:28 ` Ferruh Yigit 2023-01-30 16:01 ` [EXT] " Ankur Dwivedi 2023-01-31 18:38 ` Ferruh Yigit 2023-01-31 18:46 ` Jerin Jacob 2023-01-31 22:20 ` Ferruh Yigit 2023-02-01 8:31 ` Jerin Jacob 2023-02-01 10:50 ` Ferruh Yigit 2023-02-01 15:42 ` Ankur Dwivedi 2023-02-02 8:56 ` Ferruh Yigit 2023-02-02 10:20 ` Ankur Dwivedi 2023-02-02 12:52 ` Ferruh Yigit 2023-02-02 13:40 ` Ankur Dwivedi 2023-02-02 13:44 ` Ferruh Yigit 2023-02-02 13:53 ` Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 4/6] ethdev: add trace points for flow Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 5/6] ethdev: add trace points for mtr Ankur Dwivedi 2023-01-20 8:40 ` [PATCH v6 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-01-23 9:02 ` [PATCH v7 0/6] add trace points in ethdev library Ankur Dwivedi 2023-01-23 9:02 ` [PATCH v7 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-01-23 13:01 ` Jerin Jacob 2023-01-23 13:08 ` Morten Brørup 2023-01-23 13:39 ` Ankur Dwivedi 2023-01-30 7:30 ` Sunil Kumar Kori 2023-01-30 8:15 ` Morten Brørup 2023-01-30 8:40 ` Sunil Kumar Kori 2023-01-23 9:02 ` [PATCH v7 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi 2023-01-30 8:45 ` Sunil Kumar Kori 2023-01-23 9:02 ` [PATCH v7 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi 2023-01-30 8:47 ` Sunil Kumar Kori 2023-01-23 9:02 ` [PATCH v7 4/6] ethdev: add trace points for flow Ankur Dwivedi 2023-02-02 13:52 ` Ori Kam 2023-02-02 13:56 ` Ori Kam 2023-02-02 15:45 ` Ankur Dwivedi 2023-01-23 9:02 ` [PATCH v7 5/6] ethdev: add trace points for mtr Ankur Dwivedi 2023-01-30 8:50 ` Sunil Kumar Kori 2023-01-23 9:02 ` [PATCH v7 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-02-06 14:48 ` David Marchand 2023-02-07 5:08 ` [EXT] " Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 4/6] ethdev: add trace points for flow Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 5/6] ethdev: add trace points for mtr Ankur Dwivedi 2023-02-06 11:58 ` [PATCH v8 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-02-08 1:16 ` Ferruh Yigit 2023-02-07 6:32 ` [PATCH v9 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi 2023-02-08 1:16 ` Ferruh Yigit 2023-02-08 10:30 ` [EXT] " Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi 2023-02-08 1:20 ` Ferruh Yigit 2023-02-08 10:42 ` [EXT] " Ankur Dwivedi 2023-02-08 11:00 ` Ferruh Yigit 2023-02-08 11:04 ` Ferruh Yigit 2023-02-08 14:15 ` Ankur Dwivedi 2023-02-08 15:05 ` Ferruh Yigit 2023-02-08 15:11 ` Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 4/6] ethdev: add trace points for flow Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 5/6] ethdev: add trace points for mtr Ankur Dwivedi 2023-02-07 6:32 ` [PATCH v9 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 4/6] ethdev: add trace points for flow Ankur Dwivedi 2023-02-08 16:15 ` Ori Kam 2023-02-08 13:28 ` [PATCH v10 5/6] ethdev: add trace points for mtr Ankur Dwivedi 2023-02-08 13:28 ` [PATCH v10 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-03-15 7:14 ` Yuan, DukaiX 2023-03-16 9:58 ` Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 0/6] add trace points in ethdev library Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 1/6] eal: trace: add trace point emit for blob Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 2/6] ethdev: add trace points for ethdev (part one) Ankur Dwivedi 2023-02-17 7:32 ` Li, WeiyuanX 2023-02-08 17:12 ` [PATCH v11 3/6] ethdev: add trace points for ethdev (part two) Ankur Dwivedi 2023-02-08 20:09 ` Ferruh Yigit 2023-02-08 17:12 ` [PATCH v11 4/6] ethdev: add trace points for flow Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 5/6] ethdev: add trace points for mtr Ankur Dwivedi 2023-02-08 17:12 ` [PATCH v11 6/6] ethdev: add trace points for tm Ankur Dwivedi 2023-02-08 20:09 ` [PATCH v11 0/6] add trace points in ethdev library Ferruh Yigit 2023-02-26 18:34 ` Ali Alnubani 2023-02-27 9:38 ` Ankur Dwivedi 2023-01-23 17:30 ` [PATCH v6 " Ferruh Yigit
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).