diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2021-06-18 22:35:39 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-21 22:10:00 +0300 |
commit | 536ba2e06d1aaaed8a11c30e1609281cd955082e (patch) | |
tree | 0b1b88d2d9887c3f852e49968bbd4866fdb846be /drivers/net/hyperv | |
parent | 2b4cd14fd995e0a863b2ced4cba0bcd804d89ebc (diff) | |
download | linux-536ba2e06d1aaaed8a11c30e1609281cd955082e.tar.xz |
hv_netvsc: Set needed_headroom according to VF
Set needed_headroom according to VF if VF needs a bigger
headroom.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index f682a5572d84..382bebc2420d 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -2384,6 +2384,9 @@ static int netvsc_register_vf(struct net_device *vf_netdev) dev_hold(vf_netdev); rcu_assign_pointer(net_device_ctx->vf_netdev, vf_netdev); + if (ndev->needed_headroom < vf_netdev->needed_headroom) + ndev->needed_headroom = vf_netdev->needed_headroom; + vf_netdev->wanted_features = ndev->features; netdev_update_features(vf_netdev); @@ -2462,6 +2465,8 @@ static int netvsc_unregister_vf(struct net_device *vf_netdev) RCU_INIT_POINTER(net_device_ctx->vf_netdev, NULL); dev_put(vf_netdev); + ndev->needed_headroom = RNDIS_AND_PPI_SIZE; + return NOTIFY_OK; } |