summaryrefslogtreecommitdiff
path: root/drivers/infiniband/sw
diff options
context:
space:
mode:
authorZhu Yanjun <yanjun.zhu@oracle.com>2018-04-10 07:47:15 +0300
committerDoug Ledford <dledford@redhat.com>2018-04-19 20:58:16 +0300
commit2e47350789ebbc002b06d4549f60b5f9cba326ea (patch)
tree6e83bf6447e42eedf26a78ff10cb5d2ef05c6ee2 /drivers/infiniband/sw
parent8f1a72c815cf121f8a842c60c837f0d7605cdad4 (diff)
downloadlinux-2e47350789ebbc002b06d4549f60b5f9cba326ea.tar.xz
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: Zhu Yanjun <yanjun.zhu@oracle.com> Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_resp.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index a65c9969f7fc..c4172edf1f07 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -1124,24 +1124,13 @@ static enum resp_states duplicate_request(struct rxe_qp *qp,
/* Find the operation in our list of responder resources. */
res = find_resource(qp, pkt->psn);
if (res) {
- struct sk_buff *skb_copy;
-
- 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;
- }
-
+ skb_get(res->atomic.skb);
/* Resend the result. */
rc = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp,
- pkt, skb_copy);
+ pkt, res->atomic.skb);
if (rc) {
pr_err("Failed resending result. This flow is not handled - skb ignored\n");
- rxe_drop_ref(qp);
- kfree_skb(skb_copy);
+ kfree_skb(res->atomic.skb);
rc = RESPST_CLEANUP;
goto out;
}