From patchwork Thu Jan 28 02:38:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 43846 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41F0BB7D05 for ; Thu, 28 Jan 2010 13:38:32 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756125Ab0A1Ci1 (ORCPT ); Wed, 27 Jan 2010 21:38:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756124Ab0A1Ci1 (ORCPT ); Wed, 27 Jan 2010 21:38:27 -0500 Received: from qmta06.westchester.pa.mail.comcast.net ([76.96.62.56]:52528 "EHLO qmta06.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755808Ab0A1Ci0 (ORCPT ); Wed, 27 Jan 2010 21:38:26 -0500 Received: from omta17.westchester.pa.mail.comcast.net ([76.96.62.89]) by qmta06.westchester.pa.mail.comcast.net with comcast id afS71d0051vXlb856qeSBy; Thu, 28 Jan 2010 02:38:26 +0000 Received: from localhost.localdomain ([63.64.152.142]) by omta17.westchester.pa.mail.comcast.net with comcast id aqet1d00j34bfcX3dqewpM; Thu, 28 Jan 2010 02:39:11 +0000 From: Jeff Kirsher Subject: [net-2.6 PATCH 2/2] ixgbe: if ixgbe_copy_dcb_cfg is going to fail learn about it early To: davem@davemloft.net Cc: netdev@vger.kernel.org, gospo@redhat.com, John Fastabend , PJ Waskiewicz , Jeff Kirsher Date: Wed, 27 Jan 2010 18:38:06 -0800 Message-ID: <20100128023805.19441.23796.stgit@localhost.localdomain> In-Reply-To: <20100128023717.19441.27328.stgit@localhost.localdomain> References: <20100128023717.19441.27328.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: John Fastabend 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 Acked-by: PJ Waskiewicz Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe_dcb_nl.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c index 383e799..dd4883f 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) if (!adapter->dcb_set_bitmap) return DCB_NO_HW_CHG; + ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg, + adapter->ring_feature[RING_F_DCB].indices); + + if (ret) + return DCB_NO_HW_CHG; + /* * Only take down the adapter if the configuration change * requires a reset. @@ -359,14 +365,6 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) } } - ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg, - adapter->ring_feature[RING_F_DCB].indices); - if (ret) { - if (adapter->dcb_set_bitmap & BIT_RESETLINK) - clear_bit(__IXGBE_RESETTING, &adapter->state); - return DCB_NO_HW_CHG; - } - if (adapter->dcb_cfg.pfc_mode_enable) { if ((adapter->hw.mac.type != ixgbe_mac_82598EB) && (adapter->hw.fc.current_mode != ixgbe_fc_pfc))