From patchwork Tue Jun 28 06:40:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: amit salecha X-Patchwork-Id: 102332 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 C50B8B6F73 for ; Tue, 28 Jun 2011 17:04:40 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753762Ab1F1GvD (ORCPT ); Tue, 28 Jun 2011 02:51:03 -0400 Received: from vpn.pathscale.com ([198.186.3.75]:36880 "HELO mx.mv.qlogic.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with SMTP id S1756248Ab1F1GtG (ORCPT ); Tue, 28 Jun 2011 02:49:06 -0400 Received: from lnxdev-sm-001.mv.qlogic.com (dut6217.mv.qlogic.com [172.29.56.217]) by mx.mv.qlogic.com (Postfix) with ESMTP id 0B8FBD9FDC; Mon, 27 Jun 2011 23:48:54 -0700 (PDT) Received: by lnxdev-sm-001.mv.qlogic.com (Postfix, from userid 0) id A750314ABFB; Mon, 27 Jun 2011 23:40:47 -0700 (PDT) From: amit.salecha@qlogic.com To: davem@davemloft.net Cc: netdev@vger.kernel.org, ameen.rahman@qlogic.com, Amit Kumar Salecha Subject: [PATCH NEXT 1/2] net: add external loopback test in ethtool self test Date: Mon, 27 Jun 2011 23:40:46 -0700 Message-Id: <1309243247-15950-2-git-send-email-amit.salecha@qlogic.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1309243247-15950-1-git-send-email-amit.salecha@qlogic.com> References: <1309243247-15950-1-git-send-email-amit.salecha@qlogic.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Amit Kumar Salecha External loopback test can be performed by application without any driver support on normal Ethernet cards. But on CNA devices, where multiple functions share same physical port. Here internal loopback test and external loopback test can be initiated by different function at same time. To co exist all functions, firmware need to regulate what test can be run by which function. So before performing external loopback test, command need to send to firmware, which will quiescent other functions. User may not want to run external loopback test always. As special cable need to be connected for this test. So adding explicit flag in ethtool self test, which will specify interface to perform external loopback test. Signed-off-by: Amit Kumar Salecha --- include/linux/ethtool.h | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 048d0fa..c2ba287 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -310,9 +310,18 @@ struct ethtool_sset_info { __u32's, etc. */ }; +/* + * Flags definition of ethtool_test + * + * ETH_TEST_FL_OFFLINE: online / offline + * ETH_TEST_FL_FAILED: test passed / failed + * ETH_TEST_FL_EXTERNAL_LB: perform external loopback test + */ + enum ethtool_test_flags { - ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ - ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ + ETH_TEST_FL_OFFLINE = (1 << 0), + ETH_TEST_FL_FAILED = (1 << 1), + ETH_TEST_FL_EXTERNAL_LB = (1 << 2), }; /* for requesting NIC test and getting results*/