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,