DPDK  18.11.11
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 #include <rte_dev.h>
23 #include <rte_common.h>
24 
25 #include "rte_compressdev.h"
26 #include "rte_compressdev_internal.h"
27 
28 #define RTE_COMPRESSDEV_PMD_NAME_ARG ("name")
29 #define RTE_COMPRESSDEV_PMD_SOCKET_ID_ARG ("socket_id")
30 
31 static const char * const compressdev_pmd_valid_params[] = {
32  RTE_COMPRESSDEV_PMD_NAME_ARG,
33  RTE_COMPRESSDEV_PMD_SOCKET_ID_ARG
34 };
35 
40 struct rte_compressdev_pmd_init_params {
41  char name[RTE_COMPRESSDEV_NAME_MAX_LEN];
42  int socket_id;
43 };
44 
48  struct rte_compressdev_data *data[RTE_COMPRESS_MAX_DEVS];
50  uint8_t nb_devs;
51  uint8_t max_devs;
52 };
53 
62 struct rte_compressdev * __rte_experimental
63 rte_compressdev_pmd_get_named_dev(const char *name);
64 
81 typedef int (*compressdev_configure_t)(struct rte_compressdev *dev,
82  struct rte_compressdev_config *config);
83 
92 typedef int (*compressdev_start_t)(struct rte_compressdev *dev);
93 
100 typedef void (*compressdev_stop_t)(struct rte_compressdev *dev);
101 
111 typedef int (*compressdev_close_t)(struct rte_compressdev *dev);
112 
113 
122 typedef void (*compressdev_stats_get_t)(struct rte_compressdev *dev,
123  struct rte_compressdev_stats *stats);
124 
125 
132 typedef void (*compressdev_stats_reset_t)(struct rte_compressdev *dev);
133 
134 
141 typedef void (*compressdev_info_get_t)(struct rte_compressdev *dev,
142  struct rte_compressdev_info *dev_info);
143 
159  uint16_t qp_id, uint32_t max_inflight_ops, int socket_id);
160 
173  uint16_t qp_id);
174 
183 typedef uint32_t (*compressdev_queue_pair_count_t)(struct rte_compressdev *dev);
184 
201 typedef int (*compressdev_stream_create_t)(struct rte_compressdev *dev,
202  const struct rte_comp_xform *xform, void **stream);
203 
218 typedef int (*compressdev_stream_free_t)(struct rte_compressdev *dev,
219  void *stream);
220 
239  const struct rte_comp_xform *xform, void **private_xform);
240 
255  void *private_xform);
256 
285 };
286 
302 struct rte_compressdev * __rte_experimental
303 rte_compressdev_pmd_allocate(const char *name, int socket_id);
304 
317 int __rte_experimental
318 rte_compressdev_pmd_release_device(struct rte_compressdev *dev);
319 
320 
339 int __rte_experimental
340 rte_compressdev_pmd_parse_input_args(
341  struct rte_compressdev_pmd_init_params *params,
342  const char *args);
343 
360 struct rte_compressdev * __rte_experimental
361 rte_compressdev_pmd_create(const char *name,
362  struct rte_device *device,
363  size_t private_data_size,
364  struct rte_compressdev_pmd_init_params *params);
365 
378 int __rte_experimental
379 rte_compressdev_pmd_destroy(struct rte_compressdev *dev);
380 
381 #ifdef __cplusplus
382 }
383 #endif
384 
385 #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)
uint32_t(* compressdev_queue_pair_count_t)(struct rte_compressdev *dev)
compressdev_private_xform_free_t private_xform_free
struct rte_compressdev *__rte_experimental rte_compressdev_pmd_get_named_dev(const char *name)
compressdev_info_get_t dev_infos_get
struct rte_compressdev_data * data[RTE_COMPRESS_MAX_DEVS]
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)
compressdev_private_xform_create_t private_xform_create