| 1029 | } |
| 1030 | |
| 1031 | void |
| 1032 | rte_bbdev_pmd_callback_process(struct rte_bbdev *dev, |
| 1033 | enum rte_bbdev_event_type event, void *ret_param) |
| 1034 | { |
| 1035 | struct rte_bbdev_callback *cb_lst; |
| 1036 | struct rte_bbdev_callback dev_cb; |
| 1037 | |
| 1038 | if (dev == NULL) { |
| 1039 | rte_bbdev_log(ERR, "NULL device"); |
| 1040 | return; |
| 1041 | } |
| 1042 | |
| 1043 | if (dev->data == NULL) { |
| 1044 | rte_bbdev_log(ERR, "NULL data structure"); |
| 1045 | return; |
| 1046 | } |
| 1047 | |
| 1048 | if (event >= RTE_BBDEV_EVENT_MAX) { |
| 1049 | rte_bbdev_log(ERR, |
| 1050 | "Invalid event type (%u), should be less than %u", |
| 1051 | event, RTE_BBDEV_EVENT_MAX); |
| 1052 | return; |
| 1053 | } |
| 1054 | |
| 1055 | rte_spinlock_lock(&rte_bbdev_cb_lock); |
| 1056 | TAILQ_FOREACH(cb_lst, &(dev->list_cbs), next) { |
| 1057 | if (cb_lst->cb_fn == NULL || cb_lst->event != event) |
| 1058 | continue; |
| 1059 | dev_cb = *cb_lst; |
| 1060 | cb_lst->active = 1; |
| 1061 | if (ret_param != NULL) |
| 1062 | dev_cb.ret_param = ret_param; |
| 1063 | |
| 1064 | rte_spinlock_unlock(&rte_bbdev_cb_lock); |
| 1065 | dev_cb.cb_fn(dev->data->dev_id, dev_cb.event, |
| 1066 | dev_cb.cb_arg, dev_cb.ret_param); |
| 1067 | rte_spinlock_lock(&rte_bbdev_cb_lock); |
| 1068 | cb_lst->active = 0; |
| 1069 | } |
| 1070 | rte_spinlock_unlock(&rte_bbdev_cb_lock); |
| 1071 | } |
| 1072 | |
| 1073 | int |
| 1074 | rte_bbdev_queue_intr_enable(uint16_t dev_id, uint16_t queue_id) |