netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Prashant Sreedharan <prashant@broadcom.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, dborkman@redhat.com,
	mchan@broadcom.com
Subject: Re: [PATCH net-next] tg3: Add skb->xmit_more support
Date: Mon, 13 Oct 2014 19:38:06 +0200	[thread overview]
Message-ID: <20141013173806.GB26105@breakpoint.cc> (raw)
In-Reply-To: <1413217302-15396-1-git-send-email-prashant@broadcom.com>

Prashant Sreedharan <prashant@broadcom.com> wrote:
> Ring TX doorbell only if xmit_more is not set or the queue is stopped.
> 
> Suggested-by: Daniel Borkmann <dborkman@redhat.com>
> Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> ---
>  drivers/net/ethernet/broadcom/tg3.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index ba49948..dbb41c1 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -8099,9 +8099,6 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  	/* Sync BD data before updating mailbox */
>  	wmb();
>  
> -	/* Packets are ready, update Tx producer idx local and on card. */
> -	tw32_tx_mbox(tnapi->prodmbox, entry);
> -
>  	tnapi->tx_prod = entry;
>  	if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) {
>  		netif_tx_stop_queue(txq);
> @@ -8116,7 +8113,12 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  			netif_tx_wake_queue(txq);
>  	}
>  
> -	mmiowb();
> +	if (!skb->xmit_more || netif_xmit_stopped(txq)) {
> +		/* Packets are ready, update Tx producer idx on card. */
> +		tw32_tx_mbox(tnapi->prodmbox, entry);

I think you need to swap the test, i.e.

netif_xmit_stopped() || xmit_more

Otherwise, hw may not be aware of further packets wainting
and queue might not be restarted?

  parent reply	other threads:[~2014-10-13 17:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-13 16:21 [PATCH net-next] tg3: Add skb->xmit_more support Prashant Sreedharan
2014-10-13 16:48 ` Eric Dumazet
2014-10-13 17:14   ` Rick Jones
2014-10-13 17:38 ` Florian Westphal [this message]
2014-10-13 18:01   ` Florian Westphal
2014-10-14 19:34 ` 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=20141013173806.GB26105@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=prashant@broadcom.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 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).