DPDK  19.11.1
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 {
225  };
226  int level;
228  uint8_t window_size;
239 };
240 
249  uint8_t window_size;
258 };
259 
270  union {
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;
373  } hash;
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_ */
rte_comp_op::m_dst
struct rte_mbuf * m_dst
Definition: rte_comp.h:318
RTE_COMP_HASH_ALGO_SHA1
@ RTE_COMP_HASH_ALGO_SHA1
Definition: rte_comp.h:119
RTE_COMP_HUFFMAN_DYNAMIC
@ RTE_COMP_HUFFMAN_DYNAMIC
Definition: rte_comp.h:161
rte_comp_op_free
__rte_experimental void rte_comp_op_free(struct rte_comp_op *op)
rte_comp_decompress_xform::hash_algo
enum rte_comp_hash_algorithm hash_algo
Definition: rte_comp.h:254
rte_comp_xform_type
rte_comp_xform_type
Definition: rte_comp.h:189
rte_iova_t
uint64_t rte_iova_t
Definition: rte_common.h:335
rte_comp_xform::decompress
struct rte_comp_decompress_xform decompress
Definition: rte_comp.h:273
rte_comp_op_bulk_free
__rte_experimental void rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops)
rte_comp_decompress_xform::window_size
uint8_t window_size
Definition: rte_comp.h:249
rte_mempool::name
char name[RTE_MEMZONE_NAMESIZE]
Definition: rte_mempool.h:222
rte_comp_checksum_type
rte_comp_checksum_type
Definition: rte_comp.h:141
RTE_COMP_ALGO_LZS
@ RTE_COMP_ALGO_LZS
Definition: rte_comp.h:108
rte_comp_algorithm
rte_comp_algorithm
Definition: rte_comp.h:96
rte_comp_op::flush_flag
enum rte_comp_flush_flag flush_flag
Definition: rte_comp.h:374
rte_comp_op::m_src
struct rte_mbuf * m_src
Definition: rte_comp.h:310
rte_comp_op::status
uint8_t status
Definition: rte_comp.h:401
RTE_COMP_OP_STATUS_SUCCESS
@ RTE_COMP_OP_STATUS_SUCCESS
Definition: rte_comp.h:73
RTE_COMP_OP_STATUS_INVALID_STATE
@ RTE_COMP_OP_STATUS_INVALID_STATE
Definition: rte_comp.h:81
rte_comp_op::input_chksum
uint64_t input_chksum
Definition: rte_comp.h:378
rte_comp_deflate_params
Definition: rte_comp.h:213
rte_comp_op_alloc
__rte_experimental struct rte_comp_op * rte_comp_op_alloc(struct rte_mempool *mempool)
RTE_COMP_ALGO_NULL
@ RTE_COMP_ALGO_NULL
Definition: rte_comp.h:99
rte_mbuf
Definition: rte_mbuf_core.h:480
__rte_cache_aligned
#define __rte_cache_aligned
Definition: rte_common.h:317
rte_comp_compress_xform::deflate
struct rte_comp_deflate_params deflate
Definition: rte_comp.h:223
rte_comp_compress_xform::level
int level
Definition: rte_comp.h:226
rte_comp_op::offset
uint32_t offset
Definition: rte_comp.h:335
RTE_COMP_CHECKSUM_ADLER32
@ RTE_COMP_CHECKSUM_ADLER32
Definition: rte_comp.h:146
RTE_COMP_HUFFMAN_FIXED
@ RTE_COMP_HUFFMAN_FIXED
Definition: rte_comp.h:159
RTE_COMP_OP_STATUS_NOT_PROCESSED
@ RTE_COMP_OP_STATUS_NOT_PROCESSED
Definition: rte_comp.h:75
rte_comp_op_type
rte_comp_op_type
Definition: rte_comp.h:197
RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
@ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
Definition: rte_comp.h:83
RTE_COMP_FLUSH_FINAL
@ RTE_COMP_FLUSH_FINAL
Definition: rte_comp.h:182
RTE_COMP_CHECKSUM_NONE
@ RTE_COMP_CHECKSUM_NONE
Definition: rte_comp.h:142
rte_comp_op::mempool
struct rte_mempool * mempool
Definition: rte_comp.h:306
rte_comp_op::iova_addr
rte_iova_t iova_addr
Definition: rte_comp.h:308
rte_comp_op::debug_status
uint64_t debug_status
Definition: rte_comp.h:395
rte_comp_hash_algorithm
rte_comp_hash_algorithm
Definition: rte_comp.h:116
RTE_COMP_ALGO_DEFLATE
@ RTE_COMP_ALGO_DEFLATE
Definition: rte_comp.h:104
rte_comp_deflate_params::huffman
enum rte_comp_huffman huffman
Definition: rte_comp.h:214
rte_comp_op::length
uint32_t length
Definition: rte_comp.h:343
rte_comp_get_feature_name
const __rte_experimental char * rte_comp_get_feature_name(uint64_t flag)
rte_comp_xform
Definition: rte_comp.h:267
rte_comp_compress_xform
Definition: rte_comp.h:219
rte_comp_xform::compress
struct rte_comp_compress_xform compress
Definition: rte_comp.h:271
RTE_COMP_FLUSH_SYNC
@ RTE_COMP_FLUSH_SYNC
Definition: rte_comp.h:172
RTE_COMP_OP_STATELESS
@ RTE_COMP_OP_STATELESS
Definition: rte_comp.h:198
rte_comp_compress_xform::algo
enum rte_comp_algorithm algo
Definition: rte_comp.h:220
RTE_COMP_FLUSH_FULL
@ RTE_COMP_FLUSH_FULL
Definition: rte_comp.h:177
rte_comp_op_pool_create
__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_ALGO_NONE
@ RTE_COMP_HASH_ALGO_NONE
Definition: rte_comp.h:117
RTE_COMP_OP_STATEFUL
@ RTE_COMP_OP_STATEFUL
Definition: rte_comp.h:203
rte_comp_decompress_xform
Definition: rte_comp.h:244
rte_comp_op
Definition: rte_comp.h:287
rte_mempool
Definition: rte_mempool.h:216
RTE_COMP_COMPRESS
@ RTE_COMP_COMPRESS
Definition: rte_comp.h:190
rte_comp_op::output_chksum
uint64_t output_chksum
Definition: rte_comp.h:383
rte_comp_huffman
rte_comp_huffman
Definition: rte_comp.h:156
rte_comp_compress_xform::chksum
enum rte_comp_checksum_type chksum
Definition: rte_comp.h:233
rte_comp_xform::type
enum rte_comp_xform_type type
Definition: rte_comp.h:268
rte_comp_op::consumed
uint32_t consumed
Definition: rte_comp.h:387
rte_mempool.h
rte_comp_op::produced
uint32_t produced
Definition: rte_comp.h:391
RTE_COMP_OP_STATUS_INVALID_ARGS
@ RTE_COMP_OP_STATUS_INVALID_ARGS
Definition: rte_comp.h:77
rte_mbuf.h
RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
@ RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
Definition: rte_comp.h:88
rte_comp_decompress_xform::chksum
enum rte_comp_checksum_type chksum
Definition: rte_comp.h:247
rte_comp_flush_flag
rte_comp_flush_flag
Definition: rte_comp.h:166
RTE_COMP_DECOMPRESS
@ RTE_COMP_DECOMPRESS
Definition: rte_comp.h:192
RTE_COMP_FLUSH_NONE
@ RTE_COMP_FLUSH_NONE
Definition: rte_comp.h:167
RTE_COMP_CHECKSUM_CRC32_ADLER32
@ RTE_COMP_CHECKSUM_CRC32_ADLER32
Definition: rte_comp.h:148
RTE_COMP_OP_STATUS_ERROR
@ RTE_COMP_OP_STATUS_ERROR
Definition: rte_comp.h:79
rte_comp_compress_xform::hash_algo
enum rte_comp_hash_algorithm hash_algo
Definition: rte_comp.h:235
rte_mempool::cache_size
uint32_t cache_size
Definition: rte_mempool.h:233
RTE_COMP_CHECKSUM_CRC32
@ RTE_COMP_CHECKSUM_CRC32
Definition: rte_comp.h:144
rte_comp_decompress_xform::algo
enum rte_comp_algorithm algo
Definition: rte_comp.h:245
rte_comp_compress_xform::window_size
uint8_t window_size
Definition: rte_comp.h:228
rte_comp_op_bulk_alloc
__rte_experimental int rte_comp_op_bulk_alloc(struct rte_mempool *mempool, struct rte_comp_op **ops, uint16_t nb_ops)
rte_mempool::socket_id
int socket_id
Definition: rte_mempool.h:231
rte_comp_op::digest
uint8_t * digest
Definition: rte_comp.h:362
rte_comp_op::private_xform
void * private_xform
Definition: rte_comp.h:290
RTE_COMP_HUFFMAN_DEFAULT
@ RTE_COMP_HUFFMAN_DEFAULT
Definition: rte_comp.h:157
RTE_COMP_HASH_ALGO_SHA2_256
@ RTE_COMP_HASH_ALGO_SHA2_256
Definition: rte_comp.h:121
rte_comp_op_status
rte_comp_op_status
Definition: rte_comp.h:72
rte_comp_op::stream
void * stream
Definition: rte_comp.h:295