DPDK  22.03.0
rte_compressdev_pmd.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_PMD_H_
6 #define _RTE_COMPRESSDEV_PMD_H_
7 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #include <string.h>
21 
22 
23 #include "rte_compressdev.h"
24 #include "rte_compressdev_internal.h"
25 
26 #define RTE_COMPRESSDEV_PMD_NAME_ARG ("name")
27 #define RTE_COMPRESSDEV_PMD_SOCKET_ID_ARG ("socket_id")
28 
29 static const char * const compressdev_pmd_valid_params[] = {
30  RTE_COMPRESSDEV_PMD_NAME_ARG,
31  RTE_COMPRESSDEV_PMD_SOCKET_ID_ARG
32 };
33 
38 struct rte_compressdev_pmd_init_params {
39  char name[RTE_COMPRESSDEV_NAME_MAX_LEN];
40  int socket_id;
41 };
42 
46  struct rte_compressdev_data *data[RTE_COMPRESS_MAX_DEVS];
48  uint8_t nb_devs;
49  uint8_t max_devs;
50 };
51 
60 __rte_experimental
61 struct rte_compressdev *
62 rte_compressdev_pmd_get_named_dev(const char *name);
63 
80 typedef int (*compressdev_configure_t)(struct rte_compressdev *dev,
81  struct rte_compressdev_config *config);
82 
91 typedef int (*compressdev_start_t)(struct rte_compressdev *dev);
92 
99 typedef void (*compressdev_stop_t)(struct rte_compressdev *dev);
100 
110 typedef int (*compressdev_close_t)(struct rte_compressdev *dev);
111 
112 
121 typedef void (*compressdev_stats_get_t)(struct rte_compressdev *dev,
122  struct rte_compressdev_stats *stats);
123 
124 
131 typedef void (*compressdev_stats_reset_t)(struct rte_compressdev *dev);
132 
133 
142 typedef void (*compressdev_info_get_t)(struct rte_compressdev *dev,
143  struct rte_compressdev_info *dev_info);
144 
160  uint16_t qp_id, uint32_t max_inflight_ops, int socket_id);
161 
174  uint16_t qp_id);
175 
192 typedef int (*compressdev_stream_create_t)(struct rte_compressdev *dev,
193  const struct rte_comp_xform *xform, void **stream);
194 
209 typedef int (*compressdev_stream_free_t)(struct rte_compressdev *dev,
210  void *stream);
211 
230  const struct rte_comp_xform *xform, void **private_xform);
231 
246  void *private_xform);
247 
276 };
277 
293 __rte_experimental
294 struct rte_compressdev *
295 rte_compressdev_pmd_allocate(const char *name, int socket_id);
296 
309 __rte_experimental
310 int
311 rte_compressdev_pmd_release_device(struct rte_compressdev *dev);
312 
313 
332 __rte_experimental
333 int
334 rte_compressdev_pmd_parse_input_args(
335  struct rte_compressdev_pmd_init_params *params,
336  const char *args);
337 
354 __rte_experimental
355 struct rte_compressdev *
356 rte_compressdev_pmd_create(const char *name,
357  struct rte_device *device,
358  size_t private_data_size,
359  struct rte_compressdev_pmd_init_params *params);
360 
373 __rte_experimental
374 int
375 rte_compressdev_pmd_destroy(struct rte_compressdev *dev);
376 
377 #ifdef __cplusplus
378 }
379 #endif
380 
381 #endif /* _RTE_COMPRESSDEV_PMD_H_ */
compressdev_queue_pair_setup_t queue_pair_setup
compressdev_stream_create_t stream_create
compressdev_queue_pair_release_t queue_pair_release
int(* compressdev_private_xform_free_t)(struct rte_compressdev *dev, void *private_xform)
int(* compressdev_configure_t)(struct rte_compressdev *dev, struct rte_compressdev_config *config)
compressdev_start_t dev_start
int(* compressdev_queue_pair_setup_t)(struct rte_compressdev *dev, uint16_t qp_id, uint32_t max_inflight_ops, int socket_id)
void(* compressdev_stats_reset_t)(struct rte_compressdev *dev)
compressdev_stats_get_t stats_get
struct rte_compressdev * devs
struct rte_device * device
compressdev_stream_free_t stream_free
int(* compressdev_stream_free_t)(struct rte_compressdev *dev, void *stream)
compressdev_stats_reset_t stats_reset
int(* compressdev_stream_create_t)(struct rte_compressdev *dev, const struct rte_comp_xform *xform, void **stream)
compressdev_private_xform_free_t private_xform_free
compressdev_info_get_t dev_infos_get
compressdev_close_t dev_close
int(* compressdev_close_t)(struct rte_compressdev *dev)
compressdev_stop_t dev_stop
int(* compressdev_private_xform_create_t)(struct rte_compressdev *dev, const struct rte_comp_xform *xform, void **private_xform)
void(* compressdev_info_get_t)(struct rte_compressdev *dev, struct rte_compressdev_info *dev_info)
void(* compressdev_stop_t)(struct rte_compressdev *dev)
compressdev_configure_t dev_configure
int(* compressdev_start_t)(struct rte_compressdev *dev)
int(* compressdev_queue_pair_release_t)(struct rte_compressdev *dev, uint16_t qp_id)
void(* compressdev_stats_get_t)(struct rte_compressdev *dev, struct rte_compressdev_stats *stats)
__rte_experimental struct rte_compressdev * rte_compressdev_pmd_get_named_dev(const char *name)
compressdev_private_xform_create_t private_xform_create