Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp287145pxk; Wed, 2 Sep 2020 00:56:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkersUabTrJurq1kH4lXWo7ZWCN6cFlGRn/PfvoIefSiVx4+kMI6NM7DmsLEtMfhYEiu4F X-Received: by 2002:aa7:cdc4:: with SMTP id h4mr5195520edw.252.1599033394079; Wed, 02 Sep 2020 00:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599033394; cv=none; d=google.com; s=arc-20160816; b=Fyp4iztrsSHqo+7fb4kLLQZOxOihAD0bq/+J6o8k3Rs+FEt+zkkIHgrwKq6wycGcvu tOwTwIOFH1KlM/hF7A10ccMAniZR0049nqDW+jYJSZ0q/aUoSJXf6cIV0IJq4lQgOXT9 hwZ7TKM88CLgdYO9nLIgga38rC6TasIDxYE6We4Npo3ibZAFq53SBctc9wI/vBfD6OGv dOrjNiNh3NuATC/B5yqyx4c1mu7155pEkSypVKNehcTCMXLZpXiU/zxyVFSi2sM72Rzu nZ/NVFd6ExLgUhUwnxlb62tq3BFvU7EeucUbyLEvr4eBP9FyofctU2zo82JygTm5aMwM +crg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=faX/RRq17Z93RCYcR/iHAPench8MRWplt4raEZZtM1Q=; b=eNB6cxGmpbJecGbtiWkm5NWPupLe10DRMGMFeuDjquVEZjTPZkRuZs+CQ0csk/Zos5 QF0PG8OCUnYGguVN9/UfKAs2YvDV8pROUb32WSv3jodGom3BzmfAFPKC7UKkI6Jt8Nqx GlpzVXa8Plx/iryg0xYiRqd+vLjjZxHyJ3gFQaVzWIYh7+Wdi3ROKS/FnnJv3LLvpWoD nRnjDcHm3c2OIfrCTPDYGSUQHG3/q7LO3kT+j7hVLC6c56PfeeOfe0PzXgJnv3HW28Oe L6+7U9eFUr/sJC10xhk1qwKeegnplXQE/Tyid/Jo6vY1uheTMo7Z6rNPZO+iogE9XUC9 8I1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=QHmKlJmo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si2135458ejz.238.2020.09.02.00.56.11; Wed, 02 Sep 2020 00:56:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=QHmKlJmo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726669AbgIBHzg (ORCPT + 99 others); Wed, 2 Sep 2020 03:55:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbgIBHzf (ORCPT ); Wed, 2 Sep 2020 03:55:35 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84D38C061245 for ; Wed, 2 Sep 2020 00:55:35 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id g4so3665433wrs.5 for ; Wed, 02 Sep 2020 00:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=faX/RRq17Z93RCYcR/iHAPench8MRWplt4raEZZtM1Q=; b=QHmKlJmo13sJp2ks272+vwy3vsaPj0fmH5AbaLAfxlRRWwjC/auGHbilYIMIRYAjlQ nOrMknhFFq7pe5Bn2VRIWDAmyTAHURgrxl2adLYHw3RszdlIRHXjuiAhFJ4DkltDSzLB XUiuS7QRPClEdBae2uSmApbMbyfRYGy2JwLzHJZw6fIrt5VD5tIMbI+5LWpeN3PamGYt UAv514ThiiKg7oo+WI7yqK76DKxNP3pSAsHuZaUR5ZoRfIPKMurgkiTzQsoOpkwnYb/D VPm6D/Dw42ErRTB/8GMr26pOwLO2xITwK6M0Dc0ULGLliEOKY+8ODS2oDcPWp2/mk+rx hxxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=faX/RRq17Z93RCYcR/iHAPench8MRWplt4raEZZtM1Q=; b=aaohgq4+OaO6hFzp+Vq9PHcrvk1lOvhaq6aJcTWH4yPKDUaIvZb5VMK2MnInd7eF7h VtROpaOXYMU6Q4h90aSri5Py5KETXZqzITy+qjnXJ6WDweOBKeNvuDFFz9ItV5Oyf6S2 8wXlZBQFp3ZaM+XgU8as41JTbikm7BswGbqcDfs0GxvtThvODO3QVE2hFcIfLiMbMA7B l/I1bHdIrwVN2Ang2G4Pm+038AWZghP69JKL8v6b3kXm0GwPR8Se1oFusmMqfPk5eCo/ hubu3EcG7JSrjwuFFXTUg0h+63vLZIuse3d4BmC33/Nil/Qrt1HDeK4NKTPQps3NJ+Yx wzNA== X-Gm-Message-State: AOAM531TXI7zgQ3dGW2rUnThUpnzFhE4JuQpKEbbuJwwtA2IEf9hBa74 +u1Utcqy/hcZuC0WztgRuR8byQ== X-Received: by 2002:adf:e6cf:: with SMTP id y15mr5825642wrm.346.1599033330443; Wed, 02 Sep 2020 00:55:30 -0700 (PDT) Received: from localhost ([86.61.181.4]) by smtp.gmail.com with ESMTPSA id p22sm4984344wmc.38.2020.09.02.00.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 00:55:29 -0700 (PDT) Date: Wed, 2 Sep 2020 09:55:28 +0200 From: Jiri Pirko To: Moshe Shemesh Cc: Moshe Shemesh , "David S. Miller" , Jakub Kicinski , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next RFC v3 00/14] Add devlink reload action option Message-ID: <20200902075528.GG3794@nanopsycho.orion> References: <1598801254-27764-1-git-send-email-moshe@mellanox.com> <20200831104956.GC3794@nanopsycho.orion> <36e30108-26e3-44ae-e133-48d412f7efe6@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <36e30108-26e3-44ae-e133-48d412f7efe6@nvidia.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tue, Sep 01, 2020 at 09:16:17PM CEST, moshe@nvidia.com wrote: > >On 8/31/2020 1:49 PM, Jiri Pirko wrote: >> Sun, Aug 30, 2020 at 05:27:20PM CEST, moshe@mellanox.com wrote: >> > Introduce new option on devlink reload API to enable the user to select the >> > reload action required. Complete support for all actions in mlx5. >> > The following reload actions are supported: >> > driver_reinit: driver entities re-initialization, applying devlink-param >> > and devlink-resource values. >> > fw_activate: firmware activate. >> > fw_activate_no_reset: Activate new firmware image without any reset. >> > (also known as: firmware live patching). >> > >> > Each driver which support this command should expose the reload actions >> > supported. >> > The uAPI is backward compatible, if the reload action option is omitted >> >from the reload command, the driver reinit action will be used. >> > Note that when required to do firmware activation some drivers may need >> > to reload the driver. On the other hand some drivers may need to reset >> > the firmware to reinitialize the driver entities. Therefore, the devlink >> > reload command returns the actions which were actually done. >> > >> > Add reload actions counters to hold the history per reload action type. >> > For example, the number of times fw_activate has been done on this >> > device since the driver module was added or if the firmware activation >> > was done with or without reset. >> > >> > Patch 1 adds the new API reload action option to devlink. >> > Patch 2 adds reload actions counters. >> > Patch 3 exposes the reload actions counters on devlink dev get. >> > Patches 4-9 add support on mlx5 for devlink reload action fw_activate >> > and handle the firmware reset events. >> > Patches 10-11 add devlink enable remote dev reset parameter and use it >> > in mlx5. >> > Patches 12-13 mlx5 add devlink reload action fw_activate_no_reset support >> > and event handling. >> > Patch 14 adds documentation file devlink-reload.rst >> > >> > command examples: >> > $devlink dev reload pci/0000:82:00.0 action driver_reinit >> > reload_actions_done: >> > driver_reinit >> > >> > $devlink dev reload pci/0000:82:00.0 action fw_activate >> > reload_actions_done: >> > driver_reinit fw_activate >> > >> > $ devlink dev reload pci/0000:82:00.0 action fw_activate no_reset >> You are missing "_". > >?I meant that no_reset is an option here, so the uAPI is : > >$ devlink dev reload DEV [ netns { PID | NAME | ID } ] [ action { >driver_reinit | fw_activate [no_reset] } ] In the uapi enum, it's a different value. It is desirable to follow the uapi for things like this. I don't see why not. > >?Should have been as "--no_reset" or "-no_reset" but it seemed that all >options in devlink are global, not specific to command > >Do you see a better way, please advise if you want to do it this way, you need a separate netlink attr. But I don't think it is necessary. I provided suggestion in the other email. > >> >> > reload_actions_done: >> No need to have "reload" word here. And maybe "performed" would be >> better than "done". Idk: >> "actions_performed" >> ? > > >Yes, that's better, I will fix. > >> >> > fw_activate_no_reset >> > >> > v2 -> v3: >> > - Replace fw_live_patch action by fw_activate_no_reset >> > - Devlink reload returns the actions done over netlink reply >> > - Add reload actions counters >> > >> > v1 -> v2: >> > - Instead of reload levels driver,fw_reset,fw_live_patch have reload >> > actions driver_reinit,fw_activate,fw_live_patch >> > - Remove driver default level, the action driver_reinit is the default >> > action for all drivers >> > >> > Moshe Shemesh (14): >> > devlink: Add reload action option to devlink reload command >> > devlink: Add reload actions counters >> > devlink: Add reload actions counters to dev get >> > net/mlx5: Add functions to set/query MFRL register >> > net/mlx5: Set cap for pci sync for fw update event >> > net/mlx5: Handle sync reset request event >> > net/mlx5: Handle sync reset now event >> > net/mlx5: Handle sync reset abort event >> > net/mlx5: Add support for devlink reload action fw activate >> > devlink: Add enable_remote_dev_reset generic parameter >> > net/mlx5: Add devlink param enable_remote_dev_reset support >> > net/mlx5: Add support for fw live patch event >> > net/mlx5: Add support for devlink reload action fw activate no reset >> > devlink: Add Documentation/networking/devlink/devlink-reload.rst >> > >> > .../networking/devlink/devlink-params.rst | 6 + >> > .../networking/devlink/devlink-reload.rst | 68 +++ >> > Documentation/networking/devlink/index.rst | 1 + >> > drivers/net/ethernet/mellanox/mlx4/main.c | 14 +- >> > .../net/ethernet/mellanox/mlx5/core/Makefile | 2 +- >> > .../net/ethernet/mellanox/mlx5/core/devlink.c | 117 ++++- >> > .../mellanox/mlx5/core/diag/fw_tracer.c | 31 ++ >> > .../mellanox/mlx5/core/diag/fw_tracer.h | 1 + >> > .../ethernet/mellanox/mlx5/core/fw_reset.c | 453 ++++++++++++++++++ >> > .../ethernet/mellanox/mlx5/core/fw_reset.h | 19 + >> > .../net/ethernet/mellanox/mlx5/core/health.c | 35 +- >> > .../net/ethernet/mellanox/mlx5/core/main.c | 13 + >> > .../ethernet/mellanox/mlx5/core/mlx5_core.h | 2 + >> > drivers/net/ethernet/mellanox/mlxsw/core.c | 24 +- >> > drivers/net/netdevsim/dev.c | 16 +- >> > include/linux/mlx5/device.h | 1 + >> > include/linux/mlx5/driver.h | 4 + >> > include/net/devlink.h | 13 +- >> > include/uapi/linux/devlink.h | 24 + >> > net/core/devlink.c | 174 ++++++- >> > 20 files changed, 967 insertions(+), 51 deletions(-) >> > create mode 100644 Documentation/networking/devlink/devlink-reload.rst >> > create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c >> > create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/fw_reset.h >> > >> > -- >> > 2.17.1 >> >