From: Knut Omang Date: Tue, 21 Apr 2015 10:20:07 +0000 (+0200) Subject: ib_{uverbs/core}: add new ib_create_qp_ex with udata arg X-Git-Tag: v4.1.12-92~293^2~1^2~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5378de748cc98cb99df88407bb10ce252e13a438;p=users%2Fjedix%2Flinux-maple.git ib_{uverbs/core}: add new ib_create_qp_ex with udata arg Necessary to get device specific arguments through to XRC QPs. Added new local header file to serve as support interface between ib_core and ib_uverbs. Right now there is a lot of duplicate setup code in uverbs_cmd.c on the ib_uverbs side and verbs.c on the ib_core side. This commit is a quick fix to have XRC support working, but similar calls can be added to consolidate the code for other parts of the API. Orabug: 20930262 Signed-off-by: Knut Omang Signed-off-by: Mukesh Kacker --- diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h index 87d1936f5c1c..01cd259aa4bd 100644 --- a/drivers/infiniband/core/core_priv.h +++ b/drivers/infiniband/core/core_priv.h @@ -51,4 +51,9 @@ void ib_cache_cleanup(void); int ib_resolve_eth_l2_attrs(struct ib_qp *qp, struct ib_qp_attr *qp_attr, int *qp_attr_mask); + +struct ib_qp *ib_create_qp_ex(struct ib_pd *pd, + struct ib_qp_init_attr *qp_init_attr, + struct ib_udata *udata); + #endif /* _CORE_PRIV_H */ diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index f341cf99d164..0694210e9a89 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -1722,7 +1722,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file, INIT_LIST_HEAD(&obj->mcast_list); if (cmd.qp_type == IB_QPT_XRC_TGT) - qp = ib_create_qp(pd, &attr); + qp = ib_create_qp_ex(pd, &attr, &udata); else qp = device->create_qp(pd, &attr, &udata); diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 4632272e41aa..3c0549449cac 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -439,14 +439,15 @@ struct ib_qp *ib_open_qp(struct ib_xrcd *xrcd, } EXPORT_SYMBOL(ib_open_qp); -struct ib_qp *ib_create_qp(struct ib_pd *pd, - struct ib_qp_init_attr *qp_init_attr) +struct ib_qp *ib_create_qp_ex(struct ib_pd *pd, + struct ib_qp_init_attr *qp_init_attr, + struct ib_udata *udata) { struct ib_qp *qp, *real_qp; struct ib_device *device; device = pd ? pd->device : qp_init_attr->xrcd->device; - qp = device->create_qp(pd, qp_init_attr, NULL); + qp = device->create_qp(pd, qp_init_attr, udata); if (!IS_ERR(qp)) { qp->device = device; @@ -497,6 +498,14 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd, return qp; } +EXPORT_SYMBOL(ib_create_qp_ex); + + +struct ib_qp *ib_create_qp(struct ib_pd *pd, + struct ib_qp_init_attr *qp_init_attr) +{ + return ib_create_qp_ex(pd, qp_init_attr,NULL); +} EXPORT_SYMBOL(ib_create_qp); static const struct {