1691e1f4dSAkhil Goyal /* SPDX-License-Identifier: BSD-3-Clause 2691e1f4dSAkhil Goyal * Copyright(C) 2021 Marvell. 3691e1f4dSAkhil Goyal */ 4691e1f4dSAkhil Goyal 5691e1f4dSAkhil Goyal #ifndef _RTE_CRYPTODEV_CORE_H_ 6691e1f4dSAkhil Goyal #define _RTE_CRYPTODEV_CORE_H_ 7691e1f4dSAkhil Goyal 8691e1f4dSAkhil Goyal /** 9691e1f4dSAkhil Goyal * @file 10691e1f4dSAkhil Goyal * 11691e1f4dSAkhil Goyal * RTE Crypto Device internal header. 12691e1f4dSAkhil Goyal * 13691e1f4dSAkhil Goyal * This header contains internal data types. But they are still part of the 14691e1f4dSAkhil Goyal * public API because they are used by inline functions in the published API. 15691e1f4dSAkhil Goyal * 16691e1f4dSAkhil Goyal * Applications should not use these directly. 17691e1f4dSAkhil Goyal * 18691e1f4dSAkhil Goyal */ 19691e1f4dSAkhil Goyal 20691e1f4dSAkhil Goyal typedef uint16_t (*dequeue_pkt_burst_t)(void *qp, 21691e1f4dSAkhil Goyal struct rte_crypto_op **ops, uint16_t nb_ops); 22691e1f4dSAkhil Goyal /**< Dequeue processed packets from queue pair of a device. */ 23691e1f4dSAkhil Goyal 24691e1f4dSAkhil Goyal typedef uint16_t (*enqueue_pkt_burst_t)(void *qp, 25691e1f4dSAkhil Goyal struct rte_crypto_op **ops, uint16_t nb_ops); 26691e1f4dSAkhil Goyal /**< Enqueue packets for processing on queue pair of a device. */ 27691e1f4dSAkhil Goyal 28691e1f4dSAkhil Goyal /** 29691e1f4dSAkhil Goyal * @internal 30*2fd66f75SAkhil Goyal * Structure used to hold opaque pointers to internal ethdev Rx/Tx 31*2fd66f75SAkhil Goyal * queues data. 32*2fd66f75SAkhil Goyal * The main purpose to expose these pointers at all - allow compiler 33*2fd66f75SAkhil Goyal * to fetch this data for fast-path cryptodev inline functions in advance. 34*2fd66f75SAkhil Goyal */ 35*2fd66f75SAkhil Goyal struct rte_cryptodev_qpdata { 36*2fd66f75SAkhil Goyal /** points to array of internal queue pair data pointers. */ 37*2fd66f75SAkhil Goyal void **data; 38*2fd66f75SAkhil Goyal /** points to array of enqueue callback data pointers */ 39*2fd66f75SAkhil Goyal struct rte_cryptodev_cb_rcu *enq_cb; 40*2fd66f75SAkhil Goyal /** points to array of dequeue callback data pointers */ 41*2fd66f75SAkhil Goyal struct rte_cryptodev_cb_rcu *deq_cb; 42*2fd66f75SAkhil Goyal }; 43*2fd66f75SAkhil Goyal 44*2fd66f75SAkhil Goyal struct rte_crypto_fp_ops { 45*2fd66f75SAkhil Goyal /** PMD enqueue burst function. */ 46*2fd66f75SAkhil Goyal enqueue_pkt_burst_t enqueue_burst; 47*2fd66f75SAkhil Goyal /** PMD dequeue burst function. */ 48*2fd66f75SAkhil Goyal dequeue_pkt_burst_t dequeue_burst; 49*2fd66f75SAkhil Goyal /** Internal queue pair data pointers. */ 50*2fd66f75SAkhil Goyal struct rte_cryptodev_qpdata qp; 51*2fd66f75SAkhil Goyal /** Reserved for future ops. */ 52*2fd66f75SAkhil Goyal uintptr_t reserved[3]; 53*2fd66f75SAkhil Goyal } __rte_cache_aligned; 54*2fd66f75SAkhil Goyal 55*2fd66f75SAkhil Goyal extern struct rte_crypto_fp_ops rte_crypto_fp_ops[RTE_CRYPTO_MAX_DEVS]; 56*2fd66f75SAkhil Goyal 57*2fd66f75SAkhil Goyal /** 58691e1f4dSAkhil Goyal * The pool of rte_cryptodev structures. 59691e1f4dSAkhil Goyal */ 60691e1f4dSAkhil Goyal extern struct rte_cryptodev *rte_cryptodevs; 61691e1f4dSAkhil Goyal 62691e1f4dSAkhil Goyal #endif /* _RTE_CRYPTODEV_CORE_H_ */ 63