hv_netvsc: Fix VF namespace also in synthetic NIC NETDEV_REGISTER event
authorHaiyang Zhang <haiyangz@microsoft.com>
Fri, 18 Oct 2024 18:25:22 +0000 (11:25 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 24 Oct 2024 10:43:20 +0000 (12:43 +0200)
commit4c262801ea60c518b5bebc22a09f5b78b3147da2
tree2001e200bf36a260b6b3083864ff60e4cad3356d
parentee76eb24343bdd5450eb87572865a4d7fffd335b
hv_netvsc: Fix VF namespace also in synthetic NIC NETDEV_REGISTER event

The existing code moves VF to the same namespace as the synthetic NIC
during netvsc_register_vf(). But, if the synthetic device is moved to a
new namespace after the VF registration, the VF won't be moved together.

To make the behavior more consistent, add a namespace check for synthetic
NIC's NETDEV_REGISTER event (generated during its move), and move the VF
if it is not in the same namespace.

Cc: stable@vger.kernel.org
Fixes: c0a41b887ce6 ("hv_netvsc: move VF to same namespace as netvsc device")
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/1729275922-17595-1-git-send-email-haiyangz@microsoft.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/hyperv/netvsc_drv.c