From patchwork Fri Jun 10 03:47:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 99834 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 2F73AB7003 for ; Fri, 10 Jun 2011 13:48:30 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754467Ab1FJDsE (ORCPT ); Thu, 9 Jun 2011 23:48:04 -0400 Received: from mga09.intel.com ([134.134.136.24]:56870 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751914Ab1FJDsC (ORCPT ); Thu, 9 Jun 2011 23:48:02 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 09 Jun 2011 20:48:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,344,1304319600"; d="scan'208";a="11781107" Received: from unknown (HELO jtkirshe-mobl.amr.corp.intel.com) ([10.255.13.162]) by orsmga002.jf.intel.com with ESMTP; 09 Jun 2011 20:48:00 -0700 From: Jeff Kirsher To: davem@davemloft.net Cc: Bruce Allan , netdev@vger.kernel.org, gospo@redhat.com, Jeff Kirsher Subject: [PATCH 04/12] e1000e: do not schedule the Tx queue until ready Date: Thu, 9 Jun 2011 20:47:48 -0700 Message-Id: <1307677676-26690-5-git-send-email-jeffrey.t.kirsher@intel.com> X-Mailer: git-send-email 1.7.5.2 In-Reply-To: <1307677676-26690-1-git-send-email-jeffrey.t.kirsher@intel.com> References: <1307677676-26690-1-git-send-email-jeffrey.t.kirsher@intel.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Bruce Allan Start the Tx queue when the interface is brought up in e1000e_up() but do not schedule the queue until link is up as detected in the watchdog task which sets netif_carrier_on. Also flush the descriptors and clean the Tx and Rx rings before resetting the hardware when bringing the interface down otherwise there is a small window where the watchdog task can be triggered with netif_carrier_off and the Tx ring not yet empty which causes an additional and unnecessary reset. Signed-off-by: Bruce Allan Signed-off-by: Jeff Kirsher --- drivers/net/e1000e/netdev.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index c4a23c7..bc99458 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -3347,7 +3347,7 @@ int e1000e_up(struct e1000_adapter *adapter) e1000_configure_msix(adapter); e1000_irq_enable(adapter); - netif_wake_queue(adapter->netdev); + netif_start_queue(adapter->netdev); /* fire a link change interrupt to start the watchdog */ if (adapter->msix_entries) @@ -3414,17 +3414,16 @@ void e1000e_down(struct e1000_adapter *adapter) e1000e_update_stats(adapter); spin_unlock(&adapter->stats64_lock); + e1000e_flush_descriptors(adapter); + e1000_clean_tx_ring(adapter); + e1000_clean_rx_ring(adapter); + adapter->link_speed = 0; adapter->link_duplex = 0; if (!pci_channel_offline(adapter->pdev)) e1000e_reset(adapter); - e1000e_flush_descriptors(adapter); - - e1000_clean_tx_ring(adapter); - e1000_clean_rx_ring(adapter); - /* * TODO: for power management, we could drop the link and * pci_disable_device here.