crypto/qat: move sgl related element to appropriate files
[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 struct qat_sym_op_cookie {
26         struct qat_sgl qat_sgl_src;
27         struct qat_sgl qat_sgl_dst;
28         phys_addr_t qat_sgl_src_phys_addr;
29         phys_addr_t qat_sgl_dst_phys_addr;
30 };
31
32 int
33 qat_sym_build_request(void *in_op, uint8_t *out_msg,
34                 void *op_cookie, enum qat_device_gen qat_dev_gen);
35
36 int
37 qat_sym_process_response(void **op, uint8_t *resp,
38                 __rte_unused void *op_cookie, enum qat_device_gen qat_dev_gen);
39
40 void qat_sym_stats_get(struct rte_cryptodev *dev,
41         struct rte_cryptodev_stats *stats);
42 void qat_sym_stats_reset(struct rte_cryptodev *dev);
43
44 int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,
45         const struct rte_cryptodev_qp_conf *rx_conf, int socket_id,
46         struct rte_mempool *session_pool);
47 int qat_sym_qp_release(struct rte_cryptodev *dev,
48         uint16_t queue_pair_id);
49
50
51 uint16_t
52 qat_sym_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
53                 uint16_t nb_ops);
54
55 uint16_t
56 qat_sym_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
57                 uint16_t nb_ops);
58
59 #endif /* _QAT_SYM_H_ */