]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - drivers/infiniband/sw/rxe/rxe_verbs.c
RDMA/core: remove use of dma_virt_ops
[mirror_ubuntu-hirsute-kernel.git] / drivers / infiniband / sw / rxe / rxe_verbs.c
index 1fc022362fbe4973298623e164a4394f03a93378..a2bd91aaa5de956cc1cb777340ff475dc6aff168 100644 (file)
@@ -265,6 +265,9 @@ static int rxe_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init,
        struct rxe_srq *srq = to_rsrq(ibsrq);
        struct rxe_create_srq_resp __user *uresp = NULL;
 
+       if (init->srq_type != IB_SRQT_BASIC)
+               return -EOPNOTSUPP;
+
        if (udata) {
                if (udata->outlen < sizeof(*uresp))
                        return -EINVAL;
@@ -392,6 +395,9 @@ static struct ib_qp *rxe_create_qp(struct ib_pd *ibpd,
                uresp = udata->outbuf;
        }
 
+       if (init->create_flags)
+               return ERR_PTR(-EOPNOTSUPP);
+
        err = rxe_qp_chk_init(rxe, init);
        if (err)
                goto err1;
@@ -433,6 +439,9 @@ static int rxe_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
        struct rxe_dev *rxe = to_rdev(ibqp->device);
        struct rxe_qp *qp = to_rqp(ibqp);
 
+       if (mask & ~IB_QP_ATTR_STANDARD_BITS)
+               return -EOPNOTSUPP;
+
        err = rxe_qp_chk_attr(rxe, qp, attr, mask);
        if (err)
                goto err1;
@@ -765,7 +774,7 @@ static int rxe_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
        }
 
        if (attr->flags)
-               return -EINVAL;
+               return -EOPNOTSUPP;
 
        err = rxe_cq_chk_attr(rxe, NULL, attr->cqe, attr->comp_vector);
        if (err)
@@ -1033,7 +1042,7 @@ static ssize_t parent_show(struct device *device,
        struct rxe_dev *rxe =
                rdma_device_to_drv_device(device, struct rxe_dev, ib_dev);
 
-       return scnprintf(buf, PAGE_SIZE, "%s\n", rxe_parent_name(rxe, 1));
+       return sysfs_emit(buf, "%s\n", rxe_parent_name(rxe, 1));
 }
 
 static DEVICE_ATTR_RO(parent);
@@ -1070,6 +1079,7 @@ static const struct ib_device_ops rxe_dev_ops = {
        .create_cq = rxe_create_cq,
        .create_qp = rxe_create_qp,
        .create_srq = rxe_create_srq,
+       .create_user_ah = rxe_create_ah,
        .dealloc_driver = rxe_dealloc,
        .dealloc_pd = rxe_dealloc_pd,
        .dealloc_ucontext = rxe_dealloc_ucontext,
@@ -1128,42 +1138,9 @@ int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name)
        dev->local_dma_lkey = 0;
        addrconf_addr_eui48((unsigned char *)&dev->node_guid,
                            rxe->ndev->dev_addr);
-       dev->dev.dma_parms = &rxe->dma_parms;
-       dma_set_max_seg_size(&dev->dev, UINT_MAX);
-       dma_set_coherent_mask(&dev->dev, dma_get_required_mask(&dev->dev));
-
-       dev->uverbs_cmd_mask = BIT_ULL(IB_USER_VERBS_CMD_GET_CONTEXT)
-           | BIT_ULL(IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL)
-           | BIT_ULL(IB_USER_VERBS_CMD_QUERY_DEVICE)
-           | BIT_ULL(IB_USER_VERBS_CMD_QUERY_PORT)
-           | BIT_ULL(IB_USER_VERBS_CMD_ALLOC_PD)
-           | BIT_ULL(IB_USER_VERBS_CMD_DEALLOC_PD)
-           | BIT_ULL(IB_USER_VERBS_CMD_CREATE_SRQ)
-           | BIT_ULL(IB_USER_VERBS_CMD_MODIFY_SRQ)
-           | BIT_ULL(IB_USER_VERBS_CMD_QUERY_SRQ)
-           | BIT_ULL(IB_USER_VERBS_CMD_DESTROY_SRQ)
-           | BIT_ULL(IB_USER_VERBS_CMD_POST_SRQ_RECV)
-           | BIT_ULL(IB_USER_VERBS_CMD_CREATE_QP)
-           | BIT_ULL(IB_USER_VERBS_CMD_MODIFY_QP)
-           | BIT_ULL(IB_USER_VERBS_CMD_QUERY_QP)
-           | BIT_ULL(IB_USER_VERBS_CMD_DESTROY_QP)
-           | BIT_ULL(IB_USER_VERBS_CMD_POST_SEND)
-           | BIT_ULL(IB_USER_VERBS_CMD_POST_RECV)
-           | BIT_ULL(IB_USER_VERBS_CMD_CREATE_CQ)
-           | BIT_ULL(IB_USER_VERBS_CMD_RESIZE_CQ)
-           | BIT_ULL(IB_USER_VERBS_CMD_DESTROY_CQ)
-           | BIT_ULL(IB_USER_VERBS_CMD_POLL_CQ)
-           | BIT_ULL(IB_USER_VERBS_CMD_PEEK_CQ)
-           | BIT_ULL(IB_USER_VERBS_CMD_REQ_NOTIFY_CQ)
-           | BIT_ULL(IB_USER_VERBS_CMD_REG_MR)
-           | BIT_ULL(IB_USER_VERBS_CMD_DEREG_MR)
-           | BIT_ULL(IB_USER_VERBS_CMD_CREATE_AH)
-           | BIT_ULL(IB_USER_VERBS_CMD_MODIFY_AH)
-           | BIT_ULL(IB_USER_VERBS_CMD_QUERY_AH)
-           | BIT_ULL(IB_USER_VERBS_CMD_DESTROY_AH)
-           | BIT_ULL(IB_USER_VERBS_CMD_ATTACH_MCAST)
-           | BIT_ULL(IB_USER_VERBS_CMD_DETACH_MCAST)
-           ;
+
+       dev->uverbs_cmd_mask |= BIT_ULL(IB_USER_VERBS_CMD_POST_SEND) |
+                               BIT_ULL(IB_USER_VERBS_CMD_REQ_NOTIFY_CQ);
 
        ib_set_device_ops(dev, &rxe_dev_ops);
        err = ib_device_set_netdev(&rxe->ib_dev, rxe->ndev, 1);