From nobody Thu May 2 00:02:24 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C674C433FE for ; Sat, 1 Oct 2022 01:07:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233098AbiJABHC (ORCPT ); Fri, 30 Sep 2022 21:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233082AbiJABGf (ORCPT ); Fri, 30 Sep 2022 21:06:35 -0400 Received: from mail-pf1-x464.google.com (mail-pf1-x464.google.com [IPv6:2607:f8b0:4864:20::464]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D5F614253F for ; Fri, 30 Sep 2022 18:02:40 -0700 (PDT) Received: by mail-pf1-x464.google.com with SMTP id i6so5629262pfb.2 for ; Fri, 30 Sep 2022 18:02:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature:x-gm-message-state:from:to:cc:subject:date; bh=975yxtLp4mG5EqALM6a2Zs4xoum0EiIXsp3+otaUT9U=; b=kZA6qce4qAMk2PC/5wN6ougJd1YQUDs8o/idJiDHy2mcIkqjUMN923xauzc4CAjtl+ pbXgeHspb608TacBAV5Ti2vWGm0LTym3yBM0O6BJCjTIuRTTZUOuLpUFnIfEPAjIlPK8 /f88dGPkUHaYXarOKsoVkGb1BVoLFUatMiFT8UAXSg+FW0IlwstD46txDWh9edFt7ApB cLuTg0J6OgSjAdfUS/43qOdtdmCXxbmb+n2/VE5mR+I7Bi3VSAa2yEksUTFa/P3h4ENl Kc6ZhWD/fKRknXGVMANOfPeK6dPnjuVmj4WS5zOn2P7Y5dhEuo0rK2HRqEpF/MmciK2h yeSg== X-Gm-Message-State: ACrzQf1UUGJKJT2gLUo3jCM+zkX50T6So6EXw7Jb5OVj0tljLmyi7AvN fJAvX2d3UjoRKjnGATv+JRiv06H/XOZpKGhT8XhOuTGLnm2t X-Google-Smtp-Source: AMsMyM5a/0A2bZd6QBnYJlbBx+J+8VhIoDaOlNfiDFMXNOF/7V0AwiZwprR4k8pFIxGV9Yl7brdXnLZEFgXw X-Received: by 2002:a05:6a00:1990:b0:545:aa9e:be3d with SMTP id d16-20020a056a00199000b00545aa9ebe3dmr11672411pfl.59.1664586123955; Fri, 30 Sep 2022 18:02:03 -0700 (PDT) Received: from smtp.aristanetworks.com (smtp.aristanetworks.com. [54.193.82.35]) by smtp-relay.gmail.com with ESMTPS id je17-20020a170903265100b00179fece74bdsm91369plb.61.2022.09.30.18.02.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Sep 2022 18:02:03 -0700 (PDT) X-Relaying-Domain: arista.com Received: from chmeee (unknown [10.95.71.70]) by smtp.aristanetworks.com (Postfix) with ESMTPS id 7BD81301BD60; Fri, 30 Sep 2022 18:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=Arista-B; t=1664586123; bh=975yxtLp4mG5EqALM6a2Zs4xoum0EiIXsp3+otaUT9U=; h=From:To:Cc:Subject:Date:From; b=X0XY1NcyoLDVDZoGtgkw3Tff5sOg7HOprbfAn6PdDYIzMclwC8uaBKHHevkhDzgf+ jGYxz2vvib0towwM/ZBOsJ0A2j3vzaf5AmTUyYNnYnaAqvtxwqDcMu6wWjWiDexiEn ZbEdPdWbSUSKztjQaecNxMRlG175F1UscpOUJcj8= Received: from kevmitch by chmeee with local (Exim 4.96) (envelope-from ) id 1oeQtG-00180f-06; Fri, 30 Sep 2022 18:02:02 -0700 From: Kevin Mitchell Cc: kevmitch@arista.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Antoine Tenart , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] netdevice: don't warn when capping txqueue 0 Date: Fri, 30 Sep 2022 18:00:41 -0700 Message-Id: <20221001010039.269004-1-kevmitch@arista.com> Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With commit d7dac083414e ("net-sysfs: update the queue counts in the unregistration path"), we started seeing the following warning message during our stress test that streams packets out of a device while registering and unregistering it: et3_11_1 selects TX queue 0, but real number of TX queues is 0 The issue is that remove_queue_kobjects() is setting real_num_tx_queues to 0 before the last few packets are queued. When netdev_cap_txqueue() is called to cap queue =3D 0, it emits this message. However, when queue =3D=3D real_num_tx_queues =3D=3D 0, this message doesn't make much sense because 0 is the fallback value returned anyway. Therefore, omit the warning when queue is already the fallback value of 0. Fixes: d7dac083414e ("net-sysfs: update the queue counts in the unregistrat= ion path") Link: https://lore.kernel.org/r/YzOjEqBMtF+Ib72v@chmeee/ Signed-off-by: Kevin Mitchell --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 05d6f3facd5a..3fd1e50b6bf5 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3493,7 +3493,7 @@ static inline void netdev_reset_queue(struct net_devi= ce *dev_queue) */ static inline u16 netdev_cap_txqueue(struct net_device *dev, u16 queue_ind= ex) { - if (unlikely(queue_index >=3D dev->real_num_tx_queues)) { + if (unlikely(queue_index > 0 && queue_index >=3D dev->real_num_tx_queues)= ) { net_warn_ratelimited("%s selects TX queue %d, but real number of TX queu= es is %d\n", dev->name, queue_index, dev->real_num_tx_queues); --=20 2.37.2