• Sudheer Mogilappagari's avatar
    i40evf: prevent VF close returning before state transitions to DOWN · fe2647ab
    Sudheer Mogilappagari authored
    Currently i40evf_close() can return before state transitions to
    __I40EVF_DOWN because of the latency involved in processing and
    receiving response from PF driver and scheduling of VF watchdog_task.
    Due to this inconsistency an immediate call to i40evf_open() fails
    because state is still DOWN_PENDING.
    
    When a VF interface is in up state and we try to add it as slave,
    The bonding driver calls dev_close() and dev_open() in short duration
    resulting in dev_open returning error. The ifenslave command needs
    to be run again for dev_open to succeed.
    
    This fix ensures that watchdog timer is scheduled immediately after
    admin queue operations are scheduled in i40evf_down(). In addition a
    wait condition is added at the end of i40evf_close so that function
    wont return when state is still DOWN_PENDING. The timeout value is
    chosen after some profiling and includes some buffer.
    Signed-off-by: default avatarSudheer Mogilappagari <sudheer.mogilappagari@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    fe2647ab
i40evf_main.c 83.9 KB