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, "%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 {
33 volatile struct rte_idxd_bar0 *regs;
34 volatile struct rte_idxd_wqcfg *wq_regs;
35 volatile struct rte_idxd_grpcfg *grp_regs;
36 volatile void *portals;
40 struct rte_idxd_rawdev public; /* the public members, must be first */
42 struct rte_rawdev *rawdev;
43 const struct rte_memzone *mz;
52 struct idxd_pci_common *pci;
56 int ioat_xstats_get(const struct rte_rawdev *dev, const unsigned int ids[],
57 uint64_t values[], unsigned int n);
59 int ioat_xstats_get_names(const struct rte_rawdev *dev,
60 struct rte_rawdev_xstats_name *names,
63 int ioat_xstats_reset(struct rte_rawdev *dev, const uint32_t *ids,
66 extern int idxd_rawdev_create(const char *name, struct rte_device *dev,
67 const struct idxd_rawdev *idxd,
68 const struct rte_rawdev_ops *ops);
70 extern int idxd_rawdev_close(struct rte_rawdev *dev);
72 extern int idxd_dev_configure(const struct rte_rawdev *dev,
73 rte_rawdev_obj_t config, size_t config_size);
75 extern int idxd_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info,
78 extern int idxd_rawdev_test(uint16_t dev_id);
80 extern int idxd_dev_dump(struct rte_rawdev *dev, FILE *f);
82 #endif /* _IOAT_PRIVATE_H_ */