Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC7D9C433E2 for ; Wed, 9 Sep 2020 22:29:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C1FA20C09 for ; Wed, 9 Sep 2020 22:29:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730092AbgIIW3m (ORCPT ); Wed, 9 Sep 2020 18:29:42 -0400 Received: from mga02.intel.com ([134.134.136.20]:32737 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730025AbgIIW3k (ORCPT ); Wed, 9 Sep 2020 18:29:40 -0400 IronPort-SDR: T3ZH5x2xHgp/7jfYwC8ZwaWb1/BNanGLH01SNmd1ArqC6E08P/F7v6pPMLvAGPCpgUwd0hN/rF es4QaqB5yPcw== X-IronPort-AV: E=McAfee;i="6000,8403,9739"; a="146141079" X-IronPort-AV: E=Sophos;i="5.76,410,1592895600"; d="scan'208";a="146141079" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 15:29:35 -0700 IronPort-SDR: GaS7iU+yjiMFP+J2U2EGy+TeYbi+EaNA5n5WBscJ1IpJiQmxxJlEr4vpBJY/jJQAfM0sTOSACp PasoInCVdM9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,410,1592895600"; d="scan'208";a="480641410" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.4]) by orsmga005.jf.intel.com with ESMTP; 09 Sep 2020 15:29:35 -0700 From: Jacob Keller To: netdev@vger.kernel.org Cc: Jacob Keller Subject: [iproute2-next v4 1/2] Update devlink header for overwrite mask attribute Date: Wed, 9 Sep 2020 15:28:41 -0700 Message-Id: <20200909222842.33952-2-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.28.0.218.ge27853923b9d.dirty In-Reply-To: <20200909222842.33952-1-jacob.e.keller@intel.com> References: <20200909222842.33952-1-jacob.e.keller@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Jacob Keller --- include/uapi/linux/devlink.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index b7f23faae901..dc267058600d 100644 --- a/include/uapi/linux/devlink.h +++ b/include/uapi/linux/devlink.h @@ -228,6 +228,28 @@ enum { DEVLINK_ATTR_STATS_MAX = __DEVLINK_ATTR_STATS_MAX - 1 }; +/* Specify what sections of a flash component can be overwritten when + * performing an update. Overwriting of firmware binary sections is always + * implicitly assumed to be allowed. + * + * Each section must be documented in + * Documentation/networking/devlink/devlink-flash.rst + * + */ +enum { + DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT, + DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT, + + __DEVLINK_FLASH_OVERWRITE_MAX_BIT, + DEVLINK_FLASH_OVERWRITE_MAX_BIT = __DEVLINK_FLASH_OVERWRITE_MAX_BIT - 1 +}; + +#define DEVLINK_FLASH_OVERWRITE_SETTINGS BIT(DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT) +#define DEVLINK_FLASH_OVERWRITE_IDENTIFIERS BIT(DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT) + +#define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS \ + (BIT(__DEVLINK_FLASH_OVERWRITE_MAX_BIT) - 1) + /** * enum devlink_trap_action - Packet trap action. * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not @@ -458,6 +480,11 @@ enum devlink_attr { DEVLINK_ATTR_PORT_LANES, /* u32 */ DEVLINK_ATTR_PORT_SPLITTABLE, /* u8 */ + DEVLINK_ATTR_PORT_EXTERNAL, /* u8 */ + DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, /* u32 */ + + DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK, /* bitfield32 */ + /* add new attributes above here, update the policy in devlink.c */ __DEVLINK_ATTR_MAX, -- 2.28.0.218.ge27853923b9d.dirty