From: Simon Horman <horms@kernel.org>
To: Claudiu Manoil <claudiu.manoil@nxp.com>
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
Subject: Re: [PATCH net-next v4 2/6] net: enetc: Allocate int_vector array dynamically
Date: Thu, 19 Nov 2026 13:23:52 +0000 [thread overview]
Message-ID: <20261119132352.GW860048@horms.kernel.org> (raw)
In-Reply-To: <8026b245b4ef8e5a4af7bb8f38e4329a9ee9caad.1794581338.git.claudiu.manoil@nxp.com>
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>
next prev parent reply other threads:[~2026-11-19 13:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 15:02 [PATCH net-next v4 0/6] net: enetc: S32N79 pseudo-MAC (PPM) networking support Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node Claudiu Manoil
2026-11-14 15:17 ` sashiko-bot
2026-11-17 9:08 ` Claudiu Manoil
2026-11-17 15:55 ` netdev-bot+sashiko
2026-11-18 16:11 ` Claudiu Manoil
2026-11-19 13:23 ` Simon Horman
2026-11-13 15:02 ` [PATCH net-next v4 2/6] net: enetc: Allocate int_vector array dynamically Claudiu Manoil
2026-11-19 13:23 ` Simon Horman [this message]
2026-11-13 15:02 ` [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4 devices Claudiu Manoil
2026-11-17 15:55 ` netdev-bot+sashiko
2026-11-18 15:43 ` Claudiu Manoil
2026-11-19 13:24 ` Simon Horman
2026-11-13 15:02 ` [PATCH net-next v4 4/6] arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 5/6] arm64: dts: s32n79-rdb: enable NETC IEP18 Claudiu Manoil
2026-11-17 15:55 ` netdev-bot+sashiko
2026-11-18 16:40 ` Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions Claudiu Manoil
2026-11-14 15:17 ` sashiko-bot
2026-11-17 15:55 ` netdev-bot+sashiko
2026-11-18 16:49 ` Claudiu Manoil
2026-11-20 3:20 ` [PATCH net-next v4 0/6] net: enetc: S32N79 pseudo-MAC (PPM) networking support patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261119132352.GW860048@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=imx@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=s32@nxp.com \
--cc=vladimir.oltean@nxp.com \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.