* [PATCH] net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc()
@ 2013-03-12 16:31 Daniel Mack
2013-03-12 19:47 ` Mugunthan V N
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Mack @ 2013-03-12 16:31 UTC (permalink / raw)
To: netdev; +Cc: andreas.fenkart, davem, s.neumann, koen, Daniel Mack,
Mugunthan V N
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 <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>
---
drivers/net/ethernet/ti/cpsw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 01ffbc4..75c4855 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -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;
--
1.8.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc()
2013-03-12 16:31 [PATCH] net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc() Daniel Mack
@ 2013-03-12 19:47 ` Mugunthan V N
2013-03-12 20:20 ` Andreas Fenkart
0 siblings, 1 reply; 4+ messages in thread
From: Mugunthan V N @ 2013-03-12 19:47 UTC (permalink / raw)
To: Daniel Mack; +Cc: netdev, andreas.fenkart, davem, s.neumann, koen
On 3/12/2013 10:01 PM, Daniel Mack wrote:
> 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 <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>
> ---
> drivers/net/ethernet/ti/cpsw.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 01ffbc4..75c4855 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -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 <mugunthanvnm@ti.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Regards
Mugunthan V N
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc()
2013-03-12 19:47 ` Mugunthan V N
@ 2013-03-12 20:20 ` Andreas Fenkart
2013-03-13 8:51 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Fenkart @ 2013-03-12 20:20 UTC (permalink / raw)
To: Mugunthan V N
Cc: Daniel Mack, netdev, andreas.fenkart, davem, s.neumann, koen
On Wed, Mar 13, 2013 at 01:17:44AM +0530, Mugunthan V N wrote:
> On 3/12/2013 10:01 PM, Daniel Mack wrote:
> >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 <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>
> >---
> > drivers/net/ethernet/ti/cpsw.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> >index 01ffbc4..75c4855 100644
> >--- a/drivers/net/ethernet/ti/cpsw.c
> >+++ b/drivers/net/ethernet/ti/cpsw.c
> >@@ -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 <mugunthanvnm@ti.com>
> Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
>
> Regards
> Mugunthan V N
This restores throughput to the level of 3.7.0
Tested-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc()
2013-03-12 20:20 ` Andreas Fenkart
@ 2013-03-13 8:51 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-03-13 8:51 UTC (permalink / raw)
To: andreas.fenkart; +Cc: mugunthanvnm, zonque, netdev, s.neumann, koen
From: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Date: Tue, 12 Mar 2013 21:20:27 +0100
> On Wed, Mar 13, 2013 at 01:17:44AM +0530, Mugunthan V N wrote:
>> On 3/12/2013 10:01 PM, Daniel Mack wrote:
>> >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 <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>
...
> This restores throughput to the level of 3.7.0
>
> Tested-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-13 8:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-12 16:31 [PATCH] net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc() Daniel Mack
2013-03-12 19:47 ` Mugunthan V N
2013-03-12 20:20 ` Andreas Fenkart
2013-03-13 8:51 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).