[PATCH rdma-next 17/18] RDMA/rxe: Initialize ib_device_ops struct

Kamal Heib
2018-10-09T16:29:11Z

drivers/infiniband/sw/rxe/rxe_verbs.c | 48 +++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)

diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index e4da5b671e4a..4f28f71b7746 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -1152,6 +1152,52 @@ static struct device_attribute *rxe_dev_attributes[] = {
&dev_attr_parent,
};

+static struct ib_device_ops rxe_dev_ops = {
+ .query_device = rxe_query_device,
+ .modify_device = rxe_modify_device,
+ .query_port = rxe_query_port,
+ .modify_port = rxe_modify_port,
+ .get_link_layer = rxe_get_link_layer,
+ .get_netdev = rxe_get_netdev,
+ .query_pkey = rxe_query_pkey,
+ .alloc_ucontext = rxe_alloc_ucontext,
+ .dealloc_ucontext = rxe_dealloc_ucontext,
+ .mmap = rxe_mmap,
+ .get_port_immutable = rxe_port_immutable,
+ .alloc_pd = rxe_alloc_pd,
+ .dealloc_pd = rxe_dealloc_pd,
+ .create_ah = rxe_create_ah,
+ .modify_ah = rxe_modify_ah,
+ .query_ah = rxe_query_ah,
+ .destroy_ah = rxe_destroy_ah,
+ .create_srq = rxe_create_srq,
+ .modify_srq = rxe_modify_srq,
+ .query_srq = rxe_query_srq,
+ .destroy_srq = rxe_destroy_srq,
+ .post_srq_recv = rxe_post_srq_recv,
+ .create_qp = rxe_create_qp,
+ .modify_qp = rxe_modify_qp,
+ .query_qp = rxe_query_qp,
+ .destroy_qp = rxe_destroy_qp,
+ .post_send = rxe_post_send,
+ .post_recv = rxe_post_recv,
+ .create_cq = rxe_create_cq,
+ .destroy_cq = rxe_destroy_cq,
+ .resize_cq = rxe_resize_cq,
+ .poll_cq = rxe_poll_cq,
+ .peek_cq = rxe_peek_cq,
+ .req_notify_cq = rxe_req_notify_cq,
+ .get_dma_mr = rxe_get_dma_mr,
+ .reg_user_mr = rxe_reg_user_mr,
+ .dereg_mr = rxe_dereg_mr,
+ .alloc_mr = rxe_alloc_mr,
+ .map_mr_sg = rxe_map_mr_sg,
+ .attach_mcast = rxe_attach_mcast,
+ .detach_mcast = rxe_detach_mcast,
+ .get_hw_stats = rxe_ib_get_hw_stats,
+ .alloc_hw_stats = rxe_ib_alloc_hw_stats,
+};
+
int rxe_register_device(struct rxe_dev *rxe)
{
int err;
@@ -1251,6 +1297,8 @@ int rxe_register_device(struct rxe_dev *rxe)
dev->get_hw_stats = rxe_ib_get_hw_stats;
dev->alloc_hw_stats = rxe_ib_alloc_hw_stats;

+ ib_set_device_ops(dev, &rxe_dev_ops);
+
tfm = crypto_alloc_shash("crc32", 0, 0);
if (IS_ERR(tfm)) {
pr_err("failed to allocate crc algorithm err:%ld\n",
--
2.14.4