diff options
| -rw-r--r-- | drivers/infiniband/core/verbs.c | 5 | ||||
| -rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_provider.c | 5 | ||||
| -rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_qp.c | 15 | ||||
| -rw-r--r-- | drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 2 | ||||
| -rw-r--r-- | drivers/infiniband/hw/cxgb4/mem.c | 5 | ||||
| -rw-r--r-- | drivers/infiniband/hw/ehca/ehca_iverbs.h | 2 | ||||
| -rw-r--r-- | drivers/infiniband/hw/ehca/ehca_mrmw.c | 5 | ||||
| -rw-r--r-- | drivers/infiniband/hw/nes/nes_verbs.c | 19 | ||||
| -rw-r--r-- | include/rdma/ib_verbs.h | 73 | ||||
| -rw-r--r-- | net/sunrpc/xprtrdma/verbs.c | 20 |
10 files changed, 110 insertions, 41 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 30f199e8579f..a8fdd3381405 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c | |||
| @@ -1099,18 +1099,19 @@ EXPORT_SYMBOL(ib_free_fast_reg_page_list); | |||
| 1099 | 1099 | ||
| 1100 | /* Memory windows */ | 1100 | /* Memory windows */ |
| 1101 | 1101 | ||
| 1102 | struct ib_mw *ib_alloc_mw(struct ib_pd *pd) | 1102 | struct ib_mw *ib_alloc_mw(struct ib_pd *pd, enum ib_mw_type type) |
| 1103 | { | 1103 | { |
| 1104 | struct ib_mw *mw; | 1104 | struct ib_mw *mw; |
| 1105 | 1105 | ||
| 1106 | if (!pd->device->alloc_mw) | 1106 | if (!pd->device->alloc_mw) |
| 1107 | return ERR_PTR(-ENOSYS); | 1107 | return ERR_PTR(-ENOSYS); |
| 1108 | 1108 | ||
| 1109 | mw = pd->device->alloc_mw(pd); | 1109 | mw = pd->device->alloc_mw(pd, type); |
| 1110 | if (!IS_ERR(mw)) { | 1110 | if (!IS_ERR(mw)) { |
| 1111 | mw->device = pd->device; | 1111 | mw->device = pd->device; |
| 1112 | mw->pd = pd; | 1112 | mw->pd = pd; |
| 1113 | mw->uobject = NULL; | 1113 | mw->uobject = NULL; |
| 1114 | mw->type = type; | ||
| 1114 | atomic_inc(&pd->usecnt); | 1115 | atomic_inc(&pd->usecnt); |
| 1115 | } | 1116 | } |
| 1116 | 1117 | ||
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index 0bdf09aa6f42..074d5c25f50b 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c | |||
| @@ -738,7 +738,7 @@ static struct ib_mr *iwch_get_dma_mr(struct ib_pd *pd, int acc) | |||
| 738 | return ibmr; | 738 | return ibmr; |
| 739 | } | 739 | } |
| 740 | 740 | ||
| 741 | static struct ib_mw *iwch_alloc_mw(struct ib_pd *pd) | 741 | static struct ib_mw *iwch_alloc_mw(struct ib_pd *pd, enum ib_mw_type type) |
| 742 | { | 742 | { |
| 743 | struct iwch_dev *rhp; | 743 | struct iwch_dev *rhp; |
| 744 | struct iwch_pd *php; | 744 | struct iwch_pd *php; |
| @@ -747,6 +747,9 @@ static struct ib_mw *iwch_alloc_mw(struct ib_pd *pd) | |||
| 747 | u32 stag = 0; | 747 | u32 stag = 0; |
| 748 | int ret; | 748 | int ret; |
| 749 | 749 | ||
| 750 | if (type != IB_MW_TYPE_1) | ||
| 751 | return ERR_PTR(-EINVAL); | ||
| 752 | |||
| 750 | php = to_iwch_pd(pd); | 753 | php = to_iwch_pd(pd); |
| 751 | rhp = php->rhp; | 754 | rhp = php->rhp; |
| 752 | mhp = kzalloc(sizeof(*mhp), GFP_KERNEL); | 755 | mhp = kzalloc(sizeof(*mhp), GFP_KERNEL); |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c index 6de8463f453b..e5649e8b215d 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_qp.c +++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c | |||
| @@ -567,18 +567,19 @@ int iwch_bind_mw(struct ib_qp *qp, | |||
| 567 | if (mw_bind->send_flags & IB_SEND_SIGNALED) | 567 | if (mw_bind->send_flags & IB_SEND_SIGNALED) |
| 568 | t3_wr_flags = T3_COMPLETION_FLAG; | 568 | t3_wr_flags = T3_COMPLETION_FLAG; |
| 569 | 569 | ||
| 570 | sgl.addr = mw_bind->addr; | 570 | sgl.addr = mw_bind->bind_info.addr; |
| 571 | sgl.lkey = mw_bind->mr->lkey; | 571 | sgl.lkey = mw_bind->bind_info.mr->lkey; |
| 572 | sgl.length = mw_bind->length; | 572 | sgl.length = mw_bind->bind_info.length; |
| 573 | wqe->bind.reserved = 0; | 573 | wqe->bind.reserved = 0; |
| 574 | wqe->bind.type = TPT_VATO; | 574 | wqe->bind.type = TPT_VATO; |
| 575 | 575 | ||
| 576 | /* TBD: check perms */ | 576 | /* TBD: check perms */ |
| 577 | wqe->bind.perms = iwch_ib_to_tpt_bind_access(mw_bind->mw_access_flags); | 577 | wqe->bind.perms = iwch_ib_to_tpt_bind_access( |
| 578 | wqe->bind.mr_stag = cpu_to_be32(mw_bind->mr->lkey); | 578 | mw_bind->bind_info.mw_access_flags); |
| 579 | wqe->bind.mr_stag = cpu_to_be32(mw_bind->bind_info.mr->lkey); | ||
| 579 | wqe->bind.mw_stag = cpu_to_be32(mw->rkey); | 580 | wqe->bind.mw_stag = cpu_to_be32(mw->rkey); |
| 580 | wqe->bind.mw_len = cpu_to_be32(mw_bind->length); | 581 | wqe->bind.mw_len = cpu_to_be32(mw_bind->bind_info.length); |
| 581 | wqe->bind.mw_va = cpu_to_be64(mw_bind->addr); | 582 | wqe->bind.mw_va = cpu_to_be64(mw_bind->bind_info.addr); |
| 582 | err = iwch_sgl2pbl_map(rhp, &sgl, 1, &pbl_addr, &page_size); | 583 | err = iwch_sgl2pbl_map(rhp, &sgl, 1, &pbl_addr, &page_size); |
| 583 | if (err) { | 584 | if (err) { |
| 584 | spin_unlock_irqrestore(&qhp->lock, flag); | 585 | spin_unlock_irqrestore(&qhp->lock, flag); |
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h index 9c1644fb0259..c8bd239915d5 100644 --- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h +++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h | |||
| @@ -866,7 +866,7 @@ struct ib_fast_reg_page_list *c4iw_alloc_fastreg_pbl( | |||
| 866 | int page_list_len); | 866 | int page_list_len); |
| 867 | struct ib_mr *c4iw_alloc_fast_reg_mr(struct ib_pd *pd, int pbl_depth); | 867 | struct ib_mr *c4iw_alloc_fast_reg_mr(struct ib_pd *pd, int pbl_depth); |
| 868 | int c4iw_dealloc_mw(struct ib_mw *mw); | 868 | int c4iw_dealloc_mw(struct ib_mw *mw); |
| 869 | struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd); | 869 | struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd, enum ib_mw_type type); |
| 870 | struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start, | 870 | struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start, |
| 871 | u64 length, u64 virt, int acc, | 871 | u64 length, u64 virt, int acc, |
| 872 | struct ib_udata *udata); | 872 | struct ib_udata *udata); |
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c index afd81790ab3c..903a92d6f91d 100644 --- a/drivers/infiniband/hw/cxgb4/mem.c +++ b/drivers/infiniband/hw/cxgb4/mem.c | |||
| @@ -650,7 +650,7 @@ err: | |||
| 650 | return ERR_PTR(err); | 650 | return ERR_PTR(err); |
| 651 | } | 651 | } |
| 652 | 652 | ||
| 653 | struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd) | 653 | struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd, enum ib_mw_type type) |
| 654 | { | 654 | { |
| 655 | struct c4iw_dev *rhp; | 655 | struct c4iw_dev *rhp; |
| 656 | struct c4iw_pd *php; | 656 | struct c4iw_pd *php; |
| @@ -659,6 +659,9 @@ struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd) | |||
| 659 | u32 stag = 0; | 659 | u32 stag = 0; |
| 660 | int ret; | 660 | int ret; |
| 661 | 661 | ||
| 662 | if (type != IB_MW_TYPE_1) | ||
| 663 | return ERR_PTR(-EINVAL); | ||
| 664 | |||
| 662 | php = to_c4iw_pd(pd); | 665 | php = to_c4iw_pd(pd); |
| 663 | rhp = php->rhp; | 666 | rhp = php->rhp; |
| 664 | mhp = kzalloc(sizeof(*mhp), GFP_KERNEL); | 667 | mhp = kzalloc(sizeof(*mhp), GFP_KERNEL); |
diff --git a/drivers/infiniband/hw/ehca/ehca_iverbs.h b/drivers/infiniband/hw/ehca/ehca_iverbs.h index 8f7f282ead65..22f79afa7fc1 100644 --- a/drivers/infiniband/hw/ehca/ehca_iverbs.h +++ b/drivers/infiniband/hw/ehca/ehca_iverbs.h | |||
| @@ -95,7 +95,7 @@ int ehca_query_mr(struct ib_mr *mr, struct ib_mr_attr *mr_attr); | |||
| 95 | 95 | ||
| 96 | int ehca_dereg_mr(struct ib_mr *mr); | 96 | int ehca_dereg_mr(struct ib_mr *mr); |
| 97 | 97 | ||
| 98 | struct ib_mw *ehca_alloc_mw(struct ib_pd *pd); | 98 | struct ib_mw *ehca_alloc_mw(struct ib_pd *pd, enum ib_mw_type type); |
| 99 | 99 | ||
| 100 | int ehca_bind_mw(struct ib_qp *qp, struct ib_mw *mw, | 100 | int ehca_bind_mw(struct ib_qp *qp, struct ib_mw *mw, |
| 101 | struct ib_mw_bind *mw_bind); | 101 | struct ib_mw_bind *mw_bind); |
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c index 87844869dcc2..bcfb0c183620 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c +++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c | |||
| @@ -688,7 +688,7 @@ dereg_mr_exit0: | |||
| 688 | 688 | ||
| 689 | /*----------------------------------------------------------------------*/ | 689 | /*----------------------------------------------------------------------*/ |
| 690 | 690 | ||
| 691 | struct ib_mw *ehca_alloc_mw(struct ib_pd *pd) | 691 | struct ib_mw *ehca_alloc_mw(struct ib_pd *pd, enum ib_mw_type type) |
| 692 | { | 692 | { |
| 693 | struct ib_mw *ib_mw; | 693 | struct ib_mw *ib_mw; |
| 694 | u64 h_ret; | 694 | u64 h_ret; |
| @@ -698,6 +698,9 @@ struct ib_mw *ehca_alloc_mw(struct ib_pd *pd) | |||
| 698 | container_of(pd->device, struct ehca_shca, ib_device); | 698 | container_of(pd->device, struct ehca_shca, ib_device); |
| 699 | struct ehca_mw_hipzout_parms hipzout; | 699 | struct ehca_mw_hipzout_parms hipzout; |
| 700 | 700 | ||
| 701 | if (type != IB_MW_TYPE_1) | ||
| 702 | return ERR_PTR(-EINVAL); | ||
| 703 | |||
| 701 | e_mw = ehca_mw_new(); | 704 | e_mw = ehca_mw_new(); |
| 702 | if (!e_mw) { | 705 | if (!e_mw) { |
| 703 | ib_mw = ERR_PTR(-ENOMEM); | 706 | ib_mw = ERR_PTR(-ENOMEM); |
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 07e4fbad987a..8f67fe2e91e6 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c | |||
| @@ -55,7 +55,8 @@ static void nes_unregister_ofa_device(struct nes_ib_device *nesibdev); | |||
| 55 | /** | 55 | /** |
| 56 | * nes_alloc_mw | 56 | * nes_alloc_mw |
| 57 | */ | 57 | */ |
| 58 | static struct ib_mw *nes_alloc_mw(struct ib_pd *ibpd) { | ||
