* Enqueue a burst of operations for processing on a crypto device. * * The rte_cryptodev_enqueue_burst() function is invoked to place * crypto operations on the queue *qp_id* of the device designated by * its *dev_id*. * * The *nb_ops* parameter is the number of operations to process which are * supplied in the *ops* array of *rte_crypto_op* structures. * * The rte_cryptodev_enqueue_burst
| 1968 | * a *rte_crypto_op*. |
| 1969 | */ |
| 1970 | static inline uint16_t |
| 1971 | rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, |
| 1972 | struct rte_crypto_op **ops, uint16_t nb_ops) |
| 1973 | { |
| 1974 | const struct rte_crypto_fp_ops *fp_ops; |
| 1975 | void *qp; |
| 1976 | |
| 1977 | fp_ops = &rte_crypto_fp_ops[dev_id]; |
| 1978 | qp = fp_ops->qp.data[qp_id]; |
| 1979 | #ifdef RTE_CRYPTO_CALLBACKS |
| 1980 | if (unlikely(fp_ops->qp.enq_cb[qp_id].next != NULL)) { |
| 1981 | struct rte_cryptodev_cb_rcu *list; |
| 1982 | struct rte_cryptodev_cb *cb; |
| 1983 | |
| 1984 | /* rte_memory_order_release memory order was used when the |
| 1985 | * call back was inserted into the list. |
| 1986 | * Since there is a clear dependency between loading |
| 1987 | * cb and cb->fn/cb->next, rte_memory_order_acquire memory order is |
| 1988 | * not required. |
| 1989 | */ |
| 1990 | list = &fp_ops->qp.enq_cb[qp_id]; |
| 1991 | rte_rcu_qsbr_thread_online(list->qsbr, 0); |
| 1992 | cb = rte_atomic_load_explicit(&list->next, rte_memory_order_relaxed); |
| 1993 | |
| 1994 | while (cb != NULL) { |
| 1995 | nb_ops = cb->fn(dev_id, qp_id, ops, nb_ops, |
| 1996 | cb->arg); |
| 1997 | cb = cb->next; |
| 1998 | }; |
| 1999 | |
| 2000 | rte_rcu_qsbr_thread_offline(list->qsbr, 0); |
| 2001 | } |
| 2002 | #endif |
| 2003 | |
| 2004 | rte_cryptodev_trace_enqueue_burst(dev_id, qp_id, (void **)ops, nb_ops); |
| 2005 | return fp_ops->enqueue_burst(qp, ops, nb_ops); |
| 2006 | } |
| 2007 | |
| 2008 | |
| 2009 |