Article View: linux.kernel.netdev
Article #19155Re: [PATCH net-next v4 2/6] net: enetc: Allocate int_vector array dynamically
From: Simon Horman
Date: Thu, 19 Nov 2026 13:23
Date: Thu, 19 Nov 2026 13:23
26 lines
9308 bytes
9308 bytes
On Fri, Nov 13, 2026 at 05:02:33PM +0200, Claudiu Manoil wrote: > The number of Rx/Tx ring interrupt vectors, priv->bdr_int_num, is set > in enetc_init_si_rings_params() to the lesser of the number of online > CPUs and the number of Rx rings of the station interface. The > int_vector[] array in struct enetc_ndev_priv, however, has a fixed > size of ENETC_MAX_BDR_INT (6), a limit that dates back to the maximum > CPU count of the SoCs integrating ENETC at the time. > > That assumption does not hold for S32N79, which has 8 CPUs and gives > the ENETC PF up to 8 Rx rings. There, bdr_int_num can reach 8, and > enetc_alloc_msix() writes priv->int_vector[i] past the end of the > array, corrupting the adjacent fields of the netdev private area. > No SoC currently supported upstream exceeds 6 vectors, so this is not > reachable today; it must be fixed before S32N79 devices can be enabled > by a following patch. > > Allocate int_vector[] with devm_kcalloc() in enetc_alloc_msix(), once > bdr_int_num is known. The memory is released together with the PCI > device, so no explicit free is needed on the error or teardown paths. > This is common code, so the PF and VF drivers benefit alike. Drop the > ENETC_MAX_BDR_INT define, which only existed to size this array. > > Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com> Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID:
<20261119132352.GW860048@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367023-linux-kernel-netdev=dewy.ruReferences:
<cover.1794581338.git.claudiu.manoil@nxp.com> <8026b245b4ef8e5a4af7bb8f38e4329a9ee9caad.1794581338.git.claudiu.manoil@nxp.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367023-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v4 2/6] net: enetc: Allocate int_vector array dynamically Date: Thu, 19 Nov 2026 13:23:52 +0000 Organization: Usenet Network Message-ID: <20261119132352.GW860048@horms.kernel.org> References: <cover.1794581338.git.claudiu.manoil@nxp.com> <8026b245b4ef8e5a4af7bb8f38e4329a9ee9caad.1794581338.git.claudiu.manoil@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2881130"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:fepOgR5GWKzgrmMJmMWK7SiW17A= sha256:ILW75FzPz3gZWA8FTWlJbu8BCf+zS+MbQagKwIudqsE= sha1:lkALVholS/uTLQdv61lU2D2Dais= sha256:mv+U22GFQDdKxxACC9SREI+Slb2gMW2ktwdqHS5ShVw= Content-Disposition: inline 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 A13DF115655; Thu, 19 Nov 2026 16:24:34 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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] 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 w8wsAGY3qI1Q; Thu, 19 Nov 2026 16:24:31 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367023-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 0AB7311562B; Thu, 19 Nov 2026 16:24:22 +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 70ACAE96D0; Thu, 19 Nov 2026 13:24:13 +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=1795094638; b=jJMHNLBhD9o8/wGEcRK60KhHJT7QTAkcsIiXXnWBV0LuDs3/ZZC46olojXerPpIqaLWD l+y45ftvbAyWaPzVKG2ZwnOYpoypugxmvESr6ZyaJgU+HOBQaIF6OxmnbHp3bt9zmuqp2 6+8BJO3jtTlVG2wnUuUYO9FlRGV+0E1dlyk2rUsYH9FYSphTEZtAO7CEC+SLhXbL98vXe /KNbhrWItFBhmPcvkLqV5hCX79HT7LsqRrph4xbGMEvRFmEdKrLYb5gG1FvyHXKuYNn7g WfEwL29UxQh8NO6IsiSX2FBfmi/PVyF0iuMf34F2yiGMq4a64CrbGQdEjRWbrsQW8Ng== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795094638; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=Vhn1wwrJeguZrNgrqIjT+wifoGu+dZ9G61eI2u7SMz8=; b=c9+pa8Tc8dFA+3HFsXX8y4bVkSyDObyy0zXm0P/fgLTqv9zagZJzKMGUOfqqzElDhcIm LHXnWvM7roN6VOmVNesSp6k7kxeLkvr1jfiGOhKY5aAqFmzK+x7nYfQ2mpo2SBSN8uKUt WjR4eblz+QM5GXx4KZLqcq3LwhcnXpfhnxqSBmAEKVCxJbWaOTBIjrTQrXhWvne8j8Ufo IBw4OdxYQ6CFEmbVPYSHV46XaBBTGEbABj1TCM0PyU8IU1spQPS7XBJMFP5TWOmibH3lY HNZbyn16HeiUIYax1Un2s3xDU1c/rpvY7p4Y354/3tIiYA8RBXFAXGL8uR6zKxKN1kw== 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=FtnhAstY; 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 380A2606A324; Thu, 19 Nov 2026 13:23:58 +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=FtnhAstY 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=1795094637; b=IhvzkyhARyUgYlLO4PRJl4fSBgDsHBH3dFj8J/ioxDTmKFrCP7FvMmp5kxVX5+Vzmew0 JFUdk0vJpU0D8eRnBb0WH1pBQDm1rZ9vg+b/zHnO8Ox2l6RlDzG0hPd48kAYfgtUaYEsv gu5GoDc5k0pWdxFZLpnSHRPcRUskDIW15biZk1wKKAYDZ/yqU+6LLluL/d/CspX7bi1YS A3QdYEFZ0CqfyI0Yxur5PYBtQgTB9leYfiv/KJZ/rSLs24zaRo3DwZzPiG+q770nGDa3Y UKZkbyPuum48ilbj0xyF4dBJaFLb4sJlW7kLxPEB8fbb4XmkojXggx/JGnVfmI8hTvQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795094637; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=Vhn1wwrJeguZrNgrqIjT+wifoGu+dZ9G61eI2u7SMz8=; b=y+xkN4M6CYauaRSfHvt3NOv7WTD1P43jcxNGFw0Ty0f1JYYVEavry/rVgwlJMR8H8k/b SkHQAYC/ahfQCiPv/Vdzsz7ifTByHQu9igh67divPP9ExYihKgt/bk9CJgCB41w5WzPVl 5WxPvXMrmIizXOccjuqx4y9aBJV/PJ7pbdTzlfxiNNAcmA0C4IYN4nGlWb+C0t8XyGQyg 2PzDvGK5ti47KoRL/IpdMlvQCGqJCufSAV1LW84alYn1hPxc0G7f5mjzeAZB8+stZ+xL5 YOK2iDfEzFALf6de42KuVyFpbTHyYXsXqyAXpw/DtOwBKFD523YnUZQL8/knYl8jiIQ== 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=FtnhAstY; 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 587A460A263B; Thu, 19 Nov 2026 13:23:57 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6F7A1F000C4; Thu, 19 Nov 2026 13:23:54 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795094637; bh=Vhn1wwrJeguZrNgrqIjT+wifoGu+dZ9G61eI2u7SMz8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=FtnhAstYuUUqTIF3QN//BoVxpeCJf8hdxH+UNKw3a+knXCj3LFH0N59lKAdb4NYbH uMUpg1+Qt+ZdANR6oKOrAgTFOddKv3cxtDu+ilA7/+WdNCWXDnAZLYX6gc0ZNzNoSD kpQiiKLH+IbEi54waNVLBy5HU6rXagx+Wc/s0jxGf59ajvTCJBOrtcPuLDNSbkX7Dg ZBs7HPlcrSU+wLawCg7vaBuFULcHs/DHhRm1K4uMBKjIl+rPuQXdynJ0D8nSTYYdIY a6uKm0LWDprt4dOtwRhHf3M7kf8Q0oQ+qJYkwJVlaM7myNAC8EA+ftDSUyxZC5hm7k Y7CwiPg6stnUw== X-Cc: netdev@vger.kernel.org, s32@nxp.com, Vladimir Oltean <vladimir.oltean@nxp.com>, Wei Fang <wei.fang@nxp.com>, Clark Wang <xiaoning.wang@nxp.com>, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, imx@lists.linux.dev, linux-kernel@vger.kernel.org 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 X-In-Reply-To: <8026b245b4ef8e5a4af7bb8f38e4329a9ee9caad.1794581338.git.claudiu.manoil@nxp.com>