From: Shay Drory <shayd@nvidia.com>
To: <netdev@vger.kernel.org>, <jiri@resnulli.us>, <kuba@kernel.org>,
<edumazet@google.com>, <davem@davemloft.net>, <pabeni@redhat.com>,
<horms@kernel.org>
Cc: Shay Drory <shayd@nvidia.com>, Parav Pandit <parav@nvidia.com>
Subject: [PATCH net] devlink: Expose external flag for PCI SF ports
Date: Mon, 3 Aug 2026 12:00:12 +0300 [thread overview]
Message-ID: <20260803090012.257242-1-shayd@nvidia.com> (raw)
The external flag is part of the PCI SF port attributes, but unlike the
PCI PF and PCI VF flavours it was never filled into the port dump, so
userspace could not query it directly.
Reporting of the external flag was missed for SF ports. Hence, put
DEVLINK_ATTR_PORT_EXTERNAL for the PCI SF flavour as well, matching what
PCI PF and PCI VF ports already report.
$ devlink port show pci/0033:01:00.0/163840
pci/0033:01:00.0/163840: type eth netdev eth1 flavour pcisf controller 1 pfnum 0 sfnum 77 external true splittable false
Fixes: a1ab3e4554b5 ("devlink: Extend SF port attributes to have external attribute")
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Shay Drory <shayd@nvidia.com>
---
net/devlink/port.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/devlink/port.c b/net/devlink/port.c
index dc82cac68e7d..1528f2d148df 100644
--- a/net/devlink/port.c
+++ b/net/devlink/port.c
@@ -267,6 +267,8 @@ static int devlink_nl_port_attrs_put(struct sk_buff *msg,
nla_put_u32(msg, DEVLINK_ATTR_PORT_PCI_SF_NUMBER,
attrs->pci_sf.sf))
return -EMSGSIZE;
+ if (nla_put_u8(msg, DEVLINK_ATTR_PORT_EXTERNAL, attrs->pci_sf.external))
+ return -EMSGSIZE;
break;
case DEVLINK_PORT_FLAVOUR_PHYSICAL:
case DEVLINK_PORT_FLAVOUR_CPU:
--
2.38.1
next reply other threads:[~2026-08-03 9:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 9:00 Shay Drory [this message]
2026-08-03 13:49 ` [PATCH net] devlink: Expose external flag for PCI SF ports Przemek Kitszel
2026-08-03 18:21 ` Parav Pandit
2026-08-05 23:50 ` 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=20260803090012.257242-1-shayd@nvidia.com \
--to=shayd@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=parav@nvidia.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