Commit 3ce1cc52d2e76b6a6b9d0b52b70eb181497efa50

Authored by John Fastabend
Committed by David S. Miller
1 parent ebe1b30cd4

ixgbe: if ixgbe_copy_dcb_cfg is going to fail learn about it early

Call ixgbe_copy_dcb_cfg() earlier in the ixgbe_dcbnl_set_all() so that
we can learn if this is going to fail as early as possible.  Previously,
ixgbe_down or ixgbe_close were being called before this check and the
IXGBE_RESETTING bit was being set and cleared.  Worse if this failed
the corresponding ixgbe_up/ndo_open would not called.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 6 additions and 8 deletions Side-by-side Diff

drivers/net/ixgbe/ixgbe_dcb_nl.c
... ... @@ -341,6 +341,12 @@
341 341 if (!adapter->dcb_set_bitmap)
342 342 return DCB_NO_HW_CHG;
343 343  
  344 + ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg,
  345 + adapter->ring_feature[RING_F_DCB].indices);
  346 +
  347 + if (ret)
  348 + return DCB_NO_HW_CHG;
  349 +
344 350 /*
345 351 * Only take down the adapter if the configuration change
346 352 * requires a reset.
... ... @@ -357,14 +363,6 @@
357 363 if (netif_running(netdev))
358 364 ixgbe_down(adapter);
359 365 }
360   - }
361   -
362   - ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg,
363   - adapter->ring_feature[RING_F_DCB].indices);
364   - if (ret) {
365   - if (adapter->dcb_set_bitmap & BIT_RESETLINK)
366   - clear_bit(__IXGBE_RESETTING, &adapter->state);
367   - return DCB_NO_HW_CHG;
368 366 }
369 367  
370 368 if (adapter->dcb_cfg.pfc_mode_enable) {