DPDK  25.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 #include <rte_common.h>
15 #include <rte_mbuf.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
28 #define RTE_COMP_FF_STATEFUL_COMPRESSION (1ULL << 0)
29 
30 #define RTE_COMP_FF_STATEFUL_DECOMPRESSION (1ULL << 1)
31 
32 #define RTE_COMP_FF_OOP_SGL_IN_SGL_OUT (1ULL << 2)
33 
36 #define RTE_COMP_FF_OOP_SGL_IN_LB_OUT (1ULL << 3)
37 
41 #define RTE_COMP_FF_OOP_LB_IN_SGL_OUT (1ULL << 4)
42 
45 #define RTE_COMP_FF_ADLER32_CHECKSUM (1ULL << 5)
46 
47 #define RTE_COMP_FF_CRC32_CHECKSUM (1ULL << 6)
48 
49 #define RTE_COMP_FF_CRC32_ADLER32_CHECKSUM (1ULL << 7)
50 
51 #define RTE_COMP_FF_MULTI_PKT_CHECKSUM (1ULL << 8)
52 
53 #define RTE_COMP_FF_SHA1_HASH (1ULL << 9)
54 
55 #define RTE_COMP_FF_SHA2_SHA256_HASH (1ULL << 10)
56 
57 #define RTE_COMP_FF_NONCOMPRESSED_BLOCKS (1ULL << 11)
58 
59 #define RTE_COMP_FF_SHAREABLE_PRIV_XFORM (1ULL << 12)
60 
65 #define RTE_COMP_FF_HUFFMAN_FIXED (1ULL << 13)
66 
67 #define RTE_COMP_FF_HUFFMAN_DYNAMIC (1ULL << 14)
68 
69 #define RTE_COMP_FF_XXHASH32_CHECKSUM (1ULL << 15)
70 
71 #define RTE_COMP_FF_LZ4_DICT_ID (1ULL << 16)
72 
73 #define RTE_COMP_FF_LZ4_CONTENT_WITH_CHECKSUM (1ULL << 17)
74 
75 #define RTE_COMP_FF_LZ4_CONTENT_SIZE (1ULL << 18)
76 
77 #define RTE_COMP_FF_LZ4_BLOCK_INDEPENDENCE (1ULL << 19)
78 
79 #define RTE_COMP_FF_LZ4_BLOCK_WITH_CHECKSUM (1ULL << 20)
80 
108 };
109 
112  RTE_COMP_ALGO_UNSPECIFIED = 0,
131 };
132 
141 };
142 
148 #define RTE_COMP_LEVEL_PMD_DEFAULT (-1)
149 
150 #define RTE_COMP_LEVEL_NONE (0)
151 
152 #define RTE_COMP_LEVEL_MIN (1)
153 
154 #define RTE_COMP_LEVEL_MAX (9)
155 
177 };
178 
187 };
188 
210 };
211 
218 };
219 
233 };
234 
239  uint8_t *dictionary;
241  uint16_t dictionary_len;
243 };
244 
247  uint8_t *dictionary;
249  uint16_t dictionary_len;
251 };
252 
258 #define RTE_COMP_LZ4_FLAG_DICT_ID (1 << 0)
259 
265 #define RTE_COMP_LZ4_FLAG_CONTENT_CHECKSUM (1 << 2)
266 
273 #define RTE_COMP_LZ4_FLAG_CONTENT_SIZE (1 << 3)
274 
283 #define RTE_COMP_LZ4_FLAG_BLOCK_CHECKSUM (1 << 4)
284 
294 #define RTE_COMP_LZ4_FLAG_BLOCK_INDEPENDENCE (1 << 5)
295 
298  uint8_t flags;
303 };
304 
309  union {
314  };
315  int level;
317  uint8_t window_size;
328 };
329 
338  uint8_t window_size;
343  union {
348  };
353 };
354 
365  union {
370  };
371 };
372 
383  enum rte_comp_op_type op_type;
384  union {
390  void *stream;
399  };
400 
405  struct rte_mbuf *m_src;
413  struct rte_mbuf *m_dst;
429  struct {
430  uint32_t offset;
438  uint32_t length;
444  } src;
445  struct {
446  uint32_t offset;
455  } dst;
456  struct {
457  uint8_t *digest;
466  rte_iova_t iova_addr;
468  } hash;
469  enum rte_comp_flush_flag flush_flag;
473  uint64_t input_chksum;
478  uint64_t output_chksum;
482  uint32_t consumed;
486  uint32_t produced;
490  uint64_t debug_status;
496  uint8_t status;
504 };
505 
515 void
516 rte_comp_op_free(struct rte_comp_op *op);
517 
536 struct rte_mempool *
537 rte_comp_op_pool_create(const char *name,
538  unsigned int nb_elts, unsigned int cache_size,
539  uint16_t user_size, int socket_id)
541 
552 struct rte_comp_op *
554 
568 int
570  struct rte_comp_op **ops, uint16_t nb_ops);
571 
583 void
584 rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
585 
595 const char *
596 rte_comp_get_feature_name(uint64_t flag);
597 
598 #ifdef __cplusplus
599 }
600 #endif
601 
602 #endif /* _RTE_COMP_H_ */
struct rte_mempool * mempool
Definition: rte_comp.h:401
struct rte_mbuf * m_dst
Definition: rte_comp.h:413
struct rte_comp_lz4_params lz4
Definition: rte_comp.h:346
rte_comp_op_status
Definition: rte_comp.h:83
uint64_t rte_iova_t
Definition: rte_common.h:782
void rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops)
rte_comp_xform_type
Definition: rte_comp.h:213
uint64_t debug_status
Definition: rte_comp.h:490
enum rte_comp_hash_algorithm hash_algo
Definition: rte_comp.h:349
void * stream
Definition: rte_comp.h:390
struct rte_mempool struct rte_comp_op * rte_comp_op_alloc(struct rte_mempool *mempool)
rte_comp_op_type
Definition: rte_comp.h:221
rte_comp_algorithm
Definition: rte_comp.h:111
void rte_comp_op_free(struct rte_comp_op *op)
rte_comp_hash_algorithm
Definition: rte_comp.h:134
struct rte_comp_decompress_xform decompress
Definition: rte_comp.h:368
struct rte_comp_deflate_params deflate
Definition: rte_comp.h:310
#define __rte_cache_aligned
Definition: rte_common.h:751
uint32_t cache_size
Definition: rte_mempool.h:241
char name[RTE_MEMPOOL_NAMESIZE]
Definition: rte_mempool.h:231
struct rte_comp_lz4_params lz4
Definition: rte_comp.h:312
enum rte_comp_checksum_type chksum
Definition: rte_comp.h:322
rte_comp_checksum_type
Definition: rte_comp.h:158
const char * rte_comp_get_feature_name(uint64_t flag)
uint32_t length
Definition: rte_comp.h:438
uint32_t consumed
Definition: rte_comp.h:482
struct rte_comp_compress_xform compress
Definition: rte_comp.h:366
uint8_t * digest
Definition: rte_comp.h:457
uint64_t output_chksum
Definition: rte_comp.h:478
enum rte_comp_huffman huffman
Definition: rte_comp.h:237
#define __rte_dealloc(dealloc, argno)
Definition: rte_common.h:339
uint8_t status
Definition: rte_comp.h:496
rte_iova_t iova_addr
Definition: rte_comp.h:403
#define __rte_malloc
Definition: rte_common.h:328
uint32_t produced
Definition: rte_comp.h:486
enum rte_comp_xform_type type
Definition: rte_comp.h:363
enum rte_comp_algorithm algo
Definition: rte_comp.h:307
struct rte_mbuf * m_src
Definition: rte_comp.h:405
void * private_xform
Definition: rte_comp.h:385
struct rte_comp_inflate_params inflate
Definition: rte_comp.h:344
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:180
enum rte_comp_hash_algorithm hash_algo
Definition: rte_comp.h:324
enum rte_comp_checksum_type chksum
Definition: rte_comp.h:336
enum rte_comp_algorithm algo
Definition: rte_comp.h:334
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_malloc __rte_dealloc(rte_comp_op_free
rte_comp_flush_flag
Definition: rte_comp.h:190
uint64_t input_chksum
Definition: rte_comp.h:473
uint32_t offset
Definition: rte_comp.h:430