linux/drivers/net
David Gibson 5826cade43 [PATCH] ibmveth: Fix index increment calculation
On Thu, Oct 12, 2006 at 06:22:14PM +1000, David Gibson wrote:
> Your recent ibmveth commit, 751ae21c6c
> ("fix int rollover panic"), causes a rapid oops on my test machine
> (POWER5 LPAR).
>
> I've bisected it down to that commit, but am still investigating the
> cause of the crash itself.

Found the problem, I believe: an object lesson in the need for great
caution using ++.

[...]
@@ -213,6 +213,7 @@ static void ibmveth_replenish_buffer_poo
 		}

 		free_index = pool->consumer_index++ % pool->size;
+		pool->consumer_index = free_index;
 		index = pool->free_map[free_index];

 		ibmveth_assert(index != IBM_VETH_INVALID_MAP);

Since the ++ is used as post-increment, the increment is not included
in free_index, and so the added line effectively reverts the
increment.  The produced_index side has an analagous bug.

The following change corrects this:

The recent commit 751ae21c6c introduced
a bug in the producer/consumer index calculation in the ibmveth driver
- incautious use of the post-increment ++ operator resulted in an
increment being immediately reverted.  This patch corrects the logic.

Without this patch, the driver oopses almost immediately after
activation on at least some machines.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-10-21 14:34:21 -04:00
..
appletalk
arcnet
arm
bonding
chelsio
cris
e1000 [PATCH] e1000: Reset all functions after a PCI error 2006-10-21 14:08:24 -04:00
ehea [PATCH] ehea: fix port state notification, default queue sizes 2006-10-11 03:58:26 -04:00
fec_8xx
fs_enet
hamradio
ibm_emac
irda
ixgb
ixp2000
myri10ge
pcmcia
phy
sk98lin
skfp
tokenring
tulip [PATCH] Fix section mismatch in de2104x.c 2006-10-11 04:07:45 -04:00
wan [PATCH] WAN/pc300: handle, propagate minor errors 2006-10-21 14:08:24 -04:00
wireless [PATCH] zd1211rw: fix build-break caused by association race fix 2006-10-17 13:47:40 -04:00
3c59x.c
3c501.c
3c501.h
3c503.c
3c503.h
3c505.c
3c505.h
3c507.c
3c509.c
3c515.c
3c523.c
3c523.h
3c527.c
3c527.h
7990.c
7990.h
8139cp.c
8139too.c
8390.c
8390.h
82596.c
a2065.c
a2065.h
ac3200.c
acenic_firmware.h
acenic.c
acenic.h
amd8111e.c
amd8111e.h
apne.c
ariadne.c
ariadne.h
at1700.c
atari_bionet.c
atari_pamsnet.c
atarilance.c
atp.c
atp.h
au1000_eth.c
au1000_eth.h
b44.c
b44.h
bmac.c
bmac.h
bnx2_fw.h
bnx2.c
bnx2.h
bsd_comp.c
cassini.c
cassini.h
cs89x0.c
cs89x0.h
de600.c
de600.h
de620.c
de620.h
declance.c
defxx.c
defxx.h
depca.c
depca.h
dgrs_asstruct.h
dgrs_bcomm.h
dgrs_es4h.h
dgrs_ether.h
dgrs_firmware.c
dgrs_i82596.h
dgrs_plx9060.h
dgrs.c
dgrs.h
dl2k.c
dl2k.h
dm9000.c
dm9000.h
dummy.c
e100.c [PATCH] e100: fix reboot -f with netconsole enabled 2006-10-20 10:26:35 -07:00
e2100.c
eepro100.c
eepro.c
eexpress.c
eexpress.h
epic100.c
eql.c
es3210.c
eth16i.c [PATCH] Use linux/io.h instead of asm/io.h 2006-10-11 11:14:23 -07:00
ewrk3.c
ewrk3.h
fealnx.c
fec.c
fec.h
forcedeth.c
gianfar_ethtool.c
gianfar_mii.c
gianfar_mii.h
gianfar_sysfs.c
gianfar.c
gianfar.h
hamachi.c
hp100.c
hp100.h
hp-plus.c
hp.c
hplance.c
hplance.h
hydra.c
ibmlana.c
ibmlana.h
ibmveth.c [PATCH] ibmveth: Fix index increment calculation 2006-10-21 14:34:21 -04:00
ibmveth.h
ifb.c
ioc3-eth.c [PATCH] Fix timer race 2006-10-21 14:20:02 -04:00
isa-skeleton.c
iseries_veth.c
jazzsonic.c
Kconfig [PATCH] ucc_geth: changes to ucc_geth driver as a result of qe_lib changes and bugfixes 2006-10-21 14:09:51 -04:00
lance.c
lasi_82596.c
LICENSE.SRC
lne390.c
loopback.c [NET]: Can use __get_cpu_var() instead of per_cpu() in loopback driver. 2006-10-20 00:32:41 -07:00
lp486e.c
mac89x0.c
mac8390.c
mace.c
mace.h
macmace.c
macsonic.c
Makefile
meth.c
meth.h
mii.c
mipsnet.c
mipsnet.h
mv643xx_eth.c Revert "[mv643xx] Add pci device table for auto module loading." 2006-10-20 10:40:48 -07:00
mv643xx_eth.h
mvme147.c
myri_code.h [SPARC]: Fix some section mismatch warnings in sparc drivers. 2006-10-17 19:28:51 -07:00
myri_sbus.c [SPARC]: Fix some section mismatch warnings in sparc drivers. 2006-10-17 19:28:51 -07:00
myri_sbus.h
natsemi.c
ne2.c
ne2k-pci.c
ne3210.c
ne-h8300.c
ne.c
netconsole.c
netx-eth.c
ni52.c
ni52.h
ni65.c
ni65.h
ni5010.c
ni5010.h
ns83820.c
oaknet.c
pci-skeleton.c
pcnet32.c
plip.c
ppp_async.c
ppp_deflate.c
ppp_generic.c
ppp_mppe.c
ppp_mppe.h
ppp_synctty.c
pppoe.c
pppox.c
qla3xxx.c
qla3xxx.h
r8169.c Merge tag 'jg-20061012-00' of git://electric-eye.fr.zoreil.com/home/romieu/linux-2.6 into tmp 2006-10-21 14:16:11 -04:00
rionet.c
rrunner.c
rrunner.h
s2io-regs.h
s2io.c
s2io.h
saa9730.c
saa9730.h
sb1000.c
sb1250-mac.c [PATCH] Remove useless comment from sb1250 2006-10-21 14:20:01 -04:00
seeq8005.c
seeq8005.h
sgiseeq.c
sgiseeq.h
shaper.c
sis190.c
sis900.c
sis900.h
sk_mca.c
sk_mca.h
skge.c [PATCH] skge: version 1.9 2006-10-11 04:06:09 -04:00
skge.h [PATCH] skge: better flow control negotiation 2006-10-11 04:06:09 -04:00
sky2.c [PATCH] sky2: 88E803X transmit lockup 2006-10-21 14:08:24 -04:00
sky2.h sky2: GMAC pause frame 2006-10-17 10:24:25 -07:00
slhc.c
slip.c
slip.h
smc91x.c
smc91x.h [PATCH] Update smc91x driver with ARM Versatile board info 2006-10-21 14:08:24 -04:00
smc911x.c
smc911x.h
smc9194.c
smc9194.h
smc-mca.c
smc-ultra32.c
smc-ultra.c
sonic.c
sonic.h
Space.c
spider_net_ethtool.c [PATCH] powerpc/cell spidernet variable name change 2006-10-11 04:04:27 -04:00
spider_net.c [PATCH] powerpc/cell spidernet release all descrs 2006-10-11 04:04:27 -04:00
spider_net.h [PATCH] powerpc/cell spidernet variable name change 2006-10-11 04:04:27 -04:00
starfire_firmware.h
starfire_firmware.pl
starfire.c
stnic.c
sun3_82586.c [PATCH] sun3 __iomem annotations 2006-10-11 11:17:06 -07:00
sun3_82586.h
sun3lance.c [PATCH] sun3 __iomem annotations 2006-10-11 11:17:06 -07:00
sunbmac.c [SPARC]: Fix some section mismatch warnings in sparc drivers. 2006-10-17 19:28:51 -07:00
sunbmac.h
sundance.c
sungem_phy.c
sungem_phy.h
sungem.c
sungem.h
sunhme.c
sunhme.h
sunlance.c
sunqe.c
sunqe.h
tc35815.c
tg3.c [TG3]: Bump driver version and release date. 2006-10-18 20:56:06 -07:00
tg3.h
tlan.c
tlan.h
tun.c
typhoon-firmware.h
typhoon.c
typhoon.h
ucc_geth_phy.c [PATCH] ucc_geth: changes to ucc_geth driver as a result of qe_lib changes and bugfixes 2006-10-21 14:09:51 -04:00
ucc_geth_phy.h [PATCH] ucc_geth: changes to ucc_geth driver as a result of qe_lib changes and bugfixes 2006-10-21 14:09:51 -04:00
ucc_geth.c [PATCH] ucc_geth: changes to ucc_geth driver as a result of qe_lib changes and bugfixes 2006-10-21 14:09:51 -04:00
ucc_geth.h [PATCH] ucc_geth: changes to ucc_geth driver as a result of qe_lib changes and bugfixes 2006-10-21 14:09:51 -04:00
via-rhine.c
via-velocity.c
via-velocity.h
wd.c
yellowfin.c
znet.c
zorro8390.c