DPDK  20.11.10
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 {
223  struct rte_comp_deflate_params deflate;
225  };
226  int level;
228  uint8_t window_size;
235  enum rte_comp_hash_algorithm hash_algo;
239 };
240 
249  uint8_t window_size;
254  enum rte_comp_hash_algorithm hash_algo;
258 };
259 
270  union {
271  struct rte_comp_compress_xform compress;
273  struct rte_comp_decompress_xform decompress;
275  };
276 };
277 
287 struct rte_comp_op {
288  enum rte_comp_op_type op_type;
289  union {
295  void *stream;
304  };
305 
310  struct rte_mbuf *m_src;
318  struct rte_mbuf *m_dst;
334  struct {
335  uint32_t offset;
343  uint32_t length;
349  } src;
350  struct {
351  uint32_t offset;
360  } dst;
361  struct {
362  uint8_t *digest;
371  rte_iova_t iova_addr;
373  } hash;
374  enum rte_comp_flush_flag flush_flag;
378  uint64_t input_chksum;
383  uint64_t output_chksum;
387  uint32_t consumed;
391  uint32_t produced;
395  uint64_t debug_status;
401  uint8_t status;
410 
429 __rte_experimental
430 struct rte_mempool *
431 rte_comp_op_pool_create(const char *name,
432  unsigned int nb_elts, unsigned int cache_size,
433  uint16_t user_size, int socket_id);
434 
445 __rte_experimental
446 struct rte_comp_op *
448 
462 __rte_experimental
463 int
465  struct rte_comp_op **ops, uint16_t nb_ops);
466 
475 __rte_experimental
476 void
477 rte_comp_op_free(struct rte_comp_op *op);
478 
490 __rte_experimental
491 void
492 rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
493 
503 __rte_experimental
504 const char *
505 rte_comp_get_feature_name(uint64_t flag);
506 
507 #ifdef __cplusplus
508 }
509 #endif
510 
511 #endif /* _RTE_COMP_H_ */
struct rte_mempool * mempool
Definition: rte_comp.h:306
struct rte_mbuf * m_dst
Definition: rte_comp.h:318
rte_comp_op_status
Definition: rte_comp.h:72
uint64_t rte_iova_t
Definition: rte_common.h:423
rte_comp_xform_type
Definition: rte_comp.h:189
uint64_t debug_status
Definition: rte_comp.h:395
void * stream
Definition: rte_comp.h:295
rte_comp_op_type
Definition: rte_comp.h:197
rte_comp_algorithm
Definition: rte_comp.h:96
__rte_experimental 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_hash_algorithm
Definition: rte_comp.h:116
uint32_t cache_size
Definition: rte_mempool.h:225
rte_comp_checksum_type
Definition: rte_comp.h:141
__rte_experimental struct rte_comp_op * rte_comp_op_alloc(struct rte_mempool *mempool)
uint32_t length
Definition: rte_comp.h:343
uint32_t consumed
Definition: rte_comp.h:387
__rte_experimental void rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops)
uint8_t * digest
Definition: rte_comp.h:362
uint64_t output_chksum
Definition: rte_comp.h:383
enum rte_comp_huffman huffman
Definition: rte_comp.h:214
uint8_t status
Definition: rte_comp.h:401
rte_iova_t iova_addr
Definition: rte_comp.h:308
uint32_t produced
Definition: rte_comp.h:391
__rte_experimental const char * rte_comp_get_feature_name(uint64_t flag)
#define __rte_cache_aligned
Definition: rte_common.h:405
struct rte_mbuf * m_src
Definition: rte_comp.h:310
void * private_xform
Definition: rte_comp.h:290
rte_comp_huffman
Definition: rte_comp.h:156
rte_comp_flush_flag
Definition: rte_comp.h:166
__rte_experimental void rte_comp_op_free(struct rte_comp_op *op)
char name[RTE_MEMZONE_NAMESIZE]
Definition: rte_mempool.h:214
uint64_t input_chksum
Definition: rte_comp.h:378
uint32_t offset
Definition: rte_comp.h:335
__rte_experimental int rte_comp_op_bulk_alloc(struct rte_mempool *mempool, struct rte_comp_op **ops, uint16_t nb_ops)