summaryrefslogtreecommitdiff
path: root/net/devlink
diff options
context:
space:
mode:
authorMoshe Shemesh <moshe@nvidia.com>2026-07-02 14:17:25 +0300
committerPaolo Abeni <pabeni@redhat.com>2026-07-08 11:23:49 +0200
commitf6ec46b7e2b227499200fb071752ea653f145f3d (patch)
tree1f475238b9cd5b06bb774993c153f3d1f4e96104 /net/devlink
parenta6cfd2762eb18cde4eb34906599ffa7b07c2ed60 (diff)
devlink: print controller prefix for non-zero controller
The controller prefix (c<N>) in phys_port_name is currently restricted to external host controllers. This layout sufficed when DPUs only had a single local controller and one or more external host controllers. However, newer devices can have multiple controllers within the DPU itself, even within a single host environment. To support these topologies, allow drivers to report the controller number regardless of the "external" flag status. Any non-zero controller number will now be explicitly reported, even for single-host or local DPU controllers. Existing ports with controller=0 are unaffected. Update documentation and kdoc to clarify that a non-zero controller number does not require the external flag to be set. Signed-off-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Parav Pandit <parav@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260702111726.816985-2-tariqt@nvidia.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/devlink')
-rw-r--r--net/devlink/port.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/devlink/port.c b/net/devlink/port.c
index c268afefaed7..dc82cac68e7d 100644
--- a/net/devlink/port.c
+++ b/net/devlink/port.c
@@ -1529,7 +1529,7 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port,
WARN_ON(1);
return -EINVAL;
case DEVLINK_PORT_FLAVOUR_PCI_PF:
- if (attrs->pci_pf.external) {
+ if (attrs->pci_pf.external || attrs->pci_pf.controller) {
n = snprintf(name, len, "c%u", attrs->pci_pf.controller);
if (n >= len)
return -EINVAL;
@@ -1539,7 +1539,7 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port,
n = snprintf(name, len, "pf%u", attrs->pci_pf.pf);
break;
case DEVLINK_PORT_FLAVOUR_PCI_VF:
- if (attrs->pci_vf.external) {
+ if (attrs->pci_vf.external || attrs->pci_vf.controller) {
n = snprintf(name, len, "c%u", attrs->pci_vf.controller);
if (n >= len)
return -EINVAL;
@@ -1550,7 +1550,7 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port,
attrs->pci_vf.pf, attrs->pci_vf.vf);
break;
case DEVLINK_PORT_FLAVOUR_PCI_SF:
- if (attrs->pci_sf.external) {
+ if (attrs->pci_sf.external || attrs->pci_sf.controller) {
n = snprintf(name, len, "c%u", attrs->pci_sf.controller);
if (n >= len)
return -EINVAL;