]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
igb: call ndo_stop() instead of dev_close() when running offline selftest
authorStefan Assmann <sassmann@kpanic.de>
Wed, 3 Feb 2016 08:20:50 +0000 (09:20 +0100)
committerKirtikar Kashyap <kirtikar.kashyap@oracle.com>
Thu, 22 Jun 2017 21:28:30 +0000 (14:28 -0700)
Calling dev_close() causes IFF_UP to be cleared which will remove the
interfaces routes and some addresses. That's probably not what the user
intended when running the offline selftest. Besides this does not happen
if the interface is brought down before the test, so the current
behaviour is inconsistent.
Instead call the net_device_ops ndo_stop function directly and avoid
touching IFF_UP at all.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 46eafa59e18d034ba616fdcca688c388d0bbfd91)

Orabug: 26325580

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
drivers/net/ethernet/intel/igb/igb.h
drivers/net/ethernet/intel/igb/igb_ethtool.c
drivers/net/ethernet/intel/igb/igb_main.c

index 707ae5c297eabd8fa52c57fc27255c7778173e9b..9413fa61392f0afc596969f1e9e9003b4245831c 100644 (file)
@@ -510,6 +510,8 @@ enum igb_boards {
 extern char igb_driver_name[];
 extern char igb_driver_version[];
 
+int igb_open(struct net_device *netdev);
+int igb_close(struct net_device *netdev);
 int igb_up(struct igb_adapter *);
 void igb_down(struct igb_adapter *);
 void igb_reinit_locked(struct igb_adapter *);
index f5da88526470e966fa82aa628cfb303f0155d35f..f4f0e306c5b63bd06bb492a0b00d3bd4963d5e7e 100644 (file)
@@ -2021,7 +2021,7 @@ static void igb_diag_test(struct net_device *netdev,
 
                if (if_running)
                        /* indicate we're in test mode */
-                       dev_close(netdev);
+                       igb_close(netdev);
                else
                        igb_reset(adapter);
 
@@ -2054,7 +2054,7 @@ static void igb_diag_test(struct net_device *netdev,
 
                clear_bit(__IGB_TESTING, &adapter->state);
                if (if_running)
-                       dev_open(netdev);
+                       igb_open(netdev);
        } else {
                dev_info(&adapter->pdev->dev, "online testing starting\n");
 
index 72601545e5f7a17db3dcf0e4bcc0918028ebae63..ded52b517e5252b13ac472bdf40649c16885c99d 100644 (file)
@@ -122,8 +122,8 @@ static void igb_setup_mrqc(struct igb_adapter *);
 static int igb_probe(struct pci_dev *, const struct pci_device_id *);
 static void igb_remove(struct pci_dev *pdev);
 static int igb_sw_init(struct igb_adapter *);
-static int igb_open(struct net_device *);
-static int igb_close(struct net_device *);
+int igb_open(struct net_device *);
+int igb_close(struct net_device *);
 static void igb_configure(struct igb_adapter *);
 static void igb_configure_tx(struct igb_adapter *);
 static void igb_configure_rx(struct igb_adapter *);
@@ -3172,7 +3172,7 @@ err_setup_tx:
        return err;
 }
 
-static int igb_open(struct net_device *netdev)
+int igb_open(struct net_device *netdev)
 {
        return __igb_open(netdev, false);
 }
@@ -3209,7 +3209,7 @@ static int __igb_close(struct net_device *netdev, bool suspending)
        return 0;
 }
 
-static int igb_close(struct net_device *netdev)
+int igb_close(struct net_device *netdev)
 {
        return __igb_close(netdev, false);
 }