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

Function rte_eth_remove_rx_callback

dpdk/lib/ethdev/rte_ethdev.c:5883–5917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5881}
5882
5883int
5884rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
5885 const struct rte_eth_rxtx_callback *user_cb)
5886{
5887#ifndef RTE_ETHDEV_RXTX_CALLBACKS
5888 return -ENOTSUP;
5889#endif
5890 /* Check input parameters. */
5891 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
5892 if (user_cb == NULL ||
5893 queue_id >= rte_eth_devices[port_id].data->nb_rx_queues)
5894 return -EINVAL;
5895
5896 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
5897 struct rte_eth_rxtx_callback *cb;
5898 RTE_ATOMIC(struct rte_eth_rxtx_callback *) *prev_cb;
5899 int ret = -EINVAL;
5900
5901 rte_spinlock_lock(&eth_dev_rx_cb_lock);
5902 prev_cb = &dev->post_rx_burst_cbs[queue_id];
5903 for (; *prev_cb != NULL; prev_cb = &cb->next) {
5904 cb = *prev_cb;
5905 if (cb == user_cb) {
5906 /* Remove the user cb from the callback list. */
5907 rte_atomic_store_explicit(prev_cb, cb->next, rte_memory_order_relaxed);
5908 ret = 0;
5909 break;
5910 }
5911 }
5912 rte_spinlock_unlock(&eth_dev_rx_cb_lock);
5913
5914 rte_eth_trace_remove_rx_callback(port_id, queue_id, user_cb, ret);
5915
5916 return ret;
5917}
5918
5919int
5920rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,

Callers 5

rte_latencystats_uninitFunction · 0.85
bpf_eth_unloadFunction · 0.85
remove_rx_dump_callbacksFunction · 0.85

Calls 2

rte_spinlock_lockFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected