net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc()
Subsystems (3)
PATCH 1/1 net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc()
Commit fae50823d0 ("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.
--- drivers/net/ethernet/ti/cpsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ti/cpsw.c +1 -1
@@ -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 ;
Signature · 1 line
1.8.1.4
Quoted 22 lines · Daniel Mack
Commit
fae50823d0("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 <[email protected]>Cc Mugunthan V N <[email protected]>Reported-by Sven Neumann <[email protected]>Reported-by Andreas Fenkart <[email protected]>--- drivers/net/ethernet/ti/cpsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/ti/cpsw.c +0
-0
drivers/net/ethernet/ti/cpsw.c static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb, · line 911
Quoted 8 lines
drivers/net/ethernet/ti/cpsw.c +1
-1@@ -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 ;
Regards
Mugunthan V N
Andreas Fenkart
Tested-byQuoted 33 lines · Mugunthan V N
Quoted 22 lines · Daniel Mack
Commit
fae50823d0("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 <[email protected]>Cc Mugunthan V N <[email protected]>Reported-by Sven Neumann <[email protected]>Reported-by Andreas Fenkart <[email protected]>--- drivers/net/ethernet/ti/cpsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/ti/cpsw.c +0
-0drivers/net/ethernet/ti/cpsw.c static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb, · line 910
Quoted 7 lines
drivers/net/ethernet/ti/cpsw.c +1
-1@@ -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 ;Tested-by Mugunthan V N <[email protected]>Acked-by Mugunthan V N <[email protected]>
Quoted 2 lines
Regards
Mugunthan V N
This restores throughput to the level of 3.7.0
From: Andreas Fenkart <[email protected]>
Date: Tue, 12 Mar 2013 21:20:27 +0100
Quoted 15 lines · Mugunthan V N
Quoted 14 lines · Daniel Mack
Quoted 13 lines
Commit
fae50823d0("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 <[email protected]>Cc Mugunthan V N <[email protected]>Reported-by Sven Neumann <[email protected]>Reported-by Andreas Fenkart <[email protected]>
...
Quoted 2 lines
Quoted 2 lines
Tested-by Mugunthan V N <[email protected]>Acked-by Mugunthan V N <[email protected]>
...
Quoted 3 lines
This restores throughput to the level of 3.7.0
Tested-by Andreas Fenkart <[email protected]>
Applied.