OSDN Git Service

net: hisilicon: fix hip04-xmit never return TX_BUSY
authorJiangfeng Xiao <xiaojiangfeng@huawei.com>
Sat, 3 Aug 2019 12:31:40 +0000 (20:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:19:34 +0000 (10:19 +0200)
commit90a540d14bec0139c75e7eef9a660b2092fddee5
treee7d6b9eff91e15331fe3b8097e8bc88a71a17ed6
parent8695cfa1dd9c4959b56a53fcb1cae2451148d445
net: hisilicon: fix hip04-xmit never return TX_BUSY

[ Upstream commit f2243b82785942be519016067ee6c55a063bbfe2 ]

TX_DESC_NUM is 256, in tx_count, the maximum value of
mod(TX_DESC_NUM - 1) is 254, the variable "count" in
the hip04_mac_start_xmit function is never equal to
(TX_DESC_NUM - 1), so hip04_mac_start_xmit never
return NETDEV_TX_BUSY.

tx_count is modified to mod(TX_DESC_NUM) so that
the maximum value of tx_count can reach
(TX_DESC_NUM - 1), then hip04_mac_start_xmit can reurn
NETDEV_TX_BUSY.

Signed-off-by: Jiangfeng Xiao <xiaojiangfeng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hip04_eth.c