Commit f7482683 authored by Zhao Chen's avatar Zhao Chen Committed by David S. Miller

net-next/hinic: fix a problem in hinic_xmit_frame()

The calculation of "wqe_size" is not correct when the tx queue is busy in
hinic_xmit_frame().

When there are no free WQEs, the tx flow will unmap the skb buffer, then
ring the doobell for the pending packets. But the "wqe_size" which used
to calculate the doorbell address is not correct. The wqe size should be
cleared to 0, otherwise, it will cause a doorbell error.

This patch fixes the problem.
Reported-by: default avatarZhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: default avatarZhao Chen <zhaochen6@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4905bd9a
...@@ -229,6 +229,7 @@ netdev_tx_t hinic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -229,6 +229,7 @@ netdev_tx_t hinic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
txq->txq_stats.tx_busy++; txq->txq_stats.tx_busy++;
u64_stats_update_end(&txq->txq_stats.syncp); u64_stats_update_end(&txq->txq_stats.syncp);
err = NETDEV_TX_BUSY; err = NETDEV_TX_BUSY;
wqe_size = 0;
goto flush_skbs; goto flush_skbs;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment