net/netvsc: fix warning when VF is removed
authorStephen Hemminger <stephen@networkplumber.org>
Tue, 19 May 2020 16:52:27 +0000 (09:52 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 28 May 2020 15:57:07 +0000 (17:57 +0200)
The code to unset owner of VF device was changing port to invalid
value before calling unset.

Fixes: 4a9efcddaddd ("net/netvsc: fix VF support with secondary process")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/netvsc/hn_vf.c

index b7e3ba4..a745c7c 100644 (file)
@@ -120,11 +120,11 @@ static void hn_vf_remove(struct hn_data *hv)
                /* Stop incoming packets from arriving on VF */
                hn_nvs_set_datapath(hv, NVS_DATAPATH_SYNTHETIC);
 
-               /* Stop transmission over VF */
-               hv->vf_port = HN_INVALID_PORT;
-
                /* Give back ownership */
                rte_eth_dev_owner_unset(hv->vf_port, hv->owner.id);
+
+               /* Stop transmission over VF */
+               hv->vf_port = HN_INVALID_PORT;
        }
 }