From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 473AE367F36; Fri, 1 May 2026 07:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777619822; cv=none; b=k+AG2H21f5+/W9hiSgsWycEe9G0rh3TwlpceWM9JdWE2Kr++JuILvKQZGyYOpGi2nQayik+jQ9/8S6P4oB5p+M0JIF408RzE78629nCLxXLs/yznuvntEtRAhXIlmUud8z8fb0eD49ojEBf2+wRHUX9VbRK+VwGcuMTiWf/9+70= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777619822; c=relaxed/simple; bh=XPcRTdbWwomJwXrQ4r6B2U9JVjj7QGAmxhRjGzNSS7Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pCOZGDiVVJhFiBRqZ6F02uZtM4Tct6ZFO190Xiot79BOcqHUk5wdZluJHl0GQNXi4u3QFBJkN/Igt1RRcytLxSxE4l7cVD7Ef5Cs3D3UaIhftY1IyOjo7BjqVtomGCAcGlhClLic3vhYR8ufGdh9cq3N1+BKCdTnQAGor79+ftQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VUcoNV6V; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VUcoNV6V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BC73C2BCC4; Fri, 1 May 2026 07:16:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777619821; bh=XPcRTdbWwomJwXrQ4r6B2U9JVjj7QGAmxhRjGzNSS7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VUcoNV6VVCnMMmXnEHoWTw7NkaFiYBsCsIQmYifWmfHadBcdOj11ZGqL1BhKRq/I+ UfCcami4rMoMl1QaEO/eNjV4FYMnMusbMdqbEIhYMHHHISjeoJNSXbXMq53eRSa7ge nE11Llk3bMpule3a6z/QuVvgxUcnMdBBJHM3D7p8MuCb+ImKB/eaX8JU7MLDiZGNVh NJFk7f/YKdKc+FPqiJs7VUokZR7KwMFhYXvEHBwSGhVq/778YModVDOJ6SY8WiTMWw nZXPfkAHuDQlhcz0QctynCWx2BtDfsO/SzwPu4X39JYwXrAtIVth65PQXTCmm+dqz7 Fhu3/IxCYrIJQ== From: hawk@kernel.org To: netdev@vger.kernel.org Cc: hawk@kernel.org, kernel-team@cloudflare.com, Jakub Kicinski , =?UTF-8?q?Jonas=20K=C3=B6ppeler?= , Jamal Hadi Salim , Jiri Pirko , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , linux-kernel@vger.kernel.org Subject: [PATCH net-next v4 4/4] net: sched: add timeout count to NETDEV WATCHDOG message Date: Fri, 1 May 2026 09:16:31 +0200 Message-ID: <20260501071633.644353-5-hawk@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501071633.644353-1-hawk@kernel.org> References: <20260501071633.644353-1-hawk@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Jesper Dangaard Brouer Add the per-queue timeout counter (trans_timeout) to the core NETDEV WATCHDOG log message. This makes it easy to determine how frequently a particular queue is stalling from a single log line, without having to search through and correlate spaced-out log entries. Useful for production monitoring where timeouts are spaced by the watchdog interval, making frequency hard to judge. Suggested-by: Jakub Kicinski Link: https://lore.kernel.org/all/20251107175445.58eba452@kernel.org/ Signed-off-by: Jesper Dangaard Brouer Tested-by: Jonas Köppeler --- net/sched/sch_generic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index a93321db8fd7..3e2e2e887a86 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -533,13 +533,12 @@ static void dev_watchdog(struct timer_list *t) netif_running(dev) && netif_carrier_ok(dev)) { unsigned int timedout_ms = 0; + struct netdev_queue *txq; unsigned int i; unsigned long trans_start; unsigned long oldest_start = jiffies; for (i = 0; i < dev->num_tx_queues; i++) { - struct netdev_queue *txq; - txq = netdev_get_tx_queue(dev, i); if (!netif_xmit_stopped(txq)) continue; @@ -561,9 +560,10 @@ static void dev_watchdog(struct timer_list *t) if (unlikely(timedout_ms)) { trace_net_dev_xmit_timeout(dev, i); - netdev_crit(dev, "NETDEV WATCHDOG: CPU: %d: transmit queue %u timed out %u ms\n", + netdev_crit(dev, "NETDEV WATCHDOG: CPU: %d: transmit queue %u timed out %u ms (n:%ld)\n", raw_smp_processor_id(), - i, timedout_ms); + i, timedout_ms, + atomic_long_read(&txq->trans_timeout)); netif_freeze_queues(dev); dev->netdev_ops->ndo_tx_timeout(dev, i); netif_unfreeze_queues(dev); -- 2.43.0