examples: skip build when missing dependencies
[dpdk.git] / drivers / dma / ioat / ioat_internal.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2021 Intel Corporation
3  */
4
5 #ifndef _IOAT_INTERNAL_H_
6 #define _IOAT_INTERNAL_H_
7
8 #include "ioat_hw_defs.h"
9
10 struct ioat_dmadev {
11         struct rte_dma_dev *dmadev;
12         struct rte_dma_vchan_conf qcfg;
13         struct rte_dma_stats stats;
14
15         volatile uint16_t *doorbell __rte_cache_aligned;
16         phys_addr_t status_addr;
17         phys_addr_t ring_addr;
18
19         struct ioat_dma_hw_desc *desc_ring;
20
21         unsigned short next_read;
22         unsigned short next_write;
23         unsigned short last_write; /* Used to compute submitted count. */
24         unsigned short offset; /* Used after a device recovery when counts -> 0. */
25         unsigned int failure; /* Used to store chanerr for error handling. */
26
27         /* To report completions, the device will write status back here. */
28         volatile uint64_t status __rte_cache_aligned;
29
30         /* Pointer to the register bar. */
31         volatile struct ioat_registers *regs;
32
33         /* Store the IOAT version. */
34         uint8_t version;
35 };
36
37 extern int ioat_pmd_logtype;
38
39 #define IOAT_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
40                 ioat_pmd_logtype, "IOAT: %s(): " fmt "\n", __func__, ##args)
41
42 #define IOAT_PMD_DEBUG(fmt, args...)  IOAT_PMD_LOG(DEBUG, fmt, ## args)
43 #define IOAT_PMD_INFO(fmt, args...)   IOAT_PMD_LOG(INFO, fmt, ## args)
44 #define IOAT_PMD_ERR(fmt, args...)    IOAT_PMD_LOG(ERR, fmt, ## args)
45 #define IOAT_PMD_WARN(fmt, args...)   IOAT_PMD_LOG(WARNING, fmt, ## args)
46
47 #endif /* _IOAT_INTERNAL_H_ */