From patchwork Fri Feb 28 23:48:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Brown, Aaron F" X-Patchwork-Id: 325368 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 EC9D42C00BC for ; Sat, 1 Mar 2014 10:52:31 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752356AbaB1Xw3 (ORCPT ); Fri, 28 Feb 2014 18:52:29 -0500 Received: from mga11.intel.com ([192.55.52.93]:11497 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751723AbaB1Xw0 (ORCPT ); Fri, 28 Feb 2014 18:52:26 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 28 Feb 2014 15:52:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,564,1389772800"; d="scan'208";a="483943293" Received: from s252.jf.intel.com ([10.23.155.219]) by fmsmga001.fm.intel.com with ESMTP; 28 Feb 2014 15:52:25 -0800 From: Aaron Brown To: davem@davemloft.net Cc: Mark Rustad , netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com, Aaron Brown Subject: [net-next v2 2/4] ixgbe: Fix up some ethtool results when adapter is removed Date: Fri, 28 Feb 2014 15:48:56 -0800 Message-Id: <1393631338-18847-3-git-send-email-aaron.f.brown@intel.com> X-Mailer: git-send-email 1.8.5.GIT In-Reply-To: <1393631338-18847-1-git-send-email-aaron.f.brown@intel.com> References: <1393631338-18847-1-git-send-email-aaron.f.brown@intel.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Mark Rustad Some ethtool tests returned apparently good results when the adapter was in a removed state. Fix that by checking for removal. This also fixes two paths that could return uninitialized memory in data[4]. Signed-off-by: Mark Rustad Tested-by: Phil Schmitt Signed-off-by: Aaron Brown --- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 0433070..f2d35c0 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -1,7 +1,7 @@ /******************************************************************************* Intel 10 Gigabit PCI Express Linux driver - Copyright(c) 1999 - 2013 Intel Corporation. + Copyright(c) 1999 - 2014 Intel Corporation. This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, @@ -1247,6 +1247,11 @@ static int ixgbe_link_test(struct ixgbe_adapter *adapter, u64 *data) struct ixgbe_hw *hw = &adapter->hw; bool link_up; u32 link_speed = 0; + + if (ixgbe_removed(hw->hw_addr)) { + *data = 1; + return 1; + } *data = 0; hw->mac.ops.check_link(hw, &link_speed, &link_up, true); @@ -1969,6 +1974,7 @@ static void ixgbe_diag_test(struct net_device *netdev, data[1] = 1; data[2] = 1; data[3] = 1; + data[4] = 1; eth_test->flags |= ETH_TEST_FL_FAILED; return; } @@ -1988,6 +1994,7 @@ static void ixgbe_diag_test(struct net_device *netdev, data[1] = 1; data[2] = 1; data[3] = 1; + data[4] = 1; eth_test->flags |= ETH_TEST_FL_FAILED; clear_bit(__IXGBE_TESTING, &adapter->state);