[v3,4/7] net/netvsc: fix warning when VF is removed

Message ID 20200519165230.23306-5-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/netvsc: VF bug fix and diagnostic support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Stephen Hemminger May 19, 2020, 4:52 p.m. UTC
  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")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/netvsc/hn_vf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
index b7e3ba46bf63..a745c7c36ea3 100644
--- a/drivers/net/netvsc/hn_vf.c
+++ b/drivers/net/netvsc/hn_vf.c
@@ -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;
 	}
 }