Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2342653ybz; Thu, 23 Apr 2020 16:23:01 -0700 (PDT) X-Google-Smtp-Source: APiQypJHXI0z7uR4bnw2zzQAwSzc9quuM3WJhMCWVcU3hKsafZVwStsSf3EdEA/KeU4H4o8wxW6f X-Received: by 2002:a05:6402:16da:: with SMTP id r26mr4643202edx.375.1587684180891; Thu, 23 Apr 2020 16:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587684180; cv=none; d=google.com; s=arc-20160816; b=EvmOaQ2wn2Y1MPrat1uU7lLZTFJsHIqn76YyrE3Ohb8go93DzBBqrUvgPzHWMtibKa 7xgz6jrEUI1ej52K08cTBjqdS4KWLSPyLt1n57SjMnJCqHEKTgCWanF8YZsc07UKFPoB 2FsESBqkV8iPZQTXaDbxh/2NnSM9dh4sWann5e8P/jIvLY9oqE48P5hZ9BPjSv0jsVmX 4QffAxRkJJAMu3PdF5n6W7R0j4N6nNgjTLlcLsUqwOU4Gt3tcJxZglZLvhsCVClDBVyQ lDf4+e+kqd2MauHe/I4jmMrEXsNv5eeL2O0a6aBGMyLzEDvKhXApqNrBwmfDlEmb6yPj tQ3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=v2c7c1dG9N3WLjgtmnKsPN88QDFVWaWV8BNVc/XmnGc=; b=MLqlcNMPchTALDvsAv0dZytswNdAZ0cpgGIUaA9gG/7VYOeYBrwHxaYUPcYUyX0A41 G6vlJTGj7lfid8LZwxvimxad56faE0IF5qVdnz4aIXF+Lfth0Qf2zqKAwEtekOPvmZdv T5stlw4d22KRrTgo5kgFHfvn5sUURxL/fedH/rqPzCLdJSzDQ3SjB3LUo0hn/1uFRpIG n6TMCQwyiavFy2TQICHCqJx1EHVWP+o4RlakmbRkX1ACMm/51FsrizOK38pjKlUXr9XT +/HUeEWBF+XaN4UCOIaZWq9ZMBEP+UpObs7+FJqRxpyBZZWpgWJfn+Vc60eKgpf9f6Hh 8zNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z72si1996382ede.95.2020.04.23.16.22.37; Thu, 23 Apr 2020 16:23:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728828AbgDWXTE (ORCPT + 99 others); Thu, 23 Apr 2020 19:19:04 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:48822 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728243AbgDWXGg (ORCPT ); Thu, 23 Apr 2020 19:06:36 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRkvN-0004dP-L1; Fri, 24 Apr 2020 00:06:29 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvL-00E6l1-S9; Fri, 24 Apr 2020 00:06:27 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "David S. Miller" , "Xiao Jiangfeng" , "Mao Wenan" Date: Fri, 24 Apr 2020 00:05:05 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 078/245] af_packet: set defaule value for tmo In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.83-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Mao Wenan commit b43d1f9f7067c6759b1051e8ecb84e82cef569fe upstream. 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: Ben Hutchings --- 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 @@ -608,7 +608,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);