aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Assmann <sassmann@kpanic.de>2016-02-03 03:20:50 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-02-24 18:54:39 -0500
commit46eafa59e18d034ba616fdcca688c388d0bbfd91 (patch)
tree8526c307774b1249b559a476c35b906354a8ff26
parent030f9f52642a20cbd8c1334a237e92e3ef55e2b1 (diff)
igb: call ndo_stop() instead of dev_close() when running offline selftest
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>
-rw-r--r--drivers/net/ethernet/intel/igb/igb.h2
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ethtool.c4
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c8
3 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index 707ae5c297ea..9413fa61392f 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -510,6 +510,8 @@ enum igb_boards {
510extern char igb_driver_name[]; 510extern char igb_driver_name[];
511extern char igb_driver_version[]; 511extern char igb_driver_version[];
512 512
513int igb_open(struct net_device *netdev);
514int igb_close(struct net_device *netdev);
513int igb_up(struct igb_adapter *); 515int igb_up(struct igb_adapter *);
514void igb_down(struct igb_adapter *); 516void igb_down(struct igb_adapter *);
515void igb_reinit_locked(struct igb_adapter *); 517void igb_reinit_locked(struct igb_adapter *);
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 1d329f1d047b..7982243d1f9b 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -2017,7 +2017,7 @@ static void igb_diag_test(struct net_device *netdev,
2017 2017
2018 if (if_running) 2018 if (if_running)
2019 /* indicate we're in test mode */ 2019 /* indicate we're in test mode */
2020 dev_close(netdev); 2020 igb_close(netdev);
2021 else 2021 else
2022 igb_reset(adapter); 2022 igb_reset(adapter);
2023 2023
@@ -2050,7 +2050,7 @@ static void igb_diag_test(struct net_device *netdev,
2050 2050
2051 clear_bit(__IGB_TESTING, &adapter->state); 2051 clear_bit(__IGB_TESTING, &adapter->state);
2052 if (if_running) 2052 if (if_running)
2053 dev_open(netdev); 2053 igb_open(netdev);
2054 } else { 2054 } else {
2055 dev_info(&adapter->pdev->dev, "online testing starting\n"); 2055 dev_info(&adapter->pdev->dev, "online testing starting\n");
2056 2056
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 3b56f809967c..834b1b6a9277 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -122,8 +122,8 @@ static void igb_setup_mrqc(struct igb_adapter *);
122static int igb_probe(struct pci_dev *, const struct pci_device_id *); 122static int igb_probe(struct pci_dev *, const struct pci_device_id *);
123static void igb_remove(struct pci_dev *pdev); 123static void igb_remove(struct pci_dev *pdev);
124static int igb_sw_init(struct igb_adapter *); 124static int igb_sw_init(struct igb_adapter *);
125static int igb_open(struct net_device *); 125int igb_open(struct net_device *);
126static int igb_close(struct net_device *); 126int igb_close(struct net_device *);
127static void igb_configure(struct igb_adapter *); 127static void igb_configure(struct igb_adapter *);
128static void igb_configure_tx(struct igb_adapter *); 128static void igb_configure_tx(struct igb_adapter *);
129static void igb_configure_rx(struct igb_adapter *); 129static void igb_configure_rx(struct igb_adapter *);
@@ -3172,7 +3172,7 @@ err_setup_tx:
3172 return err; 3172 return err;
3173} 3173}
3174 3174
3175static int igb_open(struct net_device *netdev) 3175int igb_open(struct net_device *netdev)
3176{ 3176{
3177 return __igb_open(netdev, false); 3177 return __igb_open(netdev, false);
3178} 3178}
@@ -3209,7 +3209,7 @@ static int __igb_close(struct net_device *netdev, bool suspending)
3209 return 0; 3209 return 0;
3210} 3210}
3211 3211
3212static int igb_close(struct net_device *netdev) 3212int igb_close(struct net_device *netdev)
3213{ 3213{
3214 return __igb_close(netdev, false); 3214 return __igb_close(netdev, false);
3215} 3215}