4 #include <linux/types.h>
5 #include <linux/delay.h>
6 #include <linux/blkdev.h>
7 #include <linux/cpumask.h>
8 #include <linux/scatterlist.h>
9 #include <linux/percpu-defs.h>
10 #include <linux/dma-direction.h>
11 #include <linux/dma-mapping.h>
14 struct nvfs_dma_rw_ops {
15 unsigned long long ft_bmap; /* feature bitmap */
17 int (*nvfs_blk_rq_map_sg) (struct request_queue *q,
19 struct scatterlist *sglist);
21 int (*nvfs_dma_map_sg_attrs) (struct device *device,
22 struct scatterlist *sglist,
24 enum dma_data_direction dma_dir,
27 int (*nvfs_dma_unmap_sg) (struct device *device,
28 struct scatterlist *sglist,
30 enum dma_data_direction dma_dir);
31 bool (*nvfs_is_gpu_page) (struct page *);
32 unsigned int (*nvfs_gpu_index) (struct page *page);
33 unsigned int (*nvfs_device_priority) (struct device *dev, unsigned int dev_index);
36 /* feature list for dma_ops, values indicate bit pos */
38 nvfs_ft_prep_sglist = 1ULL << 0,
39 nvfs_ft_map_sglist = 1ULL << 1,
40 nvfs_ft_is_gpu_page = 1ULL << 2,
41 nvfs_ft_device_priority = 1ULL << 3,
44 /* check features for use in registration with vendor drivers */
45 #define NVIDIA_FS_CHECK_FT_SGLIST_PREP(ops) \
46 ((ops)->ft_bmap & nvfs_ft_prep_sglist)
47 #define NVIDIA_FS_CHECK_FT_SGLIST_DMA(ops) \
48 ((ops)->ft_bmap & nvfs_ft_map_sglist)
49 #define NVIDIA_FS_CHECK_FT_GPU_PAGE(ops) \
50 ((ops)->ft_bmap & nvfs_ft_is_gpu_page)
51 #define NVIDIA_FS_CHECK_FT_DEVICE_PRIORITY(ops) \
52 ((ops)->ft_bmap & nvfs_ft_device_priority)
54 #endif /* LUSTRE_NVFS_H */