From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796465079; b=jJVg+bou2AzaJkvre0ZJwLZxSUDhtC6QAShqpGfPZLn+JWi5qmEnUPyRlJzJsS+2yYTp tKPqdRZq91b3l/Gu24DqpBxz8Wa55hcLM4n72Ka+IeiTWAke5qVGHoZxlk6GzeA9zlDtx 6G7IC7tq5uAVNQzeXiiVNt8R/4aZH69BcoXwVZ/+LbTecFgjN5jt5N5STll1jRym7Y1BC yiGcJ7a7/W/SGuS2rWPK+ma8X9RHS3XCsoh/S2c4FXyIjqECOfMzpJZRFiMJRlEftbYtv kGntRROhtr2vTdrR8dF0fFt1XWGeIPTsmGxEoj0HyqrxD+3RHPp+v3TSi9s4ZzzdzTw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796465079; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=2mWwQZgyokGNjTG7P7WOJEgB5tLCEvrlz6w89oXTTAk=; b=Aj07UXUG0EdzDQFkLUjaCtyDmS8r1R6ur2RMYPB7VZ9X1MY/Jf84/3OT0V8vVJHt6VpE e3XOnzOI2pPOUxtAw5cxKHg5OMAePVIEzAtGfbsduwU2vq+qWKPk8/X6ljQcQ4JFYNezr sEDfIDFWBjoTZteotaUVVgt9w9QKz6zJemVQGqtyiLzd0kMoZRWoDIwoam8SahIlc1PDG A+VTnC2xuJMpk5gXZCud8lC5TsNk3rNgjBlG1uXHG2EjG4Wly6upufie9DPaGTfUbWF+p Gnrga8RNVB62I8LSn+iK8sAbrsVyJHSXvNpvvgtw2RpTKqLgxj/hMxzjY02JLFaSeyg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="XU2sr/CO"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D930606A32F; Sat, 5 Dec 2026 10:04:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XU2sr/CO Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA9C91F0092B; Sat, 5 Dec 2026 10:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796465079; bh=2mWwQZgyokGNjTG7P7WOJEgB5tLCEvrlz6w89oXTTAk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=XU2sr/COxpweUJhYrqLaVNvic5OGgdRrjShOa/l5qwp/FmnhuLBa3sLU+KreYmsea kE9HuSUFyyjZOGL/+qtsb2Okkc9D5hwtjMFIDyJpIBYRemf98kGgsj3tGR5grZ5uNi 4xnZAlOOGX+vf++1TF8hLnrfRVy+YS7aRqQSic6XuydVA3iVRszXIuwKK9ocs+JAqF 1DYzKc23KqOmgUlyp3gTj6m2Jy0d+My6nCFfIiWVCMJsgkZtSOX533Ql+RwsXuJYaQ xH4Gqz1JAN6/IIblRQng66/UleefnxRt9lks4b/MojG2s8GwWwAHeCnNwbjXg8WTom BgUWH3Gfifumg== Subject: Re: [PATCH net-next v2 1/2] cxgb4: size the MSI-X interrupt name buffer From: netdev-bot+sashiko@kernel.org To: chenaibing@cmss.chinamobile.com Cc: willemdebruijn.kernel@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org Date: Sat, 05 Dec 2026 10:04:38 +0000 Message-ID: <179646507830.3146.3301012771345266876@kernel.org> In-Reply-To: <20261204094816.116-1-chenaibing@cmss.chinamobile.com> References: <20261204094816.116-1-chenaibing@cmss.chinamobile.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The commit message for "cxgb4: size the MSI-X interrupt name buffer" gets some of its arithmetic wrong, and it leaves out a user-… -- cxgb4: size the MSI-X interrupt name buffer This commit grows desc[] in struct msix_info from IFNAMSIZ + 10 to 2 * IFNAMSIZ + 11 bytes. After the change, the snprintf() calls that build MSI-X interrupt names in setup_sge_queues(), cxgb4_port_mirror_alloc_queues() and alloc_uld_rxqs() can no longer truncate. This fixes the -Wformat-truncation errors in W=1 builds with CONFIG_WERROR. Link: https://lore.kernel.org/oe-kbuild-all/202604141419.a4vuNBN7-lkp@intel.com/ > The MSI-X interrupt names are assembled with snprintf() into > adap->msix_info[].desc[IFNAMSIZ + 10], from adap->port[0]->name (up to > IFNAMSIZ - 1 characters) plus a suffix and a queue index: > > "%s-Rx%d" needs IFNAMSIZ - 1 + 3 + 5 + 1 = 24 bytes [Severity: Low] The new size looks right to me, but is the 24 byte figure for "%s-Rx%d" correct? In setup_sge_queues() the queue index is a plain int: int err, i, j, msix = 0; ... snprintf(adap->msix_info[msix].desc, sizeof(adap->msix_info[msix].desc), "%s-Rx%d", dev->name, j); So %d can produce up to 11 characters, and the worst case is 15 + 3 + 11 + 1 = 30 bytes. If the format only needed 24 bytes, it would fit in the old 26 byte desc[] and would not warn. But the first compiler error quoted further down is for this format, and it says: > cxgb4_main.c:1074:48: error: '%d' directive output may be truncated > writing between 1 and 11 bytes into a region of size between 8 and 23 The 5 digit assumption only holds for "%s-mirrorrxq%d", where i is a u16 in cxgb4_port_mirror_alloc_queues(). The changelog also presents this only as a build failure. Doesn't it change runtime behaviour as well? Before this patch, alloc_uld_rxqs() could truncate the name at runtime: snprintf(adap->msix_info[msi_idx].desc, sizeof(adap->msix_info[msi_idx].desc), "%s-%s%d", adap->port[0]->name, rxq_info->name, i); Take a 15 character port name, the "iw_cxgb4" ULD and a two digit queue index. That needs 15 + 1 + 8 + 2 + 1 = 27 bytes, so the old 26 byte buffer cut the name off before it reached request_irq(). With this patch the full name shows up in /proc/interrupts. Could the commit message correct the "%s-Rx%d" arithmetic and mention that some IRQ names in /proc/interrupts will change? -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204094816.116-1-chenaibing%40cmss.chinamobile.com