Skip to content

Commit 2e47350

Browse files
Zhu Yanjundledford
authored andcommitted
IB/rxe: optimize the function duplicate_request
In the function duplicate_request, the reference of skb can be increased to replace the function skb_clone. This will make rxe performace better and save memory. CC: Srinivas Eeda <[email protected]> CC: Junxiao Bi <[email protected]> Signed-off-by: Zhu Yanjun <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 8f1a72c commit 2e47350

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

drivers/infiniband/sw/rxe/rxe_resp.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,24 +1124,13 @@ static enum resp_states duplicate_request(struct rxe_qp *qp,
11241124
/* Find the operation in our list of responder resources. */
11251125
res = find_resource(qp, pkt->psn);
11261126
if (res) {
1127-
struct sk_buff *skb_copy;
1128-
1129-
skb_copy = skb_clone(res->atomic.skb, GFP_ATOMIC);
1130-
if (skb_copy) {
1131-
rxe_add_ref(qp); /* for the new SKB */
1132-
} else {
1133-
pr_warn("Couldn't clone atomic resp\n");
1134-
rc = RESPST_CLEANUP;
1135-
goto out;
1136-
}
1137-
1127+
skb_get(res->atomic.skb);
11381128
/* Resend the result. */
11391129
rc = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp,
1140-
pkt, skb_copy);
1130+
pkt, res->atomic.skb);
11411131
if (rc) {
11421132
pr_err("Failed resending result. This flow is not handled - skb ignored\n");
1143-
rxe_drop_ref(qp);
1144-
kfree_skb(skb_copy);
1133+
kfree_skb(res->atomic.skb);
11451134
rc = RESPST_CLEANUP;
11461135
goto out;
11471136
}

0 commit comments

Comments
 (0)