mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
hv_netvsc: do not use VF device if link is down
[ Upstream commit7c9864bbcc
] If the accelerated networking SRIOV VF device has lost carrier use the synthetic network device which is available as backup path. This is a rare case since if VF link goes down, normally the VMBus device will also loose external connectivity as well. But if the communication is between two VM's on the same host the VMBus device will still work. Reported-by: "Shah, Ashish N" <ashish.n.shah@intel.com> Fixes:0c195567a8
("netvsc: transparent VF management") Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7105bb4007
commit
236a93cb8a
1 changed files with 4 additions and 3 deletions
|
@ -532,12 +532,13 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
|
||||||
u32 hash;
|
u32 hash;
|
||||||
struct hv_page_buffer pb[MAX_PAGE_BUFFER_COUNT];
|
struct hv_page_buffer pb[MAX_PAGE_BUFFER_COUNT];
|
||||||
|
|
||||||
/* if VF is present and up then redirect packets
|
/* If VF is present and up then redirect packets to it.
|
||||||
* already called with rcu_read_lock_bh
|
* Skip the VF if it is marked down or has no carrier.
|
||||||
|
* If netpoll is in uses, then VF can not be used either.
|
||||||
*/
|
*/
|
||||||
vf_netdev = rcu_dereference_bh(net_device_ctx->vf_netdev);
|
vf_netdev = rcu_dereference_bh(net_device_ctx->vf_netdev);
|
||||||
if (vf_netdev && netif_running(vf_netdev) &&
|
if (vf_netdev && netif_running(vf_netdev) &&
|
||||||
!netpoll_tx_running(net))
|
netif_carrier_ok(vf_netdev) && !netpoll_tx_running(net))
|
||||||
return netvsc_vf_xmit(net, vf_netdev, skb);
|
return netvsc_vf_xmit(net, vf_netdev, skb);
|
||||||
|
|
||||||
/* We will atmost need two pages to describe the rndis
|
/* We will atmost need two pages to describe the rndis
|
||||||
|
|
Loading…
Reference in a new issue