• Anatolii Gerasymenko's avatar
    ice: clear stale Tx queue settings before configuring · 6096dae9
    Anatolii Gerasymenko authored
    The iAVF driver uses 3 virtchnl op codes to communicate with the PF
    regarding the VF Tx queues:
    
    * VIRTCHNL_OP_CONFIG_VSI_QUEUES configures the hardware and firmware
    logic for the Tx queues
    
    * VIRTCHNL_OP_ENABLE_QUEUES configures the queue interrupts
    
    * VIRTCHNL_OP_DISABLE_QUEUES disables the queue interrupts and Tx rings.
    
    There is a bug in the iAVF driver due to the race condition between VF
    reset request and shutdown being executed in parallel. This leads to a
    break in logic and VIRTCHNL_OP_DISABLE_QUEUES is not being sent.
    
    If this occurs, the PF driver never cleans up the Tx queues. This results
    in leaving behind stale Tx queue settings in the hardware and firmware.
    
    The most obvious outcome is that upon the next
    VIRTCHNL_OP_CONFIG_VSI_QUEUES, the PF will fail to program the Tx
    scheduler node due to a lack of space.
    
    We need to protect ICE driver against such situation.
    
    To fix this, make sure we clear existing stale settings out when
    handling VIRTCHNL_OP_CONFIG_VSI_QUEUES. This ensures we remove the
    previous settings.
    
    Calling ice_vf_vsi_dis_single_txq should be safe as it will do nothing if
    the queue is not configured. The function already handles the case when the
    Tx queue is not currently configured and exits with a 0 return in that
    case.
    
    Fixes: 7ad15440 ("ice: Refactor VIRTCHNL_OP_CONFIG_VSI_QUEUES handling")
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: default avatarAnatolii Gerasymenko <anatolii.gerasymenko@intel.com>
    Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    6096dae9
ice_virtchnl.c 107 KB