Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Don't panic when resource shortage occured...



details:   https://anonhg.NetBSD.org/src/rev/fbdc9a117d7d
branches:  trunk
changeset: 358303:fbdc9a117d7d
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Dec 21 06:43:17 2017 +0000

description:
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).

diffstat:

 sys/dev/pci/ixgbe/ixv.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (35 lines):

diff -r a7b42225f761 -r fbdc9a117d7d sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Thu Dec 21 03:31:43 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Thu Dec 21 06:43:17 2017 +0000
@@ -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 @@
        /* 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 @@
                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);



Home | Main Index | Thread Index | Old Index