linux/drivers/net/ethernet/intel
Francesco Ruggeri 024a8168b7 igb: reinit_locked() should be called with rtnl_lock
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>
2020-07-30 10:05:14 -07:00
..
e1000 e1000: use generic power management 2020-06-16 15:38:11 -07:00
e1000e e1000e: continue to init PHY even when failed to disable ULP 2020-07-30 10:04:54 -07:00
fm10k net: fm10k: reject unsupported coalescing params 2020-03-12 11:32:36 -07:00
i40e i40e: fix crash when Rx descriptor count is changed 2020-06-18 22:37:25 -07:00
iavf iavf: increase reset complete wait time 2020-06-11 15:13:16 -07:00
ice ice: protect ring accesses with WRITE_ONCE 2020-06-18 22:35:34 -07:00
igb igb: reinit_locked() should be called with rtnl_lock 2020-07-30 10:05:14 -07:00
igbvf net: igbvf: reject unsupported coalescing params 2020-03-12 11:32:36 -07:00
igc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-06-03 16:27:18 -07:00
ixgb Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
ixgbe ixgbe: protect ring accesses with READ- and WRITE_ONCE 2020-06-18 22:30:04 -07:00
ixgbevf ixgbevf: Add XDP frame size to VF driver 2020-05-14 21:21:56 -07:00
e100.c netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile