From a13fe566ca58b6b7460f84d3766bec28456f3389 Mon Sep 17 00:00:00 2001 From: msaitoh Date: Thu, 21 Dec 2017 06:43:17 +0000 Subject: [PATCH] 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). --- sys/dev/pci/ixgbe/ixv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/pci/ixgbe/ixv.c b/sys/dev/pci/ixgbe/ixv.c index 987f4ff84abb..3ce9d92ab4f4 100644 --- a/sys/dev/pci/ixgbe/ixv.c +++ b/sys/dev/pci/ixgbe/ixv.c @@ -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);