From patchwork Mon Jul 18 06:22:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12920754 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73FA9CCA479 for ; Mon, 18 Jul 2022 06:23:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233438AbiGRGXC (ORCPT ); Mon, 18 Jul 2022 02:23:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233543AbiGRGWu (ORCPT ); Mon, 18 Jul 2022 02:22:50 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F82B14033 for ; Sun, 17 Jul 2022 23:22:49 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id w185so9787865pfb.4 for ; Sun, 17 Jul 2022 23:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sKv5+qJYYfSNPcmAgCpCEvaiuKeGGPU+/yusCcKkBnk=; b=Lf04MskUpfltC/lgVMy7AkJWrgGTXC9po+A0SYq9lO1/oaSkLJD2JMKQeoAESWodxr lHyawQ5Iotwg5h3Qa4aR6np6A6AAT3iRuEYO/PGMJTWWt3nhGONow1/Rg4Nw6jY4rdfH WISskHC7HpLytk4OUlasVZz2WdYfWp3vH6J18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sKv5+qJYYfSNPcmAgCpCEvaiuKeGGPU+/yusCcKkBnk=; b=gdZY7e8t4GTbHGWqlBDxZ6DQnLC0OAIoaIrLqNP27cPbViuwbqA4e49wz09h+IjDsB yYYsL4Z9IpPjsNNCHnxxhEGqQu+gWMmGY4b3AzHrxwTaGkqRxDaH5tgZ/UFrEEwl2P0e EtTHGjMiZpkJtN2UzsOmfv87COXmSL1g47tcUG5/BRaZ3PejxCQvCuxw9g+nFXymfdeu Y/Jl1FKSg/oJ0A+67RH5DhmtxmMkiVXRy+Z6LpZZKQjIE9G6/1bB7O/7YmOO69ZpMXV0 6n2oeArPS9UrQ3Wa0rgLbrDISbJWGVBFYaZwUFmWVLv3Vs5ZAaJdgZDxn8P3XI1JtlL1 BcyQ== X-Gm-Message-State: AJIora+y7xwfhyj5BVUXOyZ9sDZ1uhML3grcxnfa+IpAtugY7tXBK4PN M2TOSJzCGxp/AhYALJMUj1iUag== X-Google-Smtp-Source: AGRyM1uZXRjORl3Zc3c3V7lg4B6mr5fpNEN0WqiyzsdSIOerFCOPHBQ/wdRTtZiXFoRg3BauXFxoAg== X-Received: by 2002:a63:cf17:0:b0:419:d02e:5825 with SMTP id j23-20020a63cf17000000b00419d02e5825mr15922112pgg.38.1658125368739; Sun, 17 Jul 2022 23:22:48 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id i8-20020a17090a058800b001f1a192476csm3844307pji.15.2022.07.17.23.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jul 2022 23:22:48 -0700 (PDT) From: Vikas Gupta To: jiri@nvidia.com, dsahern@kernel.org, stephen@networkplumber.org Cc: kuba@kernel.org, netdev@vger.kernel.org, edumazet@google.com, michael.chan@broadcom.com, andrew.gospodarek@broadcom.com, Vikas Gupta Subject: [PATCH iproute2-next v3 3/3] devlink : update man page and bash-completion for new commands Date: Mon, 18 Jul 2022 11:52:29 +0530 Message-Id: <20220718062229.22531-4-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220718062229.22531-1-vikas.gupta@broadcom.com> References: <20220707183116.29422-1-vikas.gupta@broadcom.com> <20220718062229.22531-1-vikas.gupta@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com Update the man page for newly added selftests commands. Examples: devlink dev selftests run pci/0000:03:00.0 test flash devlink dev selftests show pci/0000:03:00.0 Signed-off-by: Vikas Gupta Reviewed-by: Michael Chan Reviewed-by: Andy Gospodarek --- bash-completion/devlink | 21 +++++++++++++++++- man/man8/devlink-dev.8 | 47 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/bash-completion/devlink b/bash-completion/devlink index 361be9fe..d0d13fdf 100644 --- a/bash-completion/devlink +++ b/bash-completion/devlink @@ -262,6 +262,25 @@ _devlink_dev_flash() esac } +# Completion for devlink dev selftests +_devlink_dev_selftests() +{ + case "$cword" in + 3) + COMPREPLY=( $( compgen -W "show run" -- "$cur" ) ) + return + ;; + 4) + _devlink_direct_complete "dev" + return + ;; + 5) + COMPREPLY=( $( compgen -W "test" -- "$cur" ) ) + return + ;; + esac +} + # Completion for devlink dev _devlink_dev() { @@ -274,7 +293,7 @@ _devlink_dev() fi return ;; - eswitch|param) + eswitch|param|selftests) _devlink_dev_$command return ;; diff --git a/man/man8/devlink-dev.8 b/man/man8/devlink-dev.8 index 6906e509..71a1ef18 100644 --- a/man/man8/devlink-dev.8 +++ b/man/man8/devlink-dev.8 @@ -85,6 +85,20 @@ devlink-dev \- devlink device configuration .I ID ] +.ti -8 +.B devlink dev selftests show +[ +.I DEV +] + +.ti -8 +.B devlink dev selftests run +.I DEV +[ +.B test +.RI "{ " TESTNAME " }" +] + .SH "DESCRIPTION" .SS devlink dev show - display devlink device attributes @@ -249,6 +263,29 @@ should match the component names from .B "devlink dev info" and may be driver-dependent. +.SS devlink dev selftests show - shows supported selftests on devlink device. + +.PP +.I "DEV" +- specifies the devlink device. +If this argument is omitted selftests for all devlink devices are listed. + +.SS devlink dev selftests run - runs selftests on devlink device. + +.PP +.I "DEV" +- specifies the devlink device to execute selftests. + +.B test +{ +.RI { " TESTNAME " } +} +- The value of +.I TESTNAME +should match the test names from +.B "devlink dev selftests show". +to execute all the selftests on the devlink device. + .SH "EXAMPLES" .PP devlink dev show @@ -296,6 +333,16 @@ Flashing 100% .br Flashing done .RE +.PP +devlink dev selftests show pci/0000:01:00.0 +.RS 4 +Shows the supported selftests by the devlink device. +.RE +.PP +devlink dev selftests run pci/0000:01:00.0 test flash +.RS 4 +Perform a flash test on the devlink device. +.RE .SH SEE ALSO .BR devlink (8),