xref: /f-stack/dpdk/drivers/crypto/qat/qat_asym_pmd.h (revision 0c6bd470)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019 Intel Corporation
3  */
4 
5 
6 #ifndef _QAT_ASYM_PMD_H_
7 #define _QAT_ASYM_PMD_H_
8 
9 #include <rte_cryptodev.h>
10 #include "qat_device.h"
11 
12 /** Intel(R) QAT Asymmetric Crypto PMD driver name */
13 #define CRYPTODEV_NAME_QAT_ASYM_PMD	crypto_qat_asym
14 
15 
16 extern uint8_t qat_asym_driver_id;
17 
18 /** private data structure for a QAT device.
19  * This QAT device is a device offering only asymmetric crypto service,
20  * there can be one of these on each qat_pci_device (VF).
21  */
22 struct qat_asym_dev_private {
23 	struct qat_pci_device *qat_dev;
24 	/**< The qat pci device hosting the service */
25 	uint8_t asym_dev_id;
26 	/**< Device instance for this rte_cryptodev */
27 	const struct rte_cryptodev_capabilities *qat_dev_capabilities;
28 	/* QAT device asymmetric crypto capabilities */
29 	const struct rte_memzone *capa_mz;
30 	/* Shared memzone for storing capabilities */
31 	uint16_t min_enq_burst_threshold;
32 };
33 
34 uint16_t
35 qat_asym_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
36 			      uint16_t nb_ops);
37 
38 uint16_t
39 qat_asym_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
40 			      uint16_t nb_ops);
41 
42 int qat_asym_session_configure(struct rte_cryptodev *dev,
43 		struct rte_crypto_asym_xform *xform,
44 		struct rte_cryptodev_asym_session *sess,
45 		struct rte_mempool *mempool);
46 
47 int
48 qat_asym_dev_create(struct qat_pci_device *qat_pci_dev,
49 		struct qat_dev_cmd_param *qat_dev_cmd_param);
50 
51 int
52 qat_asym_dev_destroy(struct qat_pci_device *qat_pci_dev);
53 
54 #endif /* _QAT_ASYM_PMD_H_ */
55