DPDK  22.07.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_mbuf.h>
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 
92 };
93 
96  RTE_COMP_ALGO_UNSPECIFIED = 0,
111  RTE_COMP_ALGO_LIST_END
112 };
113 
122  RTE_COMP_HASH_ALGO_LIST_END
123 };
124 
130 #define RTE_COMP_LEVEL_PMD_DEFAULT (-1)
131 
132 #define RTE_COMP_LEVEL_NONE (0)
133 
134 #define RTE_COMP_LEVEL_MIN (1)
135 
136 #define RTE_COMP_LEVEL_MAX (9)
137 
151 };
152 
153 
162 };
163 
185 };
186 
193 };
194 
208 };
209 
210 
215 };
216 
221  union {
222  struct rte_comp_deflate_params deflate;
224  };
225  int level;
227  uint8_t window_size;
234  enum rte_comp_hash_algorithm hash_algo;
238 };
239 
248  uint8_t window_size;
253  enum rte_comp_hash_algorithm hash_algo;
257 };
258 
269  union {
270  struct rte_comp_compress_xform compress;
272  struct rte_comp_decompress_xform decompress;
274  };
275 };
276 
286 struct rte_comp_op {
287  enum rte_comp_op_type op_type;
288  union {
294  void *stream;
303  };
304 
309  struct rte_mbuf *m_src;
317  struct rte_mbuf *m_dst;
333  struct {
334  uint32_t offset;
342  uint32_t length;
348  } src;
349  struct {
350  uint32_t offset;
359  } dst;
360  struct {
361  uint8_t *digest;
370  rte_iova_t iova_addr;
372  } hash;
373  enum rte_comp_flush_flag flush_flag;
377  uint64_t input_chksum;
382  uint64_t output_chksum;
386  uint32_t consumed;
390  uint32_t produced;
394  uint64_t debug_status;
400  uint8_t status;
409 
428 __rte_experimental
429 struct rte_mempool *
430 rte_comp_op_pool_create(const char *name,
431  unsigned int nb_elts, unsigned int cache_size,
432  uint16_t user_size, int socket_id);
433 
444 __rte_experimental
445 struct rte_comp_op *
447 
461 __rte_experimental
462 int
464  struct rte_comp_op **ops, uint16_t nb_ops);
465 
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:305
struct rte_mbuf * m_dst
Definition: rte_comp.h:317
rte_comp_op_status
Definition: rte_comp.h:71
uint64_t rte_iova_t
Definition: rte_common.h:463
rte_comp_xform_type
Definition: rte_comp.h:188
uint64_t debug_status
Definition: rte_comp.h:394
void * stream
Definition: rte_comp.h:294
rte_comp_op_type
Definition: rte_comp.h:196
rte_comp_algorithm
Definition: rte_comp.h:95
__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:115
uint32_t cache_size
Definition: rte_mempool.h:220
char name[RTE_MEMPOOL_NAMESIZE]
Definition: rte_mempool.h:209
rte_comp_checksum_type
Definition: rte_comp.h:140
__rte_experimental struct rte_comp_op * rte_comp_op_alloc(struct rte_mempool *mempool)
uint32_t length
Definition: rte_comp.h:342
uint32_t consumed
Definition: rte_comp.h:386
__rte_experimental void rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops)
uint8_t * digest
Definition: rte_comp.h:361
uint64_t output_chksum
Definition: rte_comp.h:382
enum rte_comp_huffman huffman
Definition: rte_comp.h:213
uint8_t status
Definition: rte_comp.h:400
rte_iova_t iova_addr
Definition: rte_comp.h:307
uint32_t produced
Definition: rte_comp.h:390
__rte_experimental const char * rte_comp_get_feature_name(uint64_t flag)
#define __rte_cache_aligned
Definition: rte_common.h:445
struct rte_mbuf * m_src
Definition: rte_comp.h:309
void * private_xform
Definition: rte_comp.h:289
rte_comp_huffman
Definition: rte_comp.h:155
rte_comp_flush_flag
Definition: rte_comp.h:165
__rte_experimental void rte_comp_op_free(struct rte_comp_op *op)
uint64_t input_chksum
Definition: rte_comp.h:377
uint32_t offset
Definition: rte_comp.h:334
__rte_experimental int rte_comp_op_bulk_alloc(struct rte_mempool *mempool, struct rte_comp_op **ops, uint16_t nb_ops)