RDMA/rxe: Don't call direct between tasks
authorBob Pearson <rpearsonhpe@gmail.com>
Fri, 29 Mar 2024 14:55:11 +0000 (09:55 -0500)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 22 Apr 2024 19:54:33 +0000 (16:54 -0300)
Replace calls to rxe_run_task() with rxe_sched_task().  This prevents the
tasks from all running on the same cpu.

This change slightly reduces performance for single qp send and write
benchmarks in loopback mode but greatly improves the performance with
multiple qps because if run task is used all the work tends to be
performed on one cpu. For actual on the wire benchmarks there is no
noticeable performance change.

Link: https://lore.kernel.org/r/20240329145513.35381-11-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_comp.c
drivers/infiniband/sw/rxe/rxe_resp.c
drivers/infiniband/sw/rxe/rxe_verbs.c

index 357c1d516efbff09305213ca0be34aeabdb670f1..d48af218074588cfb7c16594d162e62b4174f7d1 100644 (file)
@@ -129,18 +129,9 @@ void retransmit_timer(struct timer_list *t)
 
 void rxe_comp_queue_pkt(struct rxe_qp *qp, struct sk_buff *skb)
 {
-       int must_sched;
-
-       must_sched = skb_queue_len(&qp->resp_pkts) > 0;
-       if (must_sched != 0)
-               rxe_counter_inc(SKB_TO_PKT(skb)->rxe, RXE_CNT_SENDER_SCHED);
-
+       rxe_counter_inc(SKB_TO_PKT(skb)->rxe, RXE_CNT_SENDER_SCHED);
        skb_queue_tail(&qp->resp_pkts, skb);
-
-       if (must_sched)
-               rxe_sched_task(&qp->send_task);
-       else
-               rxe_run_task(&qp->send_task);
+       rxe_sched_task(&qp->send_task);
 }
 
 static inline enum comp_state get_wqe(struct rxe_qp *qp,
index 3ce7a32b5dcf88b3e0b744529138035c8f957a5e..c6a7fa3054fada989014872d416a0c22e2314d2c 100644 (file)
@@ -49,18 +49,8 @@ static char *resp_state_name[] = {
 /* rxe_recv calls here to add a request packet to the input queue */
 void rxe_resp_queue_pkt(struct rxe_qp *qp, struct sk_buff *skb)
 {
-       int must_sched;
-       struct rxe_pkt_info *pkt = SKB_TO_PKT(skb);
-
        skb_queue_tail(&qp->req_pkts, skb);
-
-       must_sched = (pkt->opcode == IB_OPCODE_RC_RDMA_READ_REQUEST) ||
-                       (skb_queue_len(&qp->req_pkts) > 1);
-
-       if (must_sched)
-               rxe_sched_task(&qp->recv_task);
-       else
-               rxe_run_task(&qp->recv_task);
+       rxe_sched_task(&qp->recv_task);
 }
 
 static inline enum resp_states get_req(struct rxe_qp *qp,
index d07f7bd3b2ae298f61b2b6862fb77c3399899671..c7d4d8ab5a0941b1fe5b3c3a0e806dbdc50aff16 100644 (file)
@@ -935,7 +935,7 @@ static int rxe_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr,
 
        if (qp->is_user) {
                /* Utilize process context to do protocol processing */
-               rxe_run_task(&qp->send_task);
+               rxe_sched_task(&qp->send_task);
        } else {
                err = rxe_post_send_kernel(qp, wr, bad_wr);
                if (err)