]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qed: Always publish VF link from leading hwfn
authorMintz, Yuval <Yuval.Mintz@cavium.com>
Sun, 19 Mar 2017 11:08:20 +0000 (13:08 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 26 Jul 2017 03:46:48 +0000 (20:46 -0700)
Orabug: 2593305326439680

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 <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/qlogic/qed/qed_sriov.c

index ffd4dd60a322cbd11d7eed75327c1a522f60c2ac..41434581829228f19ad55d565d790aa5e8385075 100644 (file)
@@ -3891,6 +3891,7 @@ static int qed_get_vf_config(struct qed_dev *cdev,
 
 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;
@@ -3907,9 +3908,15 @@ void qed_inform_vf_link_state(struct qed_hwfn *hwfn)
                if (!vf_info)
                        continue;
 
-               memcpy(&params, 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(&params, 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 */