DPDK  24.03.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 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #include <rte_mbuf.h>
19 
27 #define RTE_COMP_FF_STATEFUL_COMPRESSION (1ULL << 0)
28 
29 #define RTE_COMP_FF_STATEFUL_DECOMPRESSION (1ULL << 1)
30 
31 #define RTE_COMP_FF_OOP_SGL_IN_SGL_OUT (1ULL << 2)
32 
35 #define RTE_COMP_FF_OOP_SGL_IN_LB_OUT (1ULL << 3)
36 
40 #define RTE_COMP_FF_OOP_LB_IN_SGL_OUT (1ULL << 4)
41 
44 #define RTE_COMP_FF_ADLER32_CHECKSUM (1ULL << 5)
45 
46 #define RTE_COMP_FF_CRC32_CHECKSUM (1ULL << 6)
47 
48 #define RTE_COMP_FF_CRC32_ADLER32_CHECKSUM (1ULL << 7)
49 
50 #define RTE_COMP_FF_MULTI_PKT_CHECKSUM (1ULL << 8)
51 
52 #define RTE_COMP_FF_SHA1_HASH (1ULL << 9)
53 
54 #define RTE_COMP_FF_SHA2_SHA256_HASH (1ULL << 10)
55 
56 #define RTE_COMP_FF_NONCOMPRESSED_BLOCKS (1ULL << 11)
57 
58 #define RTE_COMP_FF_SHAREABLE_PRIV_XFORM (1ULL << 12)
59 
64 #define RTE_COMP_FF_HUFFMAN_FIXED (1ULL << 13)
65 
66 #define RTE_COMP_FF_HUFFMAN_DYNAMIC (1ULL << 14)
67 
68 #define RTE_COMP_FF_XXHASH32_CHECKSUM (1ULL << 15)
69 
70 #define RTE_COMP_FF_LZ4_DICT_ID (1ULL << 16)
71 
72 #define RTE_COMP_FF_LZ4_CONTENT_WITH_CHECKSUM (1ULL << 17)
73 
74 #define RTE_COMP_FF_LZ4_CONTENT_SIZE (1ULL << 18)
75 
76 #define RTE_COMP_FF_LZ4_BLOCK_INDEPENDENCE (1ULL << 19)
77 
78 #define RTE_COMP_FF_LZ4_BLOCK_WITH_CHECKSUM (1ULL << 20)
79 
103 };
104 
107  RTE_COMP_ALGO_UNSPECIFIED = 0,
126 };
127 
136 };
137 
143 #define RTE_COMP_LEVEL_PMD_DEFAULT (-1)
144 
145 #define RTE_COMP_LEVEL_NONE (0)
146 
147 #define RTE_COMP_LEVEL_MIN (1)
148 
149 #define RTE_COMP_LEVEL_MAX (9)
150 
168 };
169 
178 };
179 
201 };
202 
209 };
210 
224 };
225 
230 };
231 
237 #define RTE_COMP_LZ4_FLAG_DICT_ID (1 << 0)
238 
244 #define RTE_COMP_LZ4_FLAG_CONTENT_CHECKSUM (1 << 2)
245 
252 #define RTE_COMP_LZ4_FLAG_CONTENT_SIZE (1 << 3)
253 
262 #define RTE_COMP_LZ4_FLAG_BLOCK_CHECKSUM (1 << 4)
263 
273 #define RTE_COMP_LZ4_FLAG_BLOCK_INDEPENDENCE (1 << 5)
274 
277  uint8_t flags;
282 };
283 
288  union {
289  struct rte_comp_deflate_params deflate;
293  };
294  int level;
296  uint8_t window_size;
303  enum rte_comp_hash_algorithm hash_algo;
307 };
308 
317  uint8_t window_size;
322  union {
325  };
326  enum rte_comp_hash_algorithm hash_algo;
330 };
331 
342  union {
343  struct rte_comp_compress_xform compress;
345  struct rte_comp_decompress_xform decompress;
347  };
348 };
349 
360  enum rte_comp_op_type op_type;
361  union {
367  void *stream;
376  };
377 
382  struct rte_mbuf *m_src;
390  struct rte_mbuf *m_dst;
406  struct {
407  uint32_t offset;
415  uint32_t length;
421  } src;
422  struct {
423  uint32_t offset;
432  } dst;
433  struct {
434  uint8_t *digest;
443  rte_iova_t iova_addr;
445  } hash;
446  enum rte_comp_flush_flag flush_flag;
450  uint64_t input_chksum;
455  uint64_t output_chksum;
459  uint32_t consumed;
463  uint32_t produced;
467  uint64_t debug_status;
473  uint8_t status;
481 };
482 
501 struct rte_mempool *
502 rte_comp_op_pool_create(const char *name,
503  unsigned int nb_elts, unsigned int cache_size,
504  uint16_t user_size, int socket_id);
505 
516 struct rte_comp_op *
518 
532 int
534  struct rte_comp_op **ops, uint16_t nb_ops);
535 
545 void
546 rte_comp_op_free(struct rte_comp_op *op);
547 
559 void
560 rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
561 
571 const char *
572 rte_comp_get_feature_name(uint64_t flag);
573 
574 #ifdef __cplusplus
575 }
576 #endif
577 
578 #endif /* _RTE_COMP_H_ */
struct rte_mempool * mempool
Definition: rte_comp.h:378
struct rte_mbuf * m_dst
Definition: rte_comp.h:390
rte_comp_op_status
Definition: rte_comp.h:82
uint64_t rte_iova_t
Definition: rte_common.h:584
void rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops)
struct rte_mempool * rte_comp_op_pool_create(const char *name, unsigned int nb_elts, unsigned int cache_size, uint16_t user_size, int socket_id)
rte_comp_xform_type
Definition: rte_comp.h:204
uint64_t debug_status
Definition: rte_comp.h:467
void * stream
Definition: rte_comp.h:367
rte_comp_op_type
Definition: rte_comp.h:212
rte_comp_algorithm
Definition: rte_comp.h:106
void rte_comp_op_free(struct rte_comp_op *op)
struct rte_comp_op * rte_comp_op_alloc(struct rte_mempool *mempool)
rte_comp_hash_algorithm
Definition: rte_comp.h:129
#define __rte_cache_aligned
Definition: rte_common.h:553
uint32_t cache_size
Definition: rte_mempool.h:241
char name[RTE_MEMPOOL_NAMESIZE]
Definition: rte_mempool.h:231
rte_comp_checksum_type
Definition: rte_comp.h:153
const char * rte_comp_get_feature_name(uint64_t flag)
uint32_t length
Definition: rte_comp.h:415
uint32_t consumed
Definition: rte_comp.h:459
uint8_t * digest
Definition: rte_comp.h:434
uint64_t output_chksum
Definition: rte_comp.h:455
enum rte_comp_huffman huffman
Definition: rte_comp.h:228
uint8_t status
Definition: rte_comp.h:473
rte_iova_t iova_addr
Definition: rte_comp.h:380
uint32_t produced
Definition: rte_comp.h:463
struct rte_mbuf * m_src
Definition: rte_comp.h:382
void * private_xform
Definition: rte_comp.h:362
int rte_comp_op_bulk_alloc(struct rte_mempool *mempool, struct rte_comp_op **ops, uint16_t nb_ops)
rte_comp_huffman
Definition: rte_comp.h:171
rte_comp_flush_flag
Definition: rte_comp.h:181
uint64_t input_chksum
Definition: rte_comp.h:450
uint32_t offset
Definition: rte_comp.h:407