提交 560d3ab0 编写于 作者: L lingmingqiang 提交者: Xie XiuQi

uacce: Break the limit of 2^(MAX_ORDER) page size DMA memory.

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

In this patch, we try to reserve more DMA memory for usre space
application.At first, we bring SS(share static region) slice, which
includes a continuous physical address memory. And, a SS region of a
Warpdrive queue can have multiple slices. Before mapping to user
space VMA, the slices will be sorted in a physical increasing order
and merged those whose physical addresses are continuous. After
reserving the memory, several IOCAL system call will be done
to get the slices' physical address information for user space.
Signed-off-by: Nyumeng <yumeng18@huawei.com>
Reviewed-by: Nxuzaibo <xuzaibo@huawei.com>
Signed-off-by: Nlingmingqiang <lingmingqiang@huawei.com>
Reviewed-by: NZhou Wang <wangzhou1@hisilicon.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 53abc75e
此差异已折叠。
......@@ -30,6 +30,13 @@ struct uacce_err_isolate {
atomic_t is_isolate;
};
struct uacce_dma_slice {
void *kaddr; /* kernel address for ss */
dma_addr_t dma; /* dma address, if created by dma api */
u32 size; /* Size of this dma slice */
u32 total_num; /* Total slices in this dma list */
};
struct uacce_qfile_region {
enum uacce_qfrt type;
unsigned long iova; /* iova share between user and device space */
......@@ -38,8 +45,8 @@ struct uacce_qfile_region {
int prot;
unsigned int flags;
struct list_head qs; /* qs sharing the same region, for ss */
void *kaddr; /* kernel addr, for dko */
dma_addr_t dma; /* dma address, if created by dma api */
void *kaddr; /* kernel address for dko */
struct uacce_dma_slice *dma_list;
};
/**
......
......@@ -53,4 +53,9 @@ enum uacce_qfrt {
};
#define UACCE_QFRT_INVALID UACCE_QFRT_MAX
/* Pass DMA SS region slice size by granularity 64KB */
#define UACCE_GRAN_SIZE 0x10000ull
#define UACCE_GRAN_SHIFT 16
#define UACCE_GRAN_NUM_MASK 0xfffull
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册