DPDK  18.05.1
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 
86 const char * __rte_experimental
88 
91  const char *driver_name;
92  uint64_t feature_flags;
95  uint16_t max_nb_queue_pairs;
99 };
100 
103  uint64_t enqueued_count;
105  uint64_t dequeued_count;
108  uint64_t enqueue_err_count;
110  uint64_t dequeue_err_count;
112 };
113 
114 
124 int __rte_experimental
125 rte_compressdev_get_dev_id(const char *name);
126 
136 const char * __rte_experimental
137 rte_compressdev_name_get(uint8_t dev_id);
138 
146 uint8_t __rte_experimental
148 
163 uint8_t __rte_experimental
164 rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
165  uint8_t nb_devices);
166 
167 /*
168  * Return the NUMA socket to which a device is connected.
169  *
170  * @param dev_id
171  * Compress device identifier
172  * @return
173  * The NUMA socket id to which the device is connected or
174  * a default of zero if the socket could not be determined.
175  * -1 if returned is the dev_id value is out of range.
176  */
177 int __rte_experimental
178 rte_compressdev_socket_id(uint8_t dev_id);
179 
182  int socket_id;
184  uint16_t nb_queue_pairs;
186  uint16_t max_nb_priv_xforms;
188  uint16_t max_nb_streams;
190 };
191 
207 int __rte_experimental
208 rte_compressdev_configure(uint8_t dev_id,
209  struct rte_compressdev_config *config);
210 
225 int __rte_experimental
226 rte_compressdev_start(uint8_t dev_id);
227 
235 void __rte_experimental
236 rte_compressdev_stop(uint8_t dev_id);
237 
252 int __rte_experimental
253 rte_compressdev_close(uint8_t dev_id);
254 
278 int __rte_experimental
279 rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
280  uint32_t max_inflight_ops, int socket_id);
281 
290 uint16_t __rte_experimental
291 rte_compressdev_queue_pair_count(uint8_t dev_id);
292 
293 
307 int __rte_experimental
308 rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
309 
316 void __rte_experimental
317 rte_compressdev_stats_reset(uint8_t dev_id);
318 
333 void __rte_experimental
334 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
335 
390 uint16_t __rte_experimental
391 rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
392  struct rte_comp_op **ops, uint16_t nb_ops);
393 
437 uint16_t __rte_experimental
438 rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
439  struct rte_comp_op **ops, uint16_t nb_ops);
440 
465 int __rte_experimental
466 rte_compressdev_stream_create(uint8_t dev_id,
467  const struct rte_comp_xform *xform,
468  void **stream);
469 
486 int __rte_experimental
487 rte_compressdev_stream_free(uint8_t dev_id, void *stream);
488 
512 int __rte_experimental
514  const struct rte_comp_xform *xform,
515  void **private_xform);
516 
533 int __rte_experimental
534 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);
535 
536 #ifdef __cplusplus
537 }
538 #endif
539 
540 #endif /* _RTE_COMPRESSDEV_H_ */