raw/ioat: add statistics functions
[dpdk.git] / drivers / raw / ioat / rte_ioat_rawdev.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019 Intel Corporation
3  */
4
5 #ifndef _RTE_IOAT_RAWDEV_H_
6 #define _RTE_IOAT_RAWDEV_H_
7
8 /**
9  * @file rte_ioat_rawdev.h
10  *
11  * Definitions for using the ioat rawdev device driver
12  *
13  * @warning
14  * @b EXPERIMENTAL: these structures and APIs may change without prior notice
15  */
16
17 #include <x86intrin.h>
18 #include <rte_memory.h>
19 #include <rte_memzone.h>
20 #include <rte_ioat_spec.h>
21
22 /** Name of the device driver */
23 #define IOAT_PMD_RAWDEV_NAME rawdev_ioat
24 /** String reported as the device driver name by rte_rawdev_info_get() */
25 #define IOAT_PMD_RAWDEV_NAME_STR "rawdev_ioat"
26 /** Name used to adjust the log level for this driver */
27 #define IOAT_PMD_LOG_NAME "rawdev.ioat"
28
29 /**
30  * Configuration structure for an ioat rawdev instance
31  *
32  * This structure is to be passed as the ".dev_private" parameter when
33  * calling the rte_rawdev_get_info() and rte_rawdev_configure() APIs on
34  * an ioat rawdev instance.
35  */
36 struct rte_ioat_rawdev_config {
37         unsigned short ring_size;
38 };
39
40 /**
41  * @internal
42  * Structure representing a device instance
43  */
44 struct rte_ioat_rawdev {
45         struct rte_rawdev *rawdev;
46         const struct rte_memzone *mz;
47         const struct rte_memzone *desc_mz;
48
49         volatile struct rte_ioat_registers *regs;
50         phys_addr_t status_addr;
51         phys_addr_t ring_addr;
52
53         unsigned short ring_size;
54         struct rte_ioat_generic_hw_desc *desc_ring;
55         __m128i *hdls; /* completion handles for returning to user */
56
57         /* some statistics for tracking, if added/changed update xstats fns*/
58         uint64_t enqueue_failed __rte_cache_aligned;
59         uint64_t enqueued;
60         uint64_t started;
61         uint64_t completed;
62
63         /* to report completions, the device will write status back here */
64         volatile uint64_t status __rte_cache_aligned;
65 };
66
67 #endif