Page MenuHomeFreeBSD

Fix VNIC module unloading
ClosedPublic

Authored by wma on May 13 2016, 9:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 12:20 PM
Unknown Object (File)
Sat, Nov 23, 8:52 AM
Unknown Object (File)
Fri, Nov 22, 1:42 PM
Unknown Object (File)
Tue, Nov 19, 2:06 PM
Unknown Object (File)
Mon, Nov 18, 12:03 PM
Unknown Object (File)
Mon, Nov 18, 11:34 AM
Unknown Object (File)
Mon, Nov 18, 10:52 AM
Unknown Object (File)
Mon, Nov 18, 9:31 AM
Subscribers

Details

Summary
Fix panics which were present when BGX and PF module were unloaded.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

wma retitled this revision from to Fix VNIC module unloading.
wma updated this object.
wma edited the test plan for this revision. (Show Details)
wma added a reviewer: zbb.
wma set the repository for this revision to rS FreeBSD src repository - subversion.
sys/dev/vnic/nic_main.c
247

Please add following code to the patch:

 static int
 nicpf_detach(device_t dev)
 {
 	struct nicpf *nic;
+	int err;
 
+	err = 0;
 	nic = device_get_softc(dev);
 
 	callout_drain(&nic->check_link);
 	mtx_destroy(&nic->check_link_mtx);
 
 	nic_unregister_interrupts(nic);
 	nicpf_free_res(nic);
 	pci_disable_busmaster(dev);
 
-	return (0);
+#ifdef PCI_IOV
+	err = pci_iov_detach(dev);
+	if (err != 0)
+		device_printf(dev, "SR-IOV in use. Detach first.\n");
+#endif
+	return (err);
 }
wma added a reviewer: emaste.
zbb edited edge metadata.
This revision is now accepted and ready to land.May 20 2016, 8:25 AM
This revision was automatically updated to reflect the committed changes.