]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix a bug about hns3_clean_tx_ring
authorLipeng <lipeng321@huawei.com>
Mon, 23 Oct 2017 11:51:07 +0000 (19:51 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Oct 2017 00:16:42 +0000 (01:16 +0100)
commit2c56d35fb71d24b2da9db75f7291130929a09546
tree6e51b577618ddc2b30c6c94f8692ad244daff9eb
parent122fdc13f06a6cbe843a097398cd68677cf1978a
net: hns3: fix a bug about hns3_clean_tx_ring

The return value of hns3_clean_tx_ring means tx ring clean result.
Return true means clean complete and there is no more pakcet need
clean. Retrun false means there is packets need clean and napi need
poll again. The last return of hns3_clean_tx_ring is
"return !!budget" as budget will decrease when clean a buffer.

If there is no valid BD in TX ring, return 0 for hns3_clean_tx_ring
will cause napi poll again and never complete the napi poll. This
patch fixes the bug.

Fixes: 327a841 (net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC)
Signed-off-by: Lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.h