From patchwork Thu Jul 7 18:31:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12910066 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 0CFA2C433EF for ; Thu, 7 Jul 2022 18:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236392AbiGGSeV (ORCPT ); Thu, 7 Jul 2022 14:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236291AbiGGSeA (ORCPT ); Thu, 7 Jul 2022 14:34:00 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B98B26D543 for ; Thu, 7 Jul 2022 11:31:37 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id a15so21046919pfv.13 for ; Thu, 07 Jul 2022 11:31:37 -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=eFQtU3zpmdv0JEoXVgXffjYkTrfQdtuuzXBm0P2WfxU=; b=PvHmZ/qVHuSzsDI5RrHo8ilhhQdLf+1x2RhyXl+bBvy7H5UUY4IsYBCz80nEkBWhPy kr3hu/EyNUFyVDTprJG9JYFV0u2kwn4K5ql7pWXcOY8Kquc5GM/deeQciUU8rLQm4lHd DRJbx8ngWf2gh6J5tnctcKuBjDjJjziZbvJ8U= 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=eFQtU3zpmdv0JEoXVgXffjYkTrfQdtuuzXBm0P2WfxU=; b=puRO1Y5kSJXjEtxmR544mLg4vSL+xZbj2+bGYaS42Kq/in3UpNdcBlFdnFnaU9JgxM baE6jF0UaoTCrNb676udbZxAR9UWDlRb9OObyqC9hoeFlH3J2NKG8xBlv573VAYo6g82 661JDGGX5T6U87uG0ads+tXHvf1nHl/0ad9TWxe+BovIuEqtE5029FjUsqL5r/cC5lDA qKok3cLq6y47GcS5LVe+14J8z8xOjlMBRmBczxHXMn+LjkRgNIEM5aM/dTWAvlPX9/k7 sAYjwlznLFfo0XmMkgVZH6Cha+NjmrM9PhHLMnkjEKmwdQS0Zct86AEkhPTsqvsOLqPT 8SoA== X-Gm-Message-State: AJIora/W2ewhvaw1Iuc+gNx07fS9ImyXGL2XlpDpTfT+NMhWiEbzbN4G t8cBBv2UUko42d59TEQT19hUjQ== X-Google-Smtp-Source: AGRyM1v0orYxFaH2oCnL6Ta7myHOsjs3k7w6s2PD+G7J+cPU7W3skrs8y/xLH06Ib1COvHVmipOq7g== X-Received: by 2002:a63:8ac2:0:b0:412:acff:1f4f with SMTP id y185-20020a638ac2000000b00412acff1f4fmr6418533pgd.489.1657218697178; Thu, 07 Jul 2022 11:31:37 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.252.250]) by smtp.gmail.com with ESMTPSA id u9-20020a170902e80900b0016a163d1cd5sm28631949plg.253.2022.07.07.11.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 11:31:36 -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 v2 1/3] devlink: update the devlink.h Date: Fri, 8 Jul 2022 00:01:14 +0530 Message-Id: <20220707183116.29422-2-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220707183116.29422-1-vikas.gupta@broadcom.com> References: <20220628164447.45202-1-vikas.gupta@broadcom.com> <20220707183116.29422-1-vikas.gupta@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com update the devlink.h to comaptible with net-next kernel. Signed-off-by: Vikas Gupta Reviewed-by: Michael Chan Reviewed-by: Andy Gospodarek --- include/uapi/linux/devlink.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index da0f1ba8..281aa1fa 100644 --- a/include/uapi/linux/devlink.h +++ b/include/uapi/linux/devlink.h @@ -136,6 +136,9 @@ enum devlink_command { DEVLINK_CMD_LINECARD_NEW, DEVLINK_CMD_LINECARD_DEL, + DEVLINK_CMD_SELFTESTS_SHOW, + DEVLINK_CMD_SELFTESTS_RUN, + /* add new commands above here */ __DEVLINK_CMD_MAX, DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1 @@ -276,6 +279,25 @@ enum { #define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS \ (_BITUL(__DEVLINK_FLASH_OVERWRITE_MAX_BIT) - 1) +/* Commonly used test cases */ +enum { + DEVLINK_SELFTEST_FLASH_BIT, + + __DEVLINK_SELFTEST_MAX_BIT, + DEVLINK_SELFTEST_MAX_BIT = __DEVLINK_SELFTEST_MAX_BIT - 1 +}; + +#define DEVLINK_SELFTEST_FLASH _BITUL(DEVLINK_SELFTEST_FLASH_BIT) + +#define DEVLINK_SELFTESTS_MASK \ + (_BITUL(__DEVLINK_SELFTEST_MAX_BIT) - 1) + +enum { + DEVLINK_SELFTEST_SKIP, + DEVLINK_SELFTEST_PASS, + DEVLINK_SELFTEST_FAIL +}; + /** * enum devlink_trap_action - Packet trap action. * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not @@ -576,6 +598,10 @@ enum devlink_attr { DEVLINK_ATTR_LINECARD_TYPE, /* string */ DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES, /* nested */ + DEVLINK_ATTR_SELFTESTS_MASK, /* u32 */ + DEVLINK_ATTR_TEST_RESULT, /* nested */ + DEVLINK_ATTR_TEST_NAME, /* string */ + DEVLINK_ATTR_TEST_RESULT_VAL, /* u8 */ /* add new attributes above here, update the policy in devlink.c */ __DEVLINK_ATTR_MAX, From patchwork Thu Jul 7 18:31:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12910067 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 50F20C43334 for ; Thu, 7 Jul 2022 18:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236291AbiGGSeW (ORCPT ); Thu, 7 Jul 2022 14:34:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236600AbiGGSeB (ORCPT ); Thu, 7 Jul 2022 14:34:01 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43FCC6D551 for ; Thu, 7 Jul 2022 11:31:41 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id e132so20034007pgc.5 for ; Thu, 07 Jul 2022 11:31:41 -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=NXZOJMGGaReWeJOQMoXBOFm0Qtet+axzZRGMJRrGFjM=; b=HVsfbORh8AhvlaaMqX8UwlF/upMQvLNVU6bP0ZEmtlNE+xnS4ZFpE5/KQbY/ER1Qex kqEyErWLqDnY7cTz+oUrWDCWjve1t7gEq25aLl4wpyCBTybTe2xhuZEqZ2+tCFgGPnNE fRmBfBCilJ51WT/ElvWZ702IZJ/u+lkzfSeag= 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=NXZOJMGGaReWeJOQMoXBOFm0Qtet+axzZRGMJRrGFjM=; b=ygRVaRjmSRxc4h00oL7XPaSTryzbYCqf2EO6GKHthhj9CsntWhHDa54C9mqXNyTqgp sr6XAihlojlX6Pvfp5BvDvjMGDngHav7iUpnZJT+USMWRzpSsKr//5VtM1JP7nfhpbel c0w2zvX2kiy9Cu+eWxc20h0fseakT7TCSPs/cfB7j84xMrRspsIpUH4HetORZaAqS0To xP2Jgswndk9n2lR2vcgJqLJRE/k6TX1PcoC2NfyVvzU/DmhqaGDhjkcc2/M8njZrFxxL q9fZW/bkR9KDNtZomwM6Jw6pMDKr8WfNsSQ9GOUMAO35SPBQ8HS35FK5DP7N4sXTUME9 DU6w== X-Gm-Message-State: AJIora9CoFMPT1r/ck37hd8BIi96tOyVlK532OTpn2rmBuEUAAwQc5/V pv6QwRS+E4t/uQSTExzOVmyPxw== X-Google-Smtp-Source: AGRyM1v0GzXHs6DAFTUnPiBR30N4M2VEuFwNngNtFQVC8tsUeULoHiKyeXjCwYCGH8/TcbXpzJZ7Tg== X-Received: by 2002:a17:903:2410:b0:16a:81d2:f5e8 with SMTP id e16-20020a170903241000b0016a81d2f5e8mr54045857plo.81.1657218700623; Thu, 07 Jul 2022 11:31:40 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.252.250]) by smtp.gmail.com with ESMTPSA id u9-20020a170902e80900b0016a163d1cd5sm28631949plg.253.2022.07.07.11.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 11:31:39 -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 v2 2/3] devlink: add support for running selftests Date: Fri, 8 Jul 2022 00:01:15 +0530 Message-Id: <20220707183116.29422-3-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220707183116.29422-1-vikas.gupta@broadcom.com> References: <20220628164447.45202-1-vikas.gupta@broadcom.com> <20220707183116.29422-1-vikas.gupta@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com Add command and helper APIs to run selfests. Also add a seltest for flash on the device. Examples: $ devlink dev selftests run pci/0000:03:00.0 test flash selftests results: flash failed $ devlink dev selftests show pci/0000:03:00.0 supported selftests: flash Signed-off-by: Vikas Gupta Reviewed-by: Michael Chan Reviewed-by: Andy Gospodarek --- devlink/devlink.c | 193 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) diff --git a/devlink/devlink.c b/devlink/devlink.c index ddf430bb..ebd33f9d 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -294,6 +294,7 @@ static void ifname_map_free(struct ifname_map *ifname_map) #define DL_OPT_PORT_FN_RATE_TX_MAX BIT(49) #define DL_OPT_PORT_FN_RATE_NODE_NAME BIT(50) #define DL_OPT_PORT_FN_RATE_PARENT BIT(51) +#define DL_OPT_SELFTESTS BIT(52) struct dl_opts { uint64_t present; /* flags of present items */ @@ -344,6 +345,7 @@ struct dl_opts { uint32_t overwrite_mask; enum devlink_reload_action reload_action; enum devlink_reload_limit reload_limit; + uint32_t selftests_mask; uint32_t port_controller; uint32_t port_sfnumber; uint16_t port_flavour; @@ -693,6 +695,7 @@ static const enum mnl_attr_data_type devlink_policy[DEVLINK_ATTR_MAX + 1] = { [DEVLINK_ATTR_TRAP_POLICER_ID] = MNL_TYPE_U32, [DEVLINK_ATTR_TRAP_POLICER_RATE] = MNL_TYPE_U64, [DEVLINK_ATTR_TRAP_POLICER_BURST] = MNL_TYPE_U64, + [DEVLINK_ATTR_TEST_RESULT] = MNL_TYPE_NESTED }; static const enum mnl_attr_data_type @@ -1401,6 +1404,19 @@ static struct str_num_map port_fn_opstate_map[] = { { .str = NULL, } }; +static int selftests_get(const char *testname, uint32_t *mask) +{ + if (strcmp(testname, "flash") == 0) { + *mask |= DEVLINK_SELFTEST_FLASH; + } else if (strcmp(testname, "all") == 0) { + *mask = DEVLINK_SELFTESTS_MASK; + } else { + pr_err("Unknown selftest \"%s\"\n", testname); + return -EINVAL; + } + return 0; +} + static int port_flavour_parse(const char *flavour, uint16_t *value) { int num; @@ -1490,6 +1506,7 @@ static const struct dl_args_metadata dl_args_required[] = { {DL_OPT_PORT_FUNCTION_HW_ADDR, "Port function's hardware address is expected."}, {DL_OPT_PORT_FLAVOUR, "Port flavour is expected."}, {DL_OPT_PORT_PFNUMBER, "Port PCI PF number is expected."}, + {DL_OPT_SELFTESTS, "Test name is expected"}, }; static int dl_args_finding_required_validate(uint64_t o_required, @@ -1793,6 +1810,20 @@ static int dl_argv_parse(struct dl *dl, uint64_t o_required, return err; o_found |= DL_OPT_FLASH_OVERWRITE; + } else if (dl_argv_match(dl, "test") && + (o_all & DL_OPT_SELFTESTS)) { + const char *testname; + + dl_arg_inc(dl); + err = dl_argv_str(dl, &testname); + if (err) + return err; + err = selftests_get(testname, + &opts->selftests_mask); + if (err) + return err; + o_found |= DL_OPT_SELFTESTS; + } else if (dl_argv_match(dl, "reporter") && (o_all & DL_OPT_HEALTH_REPORTER_NAME)) { dl_arg_inc(dl); @@ -2063,6 +2094,17 @@ dl_reload_limits_put(struct nlmsghdr *nlh, const struct dl_opts *opts) mnl_attr_put(nlh, DEVLINK_ATTR_RELOAD_LIMITS, sizeof(limits), &limits); } +static void +dl_selftests_put(struct nlmsghdr *nlh, const struct dl_opts *opts) +{ + uint32_t selftests_mask; + + selftests_mask = opts->selftests_mask; + + mnl_attr_put(nlh, DEVLINK_ATTR_SELFTESTS_MASK, + sizeof(selftests_mask), &selftests_mask); +} + static void dl_opts_put(struct nlmsghdr *nlh, struct dl *dl) { struct dl_opts *opts = &dl->opts; @@ -2157,6 +2199,8 @@ static void dl_opts_put(struct nlmsghdr *nlh, struct dl *dl) opts->flash_component); if (opts->present & DL_OPT_FLASH_OVERWRITE) dl_flash_update_overwrite_put(nlh, opts); + if (opts->present & DL_OPT_SELFTESTS) + dl_selftests_put(nlh, opts); if (opts->present & DL_OPT_HEALTH_REPORTER_NAME) mnl_attr_put_strz(nlh, DEVLINK_ATTR_HEALTH_REPORTER_NAME, opts->reporter_name); @@ -2285,6 +2329,8 @@ static void cmd_dev_help(void) pr_err(" [ action { driver_reinit | fw_activate } ] [ limit no_reset ]\n"); pr_err(" devlink dev info [ DEV ]\n"); pr_err(" devlink dev flash DEV file PATH [ component NAME ] [ overwrite SECTION ]\n"); + pr_err(" devlink dev selftests show DEV\n"); + pr_err(" devlink dev selftests run DEV test { TESTNAME | all }\n"); } static bool cmp_arr_last_handle(struct dl *dl, const char *bus_name, @@ -3904,6 +3950,150 @@ err_socket: return err; } +static int cmd_dev_selftests_show_tests(const struct nlmsghdr *nlh, void *data) +{ + struct nlattr *version; + struct dl *dl = data; + int avail = 0; + + mnl_attr_for_each(version, nlh, sizeof(struct genlmsghdr)) { + int type = mnl_attr_get_type(version); + + if (type == DEVLINK_ATTR_BUS_NAME || type == DEVLINK_ATTR_DEV_NAME) + continue; + + if (type != DEVLINK_ATTR_TEST_NAME) + return MNL_CB_ERROR; + + if (!avail) { + pr_out_object_start(dl, "supported selftests"); + avail = 1; + } + + check_indent_newline(dl); + print_string(PRINT_ANY, NULL, "%s", mnl_attr_get_str(version)); + if (!dl->json_output) + __pr_out_newline(); + } + + if (avail) + pr_out_object_end(dl); + + return MNL_CB_OK; +} + +static const char *selftest_result_to_str(uint8_t res) +{ + switch (res) { + case DEVLINK_SELFTEST_SKIP: + return "skipped"; + case DEVLINK_SELFTEST_PASS: + return "passed"; + case DEVLINK_SELFTEST_FAIL: + return "failed"; + default: + return "unknown"; + } +} + +static int cmd_dev_selftests_result_show(const struct nlmsghdr *nlh, void *data) +{ + struct nlattr *version; + struct dl *dl = data; + int avail = 0; + + mnl_attr_for_each(version, nlh, sizeof(struct genlmsghdr)) { + struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {}; + int type = mnl_attr_get_type(version); + const char *test_name; + const char *test_res; + uint8_t res_val; + int err; + + if (type == DEVLINK_ATTR_BUS_NAME || type == DEVLINK_ATTR_DEV_NAME) + continue; + + if (type != DEVLINK_ATTR_TEST_RESULT) + return MNL_CB_ERROR; + + err = mnl_attr_parse_nested(version, attr_cb, tb); + if (err != MNL_CB_OK) + return MNL_CB_ERROR; + + if (!tb[DEVLINK_ATTR_TEST_NAME] || + !tb[DEVLINK_ATTR_TEST_RESULT_VAL]) + return MNL_CB_ERROR; + + if (!avail) { + pr_out_object_start(dl, "selftests results"); + avail = 1; + } + + test_name = mnl_attr_get_str(tb[DEVLINK_ATTR_TEST_NAME]); + res_val = mnl_attr_get_u8(tb[DEVLINK_ATTR_TEST_RESULT_VAL]); + test_res = selftest_result_to_str(res_val); + + check_indent_newline(dl); + print_string_name_value(test_name, test_res); + if (!dl->json_output) + __pr_out_newline(); + } + + if (avail) + pr_out_object_end(dl); + + return MNL_CB_OK; +} + +static int cmd_dev_selftests_run(struct dl *dl) +{ + struct nlmsghdr *nlh; + uint16_t flags = NLM_F_REQUEST | NLM_F_ACK; + int err; + + nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_SELFTESTS_RUN, flags); + + err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE | DL_OPT_SELFTESTS, 0); + if (err) + return err; + + err = mnlu_gen_socket_sndrcv(&dl->nlg, nlh, cmd_dev_selftests_result_show, dl); + return err; +} + +static int cmd_dev_selftests_show(struct dl *dl) +{ + uint16_t flags = NLM_F_REQUEST | NLM_F_ACK; + struct nlmsghdr *nlh; + int err; + + nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_SELFTESTS_SHOW, flags); + + err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE, 0); + if (err) + return err; + + err = mnlu_gen_socket_sndrcv(&dl->nlg, nlh, cmd_dev_selftests_show_tests, dl); + return err; +} + +static int cmd_dev_selftests(struct dl *dl) +{ + if (dl_argv_match(dl, "help")) { + cmd_dev_help(); + return 0; + } else if (dl_argv_match(dl, "show") || + dl_argv_match(dl, "list") || dl_no_arg(dl)) { + dl_arg_inc(dl); + return cmd_dev_selftests_show(dl); + } else if (dl_argv_match(dl, "run")) { + dl_arg_inc(dl); + return cmd_dev_selftests_run(dl); + } + pr_err("Command \"%s\" not found\n", dl_argv(dl)); + return -ENOENT; +} + static int cmd_dev(struct dl *dl) { if (dl_argv_match(dl, "help")) { @@ -3928,6 +4118,9 @@ static int cmd_dev(struct dl *dl) } else if (dl_argv_match(dl, "flash")) { dl_arg_inc(dl); return cmd_dev_flash(dl); + } else if (dl_argv_match(dl, "selftests")) { + dl_arg_inc(dl); + return cmd_dev_selftests(dl); } pr_err("Command \"%s\" not found\n", dl_argv(dl)); return -ENOENT; From patchwork Thu Jul 7 18:31:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12910068 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 25052CCA481 for ; Thu, 7 Jul 2022 18:34:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236569AbiGGSeX (ORCPT ); Thu, 7 Jul 2022 14:34:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236602AbiGGSeB (ORCPT ); Thu, 7 Jul 2022 14:34:01 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A35BA6D554 for ; Thu, 7 Jul 2022 11:31:44 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d10so7296286pfd.9 for ; Thu, 07 Jul 2022 11:31:44 -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=bdWhUvZsEHMlEHRdhzlfauXiaooZJYX0hfg30tAVuic=; b=Z3F8Gh+6ICnSc22SZXo90kd+eQ7hNvV6dPJXRKYt7jLWkIZkaNFGCcVgRcYZzlnKpy 4AAX/wpMSuvGP05ts9k0j+yoyGt7EtnQT7Rbrau7kT8OOFE48mL72EgvZUaJLQ1q8FBC lrfRSnSo0lcR2a7c8qSjmcT3b+5/iZOZHdRoU= 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=bdWhUvZsEHMlEHRdhzlfauXiaooZJYX0hfg30tAVuic=; b=3gWYrHoqBbRwIqk2xx5LOmwIk01IitCKrTao+R4Uj2KI02jZIORO5dTMcgAuajmzkO 4NDO6GdF6UsUfayqTS2O7D3WaGJXKi7c33M2knr1gJ6vj5owu5onmDAQrrmxb5ui5tGQ SgEWvI/fmY+xsDO030cv/Pah78elng985soVi9jzVKpzXuK/l+FZMt386AUnW32eE0Bw Do0EHWQcX2gHKmAxiq7XEc1ccZ12Y6+sqQrWd3kELA7AdENM/DSSml0v+7UYroU0qjeG hq7ThCluoAEOWEwg15qRyoGigyXpk/snCKrDbbl1K0gthrvFBYx5q2zZlR1xW4NYPnag NdKg== X-Gm-Message-State: AJIora975Y+W4v5zfe9BM3bU3x9S9CqyUwZ1MeA01AiqA2jipUM4wq5c is/QCX6SxduvH0hbpykwEtJ/RA== X-Google-Smtp-Source: AGRyM1u9aO7Dv1f9iC+Nw2bulLwdZmrnaVnuopt32G17yY2G8dMRELtpNRsQk5gDYwSd+qP0YbfH8A== X-Received: by 2002:a17:90b:384f:b0:1ef:e95d:de66 with SMTP id nl15-20020a17090b384f00b001efe95dde66mr153917pjb.174.1657218704028; Thu, 07 Jul 2022 11:31:44 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.252.250]) by smtp.gmail.com with ESMTPSA id u9-20020a170902e80900b0016a163d1cd5sm28631949plg.253.2022.07.07.11.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 11:31:43 -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 v2 3/3] devlink : update man page for new commands Date: Fri, 8 Jul 2022 00:01:16 +0530 Message-Id: <20220707183116.29422-4-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220707183116.29422-1-vikas.gupta@broadcom.com> References: <20220628164447.45202-1-vikas.gupta@broadcom.com> <20220707183116.29422-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 --- man/man8/devlink-dev.8 | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/man/man8/devlink-dev.8 b/man/man8/devlink-dev.8 index 6906e509..057551a8 100644 --- a/man/man8/devlink-dev.8 +++ b/man/man8/devlink-dev.8 @@ -85,6 +85,16 @@ 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 +.I TESTNAME + .SH "DESCRIPTION" .SS devlink dev show - display devlink device attributes @@ -249,6 +259,32 @@ 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. + +.SS devlink dev selftests run - runs selftests on devlink device. + +.PP +.I "DEV" +- specifies the devlink device to execute selftests. + +.B test +{ +.BI " TESTNAME " +| +.B " all " +} +- The value of +.I TESTNAME +should match the test names from +.B "devlink dev selftests show". +OR Pass option +.B "all" +to execute all the selftests on the devlink device. + .SH "EXAMPLES" .PP devlink dev show @@ -296,6 +332,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),