All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ucc_geth: Add BQL support
@ 2018-06-19 16:30 Joakim Tjernlund
  2018-06-19 18:24 ` Li Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Joakim Tjernlund @ 2018-06-19 16:30 UTC (permalink / raw)
  To: Li Yang, netdev; +Cc: Joakim Tjernlund

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
---
 drivers/net/ethernet/freescale/ucc_geth.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index f77ba9fa257b..6c99a9af6647 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -3096,6 +3096,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	ugeth_vdbg("%s: IN", __func__);
 
+	netdev_sent_queue(dev, skb->len);
 	spin_lock_irqsave(&ugeth->lock, flags);
 
 	dev->stats.tx_bytes += skb->len;
@@ -3242,6 +3243,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
 	struct ucc_geth_private *ugeth = netdev_priv(dev);
 	u8 __iomem *bd;		/* BD pointer */
 	u32 bd_status;
+	int howmany = 0;
+	unsigned int bytes_sent = 0;
 
 	bd = ugeth->confBd[txQ];
 	bd_status = in_be32((u32 __iomem *)bd);
@@ -3257,7 +3260,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
 		skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
 		if (!skb)
 			break;
-
+		howmany++;
+		bytes_sent += skb->len;
 		dev->stats.tx_packets++;
 
 		dev_consume_skb_any(skb);
@@ -3279,6 +3283,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
 		bd_status = in_be32((u32 __iomem *)bd);
 	}
 	ugeth->confBd[txQ] = bd;
+	netdev_completed_queue(dev, howmany, bytes_sent);
 	return 0;
 }
 
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ucc_geth: Add BQL support
  2018-06-19 16:30 [PATCH] ucc_geth: Add BQL support Joakim Tjernlund
@ 2018-06-19 18:24 ` Li Yang
  2018-06-19 18:37   ` Dave Taht
  2018-06-20  5:39 ` David Miller
  2018-06-20 16:29 ` [PATCH v2] " Joakim Tjernlund
  2 siblings, 1 reply; 7+ messages in thread
From: Li Yang @ 2018-06-19 18:24 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: Netdev

On Tue, Jun 19, 2018 at 11:30 AM, Joakim Tjernlund
<joakim.tjernlund@infinera.com> wrote:
> Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>

Acked-by: Li Yang <leoyang.li@nxp.com>

> ---
>  drivers/net/ethernet/freescale/ucc_geth.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
> index f77ba9fa257b..6c99a9af6647 100644
> --- a/drivers/net/ethernet/freescale/ucc_geth.c
> +++ b/drivers/net/ethernet/freescale/ucc_geth.c
> @@ -3096,6 +3096,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
>
>         ugeth_vdbg("%s: IN", __func__);
>
> +       netdev_sent_queue(dev, skb->len);
>         spin_lock_irqsave(&ugeth->lock, flags);
>
>         dev->stats.tx_bytes += skb->len;
> @@ -3242,6 +3243,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
>         struct ucc_geth_private *ugeth = netdev_priv(dev);
>         u8 __iomem *bd;         /* BD pointer */
>         u32 bd_status;
> +       int howmany = 0;
> +       unsigned int bytes_sent = 0;
>
>         bd = ugeth->confBd[txQ];
>         bd_status = in_be32((u32 __iomem *)bd);
> @@ -3257,7 +3260,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
>                 skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
>                 if (!skb)
>                         break;
> -
> +               howmany++;
> +               bytes_sent += skb->len;
>                 dev->stats.tx_packets++;
>
>                 dev_consume_skb_any(skb);
> @@ -3279,6 +3283,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
>                 bd_status = in_be32((u32 __iomem *)bd);
>         }
>         ugeth->confBd[txQ] = bd;
> +       netdev_completed_queue(dev, howmany, bytes_sent);
>         return 0;
>  }
>
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ucc_geth: Add BQL support
  2018-06-19 18:24 ` Li Yang
@ 2018-06-19 18:37   ` Dave Taht
  2018-06-19 19:06     ` Joakim Tjernlund
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Taht @ 2018-06-19 18:37 UTC (permalink / raw)
  To: Li Yang; +Cc: Joakim Tjernlund, Netdev

very happy to see this. is there a specific chip or devboard this runs on?

On Tue, Jun 19, 2018 at 11:24 AM, Li Yang <leoyang.li@nxp.com> wrote:
> On Tue, Jun 19, 2018 at 11:30 AM, Joakim Tjernlund
> <joakim.tjernlund@infinera.com> wrote:
>> Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
>
> Acked-by: Li Yang <leoyang.li@nxp.com>
>
>> ---
>>  drivers/net/ethernet/freescale/ucc_geth.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
>> index f77ba9fa257b..6c99a9af6647 100644
>> --- a/drivers/net/ethernet/freescale/ucc_geth.c
>> +++ b/drivers/net/ethernet/freescale/ucc_geth.c
>> @@ -3096,6 +3096,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
>>
>>         ugeth_vdbg("%s: IN", __func__);
>>
>> +       netdev_sent_queue(dev, skb->len);
>>         spin_lock_irqsave(&ugeth->lock, flags);
>>
>>         dev->stats.tx_bytes += skb->len;
>> @@ -3242,6 +3243,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
>>         struct ucc_geth_private *ugeth = netdev_priv(dev);
>>         u8 __iomem *bd;         /* BD pointer */
>>         u32 bd_status;
>> +       int howmany = 0;
>> +       unsigned int bytes_sent = 0;
>>
>>         bd = ugeth->confBd[txQ];
>>         bd_status = in_be32((u32 __iomem *)bd);
>> @@ -3257,7 +3260,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
>>                 skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
>>                 if (!skb)
>>                         break;
>> -
>> +               howmany++;
>> +               bytes_sent += skb->len;
>>                 dev->stats.tx_packets++;
>>
>>                 dev_consume_skb_any(skb);
>> @@ -3279,6 +3283,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
>>                 bd_status = in_be32((u32 __iomem *)bd);
>>         }
>>         ugeth->confBd[txQ] = bd;
>> +       netdev_completed_queue(dev, howmany, bytes_sent);
>>         return 0;
>>  }
>>
>> --
>> 2.13.6
>>



-- 

Dave Täht
CEO, TekLibre, LLC
http://www.teklibre.com
Tel: 1-669-226-2619

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ucc_geth: Add BQL support
  2018-06-19 18:37   ` Dave Taht
@ 2018-06-19 19:06     ` Joakim Tjernlund
  0 siblings, 0 replies; 7+ messages in thread
From: Joakim Tjernlund @ 2018-06-19 19:06 UTC (permalink / raw)
  To: leoyang.li, dave.taht; +Cc: netdev

On Tue, 2018-06-19 at 11:37 -0700, Dave Taht wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> very happy to see this. is there a specific chip or devboard this runs on?

This driver is for MPC83xx family SOCs(possibly others as well) on our custom boards, used in 
our telecom product.

You are actually the reason I impl. this :)

 Jocke

> 
> On Tue, Jun 19, 2018 at 11:24 AM, Li Yang <leoyang.li@nxp.com> wrote:
> > On Tue, Jun 19, 2018 at 11:30 AM, Joakim Tjernlund
> > <joakim.tjernlund@infinera.com> wrote:
> > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > 
> > Acked-by: Li Yang <leoyang.li@nxp.com>
> > 
> > > ---
> > >  drivers/net/ethernet/freescale/ucc_geth.c | 7 ++++++-
> > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
> > > index f77ba9fa257b..6c99a9af6647 100644
> > > --- a/drivers/net/ethernet/freescale/ucc_geth.c
> > > +++ b/drivers/net/ethernet/freescale/ucc_geth.c
> > > @@ -3096,6 +3096,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
> > > 
> > >         ugeth_vdbg("%s: IN", __func__);
> > > 
> > > +       netdev_sent_queue(dev, skb->len);
> > >         spin_lock_irqsave(&ugeth->lock, flags);
> > > 
> > >         dev->stats.tx_bytes += skb->len;
> > > @@ -3242,6 +3243,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
> > >         struct ucc_geth_private *ugeth = netdev_priv(dev);
> > >         u8 __iomem *bd;         /* BD pointer */
> > >         u32 bd_status;
> > > +       int howmany = 0;
> > > +       unsigned int bytes_sent = 0;
> > > 
> > >         bd = ugeth->confBd[txQ];
> > >         bd_status = in_be32((u32 __iomem *)bd);
> > > @@ -3257,7 +3260,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
> > >                 skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
> > >                 if (!skb)
> > >                         break;
> > > -
> > > +               howmany++;
> > > +               bytes_sent += skb->len;
> > >                 dev->stats.tx_packets++;
> > > 
> > >                 dev_consume_skb_any(skb);
> > > @@ -3279,6 +3283,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
> > >                 bd_status = in_be32((u32 __iomem *)bd);
> > >         }
> > >         ugeth->confBd[txQ] = bd;
> > > +       netdev_completed_queue(dev, howmany, bytes_sent);
> > >         return 0;
> > >  }
> > > 
> > > --
> > > 2.13.6
> > > 
> 
> 
> 
> --
> 
> Dave Täht
> CEO, TekLibre, LLC
> http://www.teklibre.com
> Tel: 1-669-226-2619

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ucc_geth: Add BQL support
  2018-06-19 16:30 [PATCH] ucc_geth: Add BQL support Joakim Tjernlund
  2018-06-19 18:24 ` Li Yang
@ 2018-06-20  5:39 ` David Miller
  2018-06-20 16:29 ` [PATCH v2] " Joakim Tjernlund
  2 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2018-06-20  5:39 UTC (permalink / raw)
  To: joakim.tjernlund; +Cc: leoyang.li, netdev

From: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Date: Tue, 19 Jun 2018 18:30:36 +0200

> @@ -3242,6 +3243,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
>  	struct ucc_geth_private *ugeth = netdev_priv(dev);
>  	u8 __iomem *bd;		/* BD pointer */
>  	u32 bd_status;
> +	int howmany = 0;
> +	unsigned int bytes_sent = 0;

Please keep the function local variable declarations ordered from
longest to shortest line.

Thank you.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] ucc_geth: Add BQL support
  2018-06-19 16:30 [PATCH] ucc_geth: Add BQL support Joakim Tjernlund
  2018-06-19 18:24 ` Li Yang
  2018-06-20  5:39 ` David Miller
@ 2018-06-20 16:29 ` Joakim Tjernlund
  2018-06-22  4:56   ` David Miller
  2 siblings, 1 reply; 7+ messages in thread
From: Joakim Tjernlund @ 2018-06-20 16:29 UTC (permalink / raw)
  To: David Miller, leoyang.li, netdev; +Cc: Joakim Tjernlund

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
---

 v2 - Reoder varibles according to Dave
      Add call to netdev_reset_queue(dev) open/close
 drivers/net/ethernet/freescale/ucc_geth.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index f77ba9fa257b..e8debbde0a34 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -3096,6 +3096,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	ugeth_vdbg("%s: IN", __func__);
 
+	netdev_sent_queue(dev, skb->len);
 	spin_lock_irqsave(&ugeth->lock, flags);
 
 	dev->stats.tx_bytes += skb->len;
@@ -3240,6 +3241,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
 {
 	/* Start from the next BD that should be filled */
 	struct ucc_geth_private *ugeth = netdev_priv(dev);
+	unsigned int bytes_sent = 0;
+	int howmany = 0;
 	u8 __iomem *bd;		/* BD pointer */
 	u32 bd_status;
 
@@ -3257,7 +3260,8 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
 		skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
 		if (!skb)
 			break;
-
+		howmany++;
+		bytes_sent += skb->len;
 		dev->stats.tx_packets++;
 
 		dev_consume_skb_any(skb);
@@ -3279,6 +3283,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
 		bd_status = in_be32((u32 __iomem *)bd);
 	}
 	ugeth->confBd[txQ] = bd;
+	netdev_completed_queue(dev, howmany, bytes_sent);
 	return 0;
 }
 
@@ -3479,6 +3484,7 @@ static int ucc_geth_open(struct net_device *dev)
 
 	phy_start(ugeth->phydev);
 	napi_enable(&ugeth->napi);
+	netdev_reset_queue(dev);
 	netif_start_queue(dev);
 
 	device_set_wakeup_capable(&dev->dev,
@@ -3509,6 +3515,7 @@ static int ucc_geth_close(struct net_device *dev)
 	free_irq(ugeth->ug_info->uf_info.irq, ugeth->ndev);
 
 	netif_stop_queue(dev);
+	netdev_reset_queue(dev);
 
 	return 0;
 }
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ucc_geth: Add BQL support
  2018-06-20 16:29 ` [PATCH v2] " Joakim Tjernlund
@ 2018-06-22  4:56   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2018-06-22  4:56 UTC (permalink / raw)
  To: joakim.tjernlund; +Cc: leoyang.li, netdev

From: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Date: Wed, 20 Jun 2018 18:29:18 +0200

> Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> ---
> 
>  v2 - Reoder varibles according to Dave
>       Add call to netdev_reset_queue(dev) open/close

Applied.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-22  4:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-19 16:30 [PATCH] ucc_geth: Add BQL support Joakim Tjernlund
2018-06-19 18:24 ` Li Yang
2018-06-19 18:37   ` Dave Taht
2018-06-19 19:06     ` Joakim Tjernlund
2018-06-20  5:39 ` David Miller
2018-06-20 16:29 ` [PATCH v2] " Joakim Tjernlund
2018-06-22  4:56   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.