1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2021 Intel Corporation
5 #ifndef _IOAT_INTERNAL_H_
6 #define _IOAT_INTERNAL_H_
8 #include "ioat_hw_defs.h"
11 struct rte_dma_dev *dmadev;
12 struct rte_dma_vchan_conf qcfg;
13 struct rte_dma_stats stats;
15 volatile uint16_t *doorbell __rte_cache_aligned;
16 phys_addr_t status_addr;
17 phys_addr_t ring_addr;
19 struct ioat_dma_hw_desc *desc_ring;
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. */
27 /* To report completions, the device will write status back here. */
28 volatile uint64_t status __rte_cache_aligned;
30 /* Pointer to the register bar. */
31 volatile struct ioat_registers *regs;
33 /* Store the IOAT version. */
37 extern int ioat_pmd_logtype;
39 #define IOAT_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
40 ioat_pmd_logtype, "IOAT: %s(): " fmt "\n", __func__, ##args)
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)
47 #endif /* _IOAT_INTERNAL_H_ */