• Vitaly Kuznetsov's avatar
    Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg() · d1f5156e
    Vitaly Kuznetsov authored
    commit c0bb0392 upstream.
    
    DoS protection conditions were altered in WS2016 and now it's easy to get
    -EAGAIN returned from vmbus_post_msg() (e.g. when we try changing MTU on a
    netvsc device in a loop). All vmbus_post_msg() callers don't retry the
    operation and we usually end up with a non-functional device or crash.
    
    While host's DoS protection conditions are unknown to me my tests show that
    it can take up to 10 seconds before the message is sent so doing udelay()
    is not an option, we really need to sleep. Almost all vmbus_post_msg()
    callers are ready to sleep but there is one special case:
    vmbus_initiate_unload() which can be called from interrupt/NMI context and
    we can't sleep there. I'm also not sure about the lonely
    vmbus_send_tl_connect_request() which has no in-tree users but its external
    users are most likely waiting for the host to reply so sleeping there is
    also appropriate.
    Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
    Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    [bwh: Backported to 3.16:
     - Drop changes in vmbus_send_tl_connect_request(),
       vmbus_initiate_unload()
     - Adjust context, indentation]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    d1f5156e
channel_mgmt.c 23.3 KB