Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp363247imi; Fri, 22 Jul 2022 00:14:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vBC2TvsCoo4IpzzuC82uTHqbOhChSBs4QR2RA1QiVd7uzW1ByIlkwJobitF0QL4/BnzdFM X-Received: by 2002:a17:902:a516:b0:16c:ef6f:fec7 with SMTP id s22-20020a170902a51600b0016cef6ffec7mr2214909plq.140.1658474095563; Fri, 22 Jul 2022 00:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658474095; cv=none; d=google.com; s=arc-20160816; b=AW3Ju1HBcVTafy6IONn1Xx9b1sK5hFOAbIuR/zr1GXgMOhnP9kpqwPKfwpcs3cCyNG xD5f+dixGart1SePPg7QIo3x2TNcS0dizlHk2MYYiDRfXmMfyR4iiSs57GEB1VZ2orMl 4DgXIGol+EOI9nzx6vw5Tl8sezgVeQEb931Bl18pnvPo+lDLV5lvzJCw4m7dr9uwTrOS YF0kk3BLMn5r+kdQzHxszvd7tqjRpwtZDbeH7zbLO7WAj9JbgU85Yt8qXA3vC+0KkKKP n7gWb688nhmDC/lmWMkY9w17jp91sqyMG3d3XZPpbcqWBv6TciKQ0INZVLx033KGxiqS 7SWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Nw8tTjTa/PZO5hmV8CKEncBLO7o0ZFuEQVqbEDoX2Ck=; b=LE5BKAO2k1iTZlUHljknRgwmB0nUwwcVxhuE192h1iF9iSX2TayYMtnn5Y+qxER2IV pfK0Mly/3SjUyara7Yhl51p3ZT2dMR4YyNdwQK1cA53/zWdfSNggqMPkd3BU7oxIco74 fRUhfcCcr1VlnEoY5VYHzZ9a6JgTaR2uSV/V3LsheSX1kG5plwbSztKVR2QoxDUIvVB0 Fc8QZfjVLFdn60CFo+E00ZRN/BYh6zhQqC04bmnhmRu+RrpEeCQlage3ZP3g6XdnOQoP SQpGTn1GFICXPZwC6NrmDd9E9S2YK07WGECWsqia/T5S+EMX8tOMJdAbhyUekB4RzarY cgkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20210112.gappssmtp.com header.s=20210112 header.b=1fvxKtPm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oo5-20020a17090b1c8500b001f22cc15dcasi5505527pjb.112.2022.07.22.00.14.38; Fri, 22 Jul 2022 00:14:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20210112.gappssmtp.com header.s=20210112 header.b=1fvxKtPm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbiGVGmB (ORCPT + 99 others); Fri, 22 Jul 2022 02:42:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234097AbiGVGmA (ORCPT ); Fri, 22 Jul 2022 02:42:00 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 266BF82441 for ; Thu, 21 Jul 2022 23:41:58 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id c72so1825983edf.8 for ; Thu, 21 Jul 2022 23:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Nw8tTjTa/PZO5hmV8CKEncBLO7o0ZFuEQVqbEDoX2Ck=; b=1fvxKtPmWT/wdCB8Zd+JYdxs8+jWy+PbYJowMNwMC0gF27ApS2xraSu5yoKuNS1eFQ FHpKRcCJ5H951J+X3Bf+I+Z8a4PujfT2O2p3PYLwnnXWSQMJp9+u4ckAlCwoPyz4D2aS GgHldmwVfW0UP/nqX63iRccR86IclUpNc7E03wnxaYtX6cQzr+F/YR/Sqf34WA+CvUWC fHU2EdJFJYvIwHyJOLRQdHcJMBaoFSPtmiQdzsV9i+oiC/fS1id0RgejZHND1ZhMQxax BtME/F7QoSXo5wwitIRxypt04Az/pyYq1lae0KhapPwib0E3Uc4ORR8DF60NrwX6G0OJ BPLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Nw8tTjTa/PZO5hmV8CKEncBLO7o0ZFuEQVqbEDoX2Ck=; b=2ARvGmj2nObt4wknuk+bK52ACqnAhiqDsFGF7AMAQq1yxI7TPl8Qcoi9vOeBIby9Hy v5ATYBH9cE8MvDxl1xPEmzCwBaKo6GDSaM/ih1daeIG2EadrspKqIdd/fzPicAHVwkb9 pILAJEcH8Dp7Rc45WlGaek244GhCm+ER/M49DZ8Q/BLyjeek87Co4CzVgZyD1s+XU9sS f4hLOoT61U9CQYpuXkmX7HNmli4Ha8+BlY5oDwfiNvdblXPjLMmvL4t7dptlei1nvboF 05Yja9LZ7N8WNBaNrE071BJMe3ynwInUU9i43QB6HcsvWdnC5zXMz3VxKxXMuLC7YmF7 SgGA== X-Gm-Message-State: AJIora/MJtOA22AhR6LnAUAgv/DPjczkdBCznlsUx7Tz2KFWvzw+4SwM VQ5TbLO3ErAkjrmjurchqFVDpw== X-Received: by 2002:a05:6402:190e:b0:43a:e914:8c11 with SMTP id e14-20020a056402190e00b0043ae9148c11mr1924522edz.281.1658472116576; Thu, 21 Jul 2022 23:41:56 -0700 (PDT) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id kw26-20020a170907771a00b0072124df085bsm1680382ejc.15.2022.07.21.23.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 23:41:55 -0700 (PDT) Date: Fri, 22 Jul 2022 08:41:54 +0200 From: Jiri Pirko To: Vikas Gupta Cc: Jiri Pirko , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , dsahern@kernel.org, stephen@networkplumber.org, Eric Dumazet , pabeni@redhat.com, ast@kernel.org, leon@kernel.org, linux-doc@vger.kernel.org, corbet@lwn.net, Michael Chan , Andrew Gospodarek Subject: Re: [PATCH net-next v4 1/3] devlink: introduce framework for selftests Message-ID: References: <20220718062032.22426-1-vikas.gupta@broadcom.com> <20220721072121.43648-1-vikas.gupta@broadcom.com> <20220721072121.43648-2-vikas.gupta@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thu, Jul 21, 2022 at 07:32:08PM CEST, vikas.gupta@broadcom.com wrote: >Hi Jiri, > > >On Thu, Jul 21, 2022 at 6:27 PM Jiri Pirko wrote: >> >> Thu, Jul 21, 2022 at 09:21:19AM CEST, vikas.gupta@broadcom.com wrote: >> >Add a framework for running selftests. >> >Framework exposes devlink commands and test suite(s) to the user >> >to execute and query the supported tests by the driver. >> > >> >Below are new entries in devlink_nl_ops >> >devlink_nl_cmd_selftests_list_doit/dumpit: To query the supported >> >selftests by the drivers. >> >devlink_nl_cmd_selftests_run: To execute selftests. Users can >> >provide a test mask for executing group tests or standalone tests. >> > >> >Documentation/networking/devlink/ path is already part of MAINTAINERS & >> >the new files come under this path. Hence no update needed to the >> >MAINTAINERS >> > >> >Signed-off-by: Vikas Gupta >> >Reviewed-by: Michael Chan >> >Reviewed-by: Andy Gospodarek >> >--- >> > .../networking/devlink/devlink-selftests.rst | 38 +++ >> > include/net/devlink.h | 20 ++ >> > include/uapi/linux/devlink.h | 29 +++ >> > net/core/devlink.c | 225 ++++++++++++++++++ >> > 4 files changed, 312 insertions(+) >> > create mode 100644 Documentation/networking/devlink/devlink-selftests.rst >> > >> >diff --git a/Documentation/networking/devlink/devlink-selftests.rst b/Documentation/networking/devlink/devlink-selftests.rst >> >new file mode 100644 >> >index 000000000000..0e9727895987 >> >--- /dev/null >> >+++ b/Documentation/networking/devlink/devlink-selftests.rst >> >@@ -0,0 +1,38 @@ >> >+.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> >+ >> >+================= >> >+Devlink Selftests >> >+================= >> >+ >> >+The ``devlink-selftests`` API allows executing selftests on the device. >> >+ >> >+Tests Mask >> >+========== >> >+The ``devlink-selftests`` command should be run with a mask indicating >> >+the tests to be executed. >> >+ >> >+Tests Description >> >+================= >> >+The following is a list of tests that drivers may execute. >> >+ >> >+.. list-table:: List of tests >> >+ :widths: 5 90 >> >+ >> >+ * - Name >> >+ - Description >> >+ * - ``DEVLINK_SELFTEST_FLASH`` >> >+ - Devices may have the firmware on non-volatile memory on the board, e.g. >> >+ flash. This particular test helps to run a flash selftest on the device. >> >+ Implementation of the test is left to the driver/firmware. >> >+ >> >+example usage >> >+------------- >> >+ >> >+.. code:: shell >> >+ >> >+ # Query selftests supported on the devlink device >> >+ $ devlink dev selftests show DEV >> >+ # Query selftests supported on all devlink devices >> >+ $ devlink dev selftests show >> >+ # Executes selftests on the device >> >+ $ devlink dev selftests run DEV test flash >> >> "test_id" to be consistend with the attr name and outputs. Please see >What is "test_id" referring to in this document? Can you please elaborate ? "test_id" is consistent with the UAPI netlink attribute name, see below. > >> below. Devlink cmdline would accept "test" as well, so you can still use >Are you mentioning the "test" argument in the above devlink command line option? Yes, the cmd line accepts shortened option names. So for "test_id", it would accept: "test_i" "test_" and "test" I just wanted to say you, as a user, will be able to still use the shortened version, but the option name "test_id" would be consistent with UAPI, which is what we usually have.