DPDK
24.11.4
Toggle main menu visibility
Loading...
Searching...
No Matches
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
13
14
#include <
rte_mbuf.h
>
15
16
#ifdef __cplusplus
17
extern
"C"
{
18
#endif
19
27
#define RTE_COMP_FF_STATEFUL_COMPRESSION (1ULL << 0)
29
#define RTE_COMP_FF_STATEFUL_DECOMPRESSION (1ULL << 1)
31
#define RTE_COMP_FF_OOP_SGL_IN_SGL_OUT (1ULL << 2)
35
#define RTE_COMP_FF_OOP_SGL_IN_LB_OUT (1ULL << 3)
40
#define RTE_COMP_FF_OOP_LB_IN_SGL_OUT (1ULL << 4)
44
#define RTE_COMP_FF_ADLER32_CHECKSUM (1ULL << 5)
46
#define RTE_COMP_FF_CRC32_CHECKSUM (1ULL << 6)
48
#define RTE_COMP_FF_CRC32_ADLER32_CHECKSUM (1ULL << 7)
50
#define RTE_COMP_FF_MULTI_PKT_CHECKSUM (1ULL << 8)
52
#define RTE_COMP_FF_SHA1_HASH (1ULL << 9)
54
#define RTE_COMP_FF_SHA2_SHA256_HASH (1ULL << 10)
56
#define RTE_COMP_FF_NONCOMPRESSED_BLOCKS (1ULL << 11)
58
#define RTE_COMP_FF_SHAREABLE_PRIV_XFORM (1ULL << 12)
64
#define RTE_COMP_FF_HUFFMAN_FIXED (1ULL << 13)
66
#define RTE_COMP_FF_HUFFMAN_DYNAMIC (1ULL << 14)
68
#define RTE_COMP_FF_XXHASH32_CHECKSUM (1ULL << 15)
70
#define RTE_COMP_FF_LZ4_DICT_ID (1ULL << 16)
72
#define RTE_COMP_FF_LZ4_CONTENT_WITH_CHECKSUM (1ULL << 17)
74
#define RTE_COMP_FF_LZ4_CONTENT_SIZE (1ULL << 18)
76
#define RTE_COMP_FF_LZ4_BLOCK_INDEPENDENCE (1ULL << 19)
78
#define RTE_COMP_FF_LZ4_BLOCK_WITH_CHECKSUM (1ULL << 20)
80
82
enum
rte_comp_op_status
{
83
RTE_COMP_OP_STATUS_SUCCESS
= 0,
85
RTE_COMP_OP_STATUS_NOT_PROCESSED
,
87
RTE_COMP_OP_STATUS_INVALID_ARGS
,
89
RTE_COMP_OP_STATUS_ERROR
,
91
RTE_COMP_OP_STATUS_INVALID_STATE
,
93
RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
,
98
RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
,
103
};
104
106
enum
rte_comp_algorithm
{
107
RTE_COMP_ALGO_UNSPECIFIED = 0,
109
RTE_COMP_ALGO_NULL
,
114
RTE_COMP_ALGO_DEFLATE
,
118
RTE_COMP_ALGO_LZS
,
122
RTE_COMP_ALGO_LZ4
,
126
};
127
129
enum
rte_comp_hash_algorithm
{
130
RTE_COMP_HASH_ALGO_NONE
= 0,
132
RTE_COMP_HASH_ALGO_SHA1
,
134
RTE_COMP_HASH_ALGO_SHA2_256
,
136
};
137
143
#define RTE_COMP_LEVEL_PMD_DEFAULT (-1)
145
#define RTE_COMP_LEVEL_NONE (0)
147
#define RTE_COMP_LEVEL_MIN (1)
149
#define RTE_COMP_LEVEL_MAX (9)
151
153
enum
rte_comp_checksum_type
{
154
RTE_COMP_CHECKSUM_NONE
,
156
RTE_COMP_CHECKSUM_CRC32
,
158
RTE_COMP_CHECKSUM_ADLER32
,
160
RTE_COMP_CHECKSUM_CRC32_ADLER32
,
164
RTE_COMP_CHECKSUM_XXHASH32
,
168
};
169
171
enum
rte_comp_huffman
{
172
RTE_COMP_HUFFMAN_DEFAULT
,
174
RTE_COMP_HUFFMAN_FIXED
,
176
RTE_COMP_HUFFMAN_DYNAMIC
,
178
};
179
181
enum
rte_comp_flush_flag
{
182
RTE_COMP_FLUSH_NONE
,
187
RTE_COMP_FLUSH_SYNC
,
192
RTE_COMP_FLUSH_FULL
,
197
RTE_COMP_FLUSH_FINAL
201
};
202
204
enum
rte_comp_xform_type
{
205
RTE_COMP_COMPRESS
,
207
RTE_COMP_DECOMPRESS
,
209
};
210
212
enum
rte_comp_op_type
{
213
RTE_COMP_OP_STATELESS
,
218
RTE_COMP_OP_STATEFUL
224
};
225
227
struct
rte_comp_deflate_params
{
228
enum
rte_comp_huffman
huffman
;
230
};
231
237
#define RTE_COMP_LZ4_FLAG_DICT_ID (1 << 0)
238
244
#define RTE_COMP_LZ4_FLAG_CONTENT_CHECKSUM (1 << 2)
245
252
#define RTE_COMP_LZ4_FLAG_CONTENT_SIZE (1 << 3)
253
262
#define RTE_COMP_LZ4_FLAG_BLOCK_CHECKSUM (1 << 4)
263
273
#define RTE_COMP_LZ4_FLAG_BLOCK_INDEPENDENCE (1 << 5)
274
276
struct
rte_comp_lz4_params
{
277
uint8_t
flags
;
282
};
283
285
struct
rte_comp_compress_xform
{
286
enum
rte_comp_algorithm
algo
;
288
union
{
289
struct
rte_comp_deflate_params
deflate
;
291
struct
rte_comp_lz4_params
lz4
;
293
};
294
int
level
;
296
uint8_t
window_size
;
301
enum
rte_comp_checksum_type
chksum
;
303
enum
rte_comp_hash_algorithm
hash_algo
;
307
};
308
312
struct
rte_comp_decompress_xform
{
313
enum
rte_comp_algorithm
algo
;
315
enum
rte_comp_checksum_type
chksum
;
317
uint8_t
window_size
;
322
union
{
323
struct
rte_comp_lz4_params
lz4
;
325
};
326
enum
rte_comp_hash_algorithm
hash_algo
;
330
};
331
339
struct
rte_comp_xform
{
340
enum
rte_comp_xform_type
type
;
342
union
{
343
struct
rte_comp_compress_xform
compress
;
345
struct
rte_comp_decompress_xform
decompress
;
347
};
348
};
349
359
struct
__rte_cache_aligned
rte_comp_op
{
360
enum
rte_comp_op_type
op_type;
361
union
{
362
void
*
private_xform
;
367
void
*
stream
;
376
};
377
378
struct
rte_mempool
*
mempool
;
380
rte_iova_t
iova_addr
;
382
struct
rte_mbuf
*
m_src
;
390
struct
rte_mbuf
*
m_dst
;
405
406
struct
{
407
uint32_t
offset
;
415
uint32_t
length
;
421
} src;
422
struct
{
423
uint32_t offset;
432
} dst;
433
struct
{
434
uint8_t *
digest
;
443
rte_iova_t
iova_addr
;
445
} hash;
446
enum
rte_comp_flush_flag
flush_flag
;
450
uint64_t
input_chksum
;
455
uint64_t
output_chksum
;
459
uint32_t
consumed
;
463
uint32_t
produced
;
467
uint64_t
debug_status
;
473
uint8_t
status
;
481
};
482
501
struct
rte_mempool
*
502
rte_comp_op_pool_create
(
const
char
*
name
,
503
unsigned
int
nb_elts,
unsigned
int
cache_size
,
504
uint16_t user_size,
int
socket_id
);
505
516
struct
rte_comp_op
*
517
rte_comp_op_alloc
(
struct
rte_mempool
*
mempool
);
518
532
int
533
rte_comp_op_bulk_alloc
(
struct
rte_mempool
*
mempool
,
534
struct
rte_comp_op
**ops, uint16_t nb_ops);
535
545
void
546
rte_comp_op_free
(
struct
rte_comp_op
*op);
547
559
void
560
rte_comp_op_bulk_free
(
struct
rte_comp_op
**ops, uint16_t nb_ops);
561
571
const
char
*
572
rte_comp_get_feature_name
(uint64_t flag);
573
574
#ifdef __cplusplus
575
}
576
#endif
577
578
#endif
/* _RTE_COMP_H_ */
rte_iova_t
uint64_t rte_iova_t
Definition
rte_common.h:658
__rte_cache_aligned
#define __rte_cache_aligned
Definition
rte_common.h:627
rte_comp_flush_flag
rte_comp_flush_flag
Definition
rte_comp.h:181
RTE_COMP_FLUSH_SYNC
@ RTE_COMP_FLUSH_SYNC
Definition
rte_comp.h:187
RTE_COMP_FLUSH_NONE
@ RTE_COMP_FLUSH_NONE
Definition
rte_comp.h:182
RTE_COMP_FLUSH_FULL
@ RTE_COMP_FLUSH_FULL
Definition
rte_comp.h:192
RTE_COMP_FLUSH_FINAL
@ RTE_COMP_FLUSH_FINAL
Definition
rte_comp.h:197
rte_comp_hash_algorithm
rte_comp_hash_algorithm
Definition
rte_comp.h:129
RTE_COMP_HASH_ALGO_NONE
@ RTE_COMP_HASH_ALGO_NONE
Definition
rte_comp.h:130
RTE_COMP_HASH_ALGO_SHA1
@ RTE_COMP_HASH_ALGO_SHA1
Definition
rte_comp.h:132
RTE_COMP_HASH_ALGO_SHA2_256
@ RTE_COMP_HASH_ALGO_SHA2_256
Definition
rte_comp.h:134
rte_comp_xform_type
rte_comp_xform_type
Definition
rte_comp.h:204
RTE_COMP_COMPRESS
@ RTE_COMP_COMPRESS
Definition
rte_comp.h:205
RTE_COMP_DECOMPRESS
@ RTE_COMP_DECOMPRESS
Definition
rte_comp.h:207
rte_comp_op_bulk_free
void rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops)
rte_comp_checksum_type
rte_comp_checksum_type
Definition
rte_comp.h:153
RTE_COMP_CHECKSUM_ADLER32
@ RTE_COMP_CHECKSUM_ADLER32
Definition
rte_comp.h:158
RTE_COMP_CHECKSUM_CRC32
@ RTE_COMP_CHECKSUM_CRC32
Definition
rte_comp.h:156
RTE_COMP_CHECKSUM_CRC32_ADLER32
@ RTE_COMP_CHECKSUM_CRC32_ADLER32
Definition
rte_comp.h:160
RTE_COMP_CHECKSUM_NONE
@ RTE_COMP_CHECKSUM_NONE
Definition
rte_comp.h:154
RTE_COMP_CHECKSUM_XXHASH32
@ RTE_COMP_CHECKSUM_XXHASH32
Definition
rte_comp.h:164
rte_comp_op_status
rte_comp_op_status
Definition
rte_comp.h:82
RTE_COMP_OP_STATUS_NOT_PROCESSED
@ RTE_COMP_OP_STATUS_NOT_PROCESSED
Definition
rte_comp.h:85
RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
@ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
Definition
rte_comp.h:93
RTE_COMP_OP_STATUS_INVALID_STATE
@ RTE_COMP_OP_STATUS_INVALID_STATE
Definition
rte_comp.h:91
RTE_COMP_OP_STATUS_INVALID_ARGS
@ RTE_COMP_OP_STATUS_INVALID_ARGS
Definition
rte_comp.h:87
RTE_COMP_OP_STATUS_ERROR
@ RTE_COMP_OP_STATUS_ERROR
Definition
rte_comp.h:89
RTE_COMP_OP_STATUS_SUCCESS
@ RTE_COMP_OP_STATUS_SUCCESS
Definition
rte_comp.h:83
RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
@ RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
Definition
rte_comp.h:98
rte_comp_op_alloc
struct rte_comp_op * rte_comp_op_alloc(struct rte_mempool *mempool)
rte_comp_op_pool_create
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_get_feature_name
const char * rte_comp_get_feature_name(uint64_t flag)
rte_comp_op_type
rte_comp_op_type
Definition
rte_comp.h:212
RTE_COMP_OP_STATEFUL
@ RTE_COMP_OP_STATEFUL
Definition
rte_comp.h:218
RTE_COMP_OP_STATELESS
@ RTE_COMP_OP_STATELESS
Definition
rte_comp.h:213
rte_comp_op_free
void rte_comp_op_free(struct rte_comp_op *op)
rte_comp_huffman
rte_comp_huffman
Definition
rte_comp.h:171
RTE_COMP_HUFFMAN_FIXED
@ RTE_COMP_HUFFMAN_FIXED
Definition
rte_comp.h:174
RTE_COMP_HUFFMAN_DEFAULT
@ RTE_COMP_HUFFMAN_DEFAULT
Definition
rte_comp.h:172
RTE_COMP_HUFFMAN_DYNAMIC
@ RTE_COMP_HUFFMAN_DYNAMIC
Definition
rte_comp.h:176
rte_comp_op_bulk_alloc
int rte_comp_op_bulk_alloc(struct rte_mempool *mempool, struct rte_comp_op **ops, uint16_t nb_ops)
rte_comp_algorithm
rte_comp_algorithm
Definition
rte_comp.h:106
RTE_COMP_ALGO_DEFLATE
@ RTE_COMP_ALGO_DEFLATE
Definition
rte_comp.h:114
RTE_COMP_ALGO_NULL
@ RTE_COMP_ALGO_NULL
Definition
rte_comp.h:109
RTE_COMP_ALGO_LZS
@ RTE_COMP_ALGO_LZS
Definition
rte_comp.h:118
RTE_COMP_ALGO_LZ4
@ RTE_COMP_ALGO_LZ4
Definition
rte_comp.h:122
rte_mbuf.h
rte_comp_compress_xform
Definition
rte_comp.h:285
rte_comp_compress_xform::algo
enum rte_comp_algorithm algo
Definition
rte_comp.h:286
rte_comp_compress_xform::window_size
uint8_t window_size
Definition
rte_comp.h:296
rte_comp_compress_xform::chksum
enum rte_comp_checksum_type chksum
Definition
rte_comp.h:301
rte_comp_compress_xform::lz4
struct rte_comp_lz4_params lz4
Definition
rte_comp.h:291
rte_comp_compress_xform::hash_algo
enum rte_comp_hash_algorithm hash_algo
Definition
rte_comp.h:303
rte_comp_compress_xform::level
int level
Definition
rte_comp.h:294
rte_comp_compress_xform::deflate
struct rte_comp_deflate_params deflate
Definition
rte_comp.h:289
rte_comp_decompress_xform
Definition
rte_comp.h:312
rte_comp_decompress_xform::algo
enum rte_comp_algorithm algo
Definition
rte_comp.h:313
rte_comp_decompress_xform::window_size
uint8_t window_size
Definition
rte_comp.h:317
rte_comp_decompress_xform::chksum
enum rte_comp_checksum_type chksum
Definition
rte_comp.h:315
rte_comp_decompress_xform::lz4
struct rte_comp_lz4_params lz4
Definition
rte_comp.h:323
rte_comp_decompress_xform::hash_algo
enum rte_comp_hash_algorithm hash_algo
Definition
rte_comp.h:326
rte_comp_deflate_params
Definition
rte_comp.h:227
rte_comp_deflate_params::huffman
enum rte_comp_huffman huffman
Definition
rte_comp.h:228
rte_comp_lz4_params
Definition
rte_comp.h:276
rte_comp_lz4_params::flags
uint8_t flags
Definition
rte_comp.h:277
rte_comp_op
Definition
rte_comp.h:359
rte_comp_op::private_xform
void * private_xform
Definition
rte_comp.h:362
rte_comp_op::produced
uint32_t produced
Definition
rte_comp.h:463
rte_comp_op::debug_status
uint64_t debug_status
Definition
rte_comp.h:467
rte_comp_op::consumed
uint32_t consumed
Definition
rte_comp.h:459
rte_comp_op::digest
uint8_t * digest
Definition
rte_comp.h:434
rte_comp_op::mempool
struct rte_mempool * mempool
Definition
rte_comp.h:378
rte_comp_op::input_chksum
uint64_t input_chksum
Definition
rte_comp.h:450
rte_comp_op::iova_addr
rte_iova_t iova_addr
Definition
rte_comp.h:380
rte_comp_op::offset
uint32_t offset
Definition
rte_comp.h:407
rte_comp_op::output_chksum
uint64_t output_chksum
Definition
rte_comp.h:455
rte_comp_op::m_dst
struct rte_mbuf * m_dst
Definition
rte_comp.h:390
rte_comp_op::flush_flag
enum rte_comp_flush_flag flush_flag
Definition
rte_comp.h:446
rte_comp_op::status
uint8_t status
Definition
rte_comp.h:473
rte_comp_op::length
uint32_t length
Definition
rte_comp.h:415
rte_comp_op::m_src
struct rte_mbuf * m_src
Definition
rte_comp.h:382
rte_comp_op::stream
void * stream
Definition
rte_comp.h:367
rte_comp_xform
Definition
rte_comp.h:339
rte_comp_xform::type
enum rte_comp_xform_type type
Definition
rte_comp.h:340
rte_comp_xform::compress
struct rte_comp_compress_xform compress
Definition
rte_comp.h:343
rte_comp_xform::decompress
struct rte_comp_decompress_xform decompress
Definition
rte_comp.h:345
rte_mbuf
Definition
rte_mbuf_core.h:467
rte_mempool
Definition
rte_mempool.h:230
rte_mempool::socket_id
int socket_id
Definition
rte_mempool.h:239
rte_mempool::name
char name[RTE_MEMPOOL_NAMESIZE]
Definition
rte_mempool.h:231
rte_mempool::cache_size
uint32_t cache_size
Definition
rte_mempool.h:241
lib
compressdev
rte_comp.h
Generated by
1.17.0