Commit 2e473507 authored by Zhu Yanjun's avatar Zhu Yanjun Committed by Doug Ledford

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 <srinivas.eeda@oracle.com>
CC: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
Reviewed-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 8f1a72c8
...@@ -1124,24 +1124,13 @@ static enum resp_states duplicate_request(struct rxe_qp *qp, ...@@ -1124,24 +1124,13 @@ static enum resp_states duplicate_request(struct rxe_qp *qp,
/* Find the operation in our list of responder resources. */ /* Find the operation in our list of responder resources. */
res = find_resource(qp, pkt->psn); res = find_resource(qp, pkt->psn);
if (res) { if (res) {
struct sk_buff *skb_copy; skb_get(res->atomic.skb);
skb_copy = skb_clone(res->atomic.skb, GFP_ATOMIC);
if (skb_copy) {
rxe_add_ref(qp); /* for the new SKB */
} else {
pr_warn("Couldn't clone atomic resp\n");
rc = RESPST_CLEANUP;
goto out;
}
/* Resend the result. */ /* Resend the result. */
rc = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, rc = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp,
pkt, skb_copy); pkt, res->atomic.skb);
if (rc) { if (rc) {
pr_err("Failed resending result. This flow is not handled - skb ignored\n"); pr_err("Failed resending result. This flow is not handled - skb ignored\n");
rxe_drop_ref(qp); kfree_skb(res->atomic.skb);
kfree_skb(skb_copy);
rc = RESPST_CLEANUP; rc = RESPST_CLEANUP;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment