From patchwork Fri Jul 29 10:18:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12932293 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 1704BC3F6B0 for ; Fri, 29 Jul 2022 10:18:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235853AbiG2KSm (ORCPT ); Fri, 29 Jul 2022 06:18:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235871AbiG2KSj (ORCPT ); Fri, 29 Jul 2022 06:18:39 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AC0E65670 for ; Fri, 29 Jul 2022 03:18:39 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id d65-20020a17090a6f4700b001f303a97b14so4841017pjk.1 for ; Fri, 29 Jul 2022 03:18:39 -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=8kxjWVlTMuvFWSh19Xr0J6Fz1hjehy/9JocLmDpApAo=; b=WvBi3eVyyVvTsSJj3o+9Rnmu85gEcLd4bN4miURt8oclzyb6Te0SwKQFOa/BGm2+fp EJrZ1KqMWOQka7HDavN5HieTrMXDcp4GukzP9doRnWV8W9luckB38fy17KjtGi/o9sw7 Mcz4tZd1vhYm2PD8hbL+qj7lFUi9jAqrgV780= 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=8kxjWVlTMuvFWSh19Xr0J6Fz1hjehy/9JocLmDpApAo=; b=INTV3VwEsK4SUxCRAYg2XfLD1ITvbNBl2yppGmwMqpFxuOiVWutQkFsab3kFry6ufz r08eneiV4WppIub+OXsVNc5z+B/8UyXu1cEJUtvg1HvrF+sFT9OOH630SvXMIMNw3sYv vaP4oHUs68z+9e52D6ozXsvkzKoYmA3ZayE3kVxzCWPCv+2M2cenDgE4ShokmPyKLTfQ f731xrUOQ5mEWoLZ0lSf8i7sTwKG81vJWkjn4cG/xWUCMK5Vcy/3LyMSrynEZ9Ovig4i icqHQqFn/6lekGiSIAUrt0k2OmH+hEbXHu6rdSpGF7yf0SSkokHL2HMwU3W+1x6eOUP9 2CxA== X-Gm-Message-State: ACgBeo0uKWakkLbyR7VkjxJPHnlGvCzqdnZts5NNDo9RETWukwcRbYiS 41UPhhTmjGiW4sRvay3TEzweDQ== X-Google-Smtp-Source: AA6agR4MHDcuX48yNXMRjWMM64OzRMIFT1swZfV5pvTA1Tbf+b16iqFSkDMTUIFzWMla5BzZYMZ7SA== X-Received: by 2002:a17:90b:681:b0:1f2:147a:5e55 with SMTP id m1-20020a17090b068100b001f2147a5e55mr3341510pjz.159.1659089918458; Fri, 29 Jul 2022 03:18:38 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id ik24-20020a170902ab1800b0016dc6243bb2sm3141727plb.143.2022.07.29.03.18.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jul 2022 03:18:37 -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 v4 1/3] devlink: update the devlink.h Date: Fri, 29 Jul 2022 15:48:19 +0530 Message-Id: <20220729101821.48180-2-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220729101821.48180-1-vikas.gupta@broadcom.com> References: <20220729101821.48180-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,