• Jacob Keller's avatar
    fm10k: allow service task to reschedule itself · b4fd8ffc
    Jacob Keller authored
    If some code path executes fm10k_service_event_schedule(), it is
    guaranteed that we only queue the service task once, since we use
    __FM10K_SERVICE_SCHED flag. Unfortunately this has a side effect that if
    a service request occurs while we are currently running the watchdog, it
    is possible that we will fail to notice the request and ignore it until
    the next time the request occurs.
    
    This can cause problems with pf/vf mailbox communication and other
    service event tasks. To avoid this, introduce a FM10K_SERVICE_REQUEST
    bit. When we successfully schedule (and set the _SCHED bit) the service
    task, we will clear this bit. However, if we are unable to currently
    schedule the service event, we just set the new SERVICE_REQUEST bit.
    
    Finally, after the service event completes, we will re-schedule if the
    request bit has been set.
    
    This should ensure that we do not miss any service event schedules,
    since we will re-schedule it once the currently running task finishes.
    This means that for each request, we will always schedule the service
    task to run at least once in full after the request came in.
    
    This will avoid timing issues that can occur with the service event
    scheduling. We do pay a cost in re-running many tasks, but all the
    service event tasks use either flags to avoid duplicate work, or are
    tolerant of being run multiple times.
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: default avatarKrishneil Singh <krishneil.k.singh@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    b4fd8ffc
fm10k.h 15.8 KB