提交 86af6176 编写于 作者: Z Zhu Yanjun 提交者: Jason Gunthorpe

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 <srinivas.eeda@oracle.com>
CC: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: NZhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 63cf1a90
...@@ -969,7 +969,6 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt, ...@@ -969,7 +969,6 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
int rc = 0; int rc = 0;
struct rxe_pkt_info ack_pkt; struct rxe_pkt_info ack_pkt;
struct sk_buff *skb; struct sk_buff *skb;
struct sk_buff *skb_copy;
struct rxe_dev *rxe = to_rdev(qp->ibqp.device); struct rxe_dev *rxe = to_rdev(qp->ibqp.device);
struct resp_res *res; struct resp_res *res;
...@@ -981,14 +980,7 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt, ...@@ -981,14 +980,7 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
goto out; goto out;
} }
skb_copy = skb_clone(skb, GFP_ATOMIC); rxe_add_ref(qp);
if (skb_copy)
rxe_add_ref(qp); /* for the new SKB */
else {
pr_warn("Could not clone atomic response\n");
rc = -ENOMEM;
goto out;
}
res = &qp->resp.resources[qp->resp.res_head]; res = &qp->resp.resources[qp->resp.res_head];
free_rd_atomic_resource(qp, res); free_rd_atomic_resource(qp, res);
...@@ -998,19 +990,18 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt, ...@@ -998,19 +990,18 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
memset((unsigned char *)SKB_TO_PKT(skb) + sizeof(ack_pkt), 0, memset((unsigned char *)SKB_TO_PKT(skb) + sizeof(ack_pkt), 0,
sizeof(skb->cb) - sizeof(ack_pkt)); sizeof(skb->cb) - sizeof(ack_pkt));
refcount_inc(&skb->users);
res->type = RXE_ATOMIC_MASK; res->type = RXE_ATOMIC_MASK;
res->atomic.skb = skb; res->atomic.skb = skb;
res->first_psn = ack_pkt.psn; res->first_psn = ack_pkt.psn;
res->last_psn = ack_pkt.psn; res->last_psn = ack_pkt.psn;
res->cur_psn = ack_pkt.psn; res->cur_psn = ack_pkt.psn;
rc = rxe_xmit_packet(rxe, qp, &ack_pkt, skb_copy); rc = rxe_xmit_packet(rxe, qp, &ack_pkt, skb);
if (rc) { if (rc) {
pr_err_ratelimited("Failed sending ack\n"); pr_err_ratelimited("Failed sending ack\n");
rxe_drop_ref(qp); rxe_drop_ref(qp);
kfree_skb(skb_copy);
} }
out: out:
return rc; return rc;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册