diff options
author | lipeng <lipeng321@huawei.com> | 2017-04-01 14:03:47 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-04 00:48:43 +0300 |
commit | 820c90cb3e2e452c80824391953cab9d5b5af154 (patch) | |
tree | 084e557cd36de868cc7094d3899a57170b9de5d7 /drivers/net/ethernet/hisilicon/hns/hnae.c | |
parent | 76b588bc523bee796834ebd319f6a71ad3eddbae (diff) | |
download | linux-820c90cb3e2e452c80824391953cab9d5b5af154.tar.xz |
net: hns: Avoid Hip06 chip TX packet line bug
There is a bug on Hip06 that tx ring interrupts packets count will be
clear when drivers send data to tx ring, so that the tx packets count
will never upgrade to packets line, and cause the interrupts engendered
was delayed.
Sometimes, it will cause sending performance lower than expected.
To fix this bug, we set tx ring interrupts packets line to 1 forever,
to avoid count clear. And set the gap time to 20us, to solve the problem
that too many interrupts engendered when packets line is 1.
This patch could advance the send performance on ARM from 6.6G to 9.37G
when an iperf send thread on ARM and an iperf send thread on X86 for XGE.
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hnae.c')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hnae.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.c b/drivers/net/ethernet/hisilicon/hns/hnae.c index ef818b7d5021..9d9b6e6dd988 100644 --- a/drivers/net/ethernet/hisilicon/hns/hnae.c +++ b/drivers/net/ethernet/hisilicon/hns/hnae.c @@ -57,10 +57,15 @@ static int hnae_alloc_buffer(struct hnae_ring *ring, struct hnae_desc_cb *cb) static void hnae_free_buffer(struct hnae_ring *ring, struct hnae_desc_cb *cb) { + if (unlikely(!cb->priv)) + return; + if (cb->type == DESC_TYPE_SKB) dev_kfree_skb_any((struct sk_buff *)cb->priv); else if (unlikely(is_rx_ring(ring))) put_page((struct page *)cb->priv); + + cb->priv = NULL; } static int hnae_map_buffer(struct hnae_ring *ring, struct hnae_desc_cb *cb) |