aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rdmavt/qp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/sw/rdmavt/qp.c')
-rw-r--r--drivers/infiniband/sw/rdmavt/qp.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 7de5134bec85..41ba7e9cadaa 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -369,8 +369,8 @@ static int alloc_qpn(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt,
369 /* wrap to first map page, invert bit 0 */ 369 /* wrap to first map page, invert bit 0 */
370 offset = qpt->incr | ((offset & 1) ^ 1); 370 offset = qpt->incr | ((offset & 1) ^ 1);
371 } 371 }
372 /* there can be no bits at shift and below */ 372 /* there can be no set bits in low-order QoS bits */
373 WARN_ON(offset & (rdi->dparms.qos_shift - 1)); 373 WARN_ON(offset & (BIT(rdi->dparms.qos_shift) - 1));
374 qpn = mk_qpn(qpt, map, offset); 374 qpn = mk_qpn(qpt, map, offset);
375 } 375 }
376 376
@@ -576,12 +576,6 @@ static void rvt_reset_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp,
576 qp->s_ssn = 1; 576 qp->s_ssn = 1;
577 qp->s_lsn = 0; 577 qp->s_lsn = 0;
578 qp->s_mig_state = IB_MIG_MIGRATED; 578 qp->s_mig_state = IB_MIG_MIGRATED;
579 if (qp->s_ack_queue)
580 memset(
581 qp->s_ack_queue,
582 0,
583 rvt_max_atomic(rdi) *
584 sizeof(*qp->s_ack_queue));
585 qp->r_head_ack_queue = 0; 579 qp->r_head_ack_queue = 0;
586 qp->s_tail_ack_queue = 0; 580 qp->s_tail_ack_queue = 0;
587 qp->s_num_rd_atomic = 0; 581 qp->s_num_rd_atomic = 0;
@@ -705,8 +699,10 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,
705 * initialization that is needed. 699 * initialization that is needed.
706 */ 700 */
707 priv = rdi->driver_f.qp_priv_alloc(rdi, qp, gfp); 701 priv = rdi->driver_f.qp_priv_alloc(rdi, qp, gfp);
708 if (!priv) 702 if (IS_ERR(priv)) {
703 ret = priv;
709 goto bail_qp; 704 goto bail_qp;
705 }
710 qp->priv = priv; 706 qp->priv = priv;
711 qp->timeout_jiffies = 707 qp->timeout_jiffies =
712 usecs_to_jiffies((4096UL * (1UL << qp->timeout)) / 708 usecs_to_jiffies((4096UL * (1UL << qp->timeout)) /