raw/ioat: create device on probe and destroy on release
[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 <rte_memory.h>
18 #include <rte_memzone.h>
19 #include <rte_ioat_spec.h>
20
21 /** Name of the device driver */
22 #define IOAT_PMD_RAWDEV_NAME rawdev_ioat
23 /** String reported as the device driver name by rte_rawdev_info_get() */
24 #define IOAT_PMD_RAWDEV_NAME_STR "rawdev_ioat"
25 /** Name used to adjust the log level for this driver */
26 #define IOAT_PMD_LOG_NAME "rawdev.ioat"
27
28 /**
29  * @internal
30  * Structure representing a device instance
31  */
32 struct rte_ioat_rawdev {
33         struct rte_rawdev *rawdev;
34         const struct rte_memzone *mz;
35         const struct rte_memzone *desc_mz;
36
37         volatile struct rte_ioat_registers *regs;
38         phys_addr_t status_addr;
39         phys_addr_t ring_addr;
40
41         unsigned short ring_size;
42         struct rte_ioat_generic_hw_desc *desc_ring;
43
44         /* to report completions, the device will write status back here */
45         volatile uint64_t status __rte_cache_aligned;
46 };
47
48 #endif