From patchwork Wed Aug 3 09:10:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12935299 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 36DC9C19F28 for ; Wed, 3 Aug 2022 09:10:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235962AbiHCJKs (ORCPT ); Wed, 3 Aug 2022 05:10:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237017AbiHCJKn (ORCPT ); Wed, 3 Aug 2022 05:10:43 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CB25BCBC for ; Wed, 3 Aug 2022 02:10:42 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id o5-20020a17090a3d4500b001ef76490983so1415357pjf.2 for ; Wed, 03 Aug 2022 02:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc; bh=9hoGk/+IzAG/JJltiRR4bqFur6ZxahyJH7/Y+XxFNUk=; b=D8xJ4UVpo/nUivjZ89AQ5OJFIN/rhlsi3qMkPyplvmBsQi6N6chLPdmOWtuv4bnQpo D070s8b/tWnR2USDnywLoiFzvWin+sibZ1kILxiUrNX1URaY2J67fGs9i/dewYooLOVD g13iBGVsWdKMczHq/J9xBxqOV2EUUhTUQmQVk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=9hoGk/+IzAG/JJltiRR4bqFur6ZxahyJH7/Y+XxFNUk=; b=Fv2QM1x5hjnydo0E8BHjscA2at/qnUzfoyl7YY7awiUgIRMgvJCKTWfNJ8ch2bs7Ob Wx9+MXvYs0m6hQtv17lNGeS0lWsJu24Hs/uSovFWVHX51nSYNvJN+Vvoi1ROKCp8uuy6 LaEwhRx6Rz/xpk0LzQwD/HZk4F2E9RVJRtkeHo96RaQp6wDLDrw3RRZ6J6+o02foWT5L AI88Z5rR1BTwq+o7E3DPw6MGDE8nxxRQh3NOG+MdVdpzougBLS0RCGiS5rF6yZQK1N5d mnapXXDsVBVP20c4fDLTtJKfhPfzypio91yQtuzQ9eNK7q1B8G3uk42N6K4CrviSHDG8 HX+g== X-Gm-Message-State: ACgBeo0H9AOudykj5RTMuo90mSivl8JUs/9bfqJEBvKhspVrvnM8whpF 7lCOf+xun6yeQuw2BU6Lr0+R4A== X-Google-Smtp-Source: AA6agR5OMylQT/MfACfa2buCZH1svFfOyYbek+RFCIeRSmXyAWuMBK6Y0+0YzS7WchxgUIuB5w0Sew== X-Received: by 2002:a17:902:f652:b0:156:701b:9a2a with SMTP id m18-20020a170902f65200b00156701b9a2amr25172718plg.14.1659517841883; Wed, 03 Aug 2022 02:10:41 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id ik25-20020a170902ab1900b0016d6963cb12sm1315960plb.304.2022.08.03.02.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 02:10:40 -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 v5 1/2] devlink: update the devlink.h Date: Wed, 3 Aug 2022 14:40:24 +0530 Message-Id: <20220803091025.30800-2-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220803091025.30800-1-vikas.gupta@broadcom.com> References: <20220803091025.30800-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 --- include/uapi/linux/devlink.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index da0f1ba8..0224b8bd 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_GET, /* can dump */ + DEVLINK_CMD_SELFTESTS_RUN, + /* add new commands above here */ __DEVLINK_CMD_MAX, DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1 @@ -276,6 +279,30 @@ enum { #define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS \ (_BITUL(__DEVLINK_FLASH_OVERWRITE_MAX_BIT) - 1) +enum devlink_attr_selftest_id { + DEVLINK_ATTR_SELFTEST_ID_UNSPEC, + DEVLINK_ATTR_SELFTEST_ID_FLASH, /* flag */ + + __DEVLINK_ATTR_SELFTEST_ID_MAX, + DEVLINK_ATTR_SELFTEST_ID_MAX = __DEVLINK_ATTR_SELFTEST_ID_MAX - 1 +}; + +enum devlink_selftest_status { + DEVLINK_SELFTEST_STATUS_SKIP, + DEVLINK_SELFTEST_STATUS_PASS, + DEVLINK_SELFTEST_STATUS_FAIL +}; + +enum devlink_attr_selftest_result { + DEVLINK_ATTR_SELFTEST_RESULT_UNSPEC, + DEVLINK_ATTR_SELFTEST_RESULT, /* nested */ + DEVLINK_ATTR_SELFTEST_RESULT_ID, /* u32, enum devlink_attr_selftest_id */ + DEVLINK_ATTR_SELFTEST_RESULT_STATUS, /* u8, enum devlink_selftest_status */ + + __DEVLINK_ATTR_SELFTEST_RESULT_MAX, + DEVLINK_ATTR_SELFTEST_RESULT_MAX = __DEVLINK_ATTR_SELFTEST_RESULT_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 +603,10 @@ enum devlink_attr { DEVLINK_ATTR_LINECARD_TYPE, /* string */ DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES, /* nested */ + DEVLINK_ATTR_NESTED_DEVLINK, /* nested */ + + DEVLINK_ATTR_SELFTESTS, /* nested */ + /* add new attributes above here, update the policy in devlink.c */ __DEVLINK_ATTR_MAX,