Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17926423ybl; Thu, 2 Jan 2020 14:58:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzar5izyx8gCz59+7NhSvCSFRBc11sMCeIOxBM9fZtmVd/TEK2OW0tVYZ/slFf85qzrxy35 X-Received: by 2002:a9d:2dca:: with SMTP id g68mr87353326otb.150.1578005905316; Thu, 02 Jan 2020 14:58:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005905; cv=none; d=google.com; s=arc-20160816; b=KuM3mdjakDr4m/9x5ut2DnTOgYqpE6KXLig2hg7pGpKRMV4hjG9ooUhybH7gXALADW 1nYQFM1M2UhiSP++NTZV9+i4CR7JGz+dpy1Wlvxachw3riNzIYfMCNVrvH3IxOwqn6Oh QEZ3+Fs/WSL7HjCy2D9DM4FdJPfWqMOQgt+QS1Xib3ODLUBw/XG9X2L4BI/TQZ9+vH2x yNtIbMHmGhDTPYfGS81WrPeLul9OBk7fqJxLmfvUDTABDXYWnWVDViJNxLVt7RHTLL4G mV7zv3DOJU0tTOxkXbzTT/6Ia+yQhAVUSZ1OJE6lOpfsBAcZUzmMIcQTclLfEqsrgm5Z t2Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7pdVh2NEMTt/hzkpe1DLIPbb0l/8L2km1mCyYLpGqC8=; b=xH7CfgprlkcqveRitygYzUR6LwQGmMWHoYWFl8hz7QMQIkk/LWukKLm32mf4wIweI5 j/DMNi0sNmH7cZXzTJ96vZORy+ouBS9m65PqbFr+8dwtTp6Ap+kMaINdL+OoX5oTXQYz Bv4fXRdhqj5T/C/FU8g1HXcL58BJURZ0lIIhkKw+K2PZh8u9RhSut3NlZq/B0cogvmuF EEu4xt3vDlfx+t7FUzYF6QstmMQqwaA8UsMqUb7g30lgMn95HaSXMEm6pbDyhvUCPiDX SytQln3wXry5hIl4Jlv2xbjWk1yCY3bZOP95DiHZ9rZ6sw5rBM4/sZbBEwl1hah4uQcc a9CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="P0ti6p/e"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f187si27669777oia.218.2020.01.02.14.58.14; Thu, 02 Jan 2020 14:58:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="P0ti6p/e"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728767AbgABW5E (ORCPT + 99 others); Thu, 2 Jan 2020 17:57:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:59924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726781AbgABWR2 (ORCPT ); Thu, 2 Jan 2020 17:17:28 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E83DD21582; Thu, 2 Jan 2020 22:17:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003447; bh=slQbVtF+GXopB5WGJzRj5aJidD4gfzmVZdsJhf0mx5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P0ti6p/eT353ZMm6/p4QRDSL5ksY2pJu0xeZjQSorK4DbLd9Jj+F6sNZpVkXhgEh+ Fzo+DOSLJLGdZTHrkPP0ZHSVDKvmEAWiVg87EF5L0qLU9i94Fds4LmUYAL044bdZyP OoanVHYYOzsSneupRos3yRFn/wt0/sV5gakHzwbM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasundhara Volam , Michael Chan , "David S. Miller" Subject: [PATCH 5.4 164/191] bnxt_en: Add missing devlink health reporters for VFs. Date: Thu, 2 Jan 2020 23:07:26 +0100 Message-Id: <20200102215846.940065716@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasundhara Volam [ Upstream commit 7e334fc8003c7a38372cc98e7be6082670a47d29 ] The VF driver also needs to create the health reporters since VFs are also involved in firmware reset and recovery. Modify bnxt_dl_register() and bnxt_dl_unregister() so that they can be called by the VFs to register/unregister devlink. Only the PF will register the devlink parameters. With devlink registered, we can now create the health reporters on the VFs. Fixes: 6763c779c2d8 ("bnxt_en: Add new FW devlink_health_reporter") Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 13 ++++-------- drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 23 ++++++++++++++++------ 2 files changed, 22 insertions(+), 14 deletions(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11343,12 +11343,11 @@ static void bnxt_remove_one(struct pci_d struct net_device *dev = pci_get_drvdata(pdev); struct bnxt *bp = netdev_priv(dev); - if (BNXT_PF(bp)) { + if (BNXT_PF(bp)) bnxt_sriov_disable(bp); - bnxt_dl_fw_reporters_destroy(bp, true); - bnxt_dl_unregister(bp); - } + bnxt_dl_fw_reporters_destroy(bp, true); + bnxt_dl_unregister(bp); pci_disable_pcie_error_reporting(pdev); unregister_netdev(dev); bnxt_shutdown_tc(bp); @@ -11844,10 +11843,8 @@ static int bnxt_init_one(struct pci_dev if (rc) goto init_err_cleanup_tc; - if (BNXT_PF(bp)) { - bnxt_dl_register(bp); - bnxt_dl_fw_reporters_create(bp); - } + bnxt_dl_register(bp); + bnxt_dl_fw_reporters_create(bp); netdev_info(dev, "%s found at mem %lx, node addr %pM\n", board_info[ent->driver_data].name, --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c @@ -226,6 +226,8 @@ static const struct devlink_ops bnxt_dl_ #endif /* CONFIG_BNXT_SRIOV */ }; +static const struct devlink_ops bnxt_vf_dl_ops; + enum bnxt_dl_param_id { BNXT_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX, BNXT_DEVLINK_PARAM_ID_GRE_VER_CHECK, @@ -439,7 +441,10 @@ int bnxt_dl_register(struct bnxt *bp) return -ENOTSUPP; } - dl = devlink_alloc(&bnxt_dl_ops, sizeof(struct bnxt_dl)); + if (BNXT_PF(bp)) + dl = devlink_alloc(&bnxt_dl_ops, sizeof(struct bnxt_dl)); + else + dl = devlink_alloc(&bnxt_vf_dl_ops, sizeof(struct bnxt_dl)); if (!dl) { netdev_warn(bp->dev, "devlink_alloc failed"); return -ENOMEM; @@ -458,6 +463,9 @@ int bnxt_dl_register(struct bnxt *bp) goto err_dl_free; } + if (!BNXT_PF(bp)) + return 0; + rc = devlink_params_register(dl, bnxt_dl_params, ARRAY_SIZE(bnxt_dl_params)); if (rc) { @@ -507,11 +515,14 @@ void bnxt_dl_unregister(struct bnxt *bp) if (!dl) return; - devlink_port_params_unregister(&bp->dl_port, bnxt_dl_port_params, - ARRAY_SIZE(bnxt_dl_port_params)); - devlink_port_unregister(&bp->dl_port); - devlink_params_unregister(dl, bnxt_dl_params, - ARRAY_SIZE(bnxt_dl_params)); + if (BNXT_PF(bp)) { + devlink_port_params_unregister(&bp->dl_port, + bnxt_dl_port_params, + ARRAY_SIZE(bnxt_dl_port_params)); + devlink_port_unregister(&bp->dl_port); + devlink_params_unregister(dl, bnxt_dl_params, + ARRAY_SIZE(bnxt_dl_params)); + } devlink_unregister(dl); devlink_free(dl); }