* [PATCH] RDMA/core: Get rid of ib_create_qp_user
@ 2020-02-13 19:19 Jason Gunthorpe
2020-02-16 11:44 ` Max Gurtovoy
0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2020-02-13 19:19 UTC (permalink / raw)
To: linux-rdma
This function accepts a udata but does nothing with it, and is never
passed a !NULL udata. Rename it to ib_create_qp which was the only
caller and remove the udata.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
drivers/infiniband/core/verbs.c | 22 +++++++++++++++-------
include/rdma/ib_verbs.h | 31 ++-----------------------------
2 files changed, 17 insertions(+), 36 deletions(-)
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 3ebae3b65c2821..13ff4c8bfe5ac7 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1127,8 +1127,7 @@ struct ib_qp *ib_open_qp(struct ib_xrcd *xrcd,
EXPORT_SYMBOL(ib_open_qp);
static struct ib_qp *create_xrc_qp_user(struct ib_qp *qp,
- struct ib_qp_init_attr *qp_init_attr,
- struct ib_udata *udata)
+ struct ib_qp_init_attr *qp_init_attr)
{
struct ib_qp *real_qp = qp;
@@ -1150,9 +1149,18 @@ static struct ib_qp *create_xrc_qp_user(struct ib_qp *qp,
return qp;
}
-struct ib_qp *ib_create_qp_user(struct ib_pd *pd,
- struct ib_qp_init_attr *qp_init_attr,
- struct ib_udata *udata)
+/**
+ * ib_create_qp - Creates a kernel QP associated with the specified protection
+ * domain.
+ * @pd: The protection domain associated with the QP.
+ * @qp_init_attr: A list of initial attributes required to create the
+ * QP. If QP creation succeeds, then the attributes are updated to
+ * the actual capabilities of the created QP.
+ *
+ * NOTE: for user qp use ib_create_qp_user with valid udata!
+ */
+struct ib_qp *ib_create_qp(struct ib_pd *pd,
+ struct ib_qp_init_attr *qp_init_attr)
{
struct ib_device *device = pd ? pd->device : qp_init_attr->xrcd->device;
struct ib_qp *qp;
@@ -1197,7 +1205,7 @@ struct ib_qp *ib_create_qp_user(struct ib_pd *pd,
if (qp_init_attr->qp_type == IB_QPT_XRC_TGT) {
struct ib_qp *xrc_qp =
- create_xrc_qp_user(qp, qp_init_attr, udata);
+ create_xrc_qp_user(qp, qp_init_attr);
if (IS_ERR(xrc_qp)) {
ret = PTR_ERR(xrc_qp);
@@ -1253,7 +1261,7 @@ struct ib_qp *ib_create_qp_user(struct ib_pd *pd,
return ERR_PTR(ret);
}
-EXPORT_SYMBOL(ib_create_qp_user);
+EXPORT_SYMBOL(ib_create_qp);
static const struct {
int valid;
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 1f779fad3a1e4e..5f3a04ead9f593 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -3627,35 +3627,8 @@ static inline int ib_post_srq_recv(struct ib_srq *srq,
bad_recv_wr ? : &dummy);
}
-/**
- * ib_create_qp_user - Creates a QP associated with the specified protection
- * domain.
- * @pd: The protection domain associated with the QP.
- * @qp_init_attr: A list of initial attributes required to create the
- * QP. If QP creation succeeds, then the attributes are updated to
- * the actual capabilities of the created QP.
- * @udata: Valid user data or NULL for kernel objects
- */
-struct ib_qp *ib_create_qp_user(struct ib_pd *pd,
- struct ib_qp_init_attr *qp_init_attr,
- struct ib_udata *udata);
-
-/**
- * ib_create_qp - Creates a kernel QP associated with the specified protection
- * domain.
- * @pd: The protection domain associated with the QP.
- * @qp_init_attr: A list of initial attributes required to create the
- * QP. If QP creation succeeds, then the attributes are updated to
- * the actual capabilities of the created QP.
- * @udata: Valid user data or NULL for kernel objects
- *
- * NOTE: for user qp use ib_create_qp_user with valid udata!
- */
-static inline struct ib_qp *ib_create_qp(struct ib_pd *pd,
- struct ib_qp_init_attr *qp_init_attr)
-{
- return ib_create_qp_user(pd, qp_init_attr, NULL);
-}
+struct ib_qp *ib_create_qp(struct ib_pd *pd,
+ struct ib_qp_init_attr *qp_init_attr);
/**
* ib_modify_qp_with_udata - Modifies the attributes for the specified QP.
--
2.25.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/core: Get rid of ib_create_qp_user
2020-02-13 19:19 [PATCH] RDMA/core: Get rid of ib_create_qp_user Jason Gunthorpe
@ 2020-02-16 11:44 ` Max Gurtovoy
2020-02-19 0:35 ` Jason Gunthorpe
0 siblings, 1 reply; 3+ messages in thread
From: Max Gurtovoy @ 2020-02-16 11:44 UTC (permalink / raw)
To: Jason Gunthorpe, linux-rdma
On 2/13/2020 9:19 PM, Jason Gunthorpe wrote:
> This function accepts a udata but does nothing with it, and is never
> passed a !NULL udata. Rename it to ib_create_qp which was the only
> caller and remove the udata.
>
> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
> ---
Looks good,
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
BTW,
shouldn't ib_alloc_mr_user need also to be updated ?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/core: Get rid of ib_create_qp_user
2020-02-16 11:44 ` Max Gurtovoy
@ 2020-02-19 0:35 ` Jason Gunthorpe
0 siblings, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2020-02-19 0:35 UTC (permalink / raw)
To: Max Gurtovoy; +Cc: linux-rdma
On Sun, Feb 16, 2020 at 01:44:40PM +0200, Max Gurtovoy wrote:
>
> On 2/13/2020 9:19 PM, Jason Gunthorpe wrote:
> > This function accepts a udata but does nothing with it, and is never
> > passed a !NULL udata. Rename it to ib_create_qp which was the only
> > caller and remove the udata.
> >
> > Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
>
> Looks good,
>
> Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Thanks, and applied to for-next
> BTW,
>
> shouldn't ib_alloc_mr_user need also to be updated ?
How so? It passes the udata to the driver
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-19 0:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13 19:19 [PATCH] RDMA/core: Get rid of ib_create_qp_user Jason Gunthorpe
2020-02-16 11:44 ` Max Gurtovoy
2020-02-19 0:35 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).