| 5917 | } |
| 5918 | |
| 5919 | int |
| 5920 | rte_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(ð_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(ð_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 | |
| 5955 | int |
| 5956 | rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, |
no test coverage detected