b92ec72de0cc9df8d6b093ce4dbdbdb9c3faa6f8
[dpdk.git] / drivers / crypto / qat / qat_sym.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2015-2018 Intel Corporation
3  */
4
5 #ifndef _QAT_SYM_H_
6 #define _QAT_SYM_H_
7
8 #include <rte_cryptodev_pmd.h>
9 #include <rte_memzone.h>
10
11 #include "qat_common.h"
12 #include "qat_device.h"
13 #include "qat_crypto_capabilities.h"
14
15 /*
16  * This macro rounds up a number to a be a multiple of
17  * the alignment when the alignment is a power of 2
18  */
19 #define ALIGN_POW2_ROUNDUP(num, align) \
20         (((num) + (align) - 1) & ~((align) - 1))
21 #define QAT_64_BTYE_ALIGN_MASK (~0x3f)
22
23 struct qat_sym_session;
24
25 int
26 qat_sym_build_request(void *in_op, uint8_t *out_msg,
27                 void *op_cookie, enum qat_device_gen qat_dev_gen);
28
29 int
30 qat_sym_process_response(void **op, uint8_t *resp,
31                 __rte_unused void *op_cookie, enum qat_device_gen qat_dev_gen);
32
33 void qat_sym_stats_get(struct rte_cryptodev *dev,
34         struct rte_cryptodev_stats *stats);
35 void qat_sym_stats_reset(struct rte_cryptodev *dev);
36
37 int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,
38         const struct rte_cryptodev_qp_conf *rx_conf, int socket_id,
39         struct rte_mempool *session_pool);
40 int qat_sym_qp_release(struct rte_cryptodev *dev,
41         uint16_t queue_pair_id);
42
43
44 uint16_t
45 qat_sym_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
46                 uint16_t nb_ops);
47
48 uint16_t
49 qat_sym_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
50                 uint16_t nb_ops);
51
52 #endif /* _QAT_SYM_H_ */