[dpdk-dev] [RFC] cryptodev: Change burst APIs to crypto operation oriented
Declan Doherty
declan.doherty at intel.com
Tue Jan 12 19:11:14 CET 2016
In this rfc I'm looking to get some feedback on a proposal to change the
cryptodev burst API from the current implementation of accepting burst
of rte_mbuf's to a burst API based on rte_crypto_op's.
-static inline uint16_t
-rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
- struct rte_mbuf **pkts, uint16_t nb_pkts)
+static inline uint16_t
+rte_cryptodev_dequeue_op_burst(uint8_t dev_id, uint16_t qp_id,
+ struct rte_crypto_op **ops, uint16_t nb_ops)
-static inline uint16_t
-rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
- struct rte_mbuf **pkts, uint16_t nb_pkts)
+ static inline uint16_t
+rte_cryptodev_dequeue_op_burst(uint8_t dev_id, uint16_t qp_id,
+ struct rte_crypto_op **ops, uint16_t nb_ops)
The motivation for these changes are to address the concerns
raise in the discussion of the rte_mbuf_offload library patch
(http://dpdk.org/ml/archives/dev/2015-November/028247.html) by both
Thomas and Olivier. By changing to an API which accepts bursts of
rte_crypto_op structures we are no longer need to have a specific field
in the rte_mbuf for offload operations and instead with a small
modification to the rte_crypto_op structure by adding a field for the
source rte_mbuf on which the crypto operation is going to be performed
the same functionality can be performed. This will break the current
dependency between the rte_mbuf and the rte_mbuf_offload library and by
proxy the rte_cyptodev library.
struct rte_crypto_op {
enum rte_crypto_op_sess_type type;
enum rte_crypto_op_status status;
+ struct rte_mbuf *m_src; /**< source mbuf */
struct rte_mbuf *m_dst; /**< Destination mbuf */
....
}
Another advantage of this approach is that it simplifies and speeds up
the processing of bursts within crypto PMDs as they no longer have to
search for the crypto operation within the rte_mbuf_offload structure
and can instead just operate on the crypto operation directly.
Regarding the rte_mbuf_offload library I think that it should be removed
and that we can look adding a more general solution for managing
external metadata to the rte_mbuf library when that functionality is
required.
More information about the dev
mailing list