DPDK  20.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 */
47 };
48 
50 #define RTE_COMP_END_OF_CAPABILITIES_LIST() \
51  { RTE_COMP_ALGO_UNSPECIFIED }
52 
53 __rte_experimental
54 const struct rte_compressdev_capabilities *
55 rte_compressdev_capability_get(uint8_t dev_id,
56  enum rte_comp_algorithm algo);
57 
65 #define RTE_COMPDEV_FF_HW_ACCELERATED (1ULL << 0)
66 
67 #define RTE_COMPDEV_FF_CPU_SSE (1ULL << 1)
68 
69 #define RTE_COMPDEV_FF_CPU_AVX (1ULL << 2)
70 
71 #define RTE_COMPDEV_FF_CPU_AVX2 (1ULL << 3)
72 
73 #define RTE_COMPDEV_FF_CPU_AVX512 (1ULL << 4)
74 
75 #define RTE_COMPDEV_FF_CPU_NEON (1ULL << 5)
76 
77 #define RTE_COMPDEV_FF_OP_DONE_IN_DEQUEUE (1ULL << 6)
78 
93 __rte_experimental
94 const char *
96 
99  const char *driver_name;
100  uint64_t feature_flags;
107 };
108 
111  uint64_t enqueued_count;
113  uint64_t dequeued_count;
120 };
121 
122 
132 __rte_experimental
133 int
134 rte_compressdev_get_dev_id(const char *name);
135 
145 __rte_experimental
146 const char *
147 rte_compressdev_name_get(uint8_t dev_id);
148 
156 __rte_experimental
157 uint8_t
159 
174 __rte_experimental
175 uint8_t
176 rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
177  uint8_t nb_devices);
178 
179 /*
180  * Return the NUMA socket to which a device is connected.
181  *
182  * @param dev_id
183  * Compress device identifier
184  * @return
185  * The NUMA socket id to which the device is connected or
186  * a default of zero if the socket could not be determined.
187  * -1 if returned is the dev_id value is out of range.
188  */
189 __rte_experimental
190 int
191 rte_compressdev_socket_id(uint8_t dev_id);
192 
197  uint16_t nb_queue_pairs;
201  uint16_t max_nb_streams;
203 };
204 
220 __rte_experimental
221 int
222 rte_compressdev_configure(uint8_t dev_id,
223  struct rte_compressdev_config *config);
224 
239 __rte_experimental
240 int
241 rte_compressdev_start(uint8_t dev_id);
242 
250 __rte_experimental
251 void
252 rte_compressdev_stop(uint8_t dev_id);
253 
268 __rte_experimental
269 int
270 rte_compressdev_close(uint8_t dev_id);
271 
295 __rte_experimental
296 int
297 rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
298  uint32_t max_inflight_ops, int socket_id);
299 
308 __rte_experimental
309 uint16_t
310 rte_compressdev_queue_pair_count(uint8_t dev_id);
311 
312 
326 __rte_experimental
327 int
328 rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
329 
336 __rte_experimental
337 void
338 rte_compressdev_stats_reset(uint8_t dev_id);
339 
354 __rte_experimental
355 void
356 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
357 
412 __rte_experimental
413 uint16_t
414 rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
415  struct rte_comp_op **ops, uint16_t nb_ops);
416 
467 __rte_experimental
468 uint16_t
469 rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
470  struct rte_comp_op **ops, uint16_t nb_ops);
471 
496 __rte_experimental
497 int
498 rte_compressdev_stream_create(uint8_t dev_id,
499  const struct rte_comp_xform *xform,
500  void **stream);
501 
518 __rte_experimental
519 int
520 rte_compressdev_stream_free(uint8_t dev_id, void *stream);
521 
545 __rte_experimental
546 int
548  const struct rte_comp_xform *xform,
549  void **private_xform);
550 
567 __rte_experimental
568 int
569 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);
570 
571 #ifdef __cplusplus
572 }
573 #endif
574 
575 #endif /* _RTE_COMPRESSDEV_H_ */
__rte_experimental int rte_compressdev_get_dev_id(const char *name)
__rte_experimental const char * rte_compressdev_name_get(uint8_t dev_id)
__rte_experimental int rte_compressdev_start(uint8_t dev_id)
__rte_experimental void rte_compressdev_stop(uint8_t dev_id)
__rte_experimental int rte_compressdev_configure(uint8_t dev_id, struct rte_compressdev_config *config)
const char * driver_name
__rte_experimental int rte_compressdev_private_xform_create(uint8_t dev_id, const struct rte_comp_xform *xform, void **private_xform)
__rte_experimental uint16_t rte_compressdev_queue_pair_count(uint8_t dev_id)
__rte_experimental uint8_t rte_compressdev_devices_get(const char *driver_name, uint8_t *devices, uint8_t nb_devices)
rte_comp_algorithm
Definition: rte_comp.h:96
__rte_experimental void rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info)
__rte_experimental int rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform)
__rte_experimental uint8_t rte_compressdev_count(void)
__rte_experimental int rte_compressdev_stream_free(uint8_t dev_id, void *stream)
__rte_experimental int rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, uint32_t max_inflight_ops, int socket_id)
__rte_experimental int rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats)
__rte_experimental uint16_t rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_comp_op **ops, uint16_t nb_ops)
__rte_experimental const char * rte_compressdev_get_feature_name(uint64_t flag)
__rte_experimental void rte_compressdev_stats_reset(uint8_t dev_id)
__rte_experimental uint16_t rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_comp_op **ops, uint16_t nb_ops)
__rte_experimental int rte_compressdev_stream_create(uint8_t dev_id, const struct rte_comp_xform *xform, void **stream)
__rte_experimental int rte_compressdev_close(uint8_t dev_id)
const struct rte_compressdev_capabilities * capabilities
struct rte_param_log2_range window_size