7e3b8402c9143e9e5749ebb49f0521fb0df68148
[dpdk.git] / drivers / compress / isal / isal_compress_pmd_private.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Intel Corporation
3  */
4
5 #ifndef _ISAL_COMP_PMD_PRIVATE_H_
6 #define _ISAL_COMP_PMD_PRIVATE_H_
7
8 #define COMPDEV_NAME_ISAL_PMD           compress_isal
9 /**< ISA-L comp PMD device name */
10
11 extern int isal_logtype_driver;
12 #define ISAL_PMD_LOG(level, fmt, args...) \
13         rte_log(RTE_LOG_ ## level, isal_logtype_driver, "%s(): "fmt "\n", \
14                         __func__, ##args)
15
16 /* private data structure for each ISA-L compression device */
17 struct isal_comp_private {
18         struct rte_mempool *priv_xform_mp;
19 };
20
21 /** ISA-L queue pair */
22 struct isal_comp_qp {
23         /* Queue Pair Identifier */
24         uint16_t id;
25         /* Unique Queue Pair Name */
26         char name[RTE_COMPRESSDEV_NAME_MAX_LEN];
27         /* Queue pair statistics */
28         struct rte_compressdev_stats qp_stats;
29         /* Number of free elements on ring */
30         uint16_t num_free_elements;
31 } __rte_cache_aligned;
32
33 /** ISA-L private xform structure */
34 struct isal_priv_xform {
35         enum rte_comp_xform_type type;
36         union {
37                 struct rte_comp_compress_xform compress;
38                 struct rte_comp_decompress_xform decompress;
39         };
40         uint32_t level_buffer_size;
41 } __rte_cache_aligned;
42
43 /** Set and validate NULL comp private xform parameters */
44 extern int
45 isal_comp_set_priv_xform_parameters(struct isal_priv_xform *priv_xform,
46                         const struct rte_comp_xform *xform);
47
48 /** device specific operations function pointer structure */
49 extern struct rte_compressdev_ops *isal_compress_pmd_ops;
50
51 #endif /* _ISAL_COMP_PMD_PRIVATE_H_ */