Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1416913
| From | Lijun Ou <oulijun@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RESEND PATCH v9 20/22] IB/hns: Add operation for getting immutable port |
| Date | 2016-06-08 08:40 +0200 |
| Message-ID | <rHFjI-4Tu-53@gated-at.bofh.it> (permalink) |
| References | <rHFjH-4Tu-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This patch added a new verbs that is getting port immutable.
It is added in the 4.5 kernel and latest. It is necessary to
solve the fail questions for registering ib device.
Signed-off-by: Wei Hu <xavier.huwei@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
drivers/infiniband/hw/hns/hns_roce_main.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
index fb21b8a..63f5a62 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -572,6 +572,25 @@ static int hns_roce_mmap(struct ib_ucontext *context,
return 0;
}
+static int hns_roce_port_immutable(struct ib_device *ib_dev, u8 port_num,
+ struct ib_port_immutable *immutable)
+{
+ struct ib_port_attr attr;
+ int ret;
+
+ ret = hns_roce_query_port(ib_dev, port_num, &attr);
+ if (ret)
+ return ret;
+
+ immutable->pkey_tbl_len = attr.pkey_tbl_len;
+ immutable->gid_tbl_len = attr.gid_tbl_len;
+
+ immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE;
+ immutable->max_mad_size = IB_MGMT_MAD_SIZE;
+
+ return 0;
+}
+
void hns_roce_unregister_device(struct hns_roce_dev *hr_dev)
{
struct hns_roce_ib_iboe *iboe = &hr_dev->iboe;
@@ -657,6 +676,9 @@ int hns_roce_register_device(struct hns_roce_dev *hr_dev)
ib_dev->reg_user_mr = hns_roce_reg_user_mr;
ib_dev->dereg_mr = hns_roce_dereg_mr;
+ /* OTHERS */
+ ib_dev->get_port_immutable = hns_roce_port_immutable;
+
ret = ib_register_device(ib_dev, NULL);
if (ret) {
dev_err(dev, "ib_register_device failed!\n");
--
1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RESEND PATCH v9 00/22] Add HiSilicon RoCE driver Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 18/22] IB/hns: Add CQ operations support Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 06/22] IB/hns: Add initial cmd operation Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 03/22] IB/hns: Add initial main frame driver and get cfg info Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 20/22] IB/hns: Add operation for getting immutable port Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 11/22] IB/hns: Add IB device registration Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 14/22] IB/hns: Add operations support for IB device and port Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 05/22] IB/hns: Add initial profile resource Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 19/22] IB/hns: Add memory region operations support Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 21/22] IB/hns: Kconfig and Makefile for RoCE module Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 09/22] IB/hns: Add hca support Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:40 +0200 [RESEND PATCH v9 16/22] IB/hns: Add ah operations support Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:50 +0200 [RESEND PATCH v9 08/22] IB/hns: Add icm support Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:50 +0200 [RESEND PATCH v9 13/22] IB/hns: Add interface of the protocol stack registration Lijun Ou <oulijun@huawei.com> - 2016-06-08 08:50 +0200 Re: [RESEND PATCH v9 00/22] Add HiSilicon RoCE driver Doug Ledford <dledford@redhat.com> - 2016-06-08 14:00 +0200
csiph-web