1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
5 #ifndef _IOAT_PRIVATE_H_
6 #define _IOAT_PRIVATE_H_
11 * Private data structures for the idxd/DSA part of ioat device driver
14 * @b EXPERIMENTAL: these structures and APIs may change without prior notice
17 #include <rte_spinlock.h>
18 #include <rte_rawdev_pmd.h>
19 #include "rte_ioat_rawdev.h"
21 extern int ioat_pmd_logtype;
23 #define IOAT_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
24 ioat_pmd_logtype, "IOAT: %s(): " fmt "\n", __func__, ##args)
26 #define IOAT_PMD_DEBUG(fmt, args...) IOAT_PMD_LOG(DEBUG, fmt, ## args)
27 #define IOAT_PMD_INFO(fmt, args...) IOAT_PMD_LOG(INFO, fmt, ## args)
28 #define IOAT_PMD_ERR(fmt, args...) IOAT_PMD_LOG(ERR, fmt, ## args)
29 #define IOAT_PMD_WARN(fmt, args...) IOAT_PMD_LOG(WARNING, fmt, ## args)
31 struct idxd_pci_common {
35 volatile struct rte_idxd_bar0 *regs;
36 volatile uint32_t *wq_regs_base;
37 volatile struct rte_idxd_grpcfg *grp_regs;
38 volatile void *portals;
42 struct rte_idxd_rawdev public; /* the public members, must be first */
44 struct rte_rawdev *rawdev;
45 const struct rte_memzone *mz;
54 struct idxd_pci_common *pci;
58 int ioat_xstats_get(const struct rte_rawdev *dev, const unsigned int ids[],
59 uint64_t values[], unsigned int n);
61 int ioat_xstats_get_names(const struct rte_rawdev *dev,
62 struct rte_rawdev_xstats_name *names,
65 int ioat_xstats_reset(struct rte_rawdev *dev, const uint32_t *ids,
68 extern int ioat_rawdev_test(uint16_t dev_id);
70 extern int idxd_rawdev_create(const char *name, struct rte_device *dev,
71 const struct idxd_rawdev *idxd,
72 const struct rte_rawdev_ops *ops);
74 extern int idxd_rawdev_close(struct rte_rawdev *dev);
76 extern int idxd_dev_configure(const struct rte_rawdev *dev,
77 rte_rawdev_obj_t config, size_t config_size);
79 extern int idxd_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info,
82 extern int idxd_dev_dump(struct rte_rawdev *dev, FILE *f);
84 #endif /* _IOAT_PRIVATE_H_ */