DPDK 25.03.0-rc1
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
18extern "C" {
19#endif
20
28#define RTE_COMP_FF_STATEFUL_COMPRESSION (1ULL << 0)
30#define RTE_COMP_FF_STATEFUL_DECOMPRESSION (1ULL << 1)
32#define RTE_COMP_FF_OOP_SGL_IN_SGL_OUT (1ULL << 2)
36#define RTE_COMP_FF_OOP_SGL_IN_LB_OUT (1ULL << 3)
41#define RTE_COMP_FF_OOP_LB_IN_SGL_OUT (1ULL << 4)
45#define RTE_COMP_FF_ADLER32_CHECKSUM (1ULL << 5)
47#define RTE_COMP_FF_CRC32_CHECKSUM (1ULL << 6)
49#define RTE_COMP_FF_CRC32_ADLER32_CHECKSUM (1ULL << 7)
51#define RTE_COMP_FF_MULTI_PKT_CHECKSUM (1ULL << 8)
53#define RTE_COMP_FF_SHA1_HASH (1ULL << 9)
55#define RTE_COMP_FF_SHA2_SHA256_HASH (1ULL << 10)
57#define RTE_COMP_FF_NONCOMPRESSED_BLOCKS (1ULL << 11)
59#define RTE_COMP_FF_SHAREABLE_PRIV_XFORM (1ULL << 12)
65#define RTE_COMP_FF_HUFFMAN_FIXED (1ULL << 13)
67#define RTE_COMP_FF_HUFFMAN_DYNAMIC (1ULL << 14)
69#define RTE_COMP_FF_XXHASH32_CHECKSUM (1ULL << 15)
71#define RTE_COMP_FF_LZ4_DICT_ID (1ULL << 16)
73#define RTE_COMP_FF_LZ4_CONTENT_WITH_CHECKSUM (1ULL << 17)
75#define RTE_COMP_FF_LZ4_CONTENT_SIZE (1ULL << 18)
77#define RTE_COMP_FF_LZ4_BLOCK_INDEPENDENCE (1ULL << 19)
79#define RTE_COMP_FF_LZ4_BLOCK_WITH_CHECKSUM (1ULL << 20)
104};
105
108 RTE_COMP_ALGO_UNSPECIFIED = 0,
127};
128
137};
138
144#define RTE_COMP_LEVEL_PMD_DEFAULT (-1)
146#define RTE_COMP_LEVEL_NONE (0)
148#define RTE_COMP_LEVEL_MIN (1)
150#define RTE_COMP_LEVEL_MAX (9)
169};
170
179};
180
203
210};
211
226
231};
232
238#define RTE_COMP_LZ4_FLAG_DICT_ID (1 << 0)
239
245#define RTE_COMP_LZ4_FLAG_CONTENT_CHECKSUM (1 << 2)
246
253#define RTE_COMP_LZ4_FLAG_CONTENT_SIZE (1 << 3)
254
263#define RTE_COMP_LZ4_FLAG_BLOCK_CHECKSUM (1 << 4)
264
274#define RTE_COMP_LZ4_FLAG_BLOCK_INDEPENDENCE (1 << 5)
275
278 uint8_t flags;
283};
284
289 union {
294 };
295 int level;
297 uint8_t window_size;
308};
309
318 uint8_t window_size;
323 union {
326 };
331};
332
343 union {
348 };
349};
350
361 enum rte_comp_op_type op_type;
362 union {
368 void *stream;
377 };
378
407 struct {
408 uint32_t offset;
416 uint32_t length;
422 } src;
423 struct {
424 uint32_t offset;
433 } dst;
434 struct {
435 uint8_t *digest;
444 rte_iova_t iova_addr;
446 } hash;
451 uint64_t input_chksum;
460 uint32_t consumed;
464 uint32_t produced;
468 uint64_t debug_status;
474 uint8_t status;
482};
483
493void
495
514struct rte_mempool *
516 unsigned int nb_elts, unsigned int cache_size,
517 uint16_t user_size, int socket_id)
519
530struct rte_comp_op *
532
546int
548 struct rte_comp_op **ops, uint16_t nb_ops);
549
561void
562rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
563
573const char *
575
576#ifdef __cplusplus
577}
578#endif
579
580#endif /* _RTE_COMP_H_ */
#define __rte_dealloc(dealloc, argno)
Definition: rte_common.h:301
uint64_t rte_iova_t
Definition: rte_common.h:732
#define __rte_cache_aligned
Definition: rte_common.h:701
#define __rte_malloc
Definition: rte_common.h:290
rte_comp_flush_flag
Definition: rte_comp.h:182
@ RTE_COMP_FLUSH_SYNC
Definition: rte_comp.h:188
@ RTE_COMP_FLUSH_NONE
Definition: rte_comp.h:183
@ RTE_COMP_FLUSH_FULL
Definition: rte_comp.h:193
@ RTE_COMP_FLUSH_FINAL
Definition: rte_comp.h:198
rte_comp_hash_algorithm
Definition: rte_comp.h:130
@ RTE_COMP_HASH_ALGO_NONE
Definition: rte_comp.h:131
@ RTE_COMP_HASH_ALGO_SHA1
Definition: rte_comp.h:133
@ RTE_COMP_HASH_ALGO_SHA2_256
Definition: rte_comp.h:135
rte_comp_xform_type
Definition: rte_comp.h:205
@ RTE_COMP_COMPRESS
Definition: rte_comp.h:206
@ RTE_COMP_DECOMPRESS
Definition: rte_comp.h:208
void rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops)
rte_comp_checksum_type
Definition: rte_comp.h:154
@ RTE_COMP_CHECKSUM_ADLER32
Definition: rte_comp.h:159
@ RTE_COMP_CHECKSUM_CRC32
Definition: rte_comp.h:157
@ RTE_COMP_CHECKSUM_CRC32_ADLER32
Definition: rte_comp.h:161
@ RTE_COMP_CHECKSUM_NONE
Definition: rte_comp.h:155
@ RTE_COMP_CHECKSUM_XXHASH32
Definition: rte_comp.h:165
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_op_status
Definition: rte_comp.h:83
@ RTE_COMP_OP_STATUS_NOT_PROCESSED
Definition: rte_comp.h:86
@ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
Definition: rte_comp.h:94
@ RTE_COMP_OP_STATUS_INVALID_STATE
Definition: rte_comp.h:92
@ RTE_COMP_OP_STATUS_INVALID_ARGS
Definition: rte_comp.h:88
@ RTE_COMP_OP_STATUS_ERROR
Definition: rte_comp.h:90
@ RTE_COMP_OP_STATUS_SUCCESS
Definition: rte_comp.h:84
@ RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
Definition: rte_comp.h:99
struct rte_mempool struct rte_comp_op * rte_comp_op_alloc(struct rte_mempool *mempool)
const char * rte_comp_get_feature_name(uint64_t flag)
rte_comp_op_type
Definition: rte_comp.h:213
@ RTE_COMP_OP_STATEFUL
Definition: rte_comp.h:219
@ RTE_COMP_OP_STATELESS
Definition: rte_comp.h:214
void rte_comp_op_free(struct rte_comp_op *op)
rte_comp_huffman
Definition: rte_comp.h:172
@ RTE_COMP_HUFFMAN_FIXED
Definition: rte_comp.h:175
@ RTE_COMP_HUFFMAN_DEFAULT
Definition: rte_comp.h:173
@ RTE_COMP_HUFFMAN_DYNAMIC
Definition: rte_comp.h:177
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:107
@ RTE_COMP_ALGO_DEFLATE
Definition: rte_comp.h:115
@ RTE_COMP_ALGO_NULL
Definition: rte_comp.h:110
@ RTE_COMP_ALGO_LZS
Definition: rte_comp.h:119
@ RTE_COMP_ALGO_LZ4
Definition: rte_comp.h:123
enum rte_comp_algorithm algo
Definition: rte_comp.h:287
enum rte_comp_checksum_type chksum
Definition: rte_comp.h:302
struct rte_comp_lz4_params lz4
Definition: rte_comp.h:292
enum rte_comp_hash_algorithm hash_algo
Definition: rte_comp.h:304
struct rte_comp_deflate_params deflate
Definition: rte_comp.h:290
enum rte_comp_algorithm algo
Definition: rte_comp.h:314
enum rte_comp_checksum_type chksum
Definition: rte_comp.h:316
struct rte_comp_lz4_params lz4
Definition: rte_comp.h:324
enum rte_comp_hash_algorithm hash_algo
Definition: rte_comp.h:327
enum rte_comp_huffman huffman
Definition: rte_comp.h:229
void * private_xform
Definition: rte_comp.h:363
uint32_t produced
Definition: rte_comp.h:464
uint64_t debug_status
Definition: rte_comp.h:468
uint32_t consumed
Definition: rte_comp.h:460
uint8_t * digest
Definition: rte_comp.h:435
struct rte_mempool * mempool
Definition: rte_comp.h:379
uint64_t input_chksum
Definition: rte_comp.h:451
rte_iova_t iova_addr
Definition: rte_comp.h:381
uint32_t offset
Definition: rte_comp.h:408
uint64_t output_chksum
Definition: rte_comp.h:456
struct rte_mbuf * m_dst
Definition: rte_comp.h:391
enum rte_comp_flush_flag flush_flag
Definition: rte_comp.h:447
uint8_t status
Definition: rte_comp.h:474
uint32_t length
Definition: rte_comp.h:416
struct rte_mbuf * m_src
Definition: rte_comp.h:383
void * stream
Definition: rte_comp.h:368
enum rte_comp_xform_type type
Definition: rte_comp.h:341
struct rte_comp_compress_xform compress
Definition: rte_comp.h:344
struct rte_comp_decompress_xform decompress
Definition: rte_comp.h:346
char name[RTE_MEMPOOL_NAMESIZE]
Definition: rte_mempool.h:231
uint32_t cache_size
Definition: rte_mempool.h:241