All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>
Subject: Re: [net-next.git 2/7] stmmac: manage tx clean out of rx_poll
Date: Wed, 5 Sep 2012 16:51:30 +0100	[thread overview]
Message-ID: <1346860290.5325.4.camel@bwh-desktop.uk.solarflarecom.com> (raw)
In-Reply-To: <1346857432-24657-3-git-send-email-peppe.cavallaro@st.com>

On Wed, 2012-09-05 at 17:03 +0200, Giuseppe CAVALLARO wrote:
> This patch is to invoke the stmmac_tx (tx handler)
> out of the NAPI poll method.
> This will make easier the next step to add the new
> mitigation schema.
> Also the patch enhances the ethtool to report some
> stats for normal TX and RX IRQs.
[...]
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -824,16 +824,27 @@ static void stmmac_tx_err(struct stmmac_priv *priv)
>  	netif_wake_queue(priv->dev);
>  }
>  
> +static inline void stmmac_rx_schedule(struct stmmac_priv *priv)
> +{
> +	if (likely(napi_schedule_prep(&priv->napi))) {
> +		stmmac_disable_irq(priv);
> +		__napi_schedule(&priv->napi);
> +	}
> +}
>  
>  static void stmmac_dma_interrupt(struct stmmac_priv *priv)
>  {
>  	int status;
>  
>  	status = priv->hw->dma->dma_interrupt(priv->ioaddr, &priv->xstats);
> -	if (likely(status == handle_tx_rx))
> -		_stmmac_schedule(priv);
> -
> -	else if (unlikely(status == tx_hard_error_bump_tc)) {
> +	if (likely(status == handle_rx)) {

Surely 'status & handle_rx'?

> +		priv->xstats.rx_normal_irq_n++;
> +		stmmac_rx_schedule(priv);
> +	}
> +	if (likely(status == handle_tx)) {

'status & handle_tx'?

> +		priv->xstats.tx_normal_irq_n++;
> +		stmmac_tx(priv);
> +	} else if (unlikely(status == tx_hard_error_bump_tc)) {
>  		/* Try to bump up the dma threshold on this failure */
>  		if (unlikely(tc != SF_DMA_MODE) && (tc <= 256)) {
>  			tc += 64;
> @@ -1443,8 +1454,7 @@ static int stmmac_poll(struct napi_struct *napi, int budget)
>  	struct stmmac_priv *priv = container_of(napi, struct stmmac_priv, napi);
>  	int work_done = 0;
>  
> -	priv->xstats.poll_n++;
> -	stmmac_tx(priv);
> +	priv->xstats.rx_napi_poll++;
>  	work_done = stmmac_rx(priv, budget);
>  
>  	if (work_done < budget) {

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

  reply	other threads:[~2012-09-05 15:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 15:03 [net-next.git 0/7 (V2)] stmmac: remove dead code for STMMAC_TIMER and add new mitigation schema Giuseppe CAVALLARO
2012-09-05 15:03 ` [net-next.git 1/7] stmmac: remove dead code for TIMER Giuseppe CAVALLARO
2012-09-05 15:03 ` [net-next.git 2/7] stmmac: manage tx clean out of rx_poll Giuseppe CAVALLARO
2012-09-05 15:51   ` Ben Hutchings [this message]
2012-09-05 15:03 ` [net-next.git 3/7] stmmac: add the initial tx coalesce schema Giuseppe CAVALLARO
2012-09-05 16:11   ` Ben Hutchings
2012-09-05 15:03 ` [net-next.git 4/7] stmmac: add Rx watchdog optimization to mitigate the DMA irqs Giuseppe CAVALLARO
2012-09-05 16:14   ` Ben Hutchings
2012-09-05 17:16     ` David Miller
2012-09-06  6:06       ` Giuseppe CAVALLARO
2012-09-05 15:03 ` [net-next.git 5/7] stmmac: get/set coalesce parameters via ethtool Giuseppe CAVALLARO
2012-09-05 15:03 ` [net-next.git 6/7] stmmac: update the doc with new IRQ mitigation Giuseppe CAVALLARO
2012-09-05 15:03 ` [net-next.git 7/7] stmmac: update the driver version to Sept_2012 Giuseppe CAVALLARO
  -- strict thread matches above, loose matches on Subject: below --
2012-09-03  7:46 [net-next.git 0/7] stmmac: remove dead code for STMMAC_TIMER and add new mitigation schema Giuseppe CAVALLARO
2012-09-03  7:46 ` [net-next.git 2/7] stmmac: manage tx clean out of rx_poll Giuseppe CAVALLARO

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=1346860290.5325.4.camel@bwh-desktop.uk.solarflarecom.com \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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 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.