提交 d35162f8 编写于 作者: D Daniel Mack 提交者: David S. Miller

net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc()

Commit fae50823 ("net: ethernet: davinci_cpdma: Add boundary for rx
and tx descriptors") introduced a function to check the current
allocation state of tx packets. The return value is taken into account
to stop the netqork queue on the adapter in case there are no free
slots.

However, cpdma_check_free_tx_desc() returns 'true' if there is room in
the bitmap, not 'false', so the usage of the function is wrong.
Signed-off-by: NDaniel Mack <zonque@gmail.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Reported-by: NSven Neumann <s.neumann@raumfeld.com>
Reported-by: NAndreas Fenkart <andreas.fenkart@streamunlimited.com>
Tested-by: NMugunthan V N <mugunthanvnm@ti.com>
Acked-by: NMugunthan V N <mugunthanvnm@ti.com>
Tested-by: NAndreas Fenkart <andreas.fenkart@streamunlimited.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c80a8512
......@@ -905,7 +905,7 @@ static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb,
/* If there is no more tx desc left free then we need to
* tell the kernel to stop sending us tx frames.
*/
if (unlikely(cpdma_check_free_tx_desc(priv->txch)))
if (unlikely(!cpdma_check_free_tx_desc(priv->txch)))
netif_stop_queue(ndev);
return NETDEV_TX_OK;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册