1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2018 Intel Corporation
5 #include "ethdev_profile.h"
8 * This conditional block enables Ethernet device profiling with
9 * Intel (R) VTune (TM) Amplifier.
11 #ifdef RTE_ETHDEV_PROFILE_WITH_VTUNE
14 * Hook callback to trace rte_eth_rx_burst() calls.
17 profile_hook_rx_burst_cb(
18 __rte_unused uint16_t port_id, __rte_unused uint16_t queue_id,
19 __rte_unused struct rte_mbuf *pkts[], uint16_t nb_pkts,
20 __rte_unused uint16_t max_pkts, __rte_unused void *user_param)
26 * Setting profiling rx callback for a given Ethernet device.
27 * This function must be invoked when ethernet device is being configured.
30 * The port identifier of the Ethernet device.
32 * The number of RX queues on specified port.
36 * - On failure, a negative value.
39 vtune_profile_rx_init(uint16_t port_id, uint8_t rx_queue_num)
43 for (q_id = 0; q_id < rx_queue_num; ++q_id) {
44 if (!rte_eth_add_rx_callback(
45 port_id, q_id, profile_hook_rx_burst_cb, NULL)) {
52 #endif /* RTE_ETHDEV_PROFILE_WITH_VTUNE */
55 __rte_eth_dev_profile_init(__rte_unused uint16_t port_id,
56 __rte_unused struct rte_eth_dev *dev)
58 #ifdef RTE_ETHDEV_PROFILE_WITH_VTUNE
59 return vtune_profile_rx_init(port_id, dev->data->nb_rx_queues);