DPDK  23.11.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)
29 #define RTE_COMP_FF_STATEFUL_DECOMPRESSION (1ULL << 1)
31 #define RTE_COMP_FF_OOP_SGL_IN_SGL_OUT (1ULL << 2)
35 #define RTE_COMP_FF_OOP_SGL_IN_LB_OUT (1ULL << 3)
40 #define RTE_COMP_FF_OOP_LB_IN_SGL_OUT (1ULL << 4)
44 #define RTE_COMP_FF_ADLER32_CHECKSUM (1ULL << 5)
46 #define RTE_COMP_FF_CRC32_CHECKSUM (1ULL << 6)
48 #define RTE_COMP_FF_CRC32_ADLER32_CHECKSUM (1ULL << 7)
50 #define RTE_COMP_FF_MULTI_PKT_CHECKSUM (1ULL << 8)
52 #define RTE_COMP_FF_SHA1_HASH (1ULL << 9)
54 #define RTE_COMP_FF_SHA2_SHA256_HASH (1ULL << 10)
56 #define RTE_COMP_FF_NONCOMPRESSED_BLOCKS (1ULL << 11)
58 #define RTE_COMP_FF_SHAREABLE_PRIV_XFORM (1ULL << 12)
64 #define RTE_COMP_FF_HUFFMAN_FIXED (1ULL << 13)
66 #define RTE_COMP_FF_HUFFMAN_DYNAMIC (1ULL << 14)
68 #define RTE_COMP_FF_XXHASH32_CHECKSUM (1ULL << 15)
70 #define RTE_COMP_FF_LZ4_DICT_ID (1ULL << 16)
72 #define RTE_COMP_FF_LZ4_CONTENT_WITH_CHECKSUM (1ULL << 17)
74 #define RTE_COMP_FF_LZ4_CONTENT_SIZE (1ULL << 18)
76 #define RTE_COMP_FF_LZ4_BLOCK_INDEPENDENCE (1ULL << 19)
78 #define RTE_COMP_FF_LZ4_BLOCK_WITH_CHECKSUM (1ULL << 20)
103 };
104 
107  RTE_COMP_ALGO_UNSPECIFIED = 0,
126 };
127 
136 };
137 
143 #define RTE_COMP_LEVEL_PMD_DEFAULT (-1)
145 #define RTE_COMP_LEVEL_NONE (0)
147 #define RTE_COMP_LEVEL_MIN (1)
149 #define RTE_COMP_LEVEL_MAX (9)
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 {
291  struct rte_comp_lz4_params lz4;
293  };
294  int level;
296  uint8_t window_size;
307 };
308 
317  uint8_t window_size;
322  union {
323  struct rte_comp_lz4_params lz4;
325  };
330 };
331 
342  union {
347  };
348 };
349 
359 struct rte_comp_op {
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;
445  } hash;
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;
482 
501 struct rte_mempool *
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
547 
559 void
560 rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
561 
571 const char *
573 
574 #ifdef __cplusplus
575 }
576 #endif
577 
578 #endif /* _RTE_COMP_H_ */
#define __rte_cache_aligned
Definition: rte_common.h:524
uint64_t rte_iova_t
Definition: rte_common.h:556
rte_comp_flush_flag
Definition: rte_comp.h:181
@ RTE_COMP_FLUSH_SYNC
Definition: rte_comp.h:187
@ RTE_COMP_FLUSH_NONE
Definition: rte_comp.h:182
@ RTE_COMP_FLUSH_FULL
Definition: rte_comp.h:192
@ RTE_COMP_FLUSH_FINAL
Definition: rte_comp.h:197
rte_comp_hash_algorithm
Definition: rte_comp.h:129
@ RTE_COMP_HASH_ALGO_NONE
Definition: rte_comp.h:130
@ RTE_COMP_HASH_ALGO_SHA1
Definition: rte_comp.h:132
@ RTE_COMP_HASH_ALGO_SHA2_256
Definition: rte_comp.h:134
rte_comp_xform_type
Definition: rte_comp.h:204
@ RTE_COMP_COMPRESS
Definition: rte_comp.h:205
@ RTE_COMP_DECOMPRESS
Definition: rte_comp.h:207
void rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops)
struct rte_comp_op * rte_comp_op_alloc(struct rte_mempool *mempool)
rte_comp_checksum_type
Definition: rte_comp.h:153
@ RTE_COMP_CHECKSUM_ADLER32
Definition: rte_comp.h:158
@ RTE_COMP_CHECKSUM_CRC32
Definition: rte_comp.h:156
@ RTE_COMP_CHECKSUM_CRC32_ADLER32
Definition: rte_comp.h:160
@ RTE_COMP_CHECKSUM_NONE
Definition: rte_comp.h:154
@ RTE_COMP_CHECKSUM_XXHASH32
Definition: rte_comp.h:164
rte_comp_op_status
Definition: rte_comp.h:82
@ RTE_COMP_OP_STATUS_NOT_PROCESSED
Definition: rte_comp.h:85
@ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
Definition: rte_comp.h:93
@ RTE_COMP_OP_STATUS_INVALID_STATE
Definition: rte_comp.h:91
@ RTE_COMP_OP_STATUS_INVALID_ARGS
Definition: rte_comp.h:87
@ RTE_COMP_OP_STATUS_ERROR
Definition: rte_comp.h:89
@ RTE_COMP_OP_STATUS_SUCCESS
Definition: rte_comp.h:83
@ RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
Definition: rte_comp.h:98
const char * rte_comp_get_feature_name(uint64_t flag)
rte_comp_op_type
Definition: rte_comp.h:212
@ RTE_COMP_OP_STATEFUL
Definition: rte_comp.h:218
@ RTE_COMP_OP_STATELESS
Definition: rte_comp.h:213
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)
void rte_comp_op_free(struct rte_comp_op *op)
rte_comp_huffman
Definition: rte_comp.h:171
@ RTE_COMP_HUFFMAN_FIXED
Definition: rte_comp.h:174
@ RTE_COMP_HUFFMAN_DEFAULT
Definition: rte_comp.h:172
@ RTE_COMP_HUFFMAN_DYNAMIC
Definition: rte_comp.h:176
int rte_comp_op_bulk_alloc(struct rte_mempool *mempool, struct rte_comp_op **ops, uint16_t nb_ops)
rte_comp_algorithm
Definition: rte_comp.h:106
@ RTE_COMP_ALGO_DEFLATE
Definition: rte_comp.h:114
@ RTE_COMP_ALGO_NULL
Definition: rte_comp.h:109
@ RTE_COMP_ALGO_LZS
Definition: rte_comp.h:118
@ RTE_COMP_ALGO_LZ4
Definition: rte_comp.h:122
enum rte_comp_algorithm algo
Definition: rte_comp.h:286
enum rte_comp_checksum_type chksum
Definition: rte_comp.h:301
struct rte_comp_lz4_params lz4
Definition: rte_comp.h:291
enum rte_comp_hash_algorithm hash_algo
Definition: rte_comp.h:303
struct rte_comp_deflate_params deflate
Definition: rte_comp.h:289
enum rte_comp_algorithm algo
Definition: rte_comp.h:313
enum rte_comp_checksum_type chksum
Definition: rte_comp.h:315
struct rte_comp_lz4_params lz4
Definition: rte_comp.h:323
enum rte_comp_hash_algorithm hash_algo
Definition: rte_comp.h:326
enum rte_comp_huffman huffman
Definition: rte_comp.h:228
void * private_xform
Definition: rte_comp.h:362
uint32_t produced
Definition: rte_comp.h:463
uint64_t debug_status
Definition: rte_comp.h:467
uint32_t consumed
Definition: rte_comp.h:459
uint8_t * digest
Definition: rte_comp.h:434
struct rte_mempool * mempool
Definition: rte_comp.h:378
uint64_t input_chksum
Definition: rte_comp.h:450
rte_iova_t iova_addr
Definition: rte_comp.h:380
uint32_t offset
Definition: rte_comp.h:407
uint64_t output_chksum
Definition: rte_comp.h:455
struct rte_mbuf * m_dst
Definition: rte_comp.h:390
enum rte_comp_flush_flag flush_flag
Definition: rte_comp.h:446
uint8_t status
Definition: rte_comp.h:473
uint32_t length
Definition: rte_comp.h:415
struct rte_mbuf * m_src
Definition: rte_comp.h:382
void * stream
Definition: rte_comp.h:367
enum rte_comp_xform_type type
Definition: rte_comp.h:340
struct rte_comp_compress_xform compress
Definition: rte_comp.h:343
struct rte_comp_decompress_xform decompress
Definition: rte_comp.h:345
char name[RTE_MEMPOOL_NAMESIZE]
Definition: rte_mempool.h:221
uint32_t cache_size
Definition: rte_mempool.h:231