From mboxrd@z Thu Jan 1 00:00:00 1970 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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 1A921C433DF for ; Wed, 27 May 2020 20:57:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E97AC2088E for ; Wed, 27 May 2020 20:57:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Pjv3Rn+0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728731AbgE0U5Y (ORCPT ); Wed, 27 May 2020 16:57:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726887AbgE0U5X (ORCPT ); Wed, 27 May 2020 16:57:23 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FC5AC05BD1E for ; Wed, 27 May 2020 13:57:23 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id z1so8374296qtn.2 for ; Wed, 27 May 2020 13:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Vb7HtBs/AWjeuby2BhCfCxuMEVlvnnUDFNR4Y4qQPJI=; b=Pjv3Rn+0oXbB+u917d6mptsgIdWn+b2B5bS2geWj5qXfKmjXaMmaIRwQhG1zhMzKox a2EWnz9F/OUrxbYILZWmmeD2LiUYM2+wGrFSIqwigK80yS72r5ME07bb7+QgOkkZ6Iu4 zca1VjnDl8T0zaxtNwgPy39RI5jh6rMCx5/Qw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Vb7HtBs/AWjeuby2BhCfCxuMEVlvnnUDFNR4Y4qQPJI=; b=nTm5NFSx3YsrKqvpt4N4ScTBEsupPiAntu1+0ssnq3AcsD+v+ynh4o+DaaoXahpPM0 Q/pcMmt/8D2jIFbtBk5nNXeDEIwW+idExV5wqU2ZLC/Tw/jIsXivQCL35to+p9Zv/Ea+ kfa+NCeIzur/QdA7o8ExBwVTDQE6rLl7xgjFc8VppIdeKMa42303hBc30m0zyTdDWcyY VZp1gLu18/3TsRM9N2j2/tRz6CLs67Ioh2ZojIIzAn1b54p9fBxFLTDwHNYvRcZ9pT8c VYSvtQidD+duIp3GWD9rR8+Wvryhjz5XaALvytvnMF2y0xEcFxyV7Eg/V0AqNAxHKQ0/ cIAg== X-Gm-Message-State: AOAM533ysikgqaAsK98e3zPuo1O9jc1UNhLUN1VwLKJL6m4f6PEvqEqI 1G9/SFEgaCKNafJzsVCRPoThfh2N8Jn2FIukWPhuyw== X-Google-Smtp-Source: ABdhPJz1nMbZwk39o7uIxT4zZ3PQFnQQVq6nFkXgtyJONcCREkr4FYiNha5i5NpDKePr3fFK6mmurJWTN6femjwUrek= X-Received: by 2002:aed:3fa4:: with SMTP id s33mr6479938qth.148.1590613042616; Wed, 27 May 2020 13:57:22 -0700 (PDT) MIME-Version: 1.0 References: <1590214105-10430-1-git-send-email-vasundhara-v.volam@broadcom.com> <1590214105-10430-2-git-send-email-vasundhara-v.volam@broadcom.com> <20200524045335.GA22938@nanopsycho> <20200525172602.GA14161@nanopsycho> <20200526044727.GB14161@nanopsycho> <20200526134032.GD14161@nanopsycho> <20200527131401.2e269ab8@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> In-Reply-To: <20200527131401.2e269ab8@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> From: Michael Chan Date: Wed, 27 May 2020 13:57:11 -0700 Message-ID: Subject: Re: [PATCH v2 net-next 1/4] devlink: Add new "allow_fw_live_reset" generic device parameter. To: Jakub Kicinski Cc: Vasundhara Volam , Jiri Pirko , David Miller , Netdev , Jiri Pirko Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, May 27, 2020 at 1:14 PM Jakub Kicinski wrote: > > On Wed, 27 May 2020 09:07:09 +0530 Vasundhara Volam wrote: > > Here is a sample sequence of commands to do a "live reset" to get some > > clear idea. > > Note that I am providing the examples based on the current patchset. > > > > 1. FW live reset is disabled in the device/adapter. Here adapter has 2 > > physical ports. > > > > $ devlink dev > > pci/0000:3b:00.0 > > pci/0000:3b:00.1 > > pci/0000:af:00.0 > > $ devlink dev param show pci/0000:3b:00.0 name allow_fw_live_reset > > pci/0000:3b:00.0: > > name allow_fw_live_reset type generic > > values: > > cmode runtime value false > > cmode permanent value false > > $ devlink dev param show pci/0000:3b:00.1 name allow_fw_live_reset > > pci/0000:3b:00.1: > > name allow_fw_live_reset type generic > > values: > > cmode runtime value false > > cmode permanent value false > > What's the permanent value? What if after reboot the driver is too old > to change this, is the reset still allowed? The permanent value should be the NVRAM value. If the NVRAM value is false, the feature is always and unconditionally disabled. If the permanent value is true, the feature will only be available when all loaded drivers indicate support for it and set the runtime value to true. If an old driver is loaded afterwards, it wouldn't indicate support for this feature and it wouldn't set the runtime value to true. So the feature will not be available until the old driver is unloaded or upgraded. > > > 2. If a user issues "ethtool --reset p1p1 all", the device cannot > > perform "live reset" as capability is not enabled. > > > > User needs to do a driver reload, for firmware to undergo reset. > > Why does driver reload have anything to do with resetting a potentially > MH device? I think she meant that all drivers have to be unloaded before the reset would take place in case it's a MH device since live reset is not supported. If it's a single function device, unloading this driver is sufficient. > > > $ ethtool --reset p1p1 all > > Reset probably needs to be done via devlink. In any case you need a new > reset level for resetting MH devices and smartnics, because the current > reset mask covers port local, and host local cases, not any form of MH. RIght. This reset could be just a single function reset in this example. > > > ETHTOOL_RESET 0xffffffff > > Components reset: 0xff0000 > > Components not reset: 0xff00ffff > > $ dmesg > > [ 198.745822] bnxt_en 0000:3b:00.0 p1p1: Firmware reset request successful. > > [ 198.745836] bnxt_en 0000:3b:00.0 p1p1: Reload driver to complete reset > > You said the reset was not performed, yet there is no information to > that effect in the log?! The firmware has been requested to reset, but the reset hasn't taken place yet because live reset cannot be done. We can make the logs more clear. > > > 3. Now enable the capability in the device and reboot for device to > > enable the capability. Firmware does not get reset just by setting the > > param to true. > > > > $ devlink dev param set pci/0000:3b:00.1 name allow_fw_live_reset > > value true cmode permanent > > > > 4. After reboot, values of param. > > Is the reboot required here? > In general, our new NVRAM permanent parameters will take effect after reset (or reboot). > > $ devlink dev param show pci/0000:3b:00.1 name allow_fw_live_reset > > pci/0000:3b:00.1: > > name allow_fw_live_reset type generic > > values: > > cmode runtime value true > > Why is runtime value true now? > If the permanent (NVRAM) parameter is true, all loaded new drivers will indicate support for this feature and set the runtime value to true by default. The runtime value would not be true if any loaded driver is too old or has set the runtime value to false.