summaryrefslogtreecommitdiff
path: root/drivers/net/hyperv
diff options
context:
space:
mode:
authorLong Li <longli@microsoft.com>2021-01-09 03:53:41 +0300
committerJakub Kicinski <kuba@kernel.org>2021-01-13 06:58:36 +0300
commit69d25a6cf4cadf756460a1bf82996ea240539999 (patch)
treed37804e3dbc37ce99357c9603f6eda423a97abef /drivers/net/hyperv
parent2c82b7fe219a4ee3024ce77334247d60194cc41d (diff)
downloadlinux-69d25a6cf4cadf756460a1bf82996ea240539999.tar.xz
hv_netvsc: Check VF datapath when sending traffic to VF
The driver needs to check if the datapath has been switched to VF before sending traffic to VF. Signed-off-by: Long Li <longli@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r--drivers/net/hyperv/netvsc_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index f32f28311d57..5dd4f37afa3d 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -539,7 +539,8 @@ static int netvsc_xmit(struct sk_buff *skb, struct net_device *net, bool xdp_tx)
*/
vf_netdev = rcu_dereference_bh(net_device_ctx->vf_netdev);
if (vf_netdev && netif_running(vf_netdev) &&
- netif_carrier_ok(vf_netdev) && !netpoll_tx_running(net))
+ netif_carrier_ok(vf_netdev) && !netpoll_tx_running(net) &&
+ net_device_ctx->data_path_is_vf)
return netvsc_vf_xmit(net, vf_netdev, skb);
/* We will atmost need two pages to describe the rndis