net-next/hinic: fix a problem in hinic_xmit_frame()
authorZhao Chen <zhaochen6@huawei.com>
Wed, 18 Jul 2018 04:33:18 +0000 (00:33 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Jul 2018 06:27:32 +0000 (23:27 -0700)
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: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Zhao Chen <zhaochen6@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/huawei/hinic/hinic_tx.c

index 9128858479c4a031baa4b6b93b47d7097f01a995..2353ec829c04407d88b365ba58e14ec960c4e978 100644 (file)
@@ -229,6 +229,7 @@ netdev_tx_t hinic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                txq->txq_stats.tx_busy++;
                u64_stats_update_end(&txq->txq_stats.syncp);
                err = NETDEV_TX_BUSY;
+               wqe_size = 0;
                goto flush_skbs;
        }