1
0
Fork 0
alistair23-linux/drivers/net/ethernet/intel/igb
Francesco Ruggeri 5414f27048 igb: reinit_locked() should be called with rtnl_lock
[ Upstream commit 024a8168b7 ]

We observed two panics involving races with igb_reset_task.
The first panic is caused by this race condition:

	kworker			reboot -f

	igb_reset_task
	igb_reinit_locked
	igb_down
	napi_synchronize
				__igb_shutdown
				igb_clear_interrupt_scheme
				igb_free_q_vectors
				igb_free_q_vector
				adapter->q_vector[v_idx] = NULL;
	napi_disable
	Panics trying to access
	adapter->q_vector[v_idx].napi_state

The second panic (a divide error) is caused by this race:

kworker		reboot -f	tx packet

igb_reset_task
		__igb_shutdown
		rtnl_lock()
		...
		igb_clear_interrupt_scheme
		igb_free_q_vectors
		adapter->num_tx_queues = 0
		...
		rtnl_unlock()
rtnl_lock()
igb_reinit_locked
igb_down
igb_up
netif_tx_start_all_queues
				dev_hard_start_xmit
				igb_xmit_frame
				igb_tx_queue_mapping
				Panics on
				r_idx % adapter->num_tx_queues

This commit applies to igb_reset_task the same changes that
were applied to ixgbe in commit 2f90b8657e ("ixgbe: this patch
adds support for DCB to the kernel and ixgbe driver"),
commit 8f4c5c9fb8 ("ixgbe: reinit_locked() should be called with
rtnl_lock") and commit 88adce4ea8 ("ixgbe: fix possible race in
reset subtask").

Signed-off-by: Francesco Ruggeri <fruggeri@arista.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-11 15:33:38 +02:00
..
Makefile net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_82575.c igb: Fix SGMII SFP module discovery for 100FX/LX. 2020-02-05 21:22:45 +00:00
e1000_82575.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_defines.h igb: Fix WARN_ONCE on runtime suspend 2019-03-26 16:12:34 -07:00
e1000_hw.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_i210.c igb: fix uninitialized variables 2018-11-28 08:27:47 -08:00
e1000_i210.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_mac.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_mac.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_mbx.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_mbx.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_nvm.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_nvm.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_phy.c igb: e1000_phy: Mark expected switch fall-through 2018-08-07 17:54:20 -07:00
e1000_phy.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
e1000_regs.h igb: add RR2DCDELAY to ethtool registers dump 2019-06-28 16:00:06 -07:00
igb.h Revert "igb: reduce CPU0 latency when updating statistics" 2019-01-15 13:33:44 -08:00
igb_ethtool.c igb: Report speed and duplex as unknown when device is runtime suspended 2020-06-22 09:31:19 +02:00
igb_hwmon.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
igb_main.c igb: reinit_locked() should be called with rtnl_lock 2020-08-11 15:33:38 +02:00
igb_ptp.c igb: Reject requests that fail to enable time stamping on both edges. 2019-11-15 12:48:32 -08:00