OSDN Git Service

i40e: Remove scheduling while atomic possibility
authorAleksandr Loktionov <aleksandr.loktionov@intel.com>
Fri, 29 May 2020 21:10:39 +0000 (14:10 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 26 Jun 2020 05:37:03 +0000 (22:37 -0700)
commit37d318d7805f25b672bfd74fc694f19a2ee9665d
treeb6075b92125fff0bd8627b20161969af5f965da5
parent3dbdd6c2f70a2efbc28e197e58ccad08bfba7735
i40e: Remove scheduling while atomic possibility

In some occasions task held spinlock (mac_filter_hash_lock),
while being rescheduled due to admin queue mutex_lock.  The struct
i40e_spinlock asq_spinlock, which later expands to struct mutex
spinlock.  Moved i40e_aq_set_vsi_multicast_promiscuous(),
i40e_aq_set_vsi_unicast_promiscuous(),
i40e_aq_set_vsi_mc_promisc_on_vlan(), and
i40e_aq_set_vsi_uc_promisc_on_vlan() outside of atomic context.  Without
this patch there is a race condition, which might result in scheduling
while in atomic context.  The race condition is between the thread, which
holds mac_filter_hash_lock, while trying to acquire an admin queue mutex
and a thread, which already has said admin queue mutex. The thread, which
holds spinlock, fails to acquire the mutex, which causes this thread to
sleep.

Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c