diff mbox series

[rdma-next,14/18] RDMA/qib: Initialize ib_device_ops struct

Message ID 20181009184547.5907-15-kamalheib1@gmail.com (mailing list archive)
State Superseded
Headers show
Series RDMA: Add support for ib_device_ops | expand

Commit Message

Kamal Heib Oct. 9, 2018, 6:45 p.m. UTC
Initialize ib_device_ops with the supported operations.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
 drivers/infiniband/hw/qib/qib_verbs.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Dennis Dalessandro Oct. 17, 2018, 11:24 a.m. UTC | #1
On 10/9/2018 2:45 PM, Kamal Heib wrote:
> Initialize ib_device_ops with the supported operations.
> 
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> ---
>   drivers/infiniband/hw/qib/qib_verbs.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c
> index 8a45964c4700..8fe2519e34d9 100644
> --- a/drivers/infiniband/hw/qib/qib_verbs.c
> +++ b/drivers/infiniband/hw/qib/qib_verbs.c
> @@ -1496,6 +1496,11 @@ static void qib_fill_device_attr(struct qib_devdata *dd)
>   	dd->verbs_dev.rdi.wc_opcode = ib_qib_wc_opcode;
>   }
>   
> +static struct ib_device_ops qib_dev_ops = {
> +	.modify_device		= qib_modify_device,
> +	.process_mad		= qib_process_mad,
> +};
> +
>   /**
>    * qib_register_ib_device - register our device with the infiniband core
>    * @dd: the device data structure
> @@ -1626,6 +1631,7 @@ int qib_register_ib_device(struct qib_devdata *dd)
>   			      dd->rcd[ctxt]->pkeys);
>   	}
>   
> +	ib_set_device_ops(ibdev, &qib_dev_ops);
>   	ret = rvt_register_device(&dd->verbs_dev.rdi, RDMA_DRIVER_QIB);
>   	if (ret)
>   		goto err_tx;
> 

Same comment as on the hfi1 patch. This should get hidden in rdmavt. Not 
the individual drivers.

-Denny
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c
index 8a45964c4700..8fe2519e34d9 100644
--- a/drivers/infiniband/hw/qib/qib_verbs.c
+++ b/drivers/infiniband/hw/qib/qib_verbs.c
@@ -1496,6 +1496,11 @@  static void qib_fill_device_attr(struct qib_devdata *dd)
 	dd->verbs_dev.rdi.wc_opcode = ib_qib_wc_opcode;
 }
 
+static struct ib_device_ops qib_dev_ops = {
+	.modify_device		= qib_modify_device,
+	.process_mad		= qib_process_mad,
+};
+
 /**
  * qib_register_ib_device - register our device with the infiniband core
  * @dd: the device data structure
@@ -1626,6 +1631,7 @@  int qib_register_ib_device(struct qib_devdata *dd)
 			      dd->rcd[ctxt]->pkeys);
 	}
 
+	ib_set_device_ops(ibdev, &qib_dev_ops);
 	ret = rvt_register_device(&dd->verbs_dev.rdi, RDMA_DRIVER_QIB);
 	if (ret)
 		goto err_tx;