Re: [PATCH net-next 2/2] dpaa2-eth: DPNIs without a DPMAC should be virtual devlink ports
From: Ioana Ciornei
Date: Mon Sep 28 2026 - 05:19:25 EST
On Wed, Sep 23, 2026 at 02:58:01PM +0200, Vincent Jardin via B4 Relay wrote:
> From: Vincent Jardin <vjardin@xxxxxxx>
>
> A DPNI whose endpoint is not a DPMAC has no physical connector: it
> may have no endpoint at all, or be connected to another DPNI or to a
> DPSW port. It is still registered as a physical devlink port, number 0,
> so userspace sees a physical port that does not exist.
Reword this so that it's clear that you are describing the state before
the patch.
>
> A virtual port has no phys_port_name, so only the DPNIs that serve a
> DPMAC report one, and "p<dpmac id>" never collides.
Reword this as well and mention directly what you are changing.
I would also suggest a change in the subject title:
dpaa2-eth: mark DPNIs without a DPMAC as virtual devlink ports
>
> Signed-off-by: Vincent Jardin <vjardin@xxxxxxx>
> ---
> drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c
> index 8b2addd3f83a..30e6cb2190db 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c
> @@ -230,16 +230,23 @@ int dpaa2_eth_dl_port_add(struct dpaa2_eth_priv *priv)
> struct devlink_port *devlink_port = &priv->devlink_port;
> struct devlink_port_attrs attrs = {};
>
> - attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
> attrs.phys.port_number = dpaa2_eth_dl_port_number(priv);
> + if (attrs.phys.port_number)
> + attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
> + else
> + attrs.flavour = DEVLINK_PORT_FLAVOUR_VIRTUAL;
> devlink_port_attrs_set(devlink_port, &attrs);
> return devlink_port_register(priv->devlink, devlink_port, 0);
> }
>
> void dpaa2_eth_dl_port_check(struct dpaa2_eth_priv *priv)
> {
> - u32 registered = priv->devlink_port.attrs.phys.port_number;
> + const struct devlink_port_attrs *attrs = &priv->devlink_port.attrs;
> u32 current_number = dpaa2_eth_dl_port_number(priv);
> + u32 registered = 0;
Move these changes to patch 1/2.
Ioana