From 34cee28f0bb067f4210271c4d7c4febe34bad2d3 Mon Sep 17 00:00:00 2001 From: Mike Marciniszyn Date: Tue, 9 Feb 2016 14:29:31 -0800 Subject: [PATCH] staging/rdma/hfi1: actually use new RNR timer API in loopback path The patch series which added a new API for the RNR timer did not include an updated call in the loopback path. RC/UC RNR loopback would be broken without this. Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Doug Ledford --- drivers/staging/rdma/hfi1/rc.c | 2 +- drivers/staging/rdma/hfi1/ruc.c | 8 +++----- drivers/staging/rdma/hfi1/verbs.h | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rdma/hfi1/rc.c b/drivers/staging/rdma/hfi1/rc.c index e54e0b4bb5e5..ba2a2ccac6f2 100644 --- a/drivers/staging/rdma/hfi1/rc.c +++ b/drivers/staging/rdma/hfi1/rc.c @@ -81,7 +81,7 @@ static inline void hfi1_add_retry_timer(struct rvt_qp *qp) * * add an rnr timer on the QP */ -static inline void hfi1_add_rnr_timer(struct rvt_qp *qp, u32 to) +void hfi1_add_rnr_timer(struct rvt_qp *qp, u32 to) { struct hfi1_qp_priv *priv = qp->priv; diff --git a/drivers/staging/rdma/hfi1/ruc.c b/drivers/staging/rdma/hfi1/ruc.c index 66449acac76d..a7add3c5d0f2 100644 --- a/drivers/staging/rdma/hfi1/ruc.c +++ b/drivers/staging/rdma/hfi1/ruc.c @@ -371,6 +371,7 @@ static void ruc_loopback(struct rvt_qp *sqp) int release; int ret; int copy_last = 0; + u32 to; rcu_read_lock(); @@ -600,11 +601,8 @@ rnr_nak: spin_lock_irqsave(&sqp->s_lock, flags); if (!(ib_rvt_state_ops[sqp->state] & RVT_PROCESS_RECV_OK)) goto clr_busy; - sqp->s_flags |= RVT_S_WAIT_RNR; - sqp->s_timer.function = hfi1_rc_rnr_retry; - sqp->s_timer.expires = jiffies + - usecs_to_jiffies(ib_hfi1_rnr_table[qp->r_min_rnr_timer]); - add_timer(&sqp->s_timer); + to = ib_hfi1_rnr_table[qp->r_min_rnr_timer]; + hfi1_add_rnr_timer(sqp, to); goto clr_busy; op_err: diff --git a/drivers/staging/rdma/hfi1/verbs.h b/drivers/staging/rdma/hfi1/verbs.h index 26eda8a3e55e..adb63bb6fae2 100644 --- a/drivers/staging/rdma/hfi1/verbs.h +++ b/drivers/staging/rdma/hfi1/verbs.h @@ -404,6 +404,7 @@ u8 ah_to_sc(struct ib_device *ibdev, struct ib_ah_attr *ah_attr); struct ib_ah *hfi1_create_qp0_ah(struct hfi1_ibport *ibp, u16 dlid); void hfi1_rc_rnr_retry(unsigned long arg); +void hfi1_add_rnr_timer(struct rvt_qp *qp, u32 to); void hfi1_rc_timeout(unsigned long arg); void hfi1_del_timers_sync(struct rvt_qp *qp); void hfi1_stop_rc_timers(struct rvt_qp *qp); -- 2.20.1