| 177 | } |
| 178 | |
| 179 | int |
| 180 | rte_eth_dev_callback_process(struct rte_eth_dev *dev, |
| 181 | enum rte_eth_event_type event, void *ret_param) |
| 182 | { |
| 183 | struct rte_eth_dev_callback *cb_lst; |
| 184 | struct rte_eth_dev_callback dev_cb; |
| 185 | int rc = 0; |
| 186 | |
| 187 | rte_spinlock_lock(ð_dev_cb_lock); |
| 188 | TAILQ_FOREACH(cb_lst, &(dev->link_intr_cbs), next) { |
| 189 | if (cb_lst->cb_fn == NULL || cb_lst->event != event) |
| 190 | continue; |
| 191 | dev_cb = *cb_lst; |
| 192 | cb_lst->active = 1; |
| 193 | if (ret_param != NULL) |
| 194 | dev_cb.ret_param = ret_param; |
| 195 | |
| 196 | rte_spinlock_unlock(ð_dev_cb_lock); |
| 197 | rc = dev_cb.cb_fn(dev->data->port_id, dev_cb.event, |
| 198 | dev_cb.cb_arg, dev_cb.ret_param); |
| 199 | rte_spinlock_lock(ð_dev_cb_lock); |
| 200 | cb_lst->active = 0; |
| 201 | } |
| 202 | rte_spinlock_unlock(ð_dev_cb_lock); |
| 203 | return rc; |
| 204 | } |
| 205 | |
| 206 | void |
| 207 | rte_eth_dev_probing_finish(struct rte_eth_dev *dev) |