DPDK
25.11.0
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_common.h
>
15
#include <
rte_mbuf.h
>
16
17
#ifdef __cplusplus
18
extern
"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)
81
83
enum
rte_comp_op_status
{
84
RTE_COMP_OP_STATUS_SUCCESS
= 0,
86
RTE_COMP_OP_STATUS_NOT_PROCESSED
,
88
RTE_COMP_OP_STATUS_INVALID_ARGS
,
90
RTE_COMP_OP_STATUS_ERROR
,
92
RTE_COMP_OP_STATUS_INVALID_STATE
,
94
RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
,
99
RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
,
104
RTE_COMP_OP_STATUS_CHECKSUM_VALIDATION_FAILED
,
108
};
109
111
enum
rte_comp_algorithm
{
112
RTE_COMP_ALGO_UNSPECIFIED = 0,
114
RTE_COMP_ALGO_NULL
,
119
RTE_COMP_ALGO_DEFLATE
,
123
RTE_COMP_ALGO_LZS
,
127
RTE_COMP_ALGO_LZ4
,
131
};
132
134
enum
rte_comp_hash_algorithm
{
135
RTE_COMP_HASH_ALGO_NONE
= 0,
137
RTE_COMP_HASH_ALGO_SHA1
,
139
RTE_COMP_HASH_ALGO_SHA2_256
,
141
};
142
148
#define RTE_COMP_LEVEL_PMD_DEFAULT (-1)
150
#define RTE_COMP_LEVEL_NONE (0)
152
#define RTE_COMP_LEVEL_MIN (1)
154
#define RTE_COMP_LEVEL_MAX (9)
156
158
enum
rte_comp_checksum_type
{
159
RTE_COMP_CHECKSUM_NONE
,
161
RTE_COMP_CHECKSUM_CRC32
,
163
RTE_COMP_CHECKSUM_ADLER32
,
165
RTE_COMP_CHECKSUM_CRC32_ADLER32
,
169
RTE_COMP_CHECKSUM_XXHASH32
,
173
RTE_COMP_CHECKSUM_3GPP_PDCP_UDC
,
177
};
178
180
enum
rte_comp_huffman
{
181
RTE_COMP_HUFFMAN_DEFAULT
,
183
RTE_COMP_HUFFMAN_FIXED
,
185
RTE_COMP_HUFFMAN_DYNAMIC
,
187
};
188
190
enum
rte_comp_flush_flag
{
191
RTE_COMP_FLUSH_NONE
,
196
RTE_COMP_FLUSH_SYNC
,
201
RTE_COMP_FLUSH_FULL
,
206
RTE_COMP_FLUSH_FINAL
210
};
211
213
enum
rte_comp_xform_type
{
214
RTE_COMP_COMPRESS
,
216
RTE_COMP_DECOMPRESS
,
218
};
219
221
enum
rte_comp_op_type
{
222
RTE_COMP_OP_STATELESS
,
227
RTE_COMP_OP_STATEFUL
233
};
234
236
struct
rte_comp_deflate_params
{
237
enum
rte_comp_huffman
huffman
;
239
uint8_t *
dictionary
;
241
uint16_t
dictionary_len
;
243
};
244
246
struct
rte_comp_inflate_params
{
247
uint8_t *
dictionary
;
249
uint16_t
dictionary_len
;
251
};
252
258
#define RTE_COMP_LZ4_FLAG_DICT_ID (1 << 0)
259
265
#define RTE_COMP_LZ4_FLAG_CONTENT_CHECKSUM (1 << 2)
266
273
#define RTE_COMP_LZ4_FLAG_CONTENT_SIZE (1 << 3)
274
283
#define RTE_COMP_LZ4_FLAG_BLOCK_CHECKSUM (1 << 4)
284
294
#define RTE_COMP_LZ4_FLAG_BLOCK_INDEPENDENCE (1 << 5)
295
297
struct
rte_comp_lz4_params
{
298
uint8_t
flags
;
303
};
304
306
struct
rte_comp_compress_xform
{
307
enum
rte_comp_algorithm
algo
;
309
union
{
310
struct
rte_comp_deflate_params
deflate
;
312
struct
rte_comp_lz4_params
lz4
;
314
};
315
int
level
;
317
uint8_t
window_size
;
322
enum
rte_comp_checksum_type
chksum
;
324
enum
rte_comp_hash_algorithm
hash_algo
;
328
};
329
333
struct
rte_comp_decompress_xform
{
334
enum
rte_comp_algorithm
algo
;
336
enum
rte_comp_checksum_type
chksum
;
338
uint8_t
window_size
;
343
union
{
344
struct
rte_comp_inflate_params
inflate
;
346
struct
rte_comp_lz4_params
lz4
;
348
};
349
enum
rte_comp_hash_algorithm
hash_algo
;
353
};
354
362
struct
rte_comp_xform
{
363
enum
rte_comp_xform_type
type
;
365
union
{
366
struct
rte_comp_compress_xform
compress
;
368
struct
rte_comp_decompress_xform
decompress
;
370
};
371
};
372
382
struct
__rte_cache_aligned
rte_comp_op
{
383
enum
rte_comp_op_type
op_type;
384
union
{
385
void
*
private_xform
;
390
void
*
stream
;
399
};
400
401
struct
rte_mempool
*
mempool
;
403
rte_iova_t
iova_addr
;
405
struct
rte_mbuf
*
m_src
;
413
struct
rte_mbuf
*
m_dst
;
428
429
struct
{
430
uint32_t
offset
;
438
uint32_t
length
;
444
} src;
445
struct
{
446
uint32_t offset;
455
} dst;
456
struct
{
457
uint8_t *
digest
;
466
rte_iova_t
iova_addr
;
468
} hash;
469
enum
rte_comp_flush_flag
flush_flag
;
473
uint64_t
input_chksum
;
478
uint64_t
output_chksum
;
482
uint32_t
consumed
;
486
uint32_t
produced
;
490
uint64_t
debug_status
;
496
uint8_t
status
;
504
};
505
515
void
516
rte_comp_op_free
(
struct
rte_comp_op
*op);
517
536
struct
rte_mempool
*
537
rte_comp_op_pool_create
(
const
char
*
name
,
538
unsigned
int
nb_elts,
unsigned
int
cache_size
,
539
uint16_t user_size,
int
socket_id
)
540
__rte_malloc
__rte_dealloc
(
rte_comp_op_free
, 1);
541
552
struct
rte_comp_op
*
553
rte_comp_op_alloc
(
struct
rte_mempool
*
mempool
);
554
568
int
569
rte_comp_op_bulk_alloc
(
struct
rte_mempool
*
mempool
,
570
struct
rte_comp_op
**ops, uint16_t nb_ops);
571
583
void
584
rte_comp_op_bulk_free
(
struct
rte_comp_op
**ops, uint16_t nb_ops);
585
595
const
char
*
596
rte_comp_get_feature_name
(uint64_t flag);
597
598
#ifdef __cplusplus
599
}
600
#endif
601
602
#endif
/* _RTE_COMP_H_ */
rte_common.h
__rte_dealloc
#define __rte_dealloc(dealloc, argno)
Definition
rte_common.h:339
rte_iova_t
uint64_t rte_iova_t
Definition
rte_common.h:770
__rte_cache_aligned
#define __rte_cache_aligned
Definition
rte_common.h:739
__rte_malloc
#define __rte_malloc
Definition
rte_common.h:328
rte_comp_flush_flag
rte_comp_flush_flag
Definition
rte_comp.h:190
RTE_COMP_FLUSH_SYNC
@ RTE_COMP_FLUSH_SYNC
Definition
rte_comp.h:196
RTE_COMP_FLUSH_NONE
@ RTE_COMP_FLUSH_NONE
Definition
rte_comp.h:191
RTE_COMP_FLUSH_FULL
@ RTE_COMP_FLUSH_FULL
Definition
rte_comp.h:201
RTE_COMP_FLUSH_FINAL
@ RTE_COMP_FLUSH_FINAL
Definition
rte_comp.h:206
rte_comp_hash_algorithm
rte_comp_hash_algorithm
Definition
rte_comp.h:134
RTE_COMP_HASH_ALGO_NONE
@ RTE_COMP_HASH_ALGO_NONE
Definition
rte_comp.h:135
RTE_COMP_HASH_ALGO_SHA1
@ RTE_COMP_HASH_ALGO_SHA1
Definition
rte_comp.h:137
RTE_COMP_HASH_ALGO_SHA2_256
@ RTE_COMP_HASH_ALGO_SHA2_256
Definition
rte_comp.h:139
rte_comp_xform_type
rte_comp_xform_type
Definition
rte_comp.h:213
RTE_COMP_COMPRESS
@ RTE_COMP_COMPRESS
Definition
rte_comp.h:214
RTE_COMP_DECOMPRESS
@ RTE_COMP_DECOMPRESS
Definition
rte_comp.h:216
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:158
RTE_COMP_CHECKSUM_ADLER32
@ RTE_COMP_CHECKSUM_ADLER32
Definition
rte_comp.h:163
RTE_COMP_CHECKSUM_CRC32
@ RTE_COMP_CHECKSUM_CRC32
Definition
rte_comp.h:161
RTE_COMP_CHECKSUM_CRC32_ADLER32
@ RTE_COMP_CHECKSUM_CRC32_ADLER32
Definition
rte_comp.h:165
RTE_COMP_CHECKSUM_3GPP_PDCP_UDC
@ RTE_COMP_CHECKSUM_3GPP_PDCP_UDC
Definition
rte_comp.h:173
RTE_COMP_CHECKSUM_NONE
@ RTE_COMP_CHECKSUM_NONE
Definition
rte_comp.h:159
RTE_COMP_CHECKSUM_XXHASH32
@ RTE_COMP_CHECKSUM_XXHASH32
Definition
rte_comp.h:169
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_malloc __rte_dealloc(rte_comp_op_free
rte_comp_op_status
rte_comp_op_status
Definition
rte_comp.h:83
RTE_COMP_OP_STATUS_CHECKSUM_VALIDATION_FAILED
@ RTE_COMP_OP_STATUS_CHECKSUM_VALIDATION_FAILED
Definition
rte_comp.h:104
RTE_COMP_OP_STATUS_NOT_PROCESSED
@ RTE_COMP_OP_STATUS_NOT_PROCESSED
Definition
rte_comp.h:86
RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
@ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
Definition
rte_comp.h:94
RTE_COMP_OP_STATUS_INVALID_STATE
@ RTE_COMP_OP_STATUS_INVALID_STATE
Definition
rte_comp.h:92
RTE_COMP_OP_STATUS_INVALID_ARGS
@ RTE_COMP_OP_STATUS_INVALID_ARGS
Definition
rte_comp.h:88
RTE_COMP_OP_STATUS_ERROR
@ RTE_COMP_OP_STATUS_ERROR
Definition
rte_comp.h:90
RTE_COMP_OP_STATUS_SUCCESS
@ RTE_COMP_OP_STATUS_SUCCESS
Definition
rte_comp.h:84
RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
@ RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
Definition
rte_comp.h:99
rte_comp_op_alloc
struct rte_mempool struct rte_comp_op * rte_comp_op_alloc(struct rte_mempool *mempool)
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:221
RTE_COMP_OP_STATEFUL
@ RTE_COMP_OP_STATEFUL
Definition
rte_comp.h:227
RTE_COMP_OP_STATELESS
@ RTE_COMP_OP_STATELESS
Definition
rte_comp.h:222
rte_comp_op_free
void rte_comp_op_free(struct rte_comp_op *op)
rte_comp_huffman
rte_comp_huffman
Definition
rte_comp.h:180
RTE_COMP_HUFFMAN_FIXED
@ RTE_COMP_HUFFMAN_FIXED
Definition
rte_comp.h:183
RTE_COMP_HUFFMAN_DEFAULT
@ RTE_COMP_HUFFMAN_DEFAULT
Definition
rte_comp.h:181
RTE_COMP_HUFFMAN_DYNAMIC
@ RTE_COMP_HUFFMAN_DYNAMIC
Definition
rte_comp.h:185
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:111
RTE_COMP_ALGO_DEFLATE
@ RTE_COMP_ALGO_DEFLATE
Definition
rte_comp.h:119
RTE_COMP_ALGO_NULL
@ RTE_COMP_ALGO_NULL
Definition
rte_comp.h:114
RTE_COMP_ALGO_LZS
@ RTE_COMP_ALGO_LZS
Definition
rte_comp.h:123
RTE_COMP_ALGO_LZ4
@ RTE_COMP_ALGO_LZ4
Definition
rte_comp.h:127
rte_mbuf.h
rte_comp_compress_xform
Definition
rte_comp.h:306
rte_comp_compress_xform::algo
enum rte_comp_algorithm algo
Definition
rte_comp.h:307
rte_comp_compress_xform::window_size
uint8_t window_size
Definition
rte_comp.h:317
rte_comp_compress_xform::chksum
enum rte_comp_checksum_type chksum
Definition
rte_comp.h:322
rte_comp_compress_xform::lz4
struct rte_comp_lz4_params lz4
Definition
rte_comp.h:312
rte_comp_compress_xform::hash_algo
enum rte_comp_hash_algorithm hash_algo
Definition
rte_comp.h:324
rte_comp_compress_xform::level
int level
Definition
rte_comp.h:315
rte_comp_compress_xform::deflate
struct rte_comp_deflate_params deflate
Definition
rte_comp.h:310
rte_comp_decompress_xform
Definition
rte_comp.h:333
rte_comp_decompress_xform::algo
enum rte_comp_algorithm algo
Definition
rte_comp.h:334
rte_comp_decompress_xform::window_size
uint8_t window_size
Definition
rte_comp.h:338
rte_comp_decompress_xform::chksum
enum rte_comp_checksum_type chksum
Definition
rte_comp.h:336
rte_comp_decompress_xform::lz4
struct rte_comp_lz4_params lz4
Definition
rte_comp.h:346
rte_comp_decompress_xform::hash_algo
enum rte_comp_hash_algorithm hash_algo
Definition
rte_comp.h:349
rte_comp_decompress_xform::inflate
struct rte_comp_inflate_params inflate
Definition
rte_comp.h:344
rte_comp_deflate_params
Definition
rte_comp.h:236
rte_comp_deflate_params::dictionary
uint8_t * dictionary
Definition
rte_comp.h:239
rte_comp_deflate_params::dictionary_len
uint16_t dictionary_len
Definition
rte_comp.h:241
rte_comp_deflate_params::huffman
enum rte_comp_huffman huffman
Definition
rte_comp.h:237
rte_comp_inflate_params
Definition
rte_comp.h:246
rte_comp_inflate_params::dictionary
uint8_t * dictionary
Definition
rte_comp.h:247
rte_comp_inflate_params::dictionary_len
uint16_t dictionary_len
Definition
rte_comp.h:249
rte_comp_lz4_params
Definition
rte_comp.h:297
rte_comp_lz4_params::flags
uint8_t flags
Definition
rte_comp.h:298
rte_comp_op
Definition
rte_comp.h:382
rte_comp_op::private_xform
void * private_xform
Definition
rte_comp.h:385
rte_comp_op::produced
uint32_t produced
Definition
rte_comp.h:486
rte_comp_op::debug_status
uint64_t debug_status
Definition
rte_comp.h:490
rte_comp_op::consumed
uint32_t consumed
Definition
rte_comp.h:482
rte_comp_op::digest
uint8_t * digest
Definition
rte_comp.h:457
rte_comp_op::mempool
struct rte_mempool * mempool
Definition
rte_comp.h:401
rte_comp_op::input_chksum
uint64_t input_chksum
Definition
rte_comp.h:473
rte_comp_op::iova_addr
rte_iova_t iova_addr
Definition
rte_comp.h:403
rte_comp_op::offset
uint32_t offset
Definition
rte_comp.h:430
rte_comp_op::output_chksum
uint64_t output_chksum
Definition
rte_comp.h:478
rte_comp_op::m_dst
struct rte_mbuf * m_dst
Definition
rte_comp.h:413
rte_comp_op::flush_flag
enum rte_comp_flush_flag flush_flag
Definition
rte_comp.h:469
rte_comp_op::status
uint8_t status
Definition
rte_comp.h:496
rte_comp_op::length
uint32_t length
Definition
rte_comp.h:438
rte_comp_op::m_src
struct rte_mbuf * m_src
Definition
rte_comp.h:405
rte_comp_op::stream
void * stream
Definition
rte_comp.h:390
rte_comp_xform
Definition
rte_comp.h:362
rte_comp_xform::type
enum rte_comp_xform_type type
Definition
rte_comp.h:363
rte_comp_xform::compress
struct rte_comp_compress_xform compress
Definition
rte_comp.h:366
rte_comp_xform::decompress
struct rte_comp_decompress_xform decompress
Definition
rte_comp.h:368
rte_mbuf
Definition
rte_mbuf_core.h:475
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