netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Sieng Piaw Liew <liew.s.piaw@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Cc: bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] bcm63xx_enet: add BQL support
Date: Fri, 4 Dec 2020 10:27:50 -0800	[thread overview]
Message-ID: <a5ccedca-a2c9-b0df-394c-0cc460923a09@gmail.com> (raw)
In-Reply-To: <20201204054616.26876-2-liew.s.piaw@gmail.com>



On 12/3/2020 9:46 PM, Sieng Piaw Liew wrote:
> Add Byte Queue Limits support to reduce/remove bufferbloat in
> bcm63xx_enet.
> 
> Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
> ---
>  drivers/net/ethernet/broadcom/bcm63xx_enet.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> index b82b7805c36a..c1eba5fa3258 100644
> --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> @@ -417,9 +417,11 @@ static int bcm_enet_receive_queue(struct net_device *dev, int budget)
>  static int bcm_enet_tx_reclaim(struct net_device *dev, int force)
>  {
>  	struct bcm_enet_priv *priv;
> +	unsigned int bytes;
>  	int released;
>  
>  	priv = netdev_priv(dev);
> +	bytes = 0;
>  	released = 0;
>  
>  	while (priv->tx_desc_count < priv->tx_ring_size) {
> @@ -456,10 +458,13 @@ static int bcm_enet_tx_reclaim(struct net_device *dev, int force)
>  		if (desc->len_stat & DMADESC_UNDER_MASK)
>  			dev->stats.tx_errors++;
>  
> +		bytes += skb->len;
>  		dev_kfree_skb(skb);
>  		released++;
>  	}
>  
> +	netdev_completed_queue(dev, released, bytes);
> +
>  	if (netif_queue_stopped(dev) && released)
>  		netif_wake_queue(dev);
>  
> @@ -626,6 +631,8 @@ bcm_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  	desc->len_stat = len_stat;
>  	wmb();
>  
> +	netdev_sent_queue(dev, skb->len);
> +
>  	/* kick tx dma */
>  	enet_dmac_writel(priv, priv->dma_chan_en_mask,
>  				 ENETDMAC_CHANCFG, priv->tx_chan);
> @@ -1069,6 +1076,7 @@ static int bcm_enet_open(struct net_device *dev)
>  	else
>  		bcm_enet_adjust_link(dev);
>  
> +	netdev_reset_queue(dev);
>  	netif_start_queue(dev);
>  	return 0;
>  
> @@ -2246,6 +2254,7 @@ static int bcm_enetsw_open(struct net_device *dev)
>  			 ENETDMAC_IRMASK, priv->tx_chan);
>  
>  	netif_carrier_on(dev);
> +	netdev_reset_queue(dev);
>  	netif_start_queue(dev);

Doing netdev_reset_queue() in bcm_enetsw_stop() and bcm_enet_stop()
would feel more natural and be consistent with where the resources are
being shut down. With that fixed:

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

  reply	other threads:[~2020-12-04 18:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04  5:46 [PATCH net-next] bcm63xx_enet: batch process rx path Sieng Piaw Liew
2020-12-04  5:46 ` [PATCH net-next] bcm63xx_enet: add BQL support Sieng Piaw Liew
2020-12-04 18:27   ` Florian Fainelli [this message]
2020-12-04  5:46 ` [PATCH net-next] bcm63xx_enet: alloc rx skb with NET_IP_ALIGN Sieng Piaw Liew
2020-12-04 18:28   ` Florian Fainelli
2020-12-04  5:46 ` [PATCH net-next] bcm63xx_enet: convert to build_skb Sieng Piaw Liew
2020-12-04 10:14   ` Eric Dumazet
2020-12-04  9:50 ` [PATCH net-next] bcm63xx_enet: batch process rx path Eric Dumazet
2020-12-09  3:33   ` Sieng Piaw Liew
2020-12-04 18:24 ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5ccedca-a2c9-b0df-394c-0cc460923a09@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=liew.s.piaw@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).