DPDK  18.05.1-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 
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_MBUF_SCATTER_GATHER (1ULL << 2)
34 
35 #define RTE_COMP_FF_ADLER32_CHECKSUM (1ULL << 3)
36 
37 #define RTE_COMP_FF_CRC32_CHECKSUM (1ULL << 4)
38 
39 #define RTE_COMP_FF_CRC32_ADLER32_CHECKSUM (1ULL << 5)
40 
41 #define RTE_COMP_FF_MULTI_PKT_CHECKSUM (1ULL << 6)
42 
43 #define RTE_COMP_FF_SHA1_HASH (1ULL << 7)
44 
45 #define RTE_COMP_FF_SHA2_SHA256_HASH (1ULL << 8)
46 
47 #define RTE_COMP_FF_NONCOMPRESSED_BLOCKS (1ULL << 9)
48 
49 #define RTE_COMP_FF_SHAREABLE_PRIV_XFORM (1ULL << 10)
50 
78 };
79 
82  RTE_COMP_ALGO_UNSPECIFIED = 0,
97  RTE_COMP_ALGO_LIST_END
98 };
99 
108  RTE_COMP_HASH_ALGO_LIST_END
109 };
110 
116 #define RTE_COMP_LEVEL_PMD_DEFAULT (-1)
117 
118 #define RTE_COMP_LEVEL_NONE (0)
119 
120 #define RTE_COMP_LEVEL_MIN (1)
121 
122 #define RTE_COMP_LEVEL_MAX (9)
123 
137 };
138 
139 
148 };
149 
171 };
172 
179 };
180 
194 };
195 
196 
201 };
202 
207  union {
210  };
211  int level;
213  uint8_t window_size;
224 };
225 
234  uint8_t window_size;
243 };
244 
255  union {
260  };
261 };
262 
272 struct rte_comp_op {
273  enum rte_comp_op_type op_type;
274  union {
280  void *stream;
289  };
290 
295  struct rte_mbuf *m_src;
303  struct rte_mbuf *m_dst;
313  struct {
314  uint32_t offset;
322  uint32_t length;
328  } src;
329  struct {
330  uint32_t offset;
339  } dst;
340  struct {
341  uint8_t *digest;
352  } hash;
357  uint64_t input_chksum;
362  uint64_t output_chksum;
366  uint32_t consumed;
370  uint32_t produced;
374  uint64_t debug_status;
380  uint8_t status;
389 
408 struct rte_mempool * __rte_experimental
409 rte_comp_op_pool_create(const char *name,
410  unsigned int nb_elts, unsigned int cache_size,
411  uint16_t user_size, int socket_id);
412 
423 struct rte_comp_op * __rte_experimental
425 
439 int __rte_experimental
441  struct rte_comp_op **ops, uint16_t nb_ops);
442 
451 void __rte_experimental
452 rte_comp_op_free(struct rte_comp_op *op);
453 
463 const char * __rte_experimental
464 rte_comp_get_feature_name(uint64_t flag);
465 
466 #ifdef __cplusplus
467 }
468 #endif
469 
470 #endif /* _RTE_COMP_H_ */
struct rte_mempool * mempool
Definition: rte_comp.h:291
enum rte_comp_flush_flag flush_flag
Definition: rte_comp.h:353
struct rte_mbuf * m_dst
Definition: rte_comp.h:303
rte_comp_op_status
Definition: rte_comp.h:57
rte_comp_xform_type
Definition: rte_comp.h:174
uint64_t debug_status
Definition: rte_comp.h:374
enum rte_comp_hash_algorithm hash_algo
Definition: rte_comp.h:239
void * stream
Definition: rte_comp.h:280
rte_comp_op_type
Definition: rte_comp.h:182
rte_comp_algorithm
Definition: rte_comp.h:81
rte_comp_hash_algorithm
Definition: rte_comp.h:101
struct rte_comp_decompress_xform decompress
Definition: rte_comp.h:258
struct rte_comp_deflate_params deflate
Definition: rte_comp.h:208
uint32_t cache_size
Definition: rte_mempool.h:230
enum rte_comp_checksum_type chksum
Definition: rte_comp.h:218
rte_comp_checksum_type
Definition: rte_comp.h:126
struct rte_comp_op *__rte_experimental rte_comp_op_alloc(struct rte_mempool *mempool)
uint32_t length
Definition: rte_comp.h:322
uint32_t consumed
Definition: rte_comp.h:366
struct rte_comp_compress_xform compress
Definition: rte_comp.h:256
uint8_t * digest
Definition: rte_comp.h:341
uint64_t output_chksum
Definition: rte_comp.h:362
enum rte_comp_huffman huffman
Definition: rte_comp.h:199
uint8_t status
Definition: rte_comp.h:380
rte_iova_t iova_addr
Definition: rte_comp.h:293
uint32_t produced
Definition: rte_comp.h:370
enum rte_comp_xform_type type
Definition: rte_comp.h:253
enum rte_comp_algorithm algo
Definition: rte_comp.h:205
struct rte_mbuf * m_src
Definition: rte_comp.h:295
void * private_xform
Definition: rte_comp.h:275
uint64_t rte_iova_t
Definition: rte_memory.h:82
const char *__rte_experimental rte_comp_get_feature_name(uint64_t flag)
rte_comp_huffman
Definition: rte_comp.h:141
enum rte_comp_hash_algorithm hash_algo
Definition: rte_comp.h:220
#define __rte_cache_aligned
Definition: rte_memory.h:66
void __rte_experimental rte_comp_op_free(struct rte_comp_op *op)
enum rte_comp_checksum_type chksum
Definition: rte_comp.h:232
enum rte_comp_algorithm algo
Definition: rte_comp.h:230
rte_comp_flush_flag
Definition: rte_comp.h:151
struct rte_mempool *__rte_experimental rte_comp_op_pool_create(const char *name, unsigned int nb_elts, unsigned int cache_size, uint16_t user_size, int socket_id)
int __rte_experimental rte_comp_op_bulk_alloc(struct rte_mempool *mempool, struct rte_comp_op **ops, uint16_t nb_ops)
char name[RTE_MEMZONE_NAMESIZE]
Definition: rte_mempool.h:219
uint64_t input_chksum
Definition: rte_comp.h:357
uint32_t offset
Definition: rte_comp.h:314