Skip to contentSkip to conversation

RDMA/rxe: Add workqueue support for tasks

PATCH Superseded Bob Pearson 1 participant 1 message Mar 1, 2023

Subsystems (2)

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 RDMA/rxe: Add workqueue support for tasks

Replace tasklets by work queues for the three main rxe tasklets:
rxe_requester, rxe_completer and rxe_responder.

This patch is all that is left from an eariler patch series that also converted tasklets to workqueues with the same subject.

With this patch the rxe driver does not exhibit the soft lockups reported by Daisuke Matsuda in the link below.

This patch depends on an earlier patch series titled "RDMA/rxe: Correct qp reference counting" which corrects the same errors for the current tasklet version.

---
v5:
Based on corrected task logic for tasklets and simplified to only convert from tasklets to workqueues and not provide a flexible interface.

 drivers/infiniband/sw/rxe/rxe.c      |  9 ++++-
 drivers/infiniband/sw/rxe/rxe_task.c | 49 +++++++++++++++++++---------
 drivers/infiniband/sw/rxe/rxe_task.h |  6 +++-
 3 files changed, 47 insertions(+), 17 deletions(-)
drivers/infiniband/sw/rxe/rxe.c +8 -1
index 7a7e713de52d..54c723a6edda 100644
@@ -212,10 +212,16 @@ static int __init rxe_module_init(void)
 {
 	int err;
 
-	err = rxe_net_init();
+	err = rxe_alloc_wq();
 	if (err)
 		return err;
 
+	err = rxe_net_init();
+	if (err) {
+		rxe_destroy_wq();
+		return err;
+	}
+
 	rdma_link_register(&rxe_link_ops);
 	pr_info("loaded\n");
 	return 0;
@@ -226,6 +232,7 @@ static void __exit rxe_module_exit(void)
 	rdma_link_unregister(&rxe_link_ops);
 	ib_unregister_driver(RDMA_DRIVER_RXE);
 	rxe_net_exit();
+	rxe_destroy_wq();
 
 	pr_info("unloaded\n");
 }
drivers/infiniband/sw/rxe/rxe_task.c +34 -15

121 lines not on this page · raw message

drivers/infiniband/sw/rxe/rxe_task.h +5 -1
index facb7c8e3729..a63e258b3d66 100644
@@ -22,7 +22,7 @@ enum {
  * called again.
  */
 struct rxe_task {
-	struct tasklet_struct	tasklet;
+	struct work_struct	work;
 	int			state;
 	spinlock_t		lock;
 	struct rxe_qp		*qp;
@@ -32,6 +32,10 @@ struct rxe_task {
 	long			num_done;
 };
 
+int rxe_alloc_wq(void);
+
+void rxe_destroy_wq(void);
+
 /*
  * init rxe_task structure
  *	qp  => parameter to pass to func
Signature · 1 line
2.37.2