| 5881 | } |
| 5882 | |
| 5883 | int |
| 5884 | rte_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(ð_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(ð_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 | |
| 5919 | int |
| 5920 | rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, |
no test coverage detected