| 630 | static rte_spinlock_t rte_cryptodev_callback_lock = RTE_SPINLOCK_INITIALIZER; |
| 631 | |
| 632 | static void |
| 633 | cryptodev_cb_cleanup(struct rte_cryptodev *dev) |
| 634 | { |
| 635 | struct rte_cryptodev_cb_rcu *list; |
| 636 | struct rte_cryptodev_cb *cb, *next; |
| 637 | uint16_t qp_id; |
| 638 | |
| 639 | if (dev->enq_cbs == NULL && dev->deq_cbs == NULL) |
| 640 | return; |
| 641 | |
| 642 | for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) { |
| 643 | list = &dev->enq_cbs[qp_id]; |
| 644 | cb = list->next; |
| 645 | while (cb != NULL) { |
| 646 | next = cb->next; |
| 647 | rte_free(cb); |
| 648 | cb = next; |
| 649 | } |
| 650 | |
| 651 | rte_free(list->qsbr); |
| 652 | } |
| 653 | |
| 654 | for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) { |
| 655 | list = &dev->deq_cbs[qp_id]; |
| 656 | cb = list->next; |
| 657 | while (cb != NULL) { |
| 658 | next = cb->next; |
| 659 | rte_free(cb); |
| 660 | cb = next; |
| 661 | } |
| 662 | |
| 663 | rte_free(list->qsbr); |
| 664 | } |
| 665 | |
| 666 | rte_free(dev->enq_cbs); |
| 667 | dev->enq_cbs = NULL; |
| 668 | rte_free(dev->deq_cbs); |
| 669 | dev->deq_cbs = NULL; |
| 670 | } |
| 671 | |
| 672 | static int |
| 673 | cryptodev_cb_init(struct rte_cryptodev *dev) |
no test coverage detected