From: Wei Fang <wei.fang@nxp.com>
To: Claudiu Manoil <claudiu.manoil@nxp.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Clark Wang <xiaoning.wang@nxp.com>,
"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>
Cc: "imx@lists.linux.dev" <imx@lists.linux.dev>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2 net-next 12/12] net: enetc: dynamically allocate rxmsg based on VF count
Date: Mon, 25 May 2026 02:36:30 +0000 [thread overview]
Message-ID: <DBBPR04MB7500AD1BEB312E1332736F1A880A2@DBBPR04MB7500.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20260522092438.1264020-13-wei.fang@nxp.com>
The below issues reported by Sashiko are false positives. The ENETC v4
(i.MX series) uses a different driver (enetc4_pf.c). enetc_pf.c and
ENETC_PSIPVMR_SET_VP and are only used by the ENETC v1 driver,
and ENETC v1 supports 2 VFs, so the issues do not actually exist.
Sashio:
> i.MX94 standalone ENETC: 0 VFs
This is a pre-existing issue, but if a device supports 0 VFs and reports
more than 8 hardware rings during probe, will this result in a division by
zero?
In enetc_port_si_configure(), the driver reserves 8 rings for the PF and
distributes the rest to the VFs:
drivers/net/ethernet/freescale/enetc/enetc_pf.c:enetc_port_si_configure() {
...
if (num_rings)
num_rings -= ENETC_PF_NUM_RINGS;
...
if (num_rings) {
num_rings /= pf->total_vfs;
val |= ENETC_PSICFGR0_SET_TXBDR(num_rings);
val |= ENETC_PSICFGR0_SET_RXBDR(num_rings);
}
...
}
If pf->total_vfs is 0 and there are remaining rings, the division by zero
will cause a kernel panic.
> i.MX94 internal ENETC: 3 VFs
This isn't a bug introduced by this patch, but since 3 VFs means there are
4 Station Interfaces (1 PF + 3 VFs) in total, will VLAN promiscuous mode
work for the 3rd VF?
The ENETC_PSIPVMR_SET_VP() macro uses a hardcoded 0x7 mask (3 bits), which
covers only the first 3 Station Interfaces:
drivers/net/ethernet/freescale/enetc/enetc_hw.h:
#define ENETC_PSIPVMR_SET_VP(simap) ((simap) & 0x7)
Because of this mask, the 4th Station Interface (the 3rd VF mapped to bit 3)
is silently dropped from the VLAN promiscuous mode configuration.
next prev parent reply other threads:[~2026-05-25 2:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 9:24 [PATCH v2 net-next 00/12] net: enetc: Prepare for ENETC v4 VF support Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 01/12] net: enetc: use enetc_set_si_hw_addr() for setting MAC address Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 02/12] net: enetc: move VF message handlers to enetc_msg.c Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 03/12] net: enetc: relocate SR-IOV configuration helper for common PF support Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 04/12] net: enetc: integrate enetc_msg.c into enetc-pf-common driver Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 05/12] net: enetc: use read_poll_timeout() for VF mailbox polling Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 06/12] net: enetc: convert mailbox messages to new formats Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 07/12] net: enetc: add VF-PF messaging support for IP minor revision query Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 08/12] net: enetc: align v1 CBDR API with v4 for VF driver sharing Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 09/12] net: enetc: add CBDR setup/teardown hooks to enetc_si_ops for VF support Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 10/12] net: enetc: add generic helper to initialize SR-IOV resources Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 11/12] net: enetc: use MADDR_TYPE for MAC filter array size Wei Fang
2026-05-22 9:24 ` [PATCH v2 net-next 12/12] net: enetc: dynamically allocate rxmsg based on VF count Wei Fang
2026-05-25 2:36 ` Wei Fang [this message]
2026-05-26 11:30 ` [PATCH v2 net-next 00/12] net: enetc: Prepare for ENETC v4 VF 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=DBBPR04MB7500AD1BEB312E1332736F1A880A2@DBBPR04MB7500.eurprd04.prod.outlook.com \
--to=wei.fang@nxp.com \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--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=vladimir.oltean@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®