DPDK  24.11.0-rc3
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 #include "rte_comp.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
27  uint8_t min;
28  uint8_t max;
29  uint8_t increment;
35 };
36 
39  enum rte_comp_algorithm algo;
40  /* Compression algorithm */
43  struct rte_param_log2_range window_size;
45 };
46 
48 #define RTE_COMP_END_OF_CAPABILITIES_LIST() \
49  { RTE_COMP_ALGO_UNSPECIFIED }
50 
51 const struct rte_compressdev_capabilities *
52 rte_compressdev_capability_get(uint8_t dev_id,
53  enum rte_comp_algorithm algo);
54 
62 #define RTE_COMPDEV_FF_HW_ACCELERATED (1ULL << 0)
63 
64 #define RTE_COMPDEV_FF_CPU_SSE (1ULL << 1)
65 
66 #define RTE_COMPDEV_FF_CPU_AVX (1ULL << 2)
67 
68 #define RTE_COMPDEV_FF_CPU_AVX2 (1ULL << 3)
69 
70 #define RTE_COMPDEV_FF_CPU_AVX512 (1ULL << 4)
71 
72 #define RTE_COMPDEV_FF_CPU_NEON (1ULL << 5)
73 
74 #define RTE_COMPDEV_FF_OP_DONE_IN_DEQUEUE (1ULL << 6)
75 
90 const char *
92 
95  const char *driver_name;
96  uint64_t feature_flags;
103 };
104 
107  uint64_t enqueued_count;
109  uint64_t dequeued_count;
116 };
117 
118 
128 int
129 rte_compressdev_get_dev_id(const char *name);
130 
140 const char *
141 rte_compressdev_name_get(uint8_t dev_id);
142 
150 uint8_t
152 
167 uint8_t
168 rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
169  uint8_t nb_devices);
170 
171 /*
172  * Return the NUMA socket to which a device is connected.
173  *
174  * @param dev_id
175  * Compress device identifier
176  * @return
177  * The NUMA socket id to which the device is connected or
178  * a default of zero if the socket could not be determined.
179  * -1 if returned is the dev_id value is out of range.
180  */
181 int
182 rte_compressdev_socket_id(uint8_t dev_id);
183 
188  uint16_t nb_queue_pairs;
192  uint16_t max_nb_streams;
194 };
195 
211 int
212 rte_compressdev_configure(uint8_t dev_id,
213  struct rte_compressdev_config *config);
214 
229 int
230 rte_compressdev_start(uint8_t dev_id);
231 
239 void
240 rte_compressdev_stop(uint8_t dev_id);
241 
256 int
257 rte_compressdev_close(uint8_t dev_id);
258 
282 int
283 rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
284  uint32_t max_inflight_ops, int socket_id);
285 
294 uint16_t
295 rte_compressdev_queue_pair_count(uint8_t dev_id);
296 
297 
311 int
312 rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
313 
320 void
321 rte_compressdev_stats_reset(uint8_t dev_id);
322 
337 void
338 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
339 
394 uint16_t
395 rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
396  struct rte_comp_op **ops, uint16_t nb_ops);
397 
448 uint16_t
449 rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
450  struct rte_comp_op **ops, uint16_t nb_ops);
451 
475 int
476 rte_compressdev_stream_create(uint8_t dev_id,
477  const struct rte_comp_xform *xform,
478  void **stream);
479 
496 int
497 rte_compressdev_stream_free(uint8_t dev_id, void *stream);
498 
522 int
524  const struct rte_comp_xform *xform,
525  void **private_xform);
526 
543 int
544 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);
545 
546 #ifdef __cplusplus
547 }
548 #endif
549 
550 #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)