linux/drivers/net/ethernet
Stefan Assmann 781798a11e igb: fix driver reload with VF assigned to guest
commit fa44f2f185 broke reloading of igb, when
VFs are assigned to a guest, in several ways.
1. on module load adapter->vf_data does not get properly allocated,
resulting in a null pointer exception when accessing adapter->vf_data in
igb_reset() on module reload.
 modprobe -r igb ; modprobe igb max_vfs=7
[  215.215837] igb 0000:01:00.1: removed PHC on eth1
[  216.932072] igb 0000:01:00.1: IOV Disabled
[  216.937038] igb 0000:01:00.0: removed PHC on eth0
[  217.127032] igb 0000:01:00.0: Cannot deallocate SR-IOV virtual functions while they are assigned - VFs will not be deallocated
[  217.146178] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.0.5-k
[  217.154050] igb: Copyright (c) 2007-2013 Intel Corporation.
[  217.160688] igb 0000:01:00.0: Enabling SR-IOV VFs using the module parameter is deprecated - please use the pci sysfs interface.
[  217.173703] igb 0000:01:00.0: irq 103 for MSI/MSI-X
[  217.179227] igb 0000:01:00.0: irq 104 for MSI/MSI-X
[  217.184735] igb 0000:01:00.0: irq 105 for MSI/MSI-X
[  217.220082] BUG: unable to handle kernel NULL pointer dereference at 0000000000000048
[  217.228846] IP: [<ffffffffa007c5e5>] igb_reset+0xc5/0x4b0 [igb]
[  217.235472] PGD 3607ec067 PUD 36170b067 PMD 0
[  217.240461] Oops: 0002 [#1] SMP
[  217.244085] Modules linked in: igb(+) igbvf mptsas mptscsih mptbase scsi_transport_sas [last unloaded: igb]
[  217.255040] CPU: 4 PID: 4833 Comm: modprobe Not tainted 3.11.0+ #46
[...]
[  217.390007]  [<ffffffffa007fab2>] igb_probe+0x892/0xfd0 [igb]
[  217.396422]  [<ffffffff81470b3e>] local_pci_probe+0x1e/0x40
[  217.402641]  [<ffffffff81472029>] pci_device_probe+0xf9/0x110
[...]
2. A follow up issue, pci_enable_sriov() should only be called if no VFs were
still allocated on module unload. Otherwise pci_enable_sriov() gets called
multiple times in a row rendering the NIC unusable until reset.
3. simply calling igb_enable_sriov() in igb_probe_vfs() is not enough as the
interrupts need to be re-setup. Switching that to igb_pci_enable_sriov().

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Tested-by: Sibai Li <Sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-10-24 05:53:46 -07:00
..
3com net: typhoon: remove unnecessary pci_set_drvdata() 2013-10-18 00:03:28 -04:00
8390 net: 8390: remove unnecessary pci_set_drvdata() 2013-10-18 00:03:28 -04:00
adaptec net: starfire: remove unnecessary pci_set_drvdata() 2013-10-18 00:03:28 -04:00
adi adi: Remove extern from function prototypes 2013-09-24 10:09:18 -04:00
aeroflex drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherent 2013-08-29 21:55:23 -04:00
allwinner drivers: net: sun4i-emac: select MDIO_SUN4I 2013-07-26 13:57:58 -07:00
alteon net/ethernet/alteon/acenic: Use module_pci_driver to register driver 2013-05-22 14:35:04 -07:00
amd net: amd8111e: remove unnecessary pci_set_drvdata() 2013-10-18 00:03:29 -04:00
apple net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
arc ethernet/arc/arc_emac: Fix huge delays in large file copies 2013-09-05 14:25:10 -04:00
atheros net: alx: remove unnecessary pci_set_drvdata() 2013-10-18 00:03:29 -04:00
broadcom Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-23 16:49:34 -04:00
brocade net: bna: remove unnecessary pci_set_drvdata() 2013-10-18 00:03:30 -04:00
cadence Remove GENERIC_HARDIRQ config option 2013-09-13 15:09:52 +02:00
calxeda net: calxedaxgmac: determine number of address filters at runtime 2013-10-02 16:10:29 -04:00
chelsio net: cxgb4vf: use DEFINE_PCI_DEVICE_TABLE 2013-10-22 02:19:23 -04:00
cirrus net: ep93xx_eth: use dev_get_platdata() 2013-08-30 17:43:35 -04:00
cisco net: enic: remove unnecessary pci_set_drvdata() 2013-10-18 00:03:30 -04:00
davicom Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-23 16:49:34 -04:00
dec net: tulip: use DEFINE_PCI_DEVICE_TABLE 2013-10-22 02:19:23 -04:00
dlink net: dl2k: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:00 -04:00
emulex net: be2net: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:00 -04:00
faraday drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherent 2013-08-29 21:55:23 -04:00
freescale Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-23 16:49:34 -04:00
fujitsu net: fujitsu: Remove ISA depdendency from Kconfig 2013-10-07 15:52:54 -04:00
hp hp100: replace hardcoded name in /proc/interrupts with interface name 2013-09-27 17:38:32 -04:00
i825xx net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
ibm net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
icplus net: icplus: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:01 -04:00
intel igb: fix driver reload with VF assigned to guest 2013-10-24 05:53:46 -07:00
marvell net: sky2: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:01 -04:00
mellanox Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-23 16:49:34 -04:00
micrel net: ksz884x: use DEFINE_PCI_DEVICE_TABLE 2013-10-22 02:19:23 -04:00
microchip net: ethernet: enc28j60: use spi_get_drvdata() and spi_set_drvdata() 2013-04-07 16:48:19 -04:00
moxa ethernet: moxa: remove duplicate includes 2013-10-21 18:46:45 -04:00
myricom net: myri10ge: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:02 -04:00
natsemi net: natsemi: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:02 -04:00
neterion net: neterion: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:02 -04:00
nuvoton drivers:net: delete premature free_irq 2013-09-04 13:18:19 -04:00
nvidia net/ethernet/nvidia/forcedeth: Use module_pci_driver to register driver 2013-05-22 14:35:05 -07:00
nxp net: ethernet: remove unnecessary platform_set_drvdata() 2013-05-27 22:34:51 -07:00
octeon Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-07-13 14:52:21 -07:00
oki-semi oki-semi: Remove extern from function prototypes 2013-09-24 12:51:46 -07:00
packetengines net: packetengines: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:02 -04:00
pasemi net: pasemi: remove unnecessary pci_set_drvdata() 2013-10-22 02:11:51 -04:00
qlogic Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-23 16:49:34 -04:00
rdc net: r6040: remove unnecessary pci_set_drvdata() 2013-10-22 02:11:52 -04:00
realtek net: r8169: remove unnecessary pci_set_drvdata() 2013-10-22 02:11:52 -04:00
renesas sh_eth: add/use RMCR.RNC bit 2013-10-23 16:49:58 -04:00
seeq net: seeq: use dev_get_platdata() 2013-08-30 17:43:37 -04:00
sfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-08 23:07:53 -04:00
sgi net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
silan net/ethernet/silan/sc92031: Use module_pci_driver to register driver 2013-05-22 14:35:03 -07:00
sis net: sis190: remove unnecessary pci_set_drvdata() 2013-10-22 02:11:52 -04:00
smsc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-23 16:49:34 -04:00
stmicro net: stmmac: remove unnecessary pci_set_drvdata() 2013-10-22 02:11:53 -04:00
sun net: niu: remove unnecessary pci_set_drvdata() 2013-10-23 16:58:41 -04:00
tehuti net: tehuti: remove unnecessary pci_set_drvdata() 2013-10-23 16:58:41 -04:00
ti net: tlan: remove unnecessary pci_set_drvdata() 2013-10-23 16:58:41 -04:00
tile net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
toshiba net: tc35815: remove unnecessary pci_set_drvdata() 2013-10-23 16:58:41 -04:00
tundra net: tsi108: use dev_get_platdata() 2013-08-30 17:43:38 -04:00
via net: via-rhine: remove unnecessary pci_set_drvdata() 2013-10-23 16:58:41 -04:00
wiznet net: w5100: use dev_get_platdata() 2013-08-30 17:43:38 -04:00
xilinx net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
xircom Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-05-01 14:08:52 -07:00
xscale net: ixp4xx_eth: use dev_get_platdata() 2013-08-30 17:43:39 -04:00
dnet.c
dnet.h
ethoc.c net: ethoc: use dev_get_platdata() 2013-08-30 17:43:35 -04:00
fealnx.c net: fealnx: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:01 -04:00
jme.c net: jme: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:01 -04:00
jme.h
Kconfig net: Add MOXA ART SoCs ethernet driver 2013-08-11 21:38:12 -07:00
korina.c net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
lantiq_etop.c net: lantiq_etop: remove deprecated IRQF_DISABLED 2013-09-15 22:01:05 -04:00
Makefile net: Add MOXA ART SoCs ethernet driver 2013-08-11 21:38:12 -07:00
netx-eth.c net: netx-eth: remove unnecessary casting 2013-09-04 00:27:27 -04:00
s6gmac.c net: ethernet: remove unnecessary platform_set_drvdata() 2013-05-27 22:34:51 -07:00