DPDK  24.07.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 
21 #include "rte_comp.h"
22 
28  uint8_t min;
29  uint8_t max;
30  uint8_t increment;
36 };
37 
40  enum rte_comp_algorithm algo;
41  /* Compression algorithm */
44  struct rte_param_log2_range window_size;
46 };
47 
49 #define RTE_COMP_END_OF_CAPABILITIES_LIST() \
50  { RTE_COMP_ALGO_UNSPECIFIED }
51 
52 const struct rte_compressdev_capabilities *
53 rte_compressdev_capability_get(uint8_t dev_id,
54  enum rte_comp_algorithm algo);
55 
63 #define RTE_COMPDEV_FF_HW_ACCELERATED (1ULL << 0)
64 
65 #define RTE_COMPDEV_FF_CPU_SSE (1ULL << 1)
66 
67 #define RTE_COMPDEV_FF_CPU_AVX (1ULL << 2)
68 
69 #define RTE_COMPDEV_FF_CPU_AVX2 (1ULL << 3)
70 
71 #define RTE_COMPDEV_FF_CPU_AVX512 (1ULL << 4)
72 
73 #define RTE_COMPDEV_FF_CPU_NEON (1ULL << 5)
74 
75 #define RTE_COMPDEV_FF_OP_DONE_IN_DEQUEUE (1ULL << 6)
76 
91 const char *
93 
96  const char *driver_name;
97  uint64_t feature_flags;
104 };
105 
108  uint64_t enqueued_count;
110  uint64_t dequeued_count;
117 };
118 
119 
129 int
130 rte_compressdev_get_dev_id(const char *name);
131 
141 const char *
142 rte_compressdev_name_get(uint8_t dev_id);
143 
151 uint8_t
153 
168 uint8_t
169 rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
170  uint8_t nb_devices);
171 
172 /*
173  * Return the NUMA socket to which a device is connected.
174  *
175  * @param dev_id
176  * Compress device identifier
177  * @return
178  * The NUMA socket id to which the device is connected or
179  * a default of zero if the socket could not be determined.
180  * -1 if returned is the dev_id value is out of range.
181  */
182 int
183 rte_compressdev_socket_id(uint8_t dev_id);
184 
189  uint16_t nb_queue_pairs;
193  uint16_t max_nb_streams;
195 };
196 
212 int
213 rte_compressdev_configure(uint8_t dev_id,
214  struct rte_compressdev_config *config);
215 
230 int
231 rte_compressdev_start(uint8_t dev_id);
232 
240 void
241 rte_compressdev_stop(uint8_t dev_id);
242 
257 int
258 rte_compressdev_close(uint8_t dev_id);
259 
283 int
284 rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
285  uint32_t max_inflight_ops, int socket_id);
286 
295 uint16_t
296 rte_compressdev_queue_pair_count(uint8_t dev_id);
297 
298 
312 int
313 rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
314 
321 void
322 rte_compressdev_stats_reset(uint8_t dev_id);
323 
338 void
339 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
340 
395 uint16_t
396 rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
397  struct rte_comp_op **ops, uint16_t nb_ops);
398 
449 uint16_t
450 rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
451  struct rte_comp_op **ops, uint16_t nb_ops);
452 
476 int
477 rte_compressdev_stream_create(uint8_t dev_id,
478  const struct rte_comp_xform *xform,
479  void **stream);
480 
497 int
498 rte_compressdev_stream_free(uint8_t dev_id, void *stream);
499 
523 int
525  const struct rte_comp_xform *xform,
526  void **private_xform);
527 
544 int
545 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);
546 
547 #ifdef __cplusplus
548 }
549 #endif
550 
551 #endif /* _RTE_COMPRESSDEV_H_ */
const char * rte_compressdev_get_feature_name(uint64_t flag)
int rte_compressdev_close(uint8_t dev_id)
int rte_compressdev_private_xform_create(uint8_t dev_id, const struct rte_comp_xform *xform, void **private_xform)
const char * driver_name
uint8_t rte_compressdev_count(void)
uint16_t rte_compressdev_queue_pair_count(uint8_t dev_id)
int rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats)
rte_comp_algorithm
Definition: rte_comp.h:106
uint16_t rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_comp_op **ops, uint16_t nb_ops)
int rte_compressdev_stream_create(uint8_t dev_id, const struct rte_comp_xform *xform, void **stream)
int rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform)
int rte_compressdev_stream_free(uint8_t dev_id, void *stream)
uint16_t rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_comp_op **ops, uint16_t nb_ops)
int rte_compressdev_get_dev_id(const char *name)
int rte_compressdev_start(uint8_t dev_id)
const char * rte_compressdev_name_get(uint8_t dev_id)
void rte_compressdev_stop(uint8_t dev_id)
void rte_compressdev_stats_reset(uint8_t dev_id)
int rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, uint32_t max_inflight_ops, int socket_id)
const struct rte_compressdev_capabilities * capabilities
uint8_t rte_compressdev_devices_get(const char *driver_name, uint8_t *devices, uint8_t nb_devices)
int rte_compressdev_configure(uint8_t dev_id, struct rte_compressdev_config *config)
void rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info)