Skip to content

Commit 86af617

Browse files
Zhu Yanjunjgunthorpe
authored andcommitted
IB/rxe: remove unnecessary skb_clone
In send_atomic_ack function, it is not necessary to make a skb_clone. To gain better performance (high throughput and low latency), this skb_clone is removed. The following tests are made. server client --------- --------- |1.1.1.1|<----rxe-channel--->|1.1.1.2| --------- --------- On server: rping -s -a 1.1.1.1 -v -C 1000 -S 512 On client: rping -c -a 1.1.1.1 -v -C 1000 -S 512 The kernel config CONFIG_DEBUG_KMEMLEAK is enabled on both server and client. This test runs for several hours. There is no memory leak and the whole system can work well. Based on the above network, the following tests are made. Server: ibv_rc_pingpong -d rxe0 -g 1 Client: ibv_rc_pingpong -d rxe0 -g 1 1.1.1.1 The test results on Server(10 tests are made). Before: Throughput is 137.07 Mbit/sec Latency is 517.76 usec/iter After: Throughput is 148.85 Mbit/sec Latency is 476.64 usec/iter The throughput is enhanced and the latency is reduced. CC: Srinivas Eeda <[email protected]> CC: Junxiao Bi <[email protected]> Signed-off-by: Zhu Yanjun <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 63cf1a9 commit 86af617

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

drivers/infiniband/sw/rxe/rxe_resp.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,6 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
969969
int rc = 0;
970970
struct rxe_pkt_info ack_pkt;
971971
struct sk_buff *skb;
972-
struct sk_buff *skb_copy;
973972
struct rxe_dev *rxe = to_rdev(qp->ibqp.device);
974973
struct resp_res *res;
975974

@@ -981,14 +980,7 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
981980
goto out;
982981
}
983982

984-
skb_copy = skb_clone(skb, GFP_ATOMIC);
985-
if (skb_copy)
986-
rxe_add_ref(qp); /* for the new SKB */
987-
else {
988-
pr_warn("Could not clone atomic response\n");
989-
rc = -ENOMEM;
990-
goto out;
991-
}
983+
rxe_add_ref(qp);
992984

993985
res = &qp->resp.resources[qp->resp.res_head];
994986
free_rd_atomic_resource(qp, res);
@@ -998,19 +990,18 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
998990
memset((unsigned char *)SKB_TO_PKT(skb) + sizeof(ack_pkt), 0,
999991
sizeof(skb->cb) - sizeof(ack_pkt));
1000992

993+
refcount_inc(&skb->users);
1001994
res->type = RXE_ATOMIC_MASK;
1002995
res->atomic.skb = skb;
1003996
res->first_psn = ack_pkt.psn;
1004997
res->last_psn = ack_pkt.psn;
1005998
res->cur_psn = ack_pkt.psn;
1006999

1007-
rc = rxe_xmit_packet(rxe, qp, &ack_pkt, skb_copy);
1000+
rc = rxe_xmit_packet(rxe, qp, &ack_pkt, skb);
10081001
if (rc) {
10091002
pr_err_ratelimited("Failed sending ack\n");
10101003
rxe_drop_ref(qp);
1011-
kfree_skb(skb_copy);
10121004
}
1013-
10141005
out:
10151006
return rc;
10161007
}

0 commit comments

Comments
 (0)