diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2017-06-21 16:40:47 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-22 13:30:37 -0400 |
commit | 53fa1a6f33520f01f9dbee48369074b34d77616b (patch) | |
tree | a5ac78cde6ec8aeb09cb3e92cbb886ccc39f42d8 /drivers/net/hyperv/netvsc.c | |
parent | dedb459e13f05824bc33d2d861e9b576bfc8d0bb (diff) |
hv_netvsc: Fix the carrier state error when data path is off
When the VF NIC is opened, the synthetic NIC's carrier state is set to
off. This tells the host to transitions data path to the VF device. But
if startup script or user manipulates the admin state of the netvsc
device directly for example:
# ifconfig eth0 down
# ifconfig eth0 up
Then the carrier state of the synthetic NIC would be on, even though the
data path was still over the VF NIC. This patch sets the carrier state
of synthetic NIC with consideration of the related VF state.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/netvsc.c')
-rw-r--r-- | drivers/net/hyperv/netvsc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 7c5ed8fe7a4f..0a9167dd72fb 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -57,6 +57,8 @@ void netvsc_switch_datapath(struct net_device *ndev, bool vf) sizeof(struct nvsp_message), (unsigned long)init_pkt, VM_PKT_DATA_INBAND, 0); + + net_device_ctx->datapath = vf; } static struct netvsc_device *alloc_net_device(void) |