Skip to content

Commit d35162f

Browse files
zonquedavem330
authored andcommitted
net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc()
Commit fae5082 ("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: Daniel Mack <zonque@gmail.com> Cc: Mugunthan V N <mugunthanvnm@ti.com> Reported-by: Sven Neumann <s.neumann@raumfeld.com> Reported-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com> Tested-by: Mugunthan V N <mugunthanvnm@ti.com> Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Tested-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c80a851 commit d35162f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/ti/cpsw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb,
905905
/* If there is no more tx desc left free then we need to
906906
* tell the kernel to stop sending us tx frames.
907907
*/
908-
if (unlikely(cpdma_check_free_tx_desc(priv->txch)))
908+
if (unlikely(!cpdma_check_free_tx_desc(priv->txch)))
909909
netif_stop_queue(ndev);
910910

911911
return NETDEV_TX_OK;

0 commit comments

Comments
 (0)