From patchwork Thu Oct 13 07:15:07 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: 119374 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 71841B6F81 for ; Thu, 13 Oct 2011 18:15:54 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753386Ab1JMHPq (ORCPT ); Thu, 13 Oct 2011 03:15:46 -0400 Received: from mga09.intel.com ([134.134.136.24]:10144 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753301Ab1JMHPT (ORCPT ); Thu, 13 Oct 2011 03:15:19 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 13 Oct 2011 00:15:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,351,1309762800"; d="scan'208";a="62782525" Received: from unknown (HELO jtkirshe-mobl.amr.corp.intel.com) ([10.255.15.24]) by orsmga002.jf.intel.com with ESMTP; 13 Oct 2011 00:15:18 -0700 From: Jeff Kirsher To: davem@davemloft.net Cc: Alexander Duyck , netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com, Jeff Kirsher Subject: [net-next 06/11] igb: Fix features that are currently 82580 only and should also be i350 Date: Thu, 13 Oct 2011 00:15:07 -0700 Message-Id: <1318490112-5092-7-git-send-email-jeffrey.t.kirsher@intel.com> X-Mailer: git-send-email 1.7.6.4 In-Reply-To: <1318490112-5092-1-git-send-email-jeffrey.t.kirsher@intel.com> References: <1318490112-5092-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: Alexander Duyck This change allows support for per packet timesync and global device reset on the i350 adapter. These features were supported on both 82580 and i350 however it looks like several checks where not updated and as such the i350 support was not enabled. Signed-off-by: Alexander Duyck Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/igb/igb_main.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index efc367b..fee771b 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -563,7 +563,7 @@ static cycle_t igb_read_clock(const struct cyclecounter *tc) * the lowest register is SYSTIMR instead of SYSTIML. However we never * adjusted TIMINCA so SYSTIMR will just read as all 0s so ignore it. */ - if (hw->mac.type == e1000_82580) { + if (hw->mac.type >= e1000_82580) { stamp = rd32(E1000_SYSTIMR) >> 8; shift = IGB_82580_TSYNC_SHIFT; } @@ -1367,7 +1367,7 @@ static void igb_irq_enable(struct igb_adapter *adapter) struct e1000_hw *hw = &adapter->hw; if (adapter->msix_entries) { - u32 ims = E1000_IMS_LSC | E1000_IMS_DOUTSYNC; + u32 ims = E1000_IMS_LSC | E1000_IMS_DOUTSYNC | E1000_IMS_DRSTA; u32 regval = rd32(E1000_EIAC); wr32(E1000_EIAC, regval | adapter->eims_enable_mask); regval = rd32(E1000_EIAM); @@ -1377,9 +1377,6 @@ static void igb_irq_enable(struct igb_adapter *adapter) wr32(E1000_MBVFIMR, 0xFF); ims |= E1000_IMS_VMMB; } - if (adapter->hw.mac.type == e1000_82580) - ims |= E1000_IMS_DRSTA; - wr32(E1000_IMS, ims); } else { wr32(E1000_IMS, IMS_ENABLE_MASK | @@ -3112,7 +3109,7 @@ void igb_configure_rx_ring(struct igb_adapter *adapter, srrctl |= (PAGE_SIZE / 2) >> E1000_SRRCTL_BSIZEPKT_SHIFT; #endif srrctl |= E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS; - if (hw->mac.type == e1000_82580) + if (hw->mac.type >= e1000_82580) srrctl |= E1000_SRRCTL_TIMESTAMP; /* Only set Drop Enable if we are supporting multiple queues */ if (adapter->vfs_allocated_count || adapter->num_rx_queues > 1) @@ -4463,7 +4460,7 @@ static void igb_tx_timeout(struct net_device *netdev) /* Do the reset outside of interrupt context */ adapter->tx_timeout_count++; - if (hw->mac.type == e1000_82580) + if (hw->mac.type >= e1000_82580) hw->dev_spec._82575.global_device_reset = true; schedule_work(&adapter->reset_task); @@ -5581,7 +5578,7 @@ static void igb_systim_to_hwtstamp(struct igb_adapter *adapter, * The 82580 starts with 1ns at bit 0 in RX/TXSTMPL, shift this up to * 24 to match clock shift we setup earlier. */ - if (adapter->hw.mac.type == e1000_82580) + if (adapter->hw.mac.type >= e1000_82580) regval <<= IGB_82580_TSYNC_SHIFT; ns = timecounter_cyc2time(&adapter->clock, regval); @@ -6276,7 +6273,7 @@ static int igb_hwtstamp_ioctl(struct net_device *netdev, * timestamped, so enable timestamping in all packets as * long as one rx filter was configured. */ - if ((hw->mac.type == e1000_82580) && tsync_rx_ctl) { + if ((hw->mac.type >= e1000_82580) && tsync_rx_ctl) { tsync_rx_ctl = E1000_TSYNCRXCTL_ENABLED; tsync_rx_ctl |= E1000_TSYNCRXCTL_TYPE_ALL; }