From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCHv3 1/1] bnx2x: fix slowpath null crash Date: Tue, 14 Nov 2017 16:16:54 +0900 (KST) Message-ID: <20171114.161654.18613173584810547.davem@davemloft.net> References: <20171111.122837.1903716277019478303.davem@davemloft.net> <1510414923-26997-1-git-send-email-yanjun.zhu@oracle.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: ariel.elior@cavium.com, everest-linux-l2@cavium.com, netdev@vger.kernel.org To: yanjun.zhu@oracle.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:36468 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108AbdKNHQ6 (ORCPT ); Tue, 14 Nov 2017 02:16:58 -0500 In-Reply-To: <1510414923-26997-1-git-send-email-yanjun.zhu@oracle.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Zhu Yanjun Date: Sat, 11 Nov 2017 10:42:03 -0500 > 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 > CC: Junxiao Bi > Signed-off-by: Zhu Yanjun > Acked-by: Ariel Elior Applied.