From: Doug Ledford Date: Tue, 15 Dec 2015 19:10:44 +0000 (-0500) Subject: Merge branch 'rdma-cq.2' of git://git.infradead.org/users/hch/rdma into 4.5/rdma-cq X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c6333f9f9f7646e311248a09e8ed96126a97aba8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Merge branch 'rdma-cq.2' of git://git.infradead.org/users/hch/rdma into 4.5/rdma-cq Signed-off-by: Doug Ledford Conflicts: drivers/infiniband/ulp/srp/ib_srp.c - Conflicts with changes in ib_srp.c introduced during 4.4-rc updates --- c6333f9f9f7646e311248a09e8ed96126a97aba8 diff --cc drivers/infiniband/ulp/srp/ib_srp.c index 3db9a659719b,dfed5d468ed8..20fa332ced8a --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@@ -488,8 -501,7 +501,7 @@@ static int srp_create_ch_ib(struct srp_ struct ib_qp *qp; struct ib_fmr_pool *fmr_pool = NULL; struct srp_fr_pool *fr_pool = NULL; - const int m = 1 + dev->use_fast_reg; + const int m = dev->use_fast_reg ? 3 : 1; - struct ib_cq_init_attr cq_attr = {}; int ret; init_attr = kzalloc(sizeof *init_attr, GFP_KERNEL); @@@ -1029,19 -1035,22 +1036,25 @@@ static int srp_connect_ch(struct srp_rd case SRP_STALE_CONN: shost_printk(KERN_ERR, target->scsi_host, PFX "giving up on stale connection\n"); - ch->status = -ECONNRESET; - return ch->status; + ret = -ECONNRESET; + goto out; default: - return ch->status; + goto out; } } + +out: + return ret <= 0 ? ret : -ENODEV; } - static int srp_inv_rkey(struct srp_rdma_ch *ch, u32 rkey) + static void srp_inv_rkey_err_done(struct ib_cq *cq, struct ib_wc *wc) + { + srp_handle_qp_err(cq, wc, "INV RKEY"); + } + + static int srp_inv_rkey(struct srp_request *req, struct srp_rdma_ch *ch, + u32 rkey) { struct ib_send_wr *bad_wr; struct ib_send_wr wr = { @@@ -1312,8 -1322,14 +1326,14 @@@ reset_state return 0; } + static void srp_reg_mr_err_done(struct ib_cq *cq, struct ib_wc *wc) + { + srp_handle_qp_err(cq, wc, "FAST REG"); + } + static int srp_map_finish_fr(struct srp_map_state *state, + struct srp_request *req, - struct srp_rdma_ch *ch) + struct srp_rdma_ch *ch, int sg_nents) { struct srp_target_port *target = ch->target; struct srp_device *dev = target->srp_host->srp_dev; @@@ -1451,11 -1470,12 +1473,11 @@@ static int srp_map_sg_fr(struct srp_map state->fr.next = req->fr_list; state->fr.end = req->fr_list + ch->target->cmd_sg_cnt; state->sg = scat; - state->sg_nents = scsi_sg_count(req->scmnd); - while (state->sg_nents) { + while (count) { int i, n; - n = srp_map_finish_fr(state, ch, count); - n = srp_map_finish_fr(state, req, ch); ++ n = srp_map_finish_fr(state, req, ch, count); if (unlikely(n < 0)) return n; @@@ -1519,12 -1539,10 +1541,12 @@@ static int srp_map_idb(struct srp_rdma_ if (dev->use_fast_reg) { state.sg = idb_sg; - state.sg_nents = 1; sg_set_buf(idb_sg, req->indirect_desc, idb_len); idb_sg->dma_address = req->indirect_dma_addr; /* hack! */ - ret = srp_map_finish_fr(&state, req, ch); +#ifdef CONFIG_NEED_SG_DMA_LENGTH + idb_sg->dma_length = idb_sg->length; /* hack^2 */ +#endif - ret = srp_map_finish_fr(&state, ch, 1); ++ ret = srp_map_finish_fr(&state, req, ch, 1); if (ret < 0) return ret; } else if (dev->use_fmr) {