Received: by 10.213.65.68 with SMTP id h4csp1773841imn; Mon, 19 Mar 2018 12:54:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELvsOdBhzSW9bt8rgDM1facfGcKmhBZj5UR5YJ8eaf+3WH50wwcZIf/hDuc9GWCtXOK3TTyj X-Received: by 10.99.171.72 with SMTP id k8mr10226906pgp.355.1521489272195; Mon, 19 Mar 2018 12:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521489272; cv=none; d=google.com; s=arc-20160816; b=wuuRbIA34GvcquBq2xIkzzlWSRdg5GU5buNbQl1Nhz4kecUg9jx8CjmjMrstXNS8if LTMVRoE3NoouFZ1l62wQbVMJJEBzPnANgk714zWlAqRPbDBUF3KVyGVLRIsOkvLsAgbT uj2mpeFG0PkvDA4ipwwytz39VMUUh4MBmQnRCU9RkZrdI4j478dGFbq6ufEMe/Vgg+YB d+OriUzFpbySzvoXIvq++7qCBqXu7sjkisGIvRft1VDAV7KQy0qEdCqhDlFLvGeErvu0 lWDns4+5BLZBzU2IdEHJrsS925C07mqIQ6nsSEB96dhuLsHuf9rPqwB8c63h0XwjPJnU s87A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=4EXc9atMa+Dcb5zJfDyldf2p2yyNlkwL/o2QQ0rhwGw=; b=nbQbbG+yiWNX4ctaOtDPF4OXciHtkO7p230wEaaD6QlWoRkOCvuwbxzx2Sya5l3aZh dIYpdJgrg/s1DbdMa+Lah0dWQQfSpBo7llpiB/BYBN1aF4LzlvJlrzWkJx4RJXW7UKdm EDry9+ZrZLACEQe50mFS1h3S9PMJtpoaQp7Z1lugklbAa1ebyrsTqmk0rvcWn7M+3QF9 swQDf0zNGhEmqV9NDi/X5xUnr8mKtUgBRPKWoK0QDc1EEZl981zOJtElAhjg767qB4dn Ki91td8Nvyx+fRc7IZLNyJQYJrNKGZL1s+09b23UEOr1S6g8oWhjz7ITDkNo+5dkt8Eb OUZg== ARC-Authentication-Results: i=1; mx.google.com; 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 i73si450367pgc.171.2018.03.19.12.53.47; Mon, 19 Mar 2018 12:54:32 -0700 (PDT) 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; 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 S970832AbeCSTuU (ORCPT + 99 others); Mon, 19 Mar 2018 15:50:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47434 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969488AbeCSSTz (ORCPT ); Mon, 19 Mar 2018 14:19:55 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 889501070; Mon, 19 Mar 2018 18:19:54 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yuval Mintz , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 046/241] qed: Always publish VF link from leading hwfn Date: Mon, 19 Mar 2018 19:05:11 +0100 Message-Id: <20180319180753.098855996@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Mintz, Yuval" [ Upstream commit e50728effe1126eae39445ba144078b1305b7047 ] The link information exists only on the leading hwfn, but some of its derivatives [e.g., min/max rate] need to be configured for each hwfn. When re-basing the VF link view, use the leading hwfn information as basis for all existing hwfns to allow said configurations to stick. Signed-off-by: Yuval Mintz Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/qlogic/qed/qed_sriov.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c +++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c @@ -3573,6 +3573,7 @@ static int qed_get_vf_config(struct qed_ void qed_inform_vf_link_state(struct qed_hwfn *hwfn) { + struct qed_hwfn *lead_hwfn = QED_LEADING_HWFN(hwfn->cdev); struct qed_mcp_link_capabilities caps; struct qed_mcp_link_params params; struct qed_mcp_link_state link; @@ -3589,9 +3590,15 @@ void qed_inform_vf_link_state(struct qed if (!vf_info) continue; - memcpy(¶ms, qed_mcp_get_link_params(hwfn), sizeof(params)); - memcpy(&link, qed_mcp_get_link_state(hwfn), sizeof(link)); - memcpy(&caps, qed_mcp_get_link_capabilities(hwfn), + /* Only hwfn0 is actually interested in the link speed. + * But since only it would receive an MFW indication of link, + * need to take configuration from it - otherwise things like + * rate limiting for hwfn1 VF would not work. + */ + memcpy(¶ms, qed_mcp_get_link_params(lead_hwfn), + sizeof(params)); + memcpy(&link, qed_mcp_get_link_state(lead_hwfn), sizeof(link)); + memcpy(&caps, qed_mcp_get_link_capabilities(lead_hwfn), sizeof(caps)); /* Modify link according to the VF's configured link state */