Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1435765
| From | Lijun Ou <oulijun@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v11 20/22] IB/hns: Add operation for getting immutable port |
| Date | 2016-07-02 11:30 +0200 |
| Message-ID | <rQppo-1JW-23@gated-at.bofh.it> (permalink) |
| References | <rQppn-1JW-5@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>
---
PATCH v11/v10/v9:
- No change over the PATCH v8
PATCH v8:
- The initial patch
---
---
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 1b1ffc4..c1c1feb 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -548,6 +548,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;
+}
+
static void hns_roce_unregister_device(struct hns_roce_dev *hr_dev)
{
struct hns_roce_ib_iboe *iboe = &hr_dev->iboe;
@@ -633,6 +652,9 @@ static 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
[PATCH v11 00/22] Add HiSilicon RoCE driver Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:30 +0200
[PATCH v11 03/22] IB/hns: Add initial main frame driver and get cfg info Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:30 +0200
[PATCH v11 21/22] IB/hns: Kconfig and Makefile for RoCE module Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:30 +0200
[PATCH v11 13/22] IB/hns: Add interface of the protocol stack registration Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:30 +0200
[PATCH v11 08/22] IB/hns: Add hem support Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:30 +0200
[PATCH v11 01/22] net: hns: Add reset function support for RoCE driver Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:30 +0200
[PATCH v11 20/22] IB/hns: Add operation for getting immutable port Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:30 +0200
[PATCH v11 10/22] IB/hns: Add process flow to init RoCE engine Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:30 +0200
[PATCH v11 22/22] MAINTAINERS: Add maintainers for HiSilicon RoCE driver Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:30 +0200
[PATCH v11 04/22] IB/hns: Add RoCE engine reset function Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:30 +0200
[PATCH v11 14/22] IB/hns: Add operations support for IB device and port Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:40 +0200
[PATCH v11 19/22] IB/hns: Add memory region operations support Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:40 +0200
[PATCH v11 12/22] IB/hns: Set mtu and gid support Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:40 +0200
[PATCH v11 02/22] devicetree: bindings: IB: Add binding document for HiSilicon RoCE Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:40 +0200
[PATCH v11 11/22] IB/hns: Add IB device registration Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:40 +0200
[PATCH v11 15/22] IB/hns: Add PD operations support Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:40 +0200
[PATCH v11 18/22] IB/hns: Add CQ operations support Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:40 +0200
[PATCH v11 16/22] IB/hns: Add ah operations support Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:40 +0200
[PATCH v11 06/22] IB/hns: Add initial cmd operation Lijun Ou <oulijun@huawei.com> - 2016-07-02 11:40 +0200
Re: [PATCH v11 00/22] Add HiSilicon RoCE driver Leon Romanovsky <leon@kernel.org> - 2016-07-02 15:00 +0200
Re: [PATCH v11 00/22] Add HiSilicon RoCE driver "Wei Hu (Xavier)" <xavier.huwei@huawei.com> - 2016-07-04 08:30 +0200
Re: [PATCH v11 00/22] Add HiSilicon RoCE driver oulijun <oulijun@huawei.com> - 2016-07-04 10:20 +0200
Re: [PATCH v11 00/22] Add HiSilicon RoCE driver oulijun <oulijun@huawei.com> - 2016-07-08 05:00 +0200
csiph-web