Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp159291rwr; Wed, 19 Apr 2023 05:01:24 -0700 (PDT) X-Google-Smtp-Source: AKy350aBO8gn5F7DnnXFJeqKIvTgukTd7BxTv4YEPSER8KTSFDBm75KSLNkXPUGsBZxISXRjOHcW X-Received: by 2002:a05:6a20:12d2:b0:c6:c0c1:b1fe with SMTP id v18-20020a056a2012d200b000c6c0c1b1femr3604337pzg.57.1681905684602; Wed, 19 Apr 2023 05:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681905684; cv=none; d=google.com; s=arc-20160816; b=UCmdFThmZP3GbgKejiaQQqyxAcqpgQ/WVAHmREaL7Tb77res9C0GNrAmbB16MsPxDO +jBCW3Bz4B2XXruGSOkcGNuYJo2W0rmkmxi3tXTr5BTUxrUAXJx+QX49Gq3fGzIpx3BB m+ToI1HfzJNGXik3fO3vTZzHG/Z8qw/mNQJKK2Zf3hBpM8uqCE67OpMkZPYTZDsEEGAH aZR/w+RSPQuJvF0hXXlhxa5Fx1U7pYDPEBk6StgnOsQUwiUqRuOQ9krr5YJtadlmVO5z Ypom9LI92EZUSx2svISkLFkI/pCK5Ki/NLHVJwqDF61vy8l8rU5DqB2M3T1OKzw2jK4J cANg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kQMy059N3s1atSzVKA/d/rtaeGTHOWIXN8OS6g3STNA=; b=n/s8pmY4dsBQyIpuc5/qu72b2/uPOt0iBqOUugalh6Bqyu5vq00w3FYHBlp4LXVBuI GVDwVUgDtJqvkRc2IqjIfkMNwpAKoT+k+X/ebd/YwlB65vVWi1dv7A8poVMDftUJslxd 8SRokFVqdga96EsPKRlmRjTouupGixt68OnA3cfi8j3sJsyO766R3gcwalWV9I3kk391 1tQc/ZlU5YMCt+e1in9ZUvY0T+tLtRk557+1rueSuEhFCue9k8ZUTQ9PhZ7mw2zzl1C7 Xeo6LBLFSDlNkv/3OrWuEG+VbjZFSPdyR/kZwWmP8in2VkOPlMX915qWtkKZQC2GGuc/ yNaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=UYRfGj+K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a63530b000000b004fbf520c66csi16927673pgb.254.2023.04.19.05.01.06; Wed, 19 Apr 2023 05:01:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=UYRfGj+K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231524AbjDSL6Y (ORCPT + 99 others); Wed, 19 Apr 2023 07:58:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231480AbjDSL6X (ORCPT ); Wed, 19 Apr 2023 07:58:23 -0400 Received: from out-18.mta1.migadu.com (out-18.mta1.migadu.com [95.215.58.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4B9215617 for ; Wed, 19 Apr 2023 04:57:57 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1681905407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kQMy059N3s1atSzVKA/d/rtaeGTHOWIXN8OS6g3STNA=; b=UYRfGj+Kl9pg6QfmfJnJT4KL/GQlRMQ1iLAOp+nSoqOMtXivQlQQT/C9Q1ML96IqrnUvF0 zbzkEFTD56/czGh+hZA9aSs8CcCfxuPyvxDqrbkLE2plOVjt8QZlogFa/Ea5lnGApN5mED w9ZKeZl/x5VwOCsi4nZsHcAMli34bzY= From: Yajun Deng To: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH] net: sched: print jiffies when transmit queue time out Date: Wed, 19 Apr 2023 19:56:32 +0800 Message-Id: <20230419115632.738730-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Although there is watchdog_timeo to let users know when the transmit queue begin stall, but dev_watchdog() is called with an interval. The jiffies will always be greater than watchdog_timeo. To let users know the exact time the stall started, print jiffies when the transmit queue time out. Signed-off-by: Yajun Deng --- net/sched/sch_generic.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index a9aadc4e6858..67b78e260d28 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -502,7 +502,7 @@ static void dev_watchdog(struct timer_list *t) if (netif_device_present(dev) && netif_running(dev) && netif_carrier_ok(dev)) { - int some_queue_timedout = 0; + unsigned long some_queue_timedout = 0; unsigned int i; unsigned long trans_start; @@ -514,7 +514,7 @@ static void dev_watchdog(struct timer_list *t) if (netif_xmit_stopped(txq) && time_after(jiffies, (trans_start + dev->watchdog_timeo))) { - some_queue_timedout = 1; + some_queue_timedout = jiffies - trans_start; atomic_long_inc(&txq->trans_timeout); break; } @@ -522,8 +522,9 @@ static void dev_watchdog(struct timer_list *t) if (unlikely(some_queue_timedout)) { trace_net_dev_xmit_timeout(dev, i); - WARN_ONCE(1, KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit queue %u timed out\n", - dev->name, netdev_drivername(dev), i); + WARN_ONCE(1, KERN_INFO "NETDEV WATCHDOG: %s (%s): \ + transmit queue %u timed out %lu jiffies\n", + dev->name, netdev_drivername(dev), i, some_queue_timedout); netif_freeze_queues(dev); dev->netdev_ops->ndo_tx_timeout(dev, i); netif_unfreeze_queues(dev); -- 2.25.1