Fix panics which were present when BGX and PF module were unloaded.
Details
Details
- Reviewers
zbb emaste - Commits
- rS300295: Fix VNIC module unloading
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/dev/vnic/nic_main.c | ||
---|---|---|
247 ↗ | (On Diff #16280) | 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); } |