From patchwork Wed Oct 28 01:53:45 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: 37042 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 EBC7CB7B7C for ; Wed, 28 Oct 2009 12:57:39 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756965AbZJ1B52 (ORCPT ); Tue, 27 Oct 2009 21:57:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756887AbZJ1B52 (ORCPT ); Tue, 27 Oct 2009 21:57:28 -0400 Received: from qmta01.westchester.pa.mail.comcast.net ([76.96.62.16]:44460 "EHLO QMTA01.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756821AbZJ1B51 (ORCPT ); Tue, 27 Oct 2009 21:57:27 -0400 Received: from OMTA22.westchester.pa.mail.comcast.net ([76.96.62.73]) by QMTA01.westchester.pa.mail.comcast.net with comcast id xnst1c0031ap0As511xZgt; Wed, 28 Oct 2009 01:57:33 +0000 Received: from localhost.localdomain ([63.64.152.142]) by OMTA22.westchester.pa.mail.comcast.net with comcast id y22W1c00134bfcX3i22Y2E; Wed, 28 Oct 2009 02:02:45 +0000 From: Jeff Kirsher Subject: [net-next-2.6 PATCH 14/20] igb: delay VF reset notification until after interrupts are enabed To: davem@davemloft.net Cc: netdev@vger.kernel.org, gospo@redhat.com, Alexander Duyck , Jeff Kirsher Date: Tue, 27 Oct 2009 18:53:45 -0700 Message-ID: <20091028015344.12470.76498.stgit@localhost.localdomain> In-Reply-To: <20091028014858.12470.99520.stgit@localhost.localdomain> References: <20091028014858.12470.99520.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: Alexander Duyck This update delays the VF reset notification until after interrupts are enabled. Otherwise there is a chance of having the VF try to reset itself too soon and being ignored by the PF as a result. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher --- drivers/net/igb/igb_main.c | 33 +++++++++++++++++++++++---------- 1 files changed, 23 insertions(+), 10 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/igb/igb_main.c b/drivers/net/igb/igb_main.c index ea05604..24a119e 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c @@ -1165,6 +1165,13 @@ int igb_up(struct igb_adapter *adapter) rd32(E1000_ICR); igb_irq_enable(adapter); + /* notify VFs that reset has been completed */ + if (adapter->vfs_allocated_count) { + u32 reg_data = rd32(E1000_CTRL_EXT); + reg_data |= E1000_CTRL_EXT_PFRSTD; + wr32(E1000_CTRL_EXT, reg_data); + } + netif_tx_start_all_queues(adapter->netdev); /* Fire a link change interrupt to start the watchdog. */ @@ -1948,6 +1955,13 @@ static int igb_open(struct net_device *netdev) igb_irq_enable(adapter); + /* notify VFs that reset has been completed */ + if (adapter->vfs_allocated_count) { + u32 reg_data = rd32(E1000_CTRL_EXT); + reg_data |= E1000_CTRL_EXT_PFRSTD; + wr32(E1000_CTRL_EXT, reg_data); + } + netif_tx_start_all_queues(netdev); /* Fire a link status change interrupt to start the watchdog. */ @@ -5785,19 +5799,18 @@ static int igb_set_vf_mac(struct igb_adapter *adapter, static void igb_vmm_control(struct igb_adapter *adapter) { struct e1000_hw *hw = &adapter->hw; - u32 reg_data; - if (!adapter->vfs_allocated_count) + /* replication is not supported for 82575 */ + if (hw->mac.type == e1000_82575) return; - /* VF's need PF reset indication before they - * can send/receive mail */ - reg_data = rd32(E1000_CTRL_EXT); - reg_data |= E1000_CTRL_EXT_PFRSTD; - wr32(E1000_CTRL_EXT, reg_data); - - igb_vmdq_set_loopback_pf(hw, true); - igb_vmdq_set_replication_pf(hw, true); + if (adapter->vfs_allocated_count) { + igb_vmdq_set_loopback_pf(hw, true); + igb_vmdq_set_replication_pf(hw, true); + } else { + igb_vmdq_set_loopback_pf(hw, false); + igb_vmdq_set_replication_pf(hw, false); + } } /* igb_main.c */