From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 5F55A32573B for ; Thu, 27 Nov 2025 10:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764240790; cv=none; b=A4FCYcpdOq2egn8EVE+NfGQQ6Fij9oKh1i3whObmWIOYc5tINegVQyE0EsVuP6WeH8f8GJS4g7MJHDaA+RjDfjM31HIdHh7C5m7GZdIHligLRL20MC/v0v3Lwa6hE3m3HgFeoZrZKiyKmD0s4LriSz2fSEuS0UxtfSk7WhkoMw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764240790; c=relaxed/simple; bh=dcwrY/ZJN91y8VKMVtZWMrFkXvzI5f8E1cX3IfcGFlI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VFqNFMzXm9N3xqYiJbhWbFUiUd6Gr3Ok/E6zzPGSLyPywXOKnHAuuIfOlcA1J3M1bTTBZlNu9uG2ydDN2vAmTCub6Mvj/FUOav9alsuH6yoV3sBT7fdz1WSNKYzvn/OVzXG0tKeYcChJ6fSB2QyepOqoH/GureIv518t7wfbTho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=h6ZkOMpx; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=VDobi9ht; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="h6ZkOMpx"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="VDobi9ht" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764240786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ia9KLe6KKWosICN6WhPtsQJNk42J7XjtbWZtakRXDh8=; b=h6ZkOMpxF2kZPd+LGmDZ8ItesLKjz2uEVujPawUkQMoxA6m5VBgXd8QKgyXy+nhFwX7ifK wLleQCyPEOxOr4PzSTG6W460ITa7R/M0xEikW5kok50u2W5Jm/d/9rYyVIZFs6AlK1LnGH KVTQHLjnBVDZLhKvlZSUlhMJP/cYlQI= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-657-ZMOFTHoeOfKyKsyQV3Z2gg-1; Thu, 27 Nov 2025 05:53:04 -0500 X-MC-Unique: ZMOFTHoeOfKyKsyQV3Z2gg-1 X-Mimecast-MFC-AGG-ID: ZMOFTHoeOfKyKsyQV3Z2gg_1764240783 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-640cdaf43aeso748008a12.2 for ; Thu, 27 Nov 2025 02:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1764240783; x=1764845583; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Ia9KLe6KKWosICN6WhPtsQJNk42J7XjtbWZtakRXDh8=; b=VDobi9htot0b//4JIG6gpekF0SrRDd40rwQ6rhYTzmO5opmj3Lf6N9e8W0fgxjULJk tffeJwoTk9h6xjXRTF4Q2hnmDtH1uEX+KLLMR9izOe0sFdR5E+nzEnzcabh7csP7FdzX 192xL+mtFq3XQki3Pek6cx2AqOaZJbAGTSzYAaUfKUMrLteWR9O+tVau1qDA2SJcQaW0 rrLyHs+Wo7+FGSq7KqCIqUKYMuga95u/GvN0vJjanpOyEXyd/svf9ZHZADR/AIVc0rau h5frWRc8OVuzj9DvYIic7HrwAgwkvsm3ffuGmvkRLXjW/zdZ+teOQRhMt1GHqKZHg2zX akmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764240783; x=1764845583; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ia9KLe6KKWosICN6WhPtsQJNk42J7XjtbWZtakRXDh8=; b=XL9G/zFnpleaO//6glMrzoyPQEyWWmCYYn7jNeN4to+rP5NVsYShLjf3mVZgsAUGRD ztEb1Mqly6CR6dcGCZmUwacJorbmybgWNOxdXbPPAp7lUys0DUl6Bq9T5WcNAEPkeN06 rKwlq0AjiPtdlC9Yh2du0M3TiOEmyqJ2oWhGnZvJ1vd8GmJGwX/NVK51YB2lTFt9W1W8 ooFAuZTy59MUcDZ4GQDDyTFAxkQm0HCAXwv0w+dUorLl+qSEZdXFj+Lndf3a88X59EeI f1HzxjtNohdF9CDLVFAqNbFkr6dBkFrY9YbgIKKCGL7+LQaPP1gzGiUewrloFjAAsj/k 29xQ== X-Forwarded-Encrypted: i=1; AJvYcCWpD12vp9dkr6bCn/YwHSrc7n9WMK/f8KCMJ344JPn19KHzEeQD4/wzwxg8J703xHNUhhRM4/JFC95CLGk=@vger.kernel.org X-Gm-Message-State: AOJu0YwK5X01LhLrTot9k3c0C3MLZKaC68jeYjLyyA12wshu5GTFtdiX 3+8p7v9qwL/tT0FPswNHoA8q/4Z9v24/FGHaZ/fUBATuLnfDZnshIuw6wnBD4Gsw4cU1hTI1YKt zq3a2AW+f0+EZTsP4bvxS7MR2/GEloiSLzeshFI/9Q686XWWJ1nMpV3yPryc0sVTHaA== X-Gm-Gg: ASbGncuGVGzTQ3WLyObX4gsFzIQO8Q5bc/Q4TkGv0W+A1UdcqupLuR+ZaWUwa7a611m heHJ6wFMq900r3pIP8ufXqiewUHEIAA6yYyJ4e79MCITwxNHZ0khscGi/exLHNdw/fN7dVl+0BR +PWGkho8ss4Go//LGgUn8DSa/LCV8Mdgj60C+BKYTjdZq895YmSkHezL98vc0dWgC13ymZvAlqm TBk9b1LxlKAUCRxqIJlxODwBmVNT7OceKzVxvwlwymL7HpwKYTiDwDIQYuxW1tc5fXzL6GUaLg1 pcu0AP2SaYWm8lDITNNu9TH3lv3+XNpOEwsx6Y+rFWfdi094LpUj1bNnN0Y4dhbVq7uA6DU1G5c P9kFK1+Gq0ZdgAQ== X-Received: by 2002:a05:6402:3054:20b0:645:c6b1:5f9d with SMTP id 4fb4d7f45d1cf-645c6b15fd9mr10852294a12.5.1764240783196; Thu, 27 Nov 2025 02:53:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeDyRIqcyD3zKEeif485rXKITX1uTQeYkqs0WbdFhc4RqC7yJG2evwVTiptKplRdNES0CvPg== X-Received: by 2002:a05:6402:3054:20b0:645:c6b1:5f9d with SMTP id 4fb4d7f45d1cf-645c6b15fd9mr10852281a12.5.1764240782769; Thu, 27 Nov 2025 02:53:02 -0800 (PST) Received: from [192.168.88.32] ([212.105.155.212]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-647509896d1sm1316264a12.0.2025.11.27.02.53.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Nov 2025 02:53:02 -0800 (PST) Message-ID: <383aed26-aa07-4759-92b9-5448161ba6a4@redhat.com> Date: Thu, 27 Nov 2025 11:53:00 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 1/3] net: Introduce netif_xmit_time_out_duration() helper To: Tariq Toukan , Eric Dumazet , Jakub Kicinski , Andrew Lunn , "David S. Miller" Cc: Jian Shen , Salil Mehta , Jijie Shao , Saeed Mahameed , Mark Bloch , Leon Romanovsky , Jamal Hadi Salim , Cong Wang , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Gal Pressman , Moshe Shemesh , Yael Chemla , Shahar Shitrit References: <1764054776-1308696-1-git-send-email-tariqt@nvidia.com> <1764054776-1308696-2-git-send-email-tariqt@nvidia.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <1764054776-1308696-2-git-send-email-tariqt@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/25/25 8:12 AM, Tariq Toukan wrote: > From: Shahar Shitrit > > Introduce a new helper function netif_xmit_time_out_duration() to > check if a TX queue has timed out and report the timeout duration. > This helper consolidates the logic that is duplicated in several > locations and also encapsulates the check for whether the TX queue > is stopped. > > As the first user, convert dev_watchdog() to use this helper. > > Signed-off-by: Shahar Shitrit > Reviewed-by: Yael Chemla > Signed-off-by: Tariq Toukan > --- > include/linux/netdevice.h | 15 +++++++++++++++ > net/sched/sch_generic.c | 7 +++---- > 2 files changed, 18 insertions(+), 4 deletions(-) > > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h > index e808071dbb7d..3cd73769fcfa 100644 > --- a/include/linux/netdevice.h > +++ b/include/linux/netdevice.h > @@ -3680,6 +3680,21 @@ static inline bool netif_xmit_stopped(const struct netdev_queue *dev_queue) > return dev_queue->state & QUEUE_STATE_ANY_XOFF; > } > > +static inline unsigned int > +netif_xmit_timeout_ms(struct netdev_queue *txq, unsigned long *trans_start) > +{ > + unsigned long txq_trans_start = READ_ONCE(txq->trans_start); > + > + if (trans_start) > + *trans_start = txq_trans_start; What about making this argument mandatory? > + > + if (netif_xmit_stopped(txq) && Why restricting to the case? AFAICS the watchdog is intended to additionally catch the scenarios where the rx ring is not full but the H/W is stuck for whatever reasons, and this change will not catch them anymore. /P