Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp418608lqd; Wed, 24 Apr 2024 06:32:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXhzCixgEFHUBHGVLEFrI2ckbBIlYn+tqHLkX2NZ3zsuBvb/Lv46SZe4KjzZbtQLFIsclh96/dyN/ENDr7wHmcy+TqM9sajIM8GgLA/gQ== X-Google-Smtp-Source: AGHT+IHqrpSpBen8FgS277F91B1wVlVBQ9u2yKj8+dmqGMASP6pA01e9El5JLrNhDKjI0L1QxIlx X-Received: by 2002:a50:9b5b:0:b0:570:8d89:4c3f with SMTP id a27-20020a509b5b000000b005708d894c3fmr1888587edj.0.1713965528641; Wed, 24 Apr 2024 06:32:08 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t13-20020a056402524d00b0057223a2a172si1927447edd.253.2024.04.24.06.32.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 06:32:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=AHfLbocu; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-156960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156960-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BE1071F22F1F for ; Wed, 24 Apr 2024 13:32:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0F9A15B989; Wed, 24 Apr 2024 13:31:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="AHfLbocu" Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2057.outbound.protection.outlook.com [40.107.101.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4860615D5DA; Wed, 24 Apr 2024 13:31:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.57 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713965489; cv=fail; b=fo7/MR6n6eYunRB/oQR9/lourF97tCnwi2di5Ce7Zc0xl9T7iZaByd8rCxDDbopOT+6unOZlYqeKnG7+pRWDE1PA7QoAyIDYHXZqXHPNAT46F9Rat6sSuYLD3kM0WMytHOnB7xArH3ewir8xsBiuOQLY+HxAdYeHIc5dP0KQg2w= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713965489; c=relaxed/simple; bh=VDYzm7b0JlsIuT7PBMwYB7Nh6vyy8Ou0P+/P1T4a8vY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UBasCoW62pnCuKuGqEXgRr+UnQm+wt/5J0Gd28YUeBjVDTuMwST81xLfqU0LZIvtCqtL4vkbOfseWElyPh1610RGk5pVyVyQAZZ8/UUeh9iGPFK9J1q6rgGjqina8jlTXUtT0ouCmM7TsW9AOZS5+EJjZ5fopr3Z0JbShUa8Q/U= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=AHfLbocu; arc=fail smtp.client-ip=40.107.101.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RQqqkncT8ng+cFgJ6dfvU1ZRl3S9++XNC0La3v9wPnwGhq+BmwPY36NaOwCpgX7uxGFwB/wKD+PPsAA5jU0tk1YIBQ2l/gJvJagpJDmi7S1wqqUD3cc3dL6e1g+CeAkLwcc6lTRGJs4uDaUMZi+mpnMQ5W233l4y8QAAt89ezQ5cVqD57aLhSr9TTAdaWh/FObRtXx4j2pC/BZs8Os9gAyfGrhPYmWU35ZeC/7FQ4zkTTouMEz9IfcOzZnFgbN/rs5eMKKMb7n4qw7abMH21Rm201jpSKSYYxrNN6houJyJJzSKq6UsYegB0K7miH+GquvZ/GHpY5GVisyt5qq3zsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZGSg/tRMxJtbFdnyDCZtd3C0FFdHY5iIKto30/M+XdQ=; b=ezPRfjemiVt9VX/TJtPD/Vh4QpswyLy7pl5ZJdxO85zlzJFGOpTtY5d0n2d8K/ySW8DuXUfOakNNmwrnWY2VbVml1fwKNIXs9xBqLU6k14cIfSGe/PbFkMBh9uJTm1MPnTegu63ZCGtL1p0c9phXnxM8PAIXDOOq5vdMHUo5vMCGkIVTT2cuSDrdRwZI+qNUa004Vy50+bTdfh0AazOhOMQXC2NJdsBglvErdGA+vL6pRjYXWXL8xm6DWGn4TwRNpmpfhhsq+N/eWywN+ITSKFCUa1aO/H6IwdMY80+lqfktaDnUqKajEyakwQW2Hbt9bzkl6qRGv/RE8j9Fakm/wA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZGSg/tRMxJtbFdnyDCZtd3C0FFdHY5iIKto30/M+XdQ=; b=AHfLbocuykJZ6zCr0E5fYSqyJeWJFZxrBbeidrsY+M1yc3BzfrHIIXbu+W9FIPxE9aAV9sD3wnaJj5D6vU4MIfInekF+xgqpIPdYqJ+poa+OTFl8hI4KbiKwfSqkXr1FPI/ELx6pcZntQTr9BNyTcGMxTo9U7C/291WYM9EovArBT8+bGtJhw2cHAcr1FIW/7NZHfx1jN629nuO2avJT0Pcbar30FdAIJ0RSdraylLBsHt+YWOuV5s9pGxWsFcyyn3XT3/C+1MqpK0yxe3j4QIVY6WLxk/R8zQ2IoBXGmoufxL+8ZzYmDfO1dANvSuAeJjOjbSWPj0dYlA0gmy2tUw== Received: from DM6PR06CA0025.namprd06.prod.outlook.com (2603:10b6:5:120::38) by PH8PR12MB6722.namprd12.prod.outlook.com (2603:10b6:510:1cd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Wed, 24 Apr 2024 13:31:24 +0000 Received: from DS2PEPF00003441.namprd04.prod.outlook.com (2603:10b6:5:120:cafe::6a) by DM6PR06CA0025.outlook.office365.com (2603:10b6:5:120::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.34 via Frontend Transport; Wed, 24 Apr 2024 13:31:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS2PEPF00003441.mail.protection.outlook.com (10.167.17.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.19 via Frontend Transport; Wed, 24 Apr 2024 13:31:23 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 24 Apr 2024 06:30:59 -0700 Received: from dev-r-vrt-155.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 24 Apr 2024 06:30:53 -0700 From: Danielle Ratson To: CC: , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH net-next v5 03/10] ethtool: Add an interface for flashing transceiver modules' firmware Date: Wed, 24 Apr 2024 16:30:16 +0300 Message-ID: <20240424133023.4150624-4-danieller@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240424133023.4150624-1-danieller@nvidia.com> References: <20240424133023.4150624-1-danieller@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003441:EE_|PH8PR12MB6722:EE_ X-MS-Office365-Filtering-Correlation-Id: e3110b0d-8484-4289-a08e-08dc6462d605 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?iT/MPWEmSRaVF+8YF/GSLXoizXP+B8anfoFcExPRHV11PXUKGXB6bjiwUJAF?= =?us-ascii?Q?f9OIi9WKcalztgmY0FbMUKdiM9S9QKo8URjrIghOBWZtwTTDYYaVGu2fa6ly?= =?us-ascii?Q?NSZekOatiou+1Q1VeiNunknmzEzYAhU0vW1z4pQcoAPE3hGj/3KecMy4B7hp?= =?us-ascii?Q?ow6bwjzbF+5fKq5TTKn+fNkp2KEWszCEzIGpDbwVYeOn3Q8cn24O4NsC6yHs?= =?us-ascii?Q?qLjAlsYJ3LVCjnRV3AS7V1NQFGDWTFVSqLCtBHvour1vtIS8jj2P6aW9D3x4?= =?us-ascii?Q?g8o8PR0Yjbdv3U7LObSoKoXpiKQax3qySbGY2tg2JfqhVXT83TEEj7Vsmez9?= =?us-ascii?Q?RFgYGKB/eYERXIvJzm9ioDgpF47Ps8DmQ20KwgPi1W9KOix2OAr2unlrICyI?= =?us-ascii?Q?p5aPJEwFx13qLZovj5rn9ouLljW2NNKPQa1cZNIUPGDVXbfiQ281DZSNji/6?= =?us-ascii?Q?SN9Pfflb9bAURLQqAqhhfFI1sBhWRwjqmnPQ6wvUY+xw8mq6OxFVwvjSNeLw?= =?us-ascii?Q?Nz181LorsxPFXc6EMMU/qfZVuamunmcLuWDj9apx+EghiXm+uc4trLgAEQIC?= =?us-ascii?Q?VoRZWzfXBc1ok4SFcSATiMLQEWy/+2HFlQo6Wh8zYlXA8jER8PFlFdqL5wQd?= =?us-ascii?Q?Aa0w5NNkAm03pKvMktfrIc0o0y3ZqL04CYpIblfSh0liPJ5SK4DUp4anNahJ?= =?us-ascii?Q?7NnMlpoU8phN8SJ4pX5ud7l8o2mecHrdIcmqFx4x/lUjb/LrTLmMhKqEUUqT?= =?us-ascii?Q?BlBtS0lDd/BjnXdeGTQtbgx16jS0XTbZVN8FB62Ik/xlOQhEMqnpxPjN9cjT?= =?us-ascii?Q?SjPicu546DzNql0xkQ5TI4SPfSN5HKenE/WXc617kGDfuss+BlZmnq/tQfBq?= =?us-ascii?Q?DNPJNGKetd7NvtiQRJGSP+5N/o+Wz5FiC5HRN0PpG3LIvr5D7opLB7da5F69?= =?us-ascii?Q?jnXA/zPBs/gTqaQ4GfgfjKUEFvSue1CL5acafc6t953WFySlu70yQDOTFqTw?= =?us-ascii?Q?QSxn2d8BxAK+YRM67r6xWCm2zB/A4dJoNBeepF+GM5/xmHhIYA9etz5ZnuSC?= =?us-ascii?Q?FQ17dkpgpy2iqYrWZEIgNGF8gK0TsTFfyej6WL7GfGBT+OAAxPk2UaKja0Sv?= =?us-ascii?Q?2kOCBUB41oIt0ndPO2ATJOm/Q1kP1TS1cxqw8JLMLluiRZzpGG0x0a5WSLQw?= =?us-ascii?Q?q3nB76RQehzfloo87ntENGpQKORbEWSmYQUiSD20p6T8QRR11fUsHYNYveXm?= =?us-ascii?Q?m5dpMNajcoiRQS6BsN9dSyGhBjrQLxsCeGtnQEL4BoL/3qIEPXw7QkRuvsGJ?= =?us-ascii?Q?aaMg7EHx6jztWueFm8ZplaIbeb54b7Da/DY6xOUr6bmXEUnSLUWJLaRzAEog?= =?us-ascii?Q?CsW1gjg=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(82310400014)(36860700004)(1800799015)(7416005)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2024 13:31:23.8472 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3110b0d-8484-4289-a08e-08dc6462d605 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003441.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6722 CMIS compliant modules such as QSFP-DD might be running a firmware that can be updated in a vendor-neutral way by exchanging messages between the host and the module as described in section 7.3.1 of revision 5.2 of the CMIS standard. Add a pair of new ethtool messages that allow: * User space to trigger firmware update of transceiver modules * The kernel to notify user space about the progress of the process The user interface is designed to be asynchronous in order to avoid RTNL being held for too long and to allow several modules to be updated simultaneously. The interface is designed with CMIS compliant modules in mind, but kept generic enough to accommodate future use cases, if these arise. Signed-off-by: Danielle Ratson --- Notes: v5: * Modify tools/net/ynl/Makefile.deps so the ynl file will include the ethtool.h changes. * u64>uint for 'total' and 'done' attrs. * Translate the enum from ethtool_netlink.h to YAML. v4: * s/is composed from/consists of/. Documentation/netlink/specs/ethtool.yaml | 55 +++++++++++++++++ Documentation/networking/ethtool-netlink.rst | 62 ++++++++++++++++++++ include/uapi/linux/ethtool.h | 18 ++++++ include/uapi/linux/ethtool_netlink.h | 20 +++++++ tools/net/ynl/Makefile.deps | 3 +- 5 files changed, 157 insertions(+), 1 deletion(-) diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml index 00dc61358be8..43c5f21e6096 100644 --- a/Documentation/netlink/specs/ethtool.yaml +++ b/Documentation/netlink/specs/ethtool.yaml @@ -20,6 +20,10 @@ definitions: name: header-flags type: flags entries: [ compact-bitsets, omit-reply, stats ] + - + name: module-fw-flash-status + type: enum + entries: [ started, in_progress, completed, error ] attribute-sets: - @@ -975,6 +979,32 @@ attribute-sets: - name: burst-tmr type: u32 + - + name: module-fw-flash + attributes: + - + name: header + type: nest + nested-attributes: header + - + name: file-name + type: string + - + name: password + type: u32 + - + name: status + type: u32 + enum: module-fw-flash-status + - + name: status-msg + type: string + - + name: done + type: uint + - + name: total + type: uint operations: enum-model: directional @@ -1730,3 +1760,28 @@ operations: name: mm-ntf doc: Notification for change in MAC Merge configuration. notify: mm-get + - + name: module-fw-flash-act + doc: Flash transceiver module firmware. + + attribute-set: module-fw-flash + + do: + request: + attributes: + - header + - file-name + - password + - + name: module-fw-flash-ntf + doc: Notification for firmware flashing progress and status. + + attribute-set: module-fw-flash + + event: + attributes: + - header + - status + - status-msg + - done + - total diff --git a/Documentation/networking/ethtool-netlink.rst b/Documentation/networking/ethtool-netlink.rst index 8bc71f249448..14082b6a8f41 100644 --- a/Documentation/networking/ethtool-netlink.rst +++ b/Documentation/networking/ethtool-netlink.rst @@ -235,6 +235,7 @@ Userspace to kernel: ``ETHTOOL_MSG_PLCA_GET_STATUS`` get PLCA RS status ``ETHTOOL_MSG_MM_GET`` get MAC merge layer state ``ETHTOOL_MSG_MM_SET`` set MAC merge layer parameters + ``ETHTOOL_MSG_MODULE_FW_FLASH_ACT`` flash transceiver module firmware ===================================== ================================= Kernel to userspace: @@ -281,6 +282,7 @@ Kernel to userspace: ``ETHTOOL_MSG_PLCA_GET_STATUS_REPLY`` PLCA RS status ``ETHTOOL_MSG_PLCA_NTF`` PLCA RS parameters ``ETHTOOL_MSG_MM_GET_REPLY`` MAC merge layer status + ``ETHTOOL_MSG_MODULE_FW_FLASH_NTF`` transceiver module flash updates ======================================== ================================= ``GET`` requests are sent by userspace applications to retrieve device @@ -2040,6 +2042,65 @@ The attributes are propagated to the driver through the following structure: .. kernel-doc:: include/linux/ethtool.h :identifiers: ethtool_mm_cfg +MODULE_FW_FLASH_ACT +=================== + +Flashes transceiver module firmware. + +Request contents: + + ======================================= ====== =========================== + ``ETHTOOL_A_MODULE_FW_FLASH_HEADER`` nested request header + ``ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME`` string firmware image file name + ``ETHTOOL_A_MODULE_FW_FLASH_PASSWORD`` u32 transceiver module password + ======================================= ====== =========================== + +The firmware update process consists of three logical steps: + +1. Downloading a firmware image to the transceiver module and validating it. +2. Running the firmware image. +3. Committing the firmware image so that it is run upon reset. + +When flash command is given, those three steps are taken in that order. + +The ``ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME`` attribute encodes the firmware +image file name. The firmware image is downloaded to the transceiver module, +validated, run and committed. + +The optional ``ETHTOOL_A_MODULE_FW_FLASH_PASSWORD`` attribute encodes a password +that might be required as part of the transceiver module firmware update +process. + +The firmware update process can take several minutes to complete. Therefore, +during the update process notifications are emitted from the kernel to user +space updating it about the status and progress. + +Notification contents: + + +---------------------------------------------------+--------+----------------+ + | ``ETHTOOL_A_MODULE_FW_FLASH_HEADER`` | nested | reply header | + +---------------------------------------------------+--------+----------------+ + | ``ETHTOOL_A_MODULE_FW_FLASH_STATUS`` | u32 | status | + +---------------------------------------------------+--------+----------------+ + | ``ETHTOOL_A_MODULE_FW_FLASH_STATUS_MSG`` | string | status message | + +---------------------------------------------------+--------+----------------+ + | ``ETHTOOL_A_MODULE_FW_FLASH_DONE`` | uint | progress | + +---------------------------------------------------+--------+----------------+ + | ``ETHTOOL_A_MODULE_FW_FLASH_TOTAL`` | uint | total | + +---------------------------------------------------+--------+----------------+ + +The ``ETHTOOL_A_MODULE_FW_FLASH_STATUS`` attribute encodes the current status +of the firmware update process. Possible values are: + +.. kernel-doc:: include/uapi/linux/ethtool.h + :identifiers: ethtool_module_fw_flash_status + +The ``ETHTOOL_A_MODULE_FW_FLASH_STATUS_MSG`` attribute encodes a status message +string. + +The ``ETHTOOL_A_MODULE_FW_FLASH_DONE`` and ``ETHTOOL_A_MODULE_FW_FLASH_TOTAL`` +attributes encode the completed and total amount of work, respectively. + Request translation =================== @@ -2146,4 +2207,5 @@ are netlink only. n/a ``ETHTOOL_MSG_PLCA_GET_STATUS`` n/a ``ETHTOOL_MSG_MM_GET`` n/a ``ETHTOOL_MSG_MM_SET`` + n/a ``ETHTOOL_MSG_MODULE_FW_FLASH_ACT`` =================================== ===================================== diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index 041e09c3515d..ac98328f527d 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h @@ -877,6 +877,24 @@ enum ethtool_mm_verify_status { ETHTOOL_MM_VERIFY_STATUS_DISABLED, }; +/** + * enum ethtool_module_fw_flash_status - plug-in module firmware flashing status + * @ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED: The firmware flashing process has + * started. + * @ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS: The firmware flashing process + * is in progress. + * @ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED: The firmware flashing process was + * completed successfully. + * @ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR: The firmware flashing process was + * stopped due to an error. + */ +enum ethtool_module_fw_flash_status { + ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED = 1, + ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS, + ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED, + ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR, +}; + /** * struct ethtool_gstrings - string set for data tagging * @cmd: Command number = %ETHTOOL_GSTRINGS diff --git a/include/uapi/linux/ethtool_netlink.h b/include/uapi/linux/ethtool_netlink.h index f17dbe54bf5e..6fbd43d5a4ea 100644 --- a/include/uapi/linux/ethtool_netlink.h +++ b/include/uapi/linux/ethtool_netlink.h @@ -57,6 +57,7 @@ enum { ETHTOOL_MSG_PLCA_GET_STATUS, ETHTOOL_MSG_MM_GET, ETHTOOL_MSG_MM_SET, + ETHTOOL_MSG_MODULE_FW_FLASH_ACT, /* add new constants above here */ __ETHTOOL_MSG_USER_CNT, @@ -109,6 +110,7 @@ enum { ETHTOOL_MSG_PLCA_NTF, ETHTOOL_MSG_MM_GET_REPLY, ETHTOOL_MSG_MM_NTF, + ETHTOOL_MSG_MODULE_FW_FLASH_NTF, /* add new constants above here */ __ETHTOOL_MSG_KERNEL_CNT, @@ -997,6 +999,24 @@ enum { ETHTOOL_A_MM_MAX = (__ETHTOOL_A_MM_CNT - 1) }; +/* MODULE_FW_FLASH */ + +enum { + ETHTOOL_A_MODULE_FW_FLASH_UNSPEC, + ETHTOOL_A_MODULE_FW_FLASH_HEADER, /* nest - _A_HEADER_* */ + ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME, /* string */ + ETHTOOL_A_MODULE_FW_FLASH_PASSWORD, /* u32 */ + ETHTOOL_A_MODULE_FW_FLASH_PAD, + ETHTOOL_A_MODULE_FW_FLASH_STATUS, /* u32 */ + ETHTOOL_A_MODULE_FW_FLASH_STATUS_MSG, /* string */ + ETHTOOL_A_MODULE_FW_FLASH_DONE, /* uint */ + ETHTOOL_A_MODULE_FW_FLASH_TOTAL, /* uint */ + + /* add new constants above here */ + __ETHTOOL_A_MODULE_FW_FLASH_CNT, + ETHTOOL_A_MODULE_FW_FLASH_MAX = (__ETHTOOL_A_MODULE_FW_FLASH_CNT - 1) +}; + /* generic netlink info */ #define ETHTOOL_GENL_NAME "ethtool" #define ETHTOOL_GENL_VERSION 1 diff --git a/tools/net/ynl/Makefile.deps b/tools/net/ynl/Makefile.deps index f4e8eb79c1b8..dbdca32a1c61 100644 --- a/tools/net/ynl/Makefile.deps +++ b/tools/net/ynl/Makefile.deps @@ -16,7 +16,8 @@ get_hdr_inc=-D$(1) -include $(UAPI_PATH)/linux/$(2) CFLAGS_devlink:=$(call get_hdr_inc,_LINUX_DEVLINK_H_,devlink.h) CFLAGS_dpll:=$(call get_hdr_inc,_LINUX_DPLL_H,dpll.h) -CFLAGS_ethtool:=$(call get_hdr_inc,_LINUX_ETHTOOL_NETLINK_H_,ethtool_netlink.h) +CFLAGS_ethtool:=$(call get_hdr_inc,_LINUX_ETHTOOL_H,ethtool.h) \ + $(call get_hdr_inc,_LINUX_ETHTOOL_NETLINK_H_,ethtool_netlink.h) CFLAGS_handshake:=$(call get_hdr_inc,_LINUX_HANDSHAKE_H,handshake.h) CFLAGS_mptcp_pm:=$(call get_hdr_inc,_LINUX_MPTCP_PM_H,mptcp_pm.h) CFLAGS_netdev:=$(call get_hdr_inc,_LINUX_NETDEV_H,netdev.h) -- 2.43.0