lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46336631.9070501@pobox.com>
Date:	Sat, 28 Apr 2007 11:20:17 -0400
From:	Jeff Garzik <jgarzik@...ox.com>
To:	Olof Johansson <olof@...om.net>
CC:	netdev@...r.kernel.org
Subject: Re: [RESEND] [PATCH v2] [1/5] pasemi_mac: minor bugfixes

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@...om.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



-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ