Don't panic when resource shortage occured. Like ixgbe.c rev. 1.116.

- Move location of {ixgbe,ixv}_setup_interface() call at a position that
   any error don't occur. One of the reason is that it should be. Another
   reason is that it's hard to call ether_ifdetach() and if_detach() when
   cold == 1 (because of pserialize_perform, xc_wait, timing of domaininit
   and maybe more).
This commit is contained in:
msaitoh 2017-12-21 06:43:17 +00:00
parent 1abf1d7802
commit a13fe566ca
1 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/*$NetBSD: ixv.c,v 1.75 2017/12/06 04:08:50 msaitoh Exp $*/
/*$NetBSD: ixv.c,v 1.76 2017/12/21 06:43:17 msaitoh Exp $*/
/******************************************************************************
@ -496,6 +496,12 @@ ixv_attach(device_t parent, device_t dev, void *aux)
/* hw.ix defaults init */
adapter->enable_aim = ixv_enable_aim;
error = ixv_allocate_msix(adapter, pa);
if (error) {
device_printf(dev, "ixv_allocate_msix() failed!\n");
goto err_late;
}
/* Setup OS specific network interface */
error = ixv_setup_interface(dev, adapter);
if (error != 0) {
@ -503,12 +509,6 @@ ixv_attach(device_t parent, device_t dev, void *aux)
goto err_late;
}
error = ixv_allocate_msix(adapter, pa);
if (error) {
device_printf(dev, "ixv_allocate_msix() failed!\n");
goto err_late;
}
/* Do the stats setup */
ixv_save_stats(adapter);
ixv_init_stats(adapter);