hv_netvsc: Mark VF as slave before exposing it to user-mode
authorLong Li <longli@microsoft.com>
Sun, 19 Nov 2023 16:23:43 +0000 (08:23 -0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 21 Nov 2023 12:15:02 +0000 (13:15 +0100)
commitc807d6cd089d2f4951baa838081ec5ae3e2360f8
treeef1f991dac34eba153dc1a69a19b64eb0ad735c1
parent85520856466ed6bc3b1ccb013cddac70ceb437db
hv_netvsc: Mark VF as slave before exposing it to user-mode

When a VF is being exposed form the kernel, it should be marked as "slave"
before exposing to the user-mode. The VF is not usable without netvsc
running as master. The user-mode should never see a VF without the "slave"
flag.

This commit moves the code of setting the slave flag to the time before
VF is exposed to user-mode.

Cc: stable@vger.kernel.org
Fixes: 0c195567a8f6 ("netvsc: transparent VF management")
Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/hyperv/netvsc_drv.c