DPDK  20.11.3
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 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #include <rte_common.h>
25 
26 #include "rte_comp.h"
27 
33  uint8_t min;
34  uint8_t max;
35  uint8_t increment;
41 };
42 
45  enum rte_comp_algorithm algo;
46  /* Compression algorithm */
49  struct rte_param_log2_range window_size;
51 };
52 
54 #define RTE_COMP_END_OF_CAPABILITIES_LIST() \
55  { RTE_COMP_ALGO_UNSPECIFIED }
56 
57 __rte_experimental
58 const struct rte_compressdev_capabilities *
59 rte_compressdev_capability_get(uint8_t dev_id,
60  enum rte_comp_algorithm algo);
61 
69 #define RTE_COMPDEV_FF_HW_ACCELERATED (1ULL << 0)
70 
71 #define RTE_COMPDEV_FF_CPU_SSE (1ULL << 1)
72 
73 #define RTE_COMPDEV_FF_CPU_AVX (1ULL << 2)
74 
75 #define RTE_COMPDEV_FF_CPU_AVX2 (1ULL << 3)
76 
77 #define RTE_COMPDEV_FF_CPU_AVX512 (1ULL << 4)
78 
79 #define RTE_COMPDEV_FF_CPU_NEON (1ULL << 5)
80 
81 #define RTE_COMPDEV_FF_OP_DONE_IN_DEQUEUE (1ULL << 6)
82 
97 __rte_experimental
98 const char *
100 
103  const char *driver_name;
104  uint64_t feature_flags;
111 };
112 
115  uint64_t enqueued_count;
117  uint64_t dequeued_count;
124 };
125 
126 
136 __rte_experimental
137 int
138 rte_compressdev_get_dev_id(const char *name);
139 
149 __rte_experimental
150 const char *
151 rte_compressdev_name_get(uint8_t dev_id);
152 
160 __rte_experimental
161 uint8_t
163 
178 __rte_experimental
179 uint8_t
180 rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
181  uint8_t nb_devices);
182 
183 /*
184  * Return the NUMA socket to which a device is connected.
185  *
186  * @param dev_id
187  * Compress device identifier
188  * @return
189  * The NUMA socket id to which the device is connected or
190  * a default of zero if the socket could not be determined.
191  * -1 if returned is the dev_id value is out of range.
192  */
193 __rte_experimental
194 int
195 rte_compressdev_socket_id(uint8_t dev_id);
196 
201  uint16_t nb_queue_pairs;
205  uint16_t max_nb_streams;
207 };
208 
224 __rte_experimental
225 int
226 rte_compressdev_configure(uint8_t dev_id,
227  struct rte_compressdev_config *config);
228 
243 __rte_experimental
244 int
245 rte_compressdev_start(uint8_t dev_id);
246 
254 __rte_experimental
255 void
256 rte_compressdev_stop(uint8_t dev_id);
257 
272 __rte_experimental
273 int
274 rte_compressdev_close(uint8_t dev_id);
275 
299 __rte_experimental
300 int
301 rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
302  uint32_t max_inflight_ops, int socket_id);
303 
312 __rte_experimental
313 uint16_t
314 rte_compressdev_queue_pair_count(uint8_t dev_id);
315 
316 
330 __rte_experimental
331 int
332 rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
333 
340 __rte_experimental
341 void
342 rte_compressdev_stats_reset(uint8_t dev_id);
343 
358 __rte_experimental
359 void
360 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
361 
416 __rte_experimental
417 uint16_t
418 rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
419  struct rte_comp_op **ops, uint16_t nb_ops);
420 
471 __rte_experimental
472 uint16_t
473 rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
474  struct rte_comp_op **ops, uint16_t nb_ops);
475 
500 __rte_experimental
501 int
502 rte_compressdev_stream_create(uint8_t dev_id,
503  const struct rte_comp_xform *xform,
504  void **stream);
505 
522 __rte_experimental
523 int
524 rte_compressdev_stream_free(uint8_t dev_id, void *stream);
525 
549 __rte_experimental
550 int
552  const struct rte_comp_xform *xform,
553  void **private_xform);
554 
571 __rte_experimental
572 int
573 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);
574 
575 #ifdef __cplusplus
576 }
577 #endif
578 
579 #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