Skip to contentSkip to conversation

IB/rxe: Avoid accessing timers for non RC QPs

PATCH Applied Leon Romanovsky 3 participants 6 messages Mar 19, 2017 – Apr 24, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 IB/rxe: Avoid accessing timers for non RC QPs

From: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/[email protected]>

This patch avoids RNR NAK timer and retransmit timer initialization and cleanup for non RC QPs (such as UD QP, GSI QP).

---
 drivers/infiniband/sw/rxe/rxe_qp.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/infiniband/sw/rxe/rxe_qp.c +8 -5
index f98a19e61a3d..3ad9b48212de 100644
@@ -273,10 +273,11 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
 	rxe_init_task(rxe, &qp->comp.task, qp,
 		      rxe_completer, "comp");
 
-	setup_timer(&qp->rnr_nak_timer, rnr_nak_timer, (unsigned long)qp);
-	setup_timer(&qp->retrans_timer, retransmit_timer, (unsigned long)qp);
 	qp->qp_timeout_jiffies = 0; /* Can't be set for UD/UC in modify_qp */
-
+	if (init->qp_type == IB_QPT_RC) {
+		setup_timer(&qp->rnr_nak_timer, rnr_nak_timer, (unsigned long)qp);
+		setup_timer(&qp->retrans_timer, retransmit_timer, (unsigned long)qp);
+	}
 	return 0;
 }
 
@@ -804,8 +805,10 @@ void rxe_qp_destroy(struct rxe_qp *qp)
 	qp->qp_timeout_jiffies = 0;
 	rxe_cleanup_task(&qp->resp.task);
 
-	del_timer_sync(&qp->retrans_timer);
-	del_timer_sync(&qp->rnr_nak_timer);
+	if (qp_type(qp) == IB_QPT_RC) {
+		del_timer_sync(&qp->retrans_timer);
+		del_timer_sync(&qp->rnr_nak_timer);
+	}
 
 	rxe_cleanup_task(&qp->req.task);
 	rxe_cleanup_task(&qp->comp.task);
Signature · 6 lines
2.12.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170319092057.9103-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#2 lore raw

PATCH 2/2 IB/rxe: Do not export module's private function

From: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/[email protected]>

Function rxe_rcv is used internally in RXE and don't need to be exported. This patch removes such export declaration.

---
 drivers/infiniband/sw/rxe/rxe_recv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_recv.c +0 -1
index 50886031096f..9775d8274b64 100644
@@ -417,4 +417,3 @@ int rxe_rcv(struct sk_buff *skb)
 	kfree_skb(skb);
 	return 0;
 }
-EXPORT_SYMBOL(rxe_rcv);
Signature · 6 lines
2.12.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170319092057.9103-2-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Reviewed-by
#4 lore raw

Re: [PATCH rdma-next 2/2] IB/rxe: Do not export module's private function

Quoted 16 lines · Leon Romanovsky

From: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/[email protected]>

Function rxe_rcv is used internally in RXE and don't need to be exported. This patch removes such export declaration.

---
 drivers/infiniband/sw/rxe/rxe_recv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_recv.c +0 -0
index 50886031096f..9775d8274b64 100644

drivers/infiniband/sw/rxe/rxe_recv.c int rxe_rcv(struct sk_buff *skb) · line 420

Quoted 4 lines
drivers/infiniband/sw/rxe/rxe_recv.c +0 -1
@@ -417,4 +417,3 @@ int rxe_rcv(struct sk_buff *skb)
 	kfree_skb(skb);
 	return 0;
 }
-EXPORT_SYMBOL(rxe_rcv);
Quoted 7 lines
Signature · 6 lines
2.12.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#5 lore raw

Re: [PATCH rdma-next 2/2] IB/rxe: Do not export module's private function

In reply to a message not in the archive
Quoted 7 lines · Leon Romanovsky

From: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/[email protected]>

Function rxe_rcv is used internally in RXE and don't need to be exported. This patch removes such export declaration.

Thanks, applied.

Signature · 9 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reviewed-by
#6 lore raw
In reply to a message not in the archive
Quoted 32 lines · Leon Romanovsky

From: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/[email protected]>

This patch avoids RNR NAK timer and retransmit timer initialization and cleanup for non RC QPs (such as UD QP, GSI QP).

---
 drivers/infiniband/sw/rxe/rxe_qp.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/infiniband/sw/rxe/rxe_qp.c +4 -3
index f98a19e61a3d..3ad9b48212de 100644
@@ -273,10 +273,11 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
 	rxe_init_task(rxe, &qp->comp.task, qp,
 		      rxe_completer, "comp");
 
-	setup_timer(&qp->rnr_nak_timer, rnr_nak_timer, (unsigned long)qp);
-	setup_timer(&qp->retrans_timer, retransmit_timer, (unsigned long)qp);
 	qp->qp_timeout_jiffies = 0; /* Can't be set for UD/UC in modify_qp */
-
+	if (init->qp_type == IB_QPT_RC) {
+		setup_timer(&qp->rnr_nak_timer, rnr_nak_timer, (unsigned long)qp);
+		setup_timer(&qp->retrans_timer, retransmit_timer, (unsigned long)qp);
+	}
 	return 0;
 }
 

drivers/infiniband/sw/rxe/rxe_qp.c void rxe_qp_destroy(struct rxe_qp *qp) · line 811

Quoted 9 lines
drivers/infiniband/sw/rxe/rxe_qp.c +4 -2
@@ -804,8 +805,10 @@ void rxe_qp_destroy(struct rxe_qp *qp)
 	qp->qp_timeout_jiffies = 0;
 	rxe_cleanup_task(&qp->resp.task);
 
-	del_timer_sync(&qp->retrans_timer);
-	del_timer_sync(&qp->rnr_nak_timer);
+	if (qp_type(qp) == IB_QPT_RC) {
+		del_timer_sync(&qp->retrans_timer);
+		del_timer_sync(&qp->rnr_nak_timer);
+	}
Quoted 10 lines
drivers/infiniband/sw/rxe/rxe_qp.c +0 -0
 	rxe_cleanup_task(&qp->req.task);
 	rxe_cleanup_task(&qp->comp.task);
Signature · 6 lines
2.12.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#7 lore raw
In reply to a message not in the archive
Quoted 9 lines · Leon Romanovsky

From: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/[email protected]>

This patch avoids RNR NAK timer and retransmit timer initialization and
cleanup for non RC QPs (such as UD QP, GSI QP).

Thanks, applied.

Signature · 9 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html