1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Cavium Networks
5 #ifndef _ZLIB_PMD_PRIVATE_H_
6 #define _ZLIB_PMD_PRIVATE_H_
9 #include <rte_compressdev.h>
10 #include <rte_compressdev_pmd.h>
12 #define COMPRESSDEV_NAME_ZLIB_PMD compress_zlib
13 /**< ZLIB PMD device name */
15 #define DEF_MEM_LEVEL 8
17 extern int zlib_logtype_driver;
18 #define ZLIB_PMD_LOG(level, fmt, args...) \
19 rte_log(RTE_LOG_ ## level, zlib_logtype_driver, "%s(): "fmt "\n", \
22 #define ZLIB_PMD_INFO(fmt, args...) \
23 ZLIB_PMD_LOG(INFO, fmt, ## args)
24 #define ZLIB_PMD_ERR(fmt, args...) \
25 ZLIB_PMD_LOG(ERR, fmt, ## args)
26 #define ZLIB_PMD_WARN(fmt, args...) \
27 ZLIB_PMD_LOG(WARNING, fmt, ## args)
30 struct rte_mempool *mp;
34 struct rte_ring *processed_pkts;
35 /**< Ring for placing process packets */
36 struct rte_compressdev_stats qp_stats;
37 /**< Queue pair statistics */
39 /**< Queue Pair Identifier */
40 char name[RTE_COMPRESSDEV_NAME_MAX_LEN];
41 /**< Unique Queue Pair Name */
42 } __rte_cache_aligned;
44 /* Algorithm handler function prototype */
45 typedef void (*comp_func_t)(struct rte_comp_op *op, z_stream *strm);
47 typedef int (*comp_free_t)(z_stream *strm);
49 /** ZLIB Stream structure */
52 /**< zlib stream structure */
54 /**< Operation (compression/decompression) */
56 /**< Free Operation (compression/decompression) */
57 } __rte_cache_aligned;
59 /** ZLIB private xform structure */
60 struct zlib_priv_xform {
61 struct zlib_stream stream;
62 } __rte_cache_aligned;
65 zlib_set_stream_parameters(const struct rte_comp_xform *xform,
66 struct zlib_stream *stream);
68 /** Device specific operations function pointer structure */
69 extern struct rte_compressdev_ops *rte_zlib_pmd_ops;
71 #endif /* _ZLIB_PMD_PRIVATE_H_ */