• Jacob Keller's avatar
    i40e: initialize our affinity_mask based on cpu_possible_mask · 759dc4a7
    Jacob Keller authored
    On older kernels a call to irq_set_affinity_hint does not guarantee that
    the IRQ affinity will be set. If nothing else on the system sets the IRQ
    affinity this can result in a bug in the i40e_napi_poll() routine where
    we notice that our interrupt fired on the "wrong" CPU according to our
    internal affinity_mask variable.
    
    This results in a bug where we continuously tell NAPI to stop polling to
    move the interrupt to a new CPU, but the CPU never changes because our
    affinity mask does not match the actual mask setup for the IRQ.
    
    The root problem is a mismatched affinity mask value. So lets initialize
    the value to cpu_possible_mask instead. This ensures that prior to the
    first time we get an IRQ affinity notification we'll have the mask set
    to include every possible CPU.
    
    We use cpu_possible_mask instead of cpu_online_mask since the former is
    almost certainly never going to change, while the later might change
    after we've made a copy.
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    759dc4a7
i40e_main.c 337 KB