提交 f2243b82 编写于 作者: J Jiangfeng Xiao 提交者: David S. Miller

net: hisilicon: fix hip04-xmit never return TX_BUSY

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: NJiangfeng Xiao <xiaojiangfeng@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1a2c070a
...@@ -248,7 +248,7 @@ struct hip04_priv { ...@@ -248,7 +248,7 @@ struct hip04_priv {
static inline unsigned int tx_count(unsigned int head, unsigned int tail) static inline unsigned int tx_count(unsigned int head, unsigned int tail)
{ {
return (head - tail) % (TX_DESC_NUM - 1); return (head - tail) % TX_DESC_NUM;
} }
static void hip04_config_port(struct net_device *ndev, u32 speed, u32 duplex) static void hip04_config_port(struct net_device *ndev, u32 speed, u32 duplex)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册