diff mbox series

[for-next,16/16] RDMA/rxe: Add parameters to control task type

Message ID 20221018043345.4033-17-rpearsonhpe@gmail.com (mailing list archive)
State Superseded
Headers show
Series Implement work queues for rdma_rxe | expand

Commit Message

Bob Pearson Oct. 18, 2022, 4:33 a.m. UTC
Add modparams to control the task types for req, comp, and resp
tasks.

Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_qp.c   | 6 +++---
 drivers/infiniband/sw/rxe/rxe_task.c | 8 ++++++++
 drivers/infiniband/sw/rxe/rxe_task.h | 4 ++++
 3 files changed, 15 insertions(+), 3 deletions(-)

Comments

Leon Romanovsky Oct. 18, 2022, 9:02 a.m. UTC | #1
On Mon, Oct 17, 2022 at 11:33:47PM -0500, Bob Pearson wrote:
> Add modparams to control the task types for req, comp, and resp
> tasks.

You need to be more descriptive why module parameters are unavoidable.

Thanks
Bob Pearson Oct. 18, 2022, 3:22 p.m. UTC | #2
On 10/18/22 04:02, Leon Romanovsky wrote:
> On Mon, Oct 17, 2022 at 11:33:47PM -0500, Bob Pearson wrote:
>> Add modparams to control the task types for req, comp, and resp
>> tasks.
> 
> You need to be more descriptive why module parameters are unavoidable.
> 
> Thanks

I asked Jason what was the best way here and didn't get an answer. These are tuning parameters.
Generally I am not sure how to present them to users. They are pretty specific to this
driver so the rdma app seems a bad choice. I know netlink is the preferred way to talk to
rdma-core but I haven't figured out how it works. I suspect this is temporary and work queues
will replace tasklets in this driver once people are used to it.

Bob
Leon Romanovsky Oct. 18, 2022, 5:55 p.m. UTC | #3
On Tue, Oct 18, 2022 at 10:22:09AM -0500, Bob Pearson wrote:
> On 10/18/22 04:02, Leon Romanovsky wrote:
> > On Mon, Oct 17, 2022 at 11:33:47PM -0500, Bob Pearson wrote:
> >> Add modparams to control the task types for req, comp, and resp
> >> tasks.
> > 
> > You need to be more descriptive why module parameters are unavoidable.
> > 
> > Thanks
> 
> I asked Jason what was the best way here and didn't get an answer. These are tuning parameters.
> Generally I am not sure how to present them to users. They are pretty specific to this
> driver so the rdma app seems a bad choice. I know netlink is the preferred way to talk to
> rdma-core but I haven't figured out how it works. I suspect this is temporary and work queues
> will replace tasklets in this driver once people are used to it.

I think that the best way is to remove tasklets from RXE, unless someone
comes forward to explain why they must to stay (not theoretical explanation,
but practical use).

Thanks

> 
> Bob
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
index 50f6b8b8ad9d..673d52271062 100644
--- a/drivers/infiniband/sw/rxe/rxe_qp.c
+++ b/drivers/infiniband/sw/rxe/rxe_qp.c
@@ -238,9 +238,9 @@  static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
 
 	skb_queue_head_init(&qp->req_pkts);
 
-	rxe_init_task(&qp->req.task, qp, rxe_requester, RXE_TASK_TYPE_TASKLET);
+	rxe_init_task(&qp->req.task, qp, rxe_requester, rxe_req_task_type);
 	rxe_init_task(&qp->comp.task, qp, rxe_completer,
-			(qp_type(qp) == IB_QPT_RC) ? RXE_TASK_TYPE_TASKLET :
+			(qp_type(qp) == IB_QPT_RC) ? rxe_comp_task_type :
 						     RXE_TASK_TYPE_INLINE);
 
 	qp->qp_timeout_jiffies = 0; /* Can't be set for UD/UC in modify_qp */
@@ -288,7 +288,7 @@  static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp,
 
 	skb_queue_head_init(&qp->resp_pkts);
 
-	rxe_init_task(&qp->resp.task, qp, rxe_responder, RXE_TASK_TYPE_TASKLET);
+	rxe_init_task(&qp->resp.task, qp, rxe_responder, rxe_resp_task_type);
 
 	qp->resp.opcode		= OPCODE_NONE;
 	qp->resp.msn		= 0;
diff --git a/drivers/infiniband/sw/rxe/rxe_task.c b/drivers/infiniband/sw/rxe/rxe_task.c
index ea33ea3bc0b1..350b033e6e59 100644
--- a/drivers/infiniband/sw/rxe/rxe_task.c
+++ b/drivers/infiniband/sw/rxe/rxe_task.c
@@ -10,6 +10,14 @@ 
 
 #include "rxe.h"
 
+int rxe_req_task_type = RXE_TASK_TYPE_TASKLET;
+int rxe_comp_task_type = RXE_TASK_TYPE_TASKLET;
+int rxe_resp_task_type = RXE_TASK_TYPE_TASKLET;
+
+module_param_named(req_task_type, rxe_req_task_type, int, 0664);
+module_param_named(comp_task_type, rxe_comp_task_type, int, 0664);
+module_param_named(resp_task_type, rxe_resp_task_type, int, 0664);
+
 static struct workqueue_struct *rxe_wq;
 
 int rxe_alloc_wq(void)
diff --git a/drivers/infiniband/sw/rxe/rxe_task.h b/drivers/infiniband/sw/rxe/rxe_task.h
index 4887ca566769..4c37b7c47a60 100644
--- a/drivers/infiniband/sw/rxe/rxe_task.h
+++ b/drivers/infiniband/sw/rxe/rxe_task.h
@@ -7,6 +7,10 @@ 
 #ifndef RXE_TASK_H
 #define RXE_TASK_H
 
+extern int rxe_req_task_type;
+extern int rxe_comp_task_type;
+extern int rxe_resp_task_type;
+
 struct rxe_task;
 
 struct rxe_task_ops {