aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns/hns_roce_main.c
diff options
context:
space:
mode:
authorYixian Liu <liuyixian@huawei.com>2018-09-23 17:20:46 +0800
committerJason Gunthorpe <jgg@mellanox.com>2018-09-26 16:21:16 -0600
commitc7c28191408bf33c1d9c83de1d5b91f58f1ddaf1 (patch)
treef5045326cea927838c5ba23b9ccd6d984869699b /drivers/infiniband/hw/hns/hns_roce_main.c
parentRDMA/hns: Add enable judgement for UD vlan (diff)
downloadlinux-dev-c7c28191408bf33c1d9c83de1d5b91f58f1ddaf1.tar.xz
linux-dev-c7c28191408bf33c1d9c83de1d5b91f58f1ddaf1.zip
RDMA/hns: Add MW support for hip08
This patch adds memory window (mw) support in the kernel space. Signed-off-by: Yixian Liu <liuyixian@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
index 202408874c54..8c5160ec3a4d 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -525,6 +525,15 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev)
ib_dev->uverbs_cmd_mask |= (1ULL << IB_USER_VERBS_CMD_REREG_MR);
}
+ /* MW */
+ if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_MW) {
+ ib_dev->alloc_mw = hns_roce_alloc_mw;
+ ib_dev->dealloc_mw = hns_roce_dealloc_mw;
+ ib_dev->uverbs_cmd_mask |=
+ (1ULL << IB_USER_VERBS_CMD_ALLOC_MW) |
+ (1ULL << IB_USER_VERBS_CMD_DEALLOC_MW);
+ }
+
/* OTHERS */
ib_dev->get_port_immutable = hns_roce_port_immutable;
ib_dev->disassociate_ucontext = hns_roce_disassociate_ucontext;