From patchwork Fri Jan 23 08:37:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 20021 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.176.167]) by ozlabs.org (Postfix) with ESMTP id C2C82DDF68 for ; Fri, 23 Jan 2009 19:38:01 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752734AbZAWIh4 (ORCPT ); Fri, 23 Jan 2009 03:37:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751405AbZAWIh4 (ORCPT ); Fri, 23 Jan 2009 03:37:56 -0500 Received: from qmta10.westchester.pa.mail.comcast.net ([76.96.62.17]:51793 "EHLO QMTA10.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbZAWIh4 (ORCPT ); Fri, 23 Jan 2009 03:37:56 -0500 Received: from OMTA01.westchester.pa.mail.comcast.net ([76.96.62.11]) by QMTA10.westchester.pa.mail.comcast.net with comcast id 6wT11b0030EZKEL5Awdv6V; Fri, 23 Jan 2009 08:37:55 +0000 Received: from lost.foo-projects.org ([63.64.152.142]) by OMTA01.westchester.pa.mail.comcast.net with comcast id 6wdb1b00534bfcX3MwdemM; Fri, 23 Jan 2009 08:37:53 +0000 From: Jeff Kirsher Subject: [net-next PATCH 1/2] ixgbe: fix slow load times on 82598 nics To: davem@davemloft.net Cc: netdev@vger.kernel.org, jeff@garzik.org, Don Skidmore , Peter P Waskiewicz Jr , Jeff Kirsher Date: Fri, 23 Jan 2009 00:37:33 -0800 Message-ID: <20090123083733.20920.86146.stgit@lost.foo-projects.org> 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: Don Skidmore Load times for NICs that use i2c to communicate with the phy were taking ~4.5 sec per port. This fix first checks to see if the link is already up before calling get_link_capabilities, since if it is we don't need query the phy for link state. Signed-off-by: Don Skidmore Signed-off-by: Peter P Waskiewicz Jr Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe_main.c | 25 ++++++++++++++++++------- 1 files changed, 18 insertions(+), 7 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_main.c b/drivers/net/ixgbe/ixgbe_main.c index f7b592e..18d4353 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -3901,16 +3901,27 @@ static void ixgbe_netpoll(struct net_device *netdev) **/ static int ixgbe_link_config(struct ixgbe_hw *hw) { - u32 autoneg = IXGBE_LINK_SPEED_10GB_FULL; + u32 autoneg; + bool link_up = false; + u32 ret = IXGBE_ERR_LINK_SETUP; - /* must always autoneg for both 1G and 10G link */ - hw->mac.autoneg = true; + if (hw->mac.ops.check_link) + ret = hw->mac.ops.check_link(hw, &autoneg, &link_up, false); - if ((hw->mac.type == ixgbe_mac_82598EB) && - (hw->phy.media_type == ixgbe_media_type_copper)) - autoneg = IXGBE_LINK_SPEED_82598_AUTONEG; + if (ret || !link_up) + goto link_cfg_out; - return hw->mac.ops.setup_link_speed(hw, autoneg, true, true); + if (hw->mac.ops.get_link_capabilities) + ret = hw->mac.ops.get_link_capabilities(hw, &autoneg, + &hw->mac.autoneg); + if (ret) + goto link_cfg_out; + + if (hw->mac.ops.setup_link_speed) + ret = hw->mac.ops.setup_link_speed(hw, autoneg, true, true); + +link_cfg_out: + return ret; } static const struct net_device_ops ixgbe_netdev_ops = {