๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27325

Re: [PATCH net-next v2 1/2] cxgb4: size the MSI-X interrupt name buffer

#27325
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 10:04
73 lines
10510 bytes
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
Technical Details
Message-ID: <179646507830.3146.3301012771345266876@kernel.org>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mi.newsdeef.eu!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377926-linux-kernel-netdev=dewy.ru
References: <20261204094816.116-1-chenaibing@cmss.chinamobile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mi.newsdeef.eu!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377926-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 1/2] cxgb4: size the MSI-X interrupt name buffer
Date: Sat, 05 Dec 2026 10:04:38 +0000
Organization: Usenet Network
Message-ID: <179646507830.3146.3301012771345266876@kernel.org>
References: <20261204094816.116-1-chenaibing@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3003180"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ASWKT/LSWHqR5OAzjuAdEGdAb8Q= sha256:Ektt6X97NBbxB0PQTkE8Hspfr1hdyXydQ91JT9iLOQE=
	sha1:4Xrx0De8YqaxNypjZQeYVDFm6zI= sha256:AQoiNYxLr2cs+rsFTf8CUXLPlpSV/PcCcsZsDabhvZg=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 2BA45117DDE; Sat,  5 Dec 2026 13:05:02 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.541
X-Spam-Status: No, score=-3.541 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id bdPDsNI5EiSX;
	Sat,  5 Dec 2026 13:04:55 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377926-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id E4A6B117DB2; Sat,  5 Dec 2026 13:04:44 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 70B392F086; Sat,  5 Dec 2026 10:04:40 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796465080;
	b=Ti95LkIPyEkA/sdYAWF+3fcMO1LOU/YvvchyvStN8+mTJ81bYNccNjo99Pm1BBztIPoD
	 SyKzbuoD9NgJwSWuq9VgkySRgEle1JX13ZNuNmvwt/fODMgCFytBHJ6I/FBo6sAnuUbmY
	 xEDTL3LvFyvUrePSugu9Zcvexr8jBbGSAOINJcXEMSxjJbD7BjItGfHe3s4GIuwRHjx77
	 dBhoCTvf69b/K5EN8aRtrgPFoBtR8VinXTiNHKjt/xHi4sGnJeTH5ALaqnJ6l7IIsnliP
	 d6B0s/Bvh7VS56DKDOl5caFSwCqlkO4GdWVKi5s+JwLZF/tF+tRi0cGbccp+yfkA67w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796465080;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=2mWwQZgyokGNjTG7P7WOJEgB5tLCEvrlz6w89oXTTAk=;
	b=iaNljeOlyP3D7/s7IVeRISqn/OaAJY8M1HmuiamaFxRxf4HJfHVmzDZh1cOUP8Pf08rY
	 XwH9qvnHwHrq+DxUrTwzPE/HtjF41KPf1hfZa+9MfXdMQcznLSn6KuO8TSKYkSNZzQufd
	 ZviTp4DazH+OEasBm5wOrfU1XS2nufRo3DdKOfpoimsBISHpvCVOhYVmytgiHGdEEbWMx
	 xCzDDeXN9KRFJ5wFfK8J+flNnKAM3i6tO5XS4cnclyms0GSJdB1P+S3YhOEYA4qkCV40c
	 Rw2DvwFcFVU8N18cpSmbJSVDzuYcZlrTci1Ztsv0DFByYOcWdhfnU64sUPfhlJvEf7w==
X-ARC-Authentication-Results: i=2; 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=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F009606A322;
	Sat,  5 Dec 2026 10:04:40 +0000 (UTC)
X-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
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-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==
X-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==
X-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
X-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)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA9C91F0092B;
	Sat,  5 Dec 2026 10:04:38 +0000 (UTC)
X-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==
X-Cc: willemdebruijn.kernel@gmail.com, netdev@vger.kernel.org,
 linux-kernel@vger.kernel.org, kuba@kernel.org
X-In-Reply-To: <20261204094816.116-1-chenaibing@cmss.chinamobile.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list