From patchwork Tue Feb 10 00:57:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Feldman X-Patchwork-Id: 22845 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 8163DDDDBB for ; Tue, 10 Feb 2009 11:57:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752549AbZBJA5Y (ORCPT ); Mon, 9 Feb 2009 19:57:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752575AbZBJA5X (ORCPT ); Mon, 9 Feb 2009 19:57:23 -0500 Received: from sj-iport-1.cisco.com ([171.71.176.70]:61377 "EHLO sj-iport-1.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752549AbZBJA5X (ORCPT ); Mon, 9 Feb 2009 19:57:23 -0500 X-IronPort-AV: E=Sophos;i="4.38,182,1233532800"; d="scan'208";a="140038983" Received: from sj-dkim-3.cisco.com ([171.71.179.195]) by sj-iport-1.cisco.com with ESMTP; 10 Feb 2009 00:57:22 +0000 Received: from sj-core-1.cisco.com (sj-core-1.cisco.com [171.71.177.237]) by sj-dkim-3.cisco.com (8.12.11/8.12.11) with ESMTP id n1A0vMDY004862 for ; Mon, 9 Feb 2009 16:57:22 -0800 Received: from palito_client100.nuovasystems.com (savbu-palito-client100.cisco.com [10.193.70.13]) by sj-core-1.cisco.com (8.13.8/8.13.8) with ESMTP id n1A0vM3a010521 for ; Tue, 10 Feb 2009 00:57:22 GMT From: Scott Feldman Subject: [PATCH net-next 3/4] enic: bug fix: tx_timeout reset path fix-ups To: netdev@vger.kernel.org Date: Mon, 09 Feb 2009 16:57:22 -0800 Message-ID: <20090210005722.24315.90194.stgit@palito_client100.nuovasystems.com> In-Reply-To: <20090210005505.24315.66810.stgit@palito_client100.nuovasystems.com> References: <20090210005505.24315.66810.stgit@palito_client100.nuovasystems.com> User-Agent: StGIT/0.12.1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; l=2444; t=1234227442; x=1235091442; c=relaxed/simple; s=sjdkim3002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=scofeldm@cisco.com; z=From:=20Scott=20Feldman=20 |Subject:=20[PATCH=20net-next=203/4]=20enic=3A=20bug=20fix= 3A=20tx_timeout=20reset=20path=20fix-ups |Sender:=20; bh=zbgk8xP2nwFt6p4Ig9Ji7ORtUj4xTDHG253l4td9NuY=; b=jBmb9kyz9tjvyx2cgUvEy+ttIH0RXJQSHb45cxif6LyMd8+5w/OZsIqEh5 vvZha0usF6VME98Nd7YsXN8cYKXjGQZsGXulcjSL417dF6TvlXqaOyeTyzJN tK1GeS3DcS; Authentication-Results: sj-dkim-3; header.From=scofeldm@cisco.com; dkim=pass ( sig from cisco.com/sjdkim3002 verified; ); Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org enic: bug fix: tx_timeout reset path fix-ups tx_timeout reset path needs to re-init dev and re-apply nic cfg to enable vlan stripping. Signed-off-by: Scott Feldman --- drivers/net/enic/enic_main.c | 39 +++++++++++++++++++++++---------------- 1 files changed, 23 insertions(+), 16 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/enic/enic_main.c b/drivers/net/enic/enic_main.c index 3ba5f54..4da1e35 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1462,6 +1462,26 @@ static int enic_dev_soft_reset(struct enic *enic) return err; } +static int enic_set_niccfg(struct enic *enic) +{ + const u8 rss_default_cpu = 0; + const u8 rss_hash_type = 0; + const u8 rss_hash_bits = 0; + const u8 rss_base_cpu = 0; + const u8 rss_enable = 0; + const u8 tso_ipid_split_en = 0; + const u8 ig_vlan_strip_en = 1; + + /* Enable VLAN tag stripping. RSS not enabled (yet). + */ + + return enic_set_nic_cfg(enic, + rss_default_cpu, rss_hash_type, + rss_hash_bits, rss_base_cpu, + rss_enable, tso_ipid_split_en, + ig_vlan_strip_en); +} + static void enic_reset(struct work_struct *work) { struct enic *enic = container_of(work, struct enic, reset); @@ -1477,8 +1497,10 @@ static void enic_reset(struct work_struct *work) enic_stop(enic->netdev); enic_dev_soft_reset(enic); + vnic_dev_init(enic->vdev, 0); enic_reset_mcaddrs(enic); enic_init_vnic_resources(enic); + enic_set_niccfg(enic); enic_open(enic->netdev); rtnl_unlock(); @@ -1621,14 +1643,6 @@ static int __devinit enic_probe(struct pci_dev *pdev, unsigned int i; int err; - const u8 rss_default_cpu = 0; - const u8 rss_hash_type = 0; - const u8 rss_hash_bits = 0; - const u8 rss_base_cpu = 0; - const u8 rss_enable = 0; - const u8 tso_ipid_split_en = 0; - const u8 ig_vlan_strip_en = 1; - /* Allocate net device structure and initialize. Private * instance data is initialized to zero. */ @@ -1794,14 +1808,7 @@ static int __devinit enic_probe(struct pci_dev *pdev, enic_init_vnic_resources(enic); - /* Enable VLAN tag stripping. RSS not enabled (yet). - */ - - err = enic_set_nic_cfg(enic, - rss_default_cpu, rss_hash_type, - rss_hash_bits, rss_base_cpu, - rss_enable, tso_ipid_split_en, - ig_vlan_strip_en); + err = enic_set_niccfg(enic); if (err) { printk(KERN_ERR PFX "Failed to config nic, aborting.\n");