From patchwork Mon Jul 18 06:22:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12920752 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 410BAC433EF for ; Mon, 18 Jul 2022 06:23:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233264AbiGRGXA (ORCPT ); Mon, 18 Jul 2022 02:23:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233525AbiGRGWo (ORCPT ); Mon, 18 Jul 2022 02:22:44 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 038791659E for ; Sun, 17 Jul 2022 23:22:43 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id s206so9725702pgs.3 for ; Sun, 17 Jul 2022 23:22:42 -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=jBtXyXr96TcET7zUE+tovhpd3FI5pxUQs3fE3LZEqSc=; b=hv/wZ0d0BBri9mgNVRDsTSze+IFYxK15j1LRAVICLGJezkzyGplG6COQqOCnE0SI/U J2iuVOwMt48Po5TZ4MgaCwVyUpUD7hM1GiuiEUx+6G9WgHj8cwIvb1vfB9pAe2TfrUvd UVmtXsiCSBfmkCIVZVj57uQxmBDjOtRf1b39A= 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=jBtXyXr96TcET7zUE+tovhpd3FI5pxUQs3fE3LZEqSc=; b=eIBKR3KFJ5WsHmU86TnDIFRhbYkO+OWSEeDwZ3kmSU1oFx6sItg8gbOlc3FJtfaXty UDj6sxIKtC4fZaD7W7R/q9SGGg+LJiaCc3iFZZelq7uyPNzJsMBqxiw0IjKQ47Ecvbxg z6+9NLRw2i5+Pst23TX8pgks0dwFBJSzwDwthQlhaxcM0Pa1ArR9GWZ/CFobLlob7IGm vXLnfhU/0XTix98Xe7uaHaoj3USBTjA0gBlZCA06mmTzyrnSTFPGIsq74JVH0m/dxSn7 +aTe46cm7btB+bK8PWciW6J6dVIg5nUv0zzxaGg9c6DEe9054m925uiVEXBhcy1pj4lf hnWw== X-Gm-Message-State: AJIora8U4Uvpq0KyFnhsXg44/AdqdxBuETWsRZPJFTqtIlUsoDmCffBW pqhue6XQ93kPVSWAoeamGw2Jbw== X-Google-Smtp-Source: AGRyM1txH/K5zEViUy86nsZ2CGfi0EuSsP+EOup/ZON5kFkQgD4sCbunnzzWBIoAljNpMX9VCWc6EA== X-Received: by 2002:a05:6a00:1485:b0:52a:ca0b:5383 with SMTP id v5-20020a056a00148500b0052aca0b5383mr26917126pfu.0.1658125362160; Sun, 17 Jul 2022 23:22:42 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jul 2022 23:22:41 -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 1/3] devlink: update the devlink.h Date: Mon, 18 Jul 2022 11:52:27 +0530 Message-Id: <20220718062229.22531-2-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 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 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index da0f1ba8..efa8af0e 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_LIST, /* can dump */ + DEVLINK_CMD_SELFTESTS_RUN, + /* add new commands above here */ __DEVLINK_CMD_MAX, DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1 @@ -276,6 +279,31 @@ enum { #define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS \ (_BITUL(__DEVLINK_FLASH_OVERWRITE_MAX_BIT) - 1) +/* Commonly used test cases */ +enum devlink_selftest_attr { + DEVLINK_SELFTEST_ATTR_UNSPEC, + DEVLINK_SELFTEST_ATTR_FLASH, /* flag */ + + __DEVLINK_SELFTEST_ATTR_MAX, + DEVLINK_SELFTEST_ATTR_MAX = __DEVLINK_SELFTEST_ATTR_MAX - 1 +}; + +enum devlink_selftest_result { + DEVLINK_SELFTEST_SKIP, + DEVLINK_SELFTEST_PASS, + DEVLINK_SELFTEST_FAIL +}; + +enum devlink_selftest_result_attr { + DEVLINK_SELFTEST_ATTR_RESULT_UNSPEC, + DEVLINK_SELFTEST_ATTR_RESULT, /* nested */ + DEVLINK_SELFTEST_ATTR_TEST_ID, /* u32, devlink_selftest_attr */ + DEVLINK_SELFTEST_ATTR_TEST_STATUS, /* u8, devlink_selftest_result */ + + __DEVLINK_SELFTEST_ATTR_RES_MAX, + DEVLINK_SELFTEST_ATTR_RES_MAX = __DEVLINK_SELFTEST_ATTR_RES_MAX - 1 +}; + /** * enum devlink_trap_action - Packet trap action. * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not @@ -576,6 +604,7 @@ enum devlink_attr { DEVLINK_ATTR_LINECARD_TYPE, /* string */ DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES, /* nested */ + DEVLINK_ATTR_SELFTESTS_INFO, /* nested */ /* add new attributes above here, update the policy in devlink.c */ __DEVLINK_ATTR_MAX,