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: <1170799541.3535.25.camel@rh4>
Date:	Tue, 06 Feb 2007 14:05:41 -0800
From:	"Michael Chan" <mchan@...adcom.com>
To:	"Eric Dumazet" <dada1@...mosbay.com>
cc:	"David Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] tg3 : avoid an expensive divide

On Tue, 2007-02-06 at 21:53 +0100, Eric Dumazet wrote:

> Signed-off-by: Eric Dumazet <dada1@...mosbay.com>
> plain text document attachment (tg3_avoid_divide.patch)
> --- linux-2.6.20/drivers/net/tg3.c.orig	2007-02-06 22:30:39.000000000 +0100
> +++ linux-2.6.20-ed/drivers/net/tg3.c	2007-02-06 22:32:42.000000000 +0100
> @@ -3384,7 +3384,7 @@
>  		}
>  next_pkt_nopost:
>  		sw_idx++;
> -		sw_idx %= TG3_RX_RCB_RING_SIZE(tp);
> +		sw_idx &= (TG3_RX_RCB_RING_SIZE(tp) - 1);
>  
>  		/* Refresh hw_idx to see if there is new work */
>  		if (sw_idx == hw_idx) {

There are other places doing similar divide (e.g. tg3_recycle_rx(),
tg3_alloc_rx_skb()).  I think we should change them all.

-
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