netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Beniamino Galvani <b.galvani@gmail.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: "Romain Perier" <romain.perier@gmail.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Tobias Klauser" <tklauser@distanz.ch>,
	"Jingoo Han" <jg1.han@samsung.com>,
	"Max Schwarz" <max.schwarz@online.de>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] net: arc_emac: enable tx interrupts
Date: Thu, 11 Sep 2014 10:24:33 -0700	[thread overview]
Message-ID: <5411DAD1.7060507@gmail.com> (raw)
In-Reply-To: <1410382203-10395-2-git-send-email-b.galvani@gmail.com>

On 09/10/2014 01:50 PM, Beniamino Galvani wrote:
> In the current implementation the cleaning of tx ring is done by the
> NAPI poll handler, which is scheduled after rx interrupts. Thus, in
> absence of received packets the reclaim of used tx buffers is never
> executed, blocking further transmission.
> 
> This can be easily reproduced starting the transmission of a UDP flow
> with iperf, which blocks almost immediately because skbs are not
> returned to the stack and the socket send buffer becomes full.
> 
> The patch enables tx interrupts so that the tx reclaim is scheduled
> after completed transmissions.

Based on what the driver does and how TX reclaim is performed, your fix
makes complete sense to me.

> 
> Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>

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

> ---
>  drivers/net/ethernet/arc/emac_main.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
> index dbea847..1d08f63 100644
> --- a/drivers/net/ethernet/arc/emac_main.c
> +++ b/drivers/net/ethernet/arc/emac_main.c
> @@ -300,7 +300,7 @@ static int arc_emac_poll(struct napi_struct *napi, int budget)
>  	work_done = arc_emac_rx(ndev, budget);
>  	if (work_done < budget) {
>  		napi_complete(napi);
> -		arc_reg_or(priv, R_ENABLE, RXINT_MASK);
> +		arc_reg_or(priv, R_ENABLE, RXINT_MASK | TXINT_MASK);
>  	}
>  
>  	return work_done;
> @@ -329,9 +329,9 @@ static irqreturn_t arc_emac_intr(int irq, void *dev_instance)
>  	/* Reset all flags except "MDIO complete" */
>  	arc_reg_set(priv, R_STATUS, status);
>  
> -	if (status & RXINT_MASK) {
> +	if (status & (RXINT_MASK | TXINT_MASK)) {
>  		if (likely(napi_schedule_prep(&priv->napi))) {
> -			arc_reg_clr(priv, R_ENABLE, RXINT_MASK);
> +			arc_reg_clr(priv, R_ENABLE, RXINT_MASK | TXINT_MASK);
>  			__napi_schedule(&priv->napi);
>  		}
>  	}
> @@ -442,7 +442,7 @@ static int arc_emac_open(struct net_device *ndev)
>  	arc_reg_set(priv, R_TX_RING, (unsigned int)priv->txbd_dma);
>  
>  	/* Enable interrupts */
> -	arc_reg_set(priv, R_ENABLE, RXINT_MASK | ERR_MASK);
> +	arc_reg_set(priv, R_ENABLE, RXINT_MASK | TXINT_MASK | ERR_MASK);
>  
>  	/* Set CONTROL */
>  	arc_reg_set(priv, R_CTRL,
> @@ -513,7 +513,7 @@ static int arc_emac_stop(struct net_device *ndev)
>  	netif_stop_queue(ndev);
>  
>  	/* Disable interrupts */
> -	arc_reg_clr(priv, R_ENABLE, RXINT_MASK | ERR_MASK);
> +	arc_reg_clr(priv, R_ENABLE, RXINT_MASK | TXINT_MASK | ERR_MASK);
>  
>  	/* Disable EMAC */
>  	arc_reg_clr(priv, R_CTRL, EN_MASK);
> 

  reply	other threads:[~2014-09-11 17:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 20:50 [PATCH v2 0/2] net: arc_emac: fix tx issues Beniamino Galvani
2014-09-10 20:50 ` [PATCH v2 1/2] net: arc_emac: enable tx interrupts Beniamino Galvani
2014-09-11 17:24   ` Florian Fainelli [this message]
2014-09-10 20:50 ` [PATCH v2 2/2] net: arc_emac: prevent reuse of unreclaimed tx descriptors Beniamino Galvani
2014-09-12 21:19 ` [PATCH v2 0/2] net: arc_emac: fix tx issues David Miller

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=5411DAD1.7060507@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=arnd@arndb.de \
    --cc=b.galvani@gmail.com \
    --cc=davem@davemloft.net \
    --cc=heiko@sntech.de \
    --cc=jg1.han@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max.schwarz@online.de \
    --cc=netdev@vger.kernel.org \
    --cc=romain.perier@gmail.com \
    --cc=tklauser@distanz.ch \
    /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).