netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Olof Johansson <olof@lixom.net>
Cc: netdev@vger.kernel.org
Subject: Re: [RESEND] [PATCH v2] [1/5] pasemi_mac: minor bugfixes
Date: Sat, 28 Apr 2007 11:20:17 -0400	[thread overview]
Message-ID: <46336631.9070501@pobox.com> (raw)
In-Reply-To: <20070428055023.GB22074@lixom.net>

Olof Johansson wrote:
> Ethernet bugfixes:
> 
> * Move the was_full/wake_queue logic from tx_intr to clean_tx
> * Fix polarity in checks in pasemi_mac_close
> 
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>
> 
> 
> Index: linux-2.6/drivers/net/pasemi_mac.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/pasemi_mac.c
> +++ linux-2.6/drivers/net/pasemi_mac.c
> @@ -451,9 +451,12 @@ static int pasemi_mac_clean_tx(struct pa
>  	struct pas_dma_xct_descr *dp;
>  	int start, count;
>  	int flags;
> +	int was_full;
>  
>  	spin_lock_irqsave(&mac->tx->lock, flags);
>  
> +	was_full = mac->tx->next_to_clean - mac->tx->next_to_use == TX_RING_SIZE;
> +
>  	start = mac->tx->next_to_clean;
>  	count = 0;
>  
> @@ -478,6 +481,9 @@ static int pasemi_mac_clean_tx(struct pa
>  	mac->tx->next_to_clean += count;
>  	spin_unlock_irqrestore(&mac->tx->lock, flags);
>  
> +	if (was_full)
> +		netif_wake_queue(mac->netdev);
> +

Isn't this was_full check redundant?  Using standard test-and-clear 
atomic logic, netif_wake_queue() will not issue spurious wakeups.  Take 
a look at its implementation in include/linux/netdevice.h.

	Jeff




  reply	other threads:[~2007-04-28 15:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-28  5:49 [RESEND] [PATCH v2] [0/5] pasemi_mac: fixes and enhancements Olof Johansson
2007-04-28  5:50 ` [RESEND] [PATCH v2] [1/5] pasemi_mac: minor bugfixes Olof Johansson
2007-04-28 15:20   ` Jeff Garzik [this message]
2007-04-28 16:17     ` Olof Johansson
2007-04-28  5:50 ` [RESEND] [PATCH v2] [2/5] pasemi_mac: irq mapping changes Olof Johansson
2007-04-28  5:51 ` [RESEND] [PATCH v2] [3/5] pasemi_mac: cleanups and rx performance improvements Olof Johansson
2007-04-28 15:22   ` Jeff Garzik
2007-04-28 20:08     ` Olof Johansson
2007-04-28  5:51 ` [RESEND] [PATCH v2] [4/5] pasemi_mac: phy support Olof Johansson
2007-04-28 15:23   ` Jeff Garzik
2007-04-28 20:09     ` Olof Johansson
2007-04-28  5:52 ` [RESEND] [PATCH v2] [5/5] pasemi_mac: use local-mac-address Olof Johansson

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=46336631.9070501@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    --cc=olof@lixom.net \
    /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).