Page MenuHomeFreeBSD

Fix VNIC module unloading
ClosedPublic

Authored by wma on May 13 2016, 9:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 10, 7:31 PM
Unknown Object (File)
Fri, Feb 7, 3:15 AM
Unknown Object (File)
Fri, Feb 7, 3:15 AM
Unknown Object (File)
Fri, Feb 7, 3:15 AM
Unknown Object (File)
Fri, Feb 7, 2:25 AM
Unknown Object (File)
Fri, Feb 7, 2:21 AM
Unknown Object (File)
Jan 8 2025, 4:02 PM
Unknown Object (File)
Dec 28 2024, 8:12 PM
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.