1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017-2018 Intel Corporation
5 #ifndef _RTE_COMPRESSDEV_INTERNAL_H_
6 #define _RTE_COMPRESSDEV_INTERNAL_H_
12 /* rte_compressdev_internal.h
13 * This file holds Compressdev private data structures.
19 #define RTE_COMPRESSDEV_NAME_MAX_LEN (64)
20 /**< Max length of name of comp PMD */
23 extern int compressdev_logtype;
24 #define COMPRESSDEV_LOG(level, fmt, args...) \
25 rte_log(RTE_LOG_ ## level, compressdev_logtype, "%s(): "fmt "\n", \
29 * Dequeue processed packets from queue pair of a device.
32 * The queue pair from which to retrieve
33 * processed operations.
35 * The address of an array of pointers to
36 * *rte_comp_op* structures that must be
37 * large enough to store *nb_ops* pointers in it
39 * The maximum number of operations to dequeue
41 * - The number of operations actually dequeued, which is the number
42 * of pointers to *rte_comp_op* structures effectively supplied to the
45 typedef uint16_t (*compressdev_dequeue_pkt_burst_t)(void *qp,
46 struct rte_comp_op **ops, uint16_t nb_ops);
49 * Enqueue a burst of operations for processing.
52 * The queue pair on which operations
53 * are to be enqueued for processing
55 * The address of an array of *nb_ops* pointers
56 * to *rte_comp_op* structures which contain
57 * the operations to be processed
59 * The number of operations to process
61 * The number of operations actually enqueued on the device. The return
62 * value can be less than the value of the *nb_ops* parameter when the
63 * comp devices queue is full or if invalid parameters are specified in
67 typedef uint16_t (*compressdev_enqueue_pkt_burst_t)(void *qp,
68 struct rte_comp_op **ops, uint16_t nb_ops);
70 /** The data structure associated with each comp device. */
71 struct rte_compressdev {
72 compressdev_dequeue_pkt_burst_t dequeue_burst;
73 /**< Pointer to PMD receive function */
74 compressdev_enqueue_pkt_burst_t enqueue_burst;
75 /**< Pointer to PMD transmit function */
77 struct rte_compressdev_data *data;
78 /**< Pointer to device data */
79 struct rte_compressdev_ops *dev_ops;
80 /**< Functions exported by PMD */
81 uint64_t feature_flags;
82 /**< Supported features */
83 struct rte_device *device;
84 /**< Backing device */
88 /**< Flag indicating the device is attached */
89 } __rte_cache_aligned;
93 * The data part, with no function pointers, associated with each device.
95 * This structure is safe to place in shared memory to be common among
96 * different processes in a multi-process configuration.
98 struct rte_compressdev_data {
100 /**< Compress device identifier */
102 /**< Socket identifier where memory is allocated */
103 char name[RTE_COMPRESSDEV_NAME_MAX_LEN];
104 /**< Unique identifier name */
107 uint8_t dev_started : 1;
108 /**< Device state: STARTED(1)/STOPPED(0) */
111 /**< Array of pointers to queue pairs. */
112 uint16_t nb_queue_pairs;
113 /**< Number of device queue pairs */
116 /**< PMD-specific private data */
117 } __rte_cache_aligned;