Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5408562yba; Wed, 8 May 2019 12:51:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNh7hd91+8aTNnWDLb/pmPq8GspCiMOKtNplL1w+umTzGcxvj3OEfpcBcwfKwoD4sbmn0n X-Received: by 2002:aa7:99c7:: with SMTP id v7mr51965101pfi.103.1557345094155; Wed, 08 May 2019 12:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557345094; cv=none; d=google.com; s=arc-20160816; b=UfPGQj3GA4caaPqiov12SKUdfqB/VP0DtlvinaakOH81b+9TrxYog5HbL3NLcHEalB eW58pBHTm5t0SY+83vgnVYlnLOKftcGAVuWEIHiHNUSuvurUCcyA4bhx+hKG49ixuaVB BphJTC0Dg/TEsd8dxC4kjkLJVjsYn901wHxW2qTs3Fym/6jv4A/oTQYw2NHS7/uK24u+ QspttaCGVzH64fzWuo6/1sn+iqU/tN/oP+sKL5IaCTjJ1DbvtGUFoHaeDMmzPhXG7ycH xq7k/rb/LdUOB48c2tZzinebW1krYkR+SLFi2VTo+qX0EbQhS9UZPpQFllRUpmzzCpVe x61w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5DOmx//fzezxXgA6dXN4cXOSgxB/Losdvoy8bCClEOA=; b=VZaisLGXxxnsZGq/tw2X4asQTj6qRH7Rq9b4dMRlU60qNHwFqhp7iav2diM7Vh3OAR RX8uPUpL6hd0oTZPiERyo8qOnudPjTnDE8x4A97OFIFLHVuCaQUJQL9hYPEaDcM7YZ+b G91YyrHe00XViJXv9ANbvh0o+zPxo8bQt1B3+u72msOwie5FZq6nBQ4+SDMPtcMXps4n +Tj/I6e73AqlGQ7gLUVTSLneNY0GK0yf6sn3qg0jKqLmtVqZk3wwKjnpzWLNjDCg+Tme ReoSRHZEwk459+eNXHzSNPf9nwkzVonrMr6ERP1SZfZAwU6b7YEgLYT9gxW+EYewrtKk Nl+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=oijb849r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si24677709pla.405.2019.05.08.12.51.17; Wed, 08 May 2019 12:51:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=oijb849r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727229AbfEHTuP (ORCPT + 99 others); Wed, 8 May 2019 15:50:15 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:58807 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726852AbfEHTuP (ORCPT ); Wed, 8 May 2019 15:50:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=5DOmx//fzezxXgA6dXN4cXOSgxB/Losdvoy8bCClEOA=; b=oijb849rOm0vwPxJ/7MRCE3fwS OaJ6Z+jCbi0UjJwtOezbYLCkNIRF/My7PBlpqOSQd1Q0yzUQMaOZ9e02lKGkZ1oMGvccaeU+qDsq/ I7DkChQVJDsHTk3IENfEkBiXRnzBhPUBqXEk2QjInxyfWs+Hd0NjGiY0dIdDCirEcyKg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hOSZv-0004Mv-45; Wed, 08 May 2019 21:50:11 +0200 Date: Wed, 8 May 2019 21:50:11 +0200 From: Andrew Lunn To: Jose Abreu Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Joao Pinto , "David S . Miller" , Giuseppe Cavallaro , Alexandre Torgue Subject: Re: [PATCH net-next 00/11] net: stmmac: Selftests Message-ID: <20190508195011.GK25013@lunn.ch> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 08, 2019 at 09:51:00AM +0200, Jose Abreu wrote: > [ Submitting with net-next closed for proper review and testing. ] > > This introduces selftests support in stmmac driver. We add 4 basic sanity > checks and MAC loopback support for all cores within the driver. This way > more tests can easily be added in the future and can be run in virtually > any MAC/GMAC/QoS/XGMAC platform. > > Having this we can find regressions and missing features in the driver > while at the same time we can check if the IP is correctly working. > > We have been using this for some time now and I do have more tests to > submit in the feature. My experience is that although writing the tests > adds more development time, the gain results are obvious. > > I let this feature optional within the driver under a Kconfig option. > > For this series the output result will be something like this > (e.g. for dwmac1000): > ---- > # ethtool -t eth0 > The test result is PASS > The test extra info: > 1. MAC Loopback 0 > 2. PHY Loopback -95 > 3. MMC Counters 0 > 4. EEE -95 > 5. Hash Filter MC 0 > 6. Perfect Filter UC 0 > 7. Flow Control 0 Hi Jose The man page says: -t --test Executes adapter selftest on the specified network device. Possible test modes are: offline Perform full set of tests, possibly interrupting normal operation during the tests, online Perform limited set of tests, not interrupting normal operation, external_lb Perform full set of tests, as for offline, and additionally an external-loopback test. The normal operation is interrupted by the tests you carry out here. But i don't see any code looking for ETH_TEST_FL_OFFLINE > (Error code -95 means EOPNOTSUPP in current HW). How deep do you have to go before you know about EOPNOTSUPP? It would be better to not return the string and result at all. Or patch ethtool to call strerror(3). Andrew