Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1743437lqa; Mon, 29 Apr 2024 19:14:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXhMNycjprPZRVmD/AxYs9/SvBQKkvfGkrw2p4Ptm8s8C+vruH8wBnQTBPCGqvWKTqNsARC3BDlQROj1NUNsZ4LQ6Bsjham1hxa6r+P4Q== X-Google-Smtp-Source: AGHT+IESyivkwOit++iIc8154srmcsYCBLHJzhvE9mXG2HUsmCVDNRMaKZM66sEFQwwbKADQTOD1 X-Received: by 2002:a50:cd54:0:b0:56d:e6f6:f73c with SMTP id d20-20020a50cd54000000b0056de6f6f73cmr6516864edj.42.1714443292779; Mon, 29 Apr 2024 19:14:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714443292; cv=pass; d=google.com; s=arc-20160816; b=KCu+RHCukxQCWer0VVAUWvbutBJGsBoTnCo1P5T4lOXhVFg1OqVr7H/Mqn0rIzszLB WcTl6u5+MitEgHLiKW3O8ccAVJ6V0BbnkBc+ikLIHB0swQSuiGkA6UdMMZkayZv+SyTJ c8Td495W0xdYfo4bpxNU26wFSd8pHutMsirSuC7EPgK8VJhfVJVBrgQvEFtC6827g7OH /8GcC8QXBl7a5te7ua+Ehi1Usar5+Nb2Y34P8qEm3CvaJ8knkOy9cgEcVTt/FLXMkCYN zvXbaVQUrGChP95avNOWJQvCZCi93oTu4vLY3du/8Pzu0j+V2K5l7j12DBc0g4l8Hg1o Yx/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=KIP0RbPzpLRKj5ueXmoGbaL4pNIDho7AVoOBOGDIoQE=; fh=MUR88bFMIx3vFKp/j9Y9fWtpE04vvnu3U9YY6g14FHI=; b=rJg9LQLsYNRLCH1vPx2Vq6avoKjhmJ6DG9I5J45kXL0lmwBZhTer3Ik3Gf7cktphxp N8Fxm7bVrh7XccOTqy8rYqpbm9cAaM0vKwu8Tzql3qdx5RRDAEV0O9bfYHzKlyUVMpk/ o/teoAZMTbNOTkoRG+5J+XMV88Ec1NbtYyQmYd6tZdTdnd1CWbjNjGnI+wom1fVIs4Fp YkN85yKZzSSaw6OcGYir9ZwGAszKMdZb/jdss229IMKL08RoG4WzOR1dHPwln65Rd4Zn iTUKm7A19odNlG8w4akrobSQsje/MAo16SSSid/bm+LpiWoyuO5KAr7iOS6fpBdxTeTg qDiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ThGrP9rU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-163260-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163260-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z97-20020a509e6a000000b0057016a54665si14388642ede.171.2024.04.29.19.14.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 19:14:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163260-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=@kernel.org header.s=k20201202 header.b=ThGrP9rU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-163260-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163260-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 81D6D1F22C1B for ; Tue, 30 Apr 2024 02:14:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC75CC152; Tue, 30 Apr 2024 02:14:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ThGrP9rU" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F39A38BF0; Tue, 30 Apr 2024 02:14:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714443283; cv=none; b=qO7euT9+O7QEX3eptwfHzebYFfGB8ouJlzulwHMdLrMC1ETrg+Ax968XgW4OMhVWuCqdCLTAo7jjWNX9FjjrEQanfs1shdrtAgL0NqXSDIPt8jWwMd+wBbyg4gPkKuun3xiDOZ6mV/rQgTnyhl6o5oNnKjv1/1Mg4mP5D0Eq0ac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714443283; c=relaxed/simple; bh=FIilMgaRdUPaNn6QCuAfAl8l87+fZoiLcPoheYgRtVA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aee7LMsvYj6cNlKeeXBbWTQ6m1+H7Qq9vobE/rMxXJ0j76X2fXSOG5sDoGT40qF7oDrXlCwuc86nzhOm5WXI8g6B4GoXG/LKpgXVazfOuTDRQJ5fM/sqPTaslNzU0qC0/l7I0qHPnuy4zSn7oRenWXKeum/UbesV28trY6qAN4c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ThGrP9rU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A13E1C116B1; Tue, 30 Apr 2024 02:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714443282; bh=FIilMgaRdUPaNn6QCuAfAl8l87+fZoiLcPoheYgRtVA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ThGrP9rUlZFkmUR02Uk4y9M16GQIf03bOK47sqbPD2tFiN4nnUwl8Ig+nhkubj3I0 e2I6nKpZKkqv+dI6ksjBOZ4BHSy2RKfRTf0snQ03B7flnVFuDnSj3HRUfwJnMsJQ2A WGKXnVDPb7Y02XlQAjdjoMgXh5THdeOfsZHZXmrOAs6OXZs6YjEGU9bch8fb9MZmzC i46M5R+5PWVGKgBfrWBFz3Q6G4NBLsGkapZKQssx0BjMLaBJD0+OPHEwbNC7Ph3He7 mQuHuvmcB1ADxhEEbBrS14NKYHLgfk6K0rhqrPYWIvBnrdIEjoJateGOiaMU9EnV9c aaFhI7Q2ZVQgw== Date: Mon, 29 Apr 2024 19:14:40 -0700 From: Jakub Kicinski To: Danielle Ratson Cc: , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH net-next v5 03/10] ethtool: Add an interface for flashing transceiver modules' firmware Message-ID: <20240429191440.7b1182c3@kernel.org> In-Reply-To: <20240424133023.4150624-4-danieller@nvidia.com> References: <20240424133023.4150624-1-danieller@nvidia.com> <20240424133023.4150624-4-danieller@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 24 Apr 2024 16:30:16 +0300 Danielle Ratson wrote: > +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. We should spell out that the request only kicks off the process. devlink flashing blocks the netlink socket send() until it's completed, and the notifications have to be received on another socket. So someone who has devlink experience may expect the same behavior here. > +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 | > + +---------------------------------------------------+--------+----------------+ > +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, uint doesn't need pad, and pad is not specified in YAML, so the following attribute IDs will be all off by one in YNL. > + 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)