From patchwork Tue Oct 14 19:56:05 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 4500 X-Patchwork-Delegate: jgarzik@pobox.com 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 37D3CDE795 for ; Wed, 15 Oct 2008 06:56:42 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755116AbYJNT4b (ORCPT ); Tue, 14 Oct 2008 15:56:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755109AbYJNT4b (ORCPT ); Tue, 14 Oct 2008 15:56:31 -0400 Received: from qmta02.emeryville.ca.mail.comcast.net ([76.96.30.24]:55714 "EHLO QMTA02.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755094AbYJNT4a (ORCPT ); Tue, 14 Oct 2008 15:56:30 -0400 Received: from OMTA13.emeryville.ca.mail.comcast.net ([76.96.30.52]) by QMTA02.emeryville.ca.mail.comcast.net with comcast id SdmY1a02D17UAYkA2jwVne; Tue, 14 Oct 2008 19:56:29 +0000 Received: from gitlost.lost ([63.64.152.142]) by OMTA13.emeryville.ca.mail.comcast.net with comcast id Sjw51a00A34bfcX8Zjw7FU; Tue, 14 Oct 2008 19:56:24 +0000 X-Authority-Analysis: v=1.0 c=1 a=qYOhu5Qx6v8A:10 a=4toi1r5nGRgA:10 a=quS4FCQqLwwIv9-0tLQA:9 a=Gs_dYvPeFjGB-PvaLTAA:7 a=J9Mb2p4LohECD4ogVr3Htx_ap6EA:4 a=dGJ0OcVc7YAA:10 a=iYlkOlhu7C0A:10 From: Jeff Kirsher Subject: [PATCH 6/6] DCB: setting pg will cause tx unit hangs To: davem@davemloft.net, jeff@garzik.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Duyck , Jeff Kirsher , Peter P Waskiewicz Jr Date: Tue, 14 Oct 2008 12:56:05 -0700 Message-ID: <20081014195605.16879.38567.stgit@gitlost.lost> In-Reply-To: <20081014195413.16879.25832.stgit@gitlost.lost> References: <20081014195413.16879.25832.stgit@gitlost.lost> 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: Alexander Duyck This patch fixes a hang in the ixgbe driver that occured when setting the Data Center Bridging (DCB) settings. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: Peter P Waskiewicz Jr --- drivers/net/ixgbe/ixgbe_dcb_nl.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 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 51d162d..615c280 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c @@ -135,7 +135,7 @@ static void ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { return; } else { - if (netdev->flags & IFF_UP) + if (netif_running(netdev)) netdev->stop(netdev); ixgbe_reset_interrupt_capability(adapter); ixgbe_napi_del_all(adapter); @@ -149,13 +149,13 @@ static void ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) adapter->flags |= IXGBE_FLAG_DCB_ENABLED; ixgbe_init_interrupt_scheme(adapter); ixgbe_napi_add_all(adapter); - if (netdev->flags & IFF_UP) + if (netif_running(netdev)) netdev->open(netdev); } } else { /* Turn off DCB */ if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { - if (netdev->flags & IFF_UP) + if (netif_running(netdev)) netdev->stop(netdev); ixgbe_reset_interrupt_capability(adapter); ixgbe_napi_del_all(adapter); @@ -169,7 +169,7 @@ static void ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) adapter->flags |= IXGBE_FLAG_RSS_ENABLED; ixgbe_init_interrupt_scheme(adapter); ixgbe_napi_add_all(adapter); - if (netdev->flags & IFF_UP) + if (netif_running(netdev)) netdev->open(netdev); } else { return; @@ -338,6 +338,9 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state)) msleep(1); + if (netif_running(netdev)) + ixgbe_down(adapter); + ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg, adapter->ring_feature[RING_F_DCB].indices); if (ret) { @@ -345,8 +348,9 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) return ret; } - ixgbe_down(adapter); - ixgbe_up(adapter); + if (netif_running(netdev)) + ixgbe_up(adapter); + adapter->dcb_set_bitmap = 0x00; clear_bit(__IXGBE_RESETTING, &adapter->state); return ret;