DPDK  19.05.0
rte_compressdev.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_COMPRESSDEV_H_
6 #define _RTE_COMPRESSDEV_H_
7 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #include <rte_common.h>
21 
22 #include "rte_comp.h"
23 
29  uint8_t min;
30  uint8_t max;
31  uint8_t increment;
37 };
38 
41  enum rte_comp_algorithm algo;
42  /* Compression algorithm */
43  uint64_t comp_feature_flags;
47 };
48 
50 #define RTE_COMP_END_OF_CAPABILITIES_LIST() \
51  { RTE_COMP_ALGO_UNSPECIFIED }
52 
53 const struct rte_compressdev_capabilities * __rte_experimental
54 rte_compressdev_capability_get(uint8_t dev_id,
55  enum rte_comp_algorithm algo);
56 
64 #define RTE_COMPDEV_FF_HW_ACCELERATED (1ULL << 0)
65 
66 #define RTE_COMPDEV_FF_CPU_SSE (1ULL << 1)
67 
68 #define RTE_COMPDEV_FF_CPU_AVX (1ULL << 2)
69 
70 #define RTE_COMPDEV_FF_CPU_AVX2 (1ULL << 3)
71 
72 #define RTE_COMPDEV_FF_CPU_AVX512 (1ULL << 4)
73 
74 #define RTE_COMPDEV_FF_CPU_NEON (1ULL << 5)
75 
76 #define RTE_COMPDEV_FF_OP_DONE_IN_DEQUEUE (1ULL << 6)
77 
92 const char * __rte_experimental
94 
97  const char *driver_name;
98  uint64_t feature_flags;
101  uint16_t max_nb_queue_pairs;
105 };
106 
109  uint64_t enqueued_count;
111  uint64_t dequeued_count;
114  uint64_t enqueue_err_count;
116  uint64_t dequeue_err_count;
118 };
119 
120 
130 int __rte_experimental
131 rte_compressdev_get_dev_id(const char *name);
132 
142 const char * __rte_experimental
143 rte_compressdev_name_get(uint8_t dev_id);
144 
152 uint8_t __rte_experimental
154 
169 uint8_t __rte_experimental
170 rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
171  uint8_t nb_devices);
172 
173 /*
174  * Return the NUMA socket to which a device is connected.
175  *
176  * @param dev_id
177  * Compress device identifier
178  * @return
179  * The NUMA socket id to which the device is connected or
180  * a default of zero if the socket could not be determined.
181  * -1 if returned is the dev_id value is out of range.
182  */
183 int __rte_experimental
184 rte_compressdev_socket_id(uint8_t dev_id);
185 
188  int socket_id;
190  uint16_t nb_queue_pairs;
192  uint16_t max_nb_priv_xforms;
194  uint16_t max_nb_streams;
196 };
197 
213 int __rte_experimental
214 rte_compressdev_configure(uint8_t dev_id,
215  struct rte_compressdev_config *config);
216 
231 int __rte_experimental
232 rte_compressdev_start(uint8_t dev_id);
233 
241 void __rte_experimental
242 rte_compressdev_stop(uint8_t dev_id);
243 
258 int __rte_experimental
259 rte_compressdev_close(uint8_t dev_id);
260 
284 int __rte_experimental
285 rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
286  uint32_t max_inflight_ops, int socket_id);
287 
296 uint16_t __rte_experimental
297 rte_compressdev_queue_pair_count(uint8_t dev_id);
298 
299 
313 int __rte_experimental
314 rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
315 
322 void __rte_experimental
323 rte_compressdev_stats_reset(uint8_t dev_id);
324 
339 void __rte_experimental
340 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
341 
396 uint16_t __rte_experimental
397 rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
398  struct rte_comp_op **ops, uint16_t nb_ops);
399 
450 uint16_t __rte_experimental
451 rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
452  struct rte_comp_op **ops, uint16_t nb_ops);
453 
478 int __rte_experimental
479 rte_compressdev_stream_create(uint8_t dev_id,
480  const struct rte_comp_xform *xform,
481  void **stream);
482 
499 int __rte_experimental
500 rte_compressdev_stream_free(uint8_t dev_id, void *stream);
501 
525 int __rte_experimental
527  const struct rte_comp_xform *xform,
528  void **private_xform);
529 
546 int __rte_experimental
547 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);
548 
549 #ifdef __cplusplus
550 }
551 #endif
552 
553 #endif /* _RTE_COMPRESSDEV_H_ */