DPDK  19.05.0
rte_comp.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017-2018 Intel Corporation
3  */
4 
5 #ifndef _RTE_COMP_H_
6 #define _RTE_COMP_H_
7 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #include <rte_mempool.h>
20 #include <rte_mbuf.h>
21 
29 #define RTE_COMP_FF_STATEFUL_COMPRESSION (1ULL << 0)
30 
31 #define RTE_COMP_FF_STATEFUL_DECOMPRESSION (1ULL << 1)
32 
33 #define RTE_COMP_FF_OOP_SGL_IN_SGL_OUT (1ULL << 2)
34 
37 #define RTE_COMP_FF_OOP_SGL_IN_LB_OUT (1ULL << 3)
38 
42 #define RTE_COMP_FF_OOP_LB_IN_SGL_OUT (1ULL << 4)
43 
46 #define RTE_COMP_FF_ADLER32_CHECKSUM (1ULL << 5)
47 
48 #define RTE_COMP_FF_CRC32_CHECKSUM (1ULL << 6)
49 
50 #define RTE_COMP_FF_CRC32_ADLER32_CHECKSUM (1ULL << 7)
51 
52 #define RTE_COMP_FF_MULTI_PKT_CHECKSUM (1ULL << 8)
53 
54 #define RTE_COMP_FF_SHA1_HASH (1ULL << 9)
55 
56 #define RTE_COMP_FF_SHA2_SHA256_HASH (1ULL << 10)
57 
58 #define RTE_COMP_FF_NONCOMPRESSED_BLOCKS (1ULL << 11)
59 
60 #define RTE_COMP_FF_SHAREABLE_PRIV_XFORM (1ULL << 12)
61 
66 #define RTE_COMP_FF_HUFFMAN_FIXED (1ULL << 13)
67 
68 #define RTE_COMP_FF_HUFFMAN_DYNAMIC (1ULL << 14)
69 
93 };
94 
97  RTE_COMP_ALGO_UNSPECIFIED = 0,
112  RTE_COMP_ALGO_LIST_END
113 };
114 
123  RTE_COMP_HASH_ALGO_LIST_END
124 };
125 
131 #define RTE_COMP_LEVEL_PMD_DEFAULT (-1)
132 
133 #define RTE_COMP_LEVEL_NONE (0)
134 
135 #define RTE_COMP_LEVEL_MIN (1)
136 
137 #define RTE_COMP_LEVEL_MAX (9)
138 
152 };
153 
154 
163 };
164 
186 };
187 
194 };
195 
209 };
210 
211 
216 };
217 
222  union {
225  };
226  int level;
228  uint8_t window_size;
239 };
240 
249  uint8_t window_size;
258 };
259 
270  union {
275  };
276 };
277 
287 struct rte_comp_op {
288  enum rte_comp_op_type op_type;
289  union {
290  void *private_xform;
295  void *stream;
304  };
305 
310  struct rte_mbuf *m_src;
318  struct rte_mbuf *m_dst;
328  struct {
329  uint32_t offset;
337  uint32_t length;
343  } src;
344  struct {
345  uint32_t offset;
354  } dst;
355  struct {
356  uint8_t *digest;
367  } hash;
372  uint64_t input_chksum;
377  uint64_t output_chksum;
381  uint32_t consumed;
385  uint32_t produced;
389  uint64_t debug_status;
395  uint8_t status;
404 
423 struct rte_mempool * __rte_experimental
424 rte_comp_op_pool_create(const char *name,
425  unsigned int nb_elts, unsigned int cache_size,
426  uint16_t user_size, int socket_id);
427 
438 struct rte_comp_op * __rte_experimental
440 
454 int __rte_experimental
456  struct rte_comp_op **ops, uint16_t nb_ops);
457 
466 void __rte_experimental
467 rte_comp_op_free(struct rte_comp_op *op);
468 
480 void __rte_experimental
481 rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
482 
492 const char * __rte_experimental
493 rte_comp_get_feature_name(uint64_t flag);
494 
495 #ifdef __cplusplus
496 }
497 #endif
498 
499 #endif /* _RTE_COMP_H_ */