aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_provider.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2005-07-07 20:57:18 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:49 -0400
commit99264c1ee2ce908f95c075cce97698758a793b58 (patch)
treed6ce99ee31aa1da65531f67268695f89d9e876d2 /drivers/infiniband/hw/mthca/mthca_provider.c
parent53b8b3ffd5e0b10f3c683096a663d0cc22179c43 (diff)
[PATCH] IB uverbs: add mthca user PD support
Add support for userspace protection domains (PDs) to mthca. Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_provider.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_provider.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index 9acb8c54ce4f..318356c19abe 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -368,12 +368,20 @@ static struct ib_pd *mthca_alloc_pd(struct ib_device *ibdev,
368 if (!pd) 368 if (!pd)
369 return ERR_PTR(-ENOMEM); 369 return ERR_PTR(-ENOMEM);
370 370
371 err = mthca_pd_alloc(to_mdev(ibdev), pd); 371 err = mthca_pd_alloc(to_mdev(ibdev), !context, pd);
372 if (err) { 372 if (err) {
373 kfree(pd); 373 kfree(pd);
374 return ERR_PTR(err); 374 return ERR_PTR(err);
375 } 375 }
376 376
377 if (context) {
378 if (ib_copy_to_udata(udata, &pd->pd_num, sizeof (__u32))) {
379 mthca_pd_free(to_mdev(ibdev), pd);
380 kfree(pd);
381 return ERR_PTR(-EFAULT);
382 }
383 }
384
377 return &pd->ibpd; 385 return &pd->ibpd;
378} 386}
379 387