aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2010-01-27 11:38:06 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-28 08:55:54 -0500
commit3ce1cc52d2e76b6a6b9d0b52b70eb181497efa50 (patch)
treee6eed2508b3feab63eaa091b78616c17f5eed89a
parentebe1b30cd441b576fb9d0b42857af3e423dd5826 (diff)
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>
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 383e799c5fed..dd4883f642be 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -341,6 +341,12 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
341 if (!adapter->dcb_set_bitmap) 341 if (!adapter->dcb_set_bitmap)
342 return DCB_NO_HW_CHG; 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 * Only take down the adapter if the configuration change 351 * Only take down the adapter if the configuration change
346 * requires a reset. 352 * requires a reset.
@@ -359,14 +365,6 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
359 } 365 }
360 } 366 }
361 367
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 }
369
370 if (adapter->dcb_cfg.pfc_mode_enable) { 368 if (adapter->dcb_cfg.pfc_mode_enable) {
371 if ((adapter->hw.mac.type != ixgbe_mac_82598EB) && 369 if ((adapter->hw.mac.type != ixgbe_mac_82598EB) &&
372 (adapter->hw.fc.current_mode != ixgbe_fc_pfc)) 370 (adapter->hw.fc.current_mode != ixgbe_fc_pfc))