MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_eth_remove_tx_callback

Function rte_eth_remove_tx_callback

dpdk/lib/ethdev/rte_ethdev.c:5919–5953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5917}
5918
5919int
5920rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
5921 const struct rte_eth_rxtx_callback *user_cb)
5922{
5923#ifndef RTE_ETHDEV_RXTX_CALLBACKS
5924 return -ENOTSUP;
5925#endif
5926 /* Check input parameters. */
5927 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
5928 if (user_cb == NULL ||
5929 queue_id >= rte_eth_devices[port_id].data->nb_tx_queues)
5930 return -EINVAL;
5931
5932 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
5933 int ret = -EINVAL;
5934 struct rte_eth_rxtx_callback *cb;
5935 RTE_ATOMIC(struct rte_eth_rxtx_callback *) *prev_cb;
5936
5937 rte_spinlock_lock(&eth_dev_tx_cb_lock);
5938 prev_cb = &dev->pre_tx_burst_cbs[queue_id];
5939 for (; *prev_cb != NULL; prev_cb = &cb->next) {
5940 cb = *prev_cb;
5941 if (cb == user_cb) {
5942 /* Remove the user cb from the callback list. */
5943 rte_atomic_store_explicit(prev_cb, cb->next, rte_memory_order_relaxed);
5944 ret = 0;
5945 break;
5946 }
5947 }
5948 rte_spinlock_unlock(&eth_dev_tx_cb_lock);
5949
5950 rte_eth_trace_remove_tx_callback(port_id, queue_id, user_cb, ret);
5951
5952 return ret;
5953}
5954
5955int
5956rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,

Callers 6

rte_latencystats_uninitFunction · 0.85
bpf_eth_unloadFunction · 0.85
remove_tx_dump_callbacksFunction · 0.85
remove_tx_md_callbackFunction · 0.85
remove_tx_dynf_callbackFunction · 0.85

Calls 2

rte_spinlock_lockFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected