]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: call ndo_stop() instead of dev_close() when running offline selftest
authorStefan Assmann <sassmann@kpanic.de>
Wed, 3 Feb 2016 08:20:47 +0000 (09:20 +0100)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 7 Jul 2016 17:40:40 +0000 (10:40 -0700)
Orabug: 23176970

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: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 08ca38742b63ae3825096e943de371a3b372c4a0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e.h

drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c

index 7e4bec86187f3a066810a86d1655a597bb2443e1..38aca0e42333740e1d301ed0a6d372be7112d369 100644 (file)
@@ -809,6 +809,7 @@ int i40e_vlan_rx_kill_vid(struct net_device *netdev,
                          __always_unused __be16 proto, u16 vid);
 #endif
 int i40e_open(struct net_device *netdev);
+int i40e_close(struct net_device *netdev);
 int i40e_vsi_open(struct i40e_vsi *vsi);
 void i40e_vlan_stripping_disable(struct i40e_vsi *vsi);
 int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid);
@@ -821,7 +822,6 @@ bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi);
 struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr,
                                      bool is_vf, bool is_netdev);
 #ifdef I40E_FCOE
-int i40e_close(struct net_device *netdev);
 int i40e_setup_tc(struct net_device *netdev, u8 tc);
 void i40e_netpoll(struct net_device *netdev);
 int i40e_fcoe_enable(struct net_device *netdev);
index 121c744cada52df02a45476d97047fa0eaceca3a..6e58f4e8dfe1837db870ed048e3cee0f156b6605 100644 (file)
@@ -1709,7 +1709,7 @@ static void i40e_diag_test(struct net_device *netdev,
                /* If the device is online then take it offline */
                if (if_running)
                        /* indicate we're in test mode */
-                       dev_close(netdev);
+                       i40e_close(netdev);
                else
                        /* This reset does not affect link - if it is
                         * changed to a type of reset that does affect
@@ -1738,7 +1738,7 @@ static void i40e_diag_test(struct net_device *netdev,
                i40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED));
 
                if (if_running)
-                       dev_open(netdev);
+                       i40e_open(netdev);
        } else {
                /* Online tests */
                netif_info(pf, drv, netdev, "online testing starting\n");
index b67874df38b39bf1089d52f68f79f6fbe5840230..56c49132cb1c2cbea843658dfad3edd919cca4a0 100644 (file)
@@ -5470,11 +5470,7 @@ static void i40e_fdir_filter_exit(struct i40e_pf *pf)
  *
  * Returns 0, this is not allowed to fail
  **/
-#ifdef I40E_FCOE
 int i40e_close(struct net_device *netdev)
-#else
-static int i40e_close(struct net_device *netdev)
-#endif
 {
        struct i40e_netdev_priv *np = netdev_priv(netdev);
        struct i40e_vsi *vsi = np->vsi;