Thread (6 messages) 6 messages, 3 authors, 15d ago

[PATCH net-next v2 2/2] dpaa2-eth: mark DPNIs without a DPMAC as virtual devlink ports

flat view
COLD15d IN NET-NEXT

From: Vincent Jardin via B4 Relay <devnull+vjardin.free.fr@kernel.org>
Date: 2026-09-28 11:22:48
Also in: b4-sent, lkml
Subsystem: dpaa2 ethernet driver, networking drivers, the rest · Maintainers: Ioana Ciornei, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Queued in net-next as aed5a323ec37 on 2026-10-02.

From: Vincent Jardin <vjardin@free.fr>

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. Until now, such a DPNI was still registered as a physical
devlink port with number 0, so userspace saw a physical port that does
not exist.

Register these DPNIs as virtual devlink ports instead. A virtual port
has no phys_port_name, so only the DPNIs that serve a DPMAC at probe
time report one, "p<dpmac id>", and those names do not collide.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c
index 4c0a04c2d458..6defc00199bf 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c
@@ -233,7 +233,10 @@ int dpaa2_eth_dl_port_add(struct dpaa2_eth_priv *priv)
 	priv->dl_port_valid = true;
 	mutex_unlock(&priv->mac_lock);
 
-	attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
+	if (port_number)
+		attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
+	else
+		attrs.flavour = DEVLINK_PORT_FLAVOUR_VIRTUAL;
 	attrs.phys.port_number = port_number;
 	devlink_port_attrs_set(devlink_port, &attrs);
 	err = devlink_port_register(priv->devlink, devlink_port, 0);
-- 
2.43.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help