linux/drivers/net/ethernet/broadcom/bnx2x
Zhu Yanjun 442866ff97 bnx2x: fix slowpath null crash
When "NETDEV WATCHDOG: em4 (bnx2x): transmit queue 2 timed out" occurs,
BNX2X_SP_RTNL_TX_TIMEOUT is set. In the function bnx2x_sp_rtnl_task,
bnx2x_nic_unload and bnx2x_nic_load are executed to shutdown and open
NIC. In the function bnx2x_nic_load, bnx2x_alloc_mem allocates dma
failure. The message "bnx2x: [bnx2x_alloc_mem:8399(em4)]Can't
allocate memory" pops out. The variable slowpath is set to NULL.
When shutdown the NIC, the function bnx2x_nic_unload is called. In
the function bnx2x_nic_unload, the following functions are executed.
bnx2x_chip_cleanup
    bnx2x_set_storm_rx_mode
        bnx2x_set_q_rx_mode
            bnx2x_set_q_rx_mode
                bnx2x_config_rx_mode
                    bnx2x_set_rx_mode_e2
In the function bnx2x_set_rx_mode_e2, the variable slowpath is operated.
Then the crash occurs.
To fix this crash, the variable slowpath is checked. And in the function
bnx2x_sp_rtnl_task, after dma memory allocation fails, another shutdown
and open NIC is executed.

CC: Joe Jin <joe.jin@oracle.com>
CC: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Acked-by: Ariel Elior <aelior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-14 16:16:32 +09:00
..
bnx2x_cmn.c net_sch: mqprio: Change TC_SETUP_MQPRIO to TC_SETUP_QDISC_MQPRIO 2017-11-08 12:23:38 +09:00
bnx2x_cmn.h net: sched: get rid of struct tc_to_netdev 2017-08-07 09:42:37 -07:00
bnx2x_dcb.c
bnx2x_dcb.h
bnx2x_dump.h
bnx2x_ethtool.c bnx2x: fix format overflow warning 2017-07-14 09:03:11 -07:00
bnx2x_fw_defs.h
bnx2x_fw_file_hdr.h
bnx2x_hsi.h
bnx2x_init_ops.h
bnx2x_init.h
bnx2x_link.c bnx2x: Get rid of useless temporary variable 2017-04-30 22:28:00 -04:00
bnx2x_link.h
bnx2x_main.c bnx2x: fix slowpath null crash 2017-11-14 16:16:32 +09:00
bnx2x_mfw_req.h
bnx2x_reg.h
bnx2x_sp.c treewide: spelling: correct diffrent[iate] and banlance typos 2017-05-08 17:15:13 -07:00
bnx2x_sp.h bnx2x: Don't flush multicast MACs 2016-08-24 09:45:20 -07:00
bnx2x_sriov.c bnx2x: Use pci_ari_enabled() instead of local copy 2017-10-06 10:06:06 -07:00
bnx2x_sriov.h bnx2x: Don't post statistics to malicious VFs 2017-06-10 16:02:55 -04:00
bnx2x_stats.c
bnx2x_stats.h
bnx2x_vfpf.c bnx2x: add missing configuration of VF VLAN filters 2017-03-07 13:47:15 -08:00
bnx2x_vfpf.h
bnx2x.h bnx2x: fix spelling mistake in macros HW_INTERRUT_ASSERT_SET_* 2017-04-04 10:04:49 -07:00
Makefile