• Stephen Hemminger's avatar
    hv_netvsc: common detach logic · 7b2ee50c
    Stephen Hemminger authored
    Make common function for detaching internals of device
    during changes to MTU and RSS. Make sure no more packets
    are transmitted and all packets have been received before
    doing device teardown.
    
    Change the wait logic to be common and use usleep_range().
    
    Changes transmit enabling logic so that transmit queues are disabled
    during the period when lower device is being changed. And enabled
    only after sub channels are setup. This avoids issue where it could
    be that a packet was being sent while subchannel was not initialized.
    
    Fixes: 8195b139 ("hv_netvsc: fix deadlock on hotplug")
    Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7b2ee50c
netvsc.c 37.2 KB