Skip to content

Commit 5378de7

Browse files
Knut OmangMukesh Kacker
authored andcommitted
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 <[email protected]> Signed-off-by: Mukesh Kacker <[email protected]>
1 parent 8e73cdb commit 5378de7

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

drivers/infiniband/core/core_priv.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,9 @@ void ib_cache_cleanup(void);
5151

5252
int ib_resolve_eth_l2_attrs(struct ib_qp *qp,
5353
struct ib_qp_attr *qp_attr, int *qp_attr_mask);
54+
55+
struct ib_qp *ib_create_qp_ex(struct ib_pd *pd,
56+
struct ib_qp_init_attr *qp_init_attr,
57+
struct ib_udata *udata);
58+
5459
#endif /* _CORE_PRIV_H */

drivers/infiniband/core/uverbs_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1722,7 +1722,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,
17221722
INIT_LIST_HEAD(&obj->mcast_list);
17231723

17241724
if (cmd.qp_type == IB_QPT_XRC_TGT)
1725-
qp = ib_create_qp(pd, &attr);
1725+
qp = ib_create_qp_ex(pd, &attr, &udata);
17261726
else
17271727
qp = device->create_qp(pd, &attr, &udata);
17281728

drivers/infiniband/core/verbs.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,15 @@ struct ib_qp *ib_open_qp(struct ib_xrcd *xrcd,
439439
}
440440
EXPORT_SYMBOL(ib_open_qp);
441441

442-
struct ib_qp *ib_create_qp(struct ib_pd *pd,
443-
struct ib_qp_init_attr *qp_init_attr)
442+
struct ib_qp *ib_create_qp_ex(struct ib_pd *pd,
443+
struct ib_qp_init_attr *qp_init_attr,
444+
struct ib_udata *udata)
444445
{
445446
struct ib_qp *qp, *real_qp;
446447
struct ib_device *device;
447448

448449
device = pd ? pd->device : qp_init_attr->xrcd->device;
449-
qp = device->create_qp(pd, qp_init_attr, NULL);
450+
qp = device->create_qp(pd, qp_init_attr, udata);
450451

451452
if (!IS_ERR(qp)) {
452453
qp->device = device;
@@ -497,6 +498,14 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
497498

498499
return qp;
499500
}
501+
EXPORT_SYMBOL(ib_create_qp_ex);
502+
503+
504+
struct ib_qp *ib_create_qp(struct ib_pd *pd,
505+
struct ib_qp_init_attr *qp_init_attr)
506+
{
507+
return ib_create_qp_ex(pd, qp_init_attr,NULL);
508+
}
500509
EXPORT_SYMBOL(ib_create_qp);
501510

502511
static const struct {

0 commit comments

Comments
 (0)