Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11812811pjo; Thu, 2 Jan 2020 14:43:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxkY3iIYWPCyRB1kPD52xcdSKTG/JPUHR0uUjS+uE8UviuXXwWCucTdu6ljG18+tpwq5zv5 X-Received: by 2002:a9d:7448:: with SMTP id p8mr79990214otk.96.1578005001821; Thu, 02 Jan 2020 14:43:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005001; cv=none; d=google.com; s=arc-20160816; b=RKYV7Yn0dCkzJ/Wr/9aWqo60VpPH6xdOPF3/K6WKcYPJkRvd74GVfRcg0Ixcwev/Nh UkPL+FU+iT07eMFzaMaMFMCQK3ntM+UERxZOBFCFwheUIg1NpHfLjx9vwavwyBMQmgc6 7VNPxxXMqj7BV1hGyNc7QRrwuWqcQWGZwH8qEUMDHQtoGDp1lhUOX5uhArMAQ8vgLCs6 XRAGvT4Cstk9hjtIWxjyLaL+eOACXvt8+E5GuLNaqj9D9GXlM1q+HQlQ/xtrxP9bDjDd 6ngX1Fse9u5Guq3oBaX0YnAtNBzic8GKAKYF+q62ZRS9ITvDM/NHvEgkuHW4FtQEzNvF wRKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pnstBb4V2CsZr+Vun8FgHSLYGfutQ24kBkFLR0BA/W8=; b=R4T6IADLibI1eRl4FO+BQTD/XacFIb4y5mk/Q4YwSlZS0WMdHjKc5iMXtBoYUJ+STL mi7fGp10+UZm0uel2Do8bVDNmfojYpyAQgpLtCCu8skyq1utl66vdMQvK059iJCi+WYR 8Zei520ySqTje0iMTCGJnjIOtbUGrvRg7UobIS2A+OmG3suYNNFWqKOfqaeXbKOL7rhZ c1G9SKrxlyudNEGOuYX5eCzxsI6wjUgl7Hss5pJZ6roYltXubef3J22TnibAL1qBSAhc mR0u1JjX4SoWgH+OQnw3T/3foBItMVJ4+KB82ucP5lA20XGalfiz24bztOtSPmwgfnvv Ni5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vf6zJkQx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t12si29514403otq.53.2020.01.02.14.43.10; Thu, 02 Jan 2020 14:43:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vf6zJkQx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730955AbgABWl4 (ORCPT + 99 others); Thu, 2 Jan 2020 17:41:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:48130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730970AbgABWgi (ORCPT ); Thu, 2 Jan 2020 17:36:38 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76EE420863; Thu, 2 Jan 2020 22:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004597; bh=EUAcYqe/UMjgqy0yCq9RGTDAipfMHNYo70dluzpGb9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vf6zJkQxBgUTv9i1mXcu8UZ4ym9KxolccCcIyHeSBf318xBOSWvwc549/YDJmRm9N 9lZmeyOrGL8+QUKgz6tfvbqiBghFlFwH/KtGMgpEpPzB3sIroxqoUy4ublAi9HzuPW 26xMbcu0FHm8IQ0Ltkz8henD0g8OzWNDkFFNrsVA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiao Jiangfeng , Mao Wenan , "David S. Miller" Subject: [PATCH 4.4 073/137] af_packet: set defaule value for tmo Date: Thu, 2 Jan 2020 23:07:26 +0100 Message-Id: <20200102220556.448693240@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.618583146@linuxfoundation.org> References: <20200102220546.618583146@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mao Wenan [ Upstream commit b43d1f9f7067c6759b1051e8ecb84e82cef569fe ] There is softlockup when using TPACKET_V3: ... NMI watchdog: BUG: soft lockup - CPU#2 stuck for 60010ms! (__irq_svc) from [] (_raw_spin_unlock_irqrestore+0x44/0x54) (_raw_spin_unlock_irqrestore) from [] (mod_timer+0x210/0x25c) (mod_timer) from [] (prb_retire_rx_blk_timer_expired+0x68/0x11c) (prb_retire_rx_blk_timer_expired) from [] (call_timer_fn+0x90/0x17c) (call_timer_fn) from [] (run_timer_softirq+0x2d4/0x2fc) (run_timer_softirq) from [] (__do_softirq+0x218/0x318) (__do_softirq) from [] (irq_exit+0x88/0xac) (irq_exit) from [] (msa_irq_exit+0x11c/0x1d4) (msa_irq_exit) from [] (handle_IPI+0x650/0x7f4) (handle_IPI) from [] (gic_handle_irq+0x108/0x118) (gic_handle_irq) from [] (__irq_usr+0x44/0x5c) ... If __ethtool_get_link_ksettings() is failed in prb_calc_retire_blk_tmo(), msec and tmo will be zero, so tov_in_jiffies is zero and the timer expire for retire_blk_timer is turn to mod_timer(&pkc->retire_blk_timer, jiffies + 0), which will trigger cpu usage of softirq is 100%. Fixes: f6fb8f100b80 ("af-packet: TPACKET_V3 flexible buffer implementation.") Tested-by: Xiao Jiangfeng Signed-off-by: Mao Wenan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/packet/af_packet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -587,7 +587,8 @@ static int prb_calc_retire_blk_tmo(struc msec = 1; div = speed / 1000; } - } + } else + return DEFAULT_PRB_RETIRE_TOV; mbits = (blk_size_in_bytes * 8) / (1024 * 1024);