* [PATCH net] devlink: Expose external flag for PCI SF ports
@ 2026-08-03 9:00 Shay Drory
2026-08-03 13:49 ` Przemek Kitszel
2026-08-05 23:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Shay Drory @ 2026-08-03 9:00 UTC (permalink / raw)
To: netdev, jiri, kuba, edumazet, davem, pabeni, horms
Cc: Shay Drory, Parav Pandit
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] devlink: Expose external flag for PCI SF ports
2026-08-03 9:00 [PATCH net] devlink: Expose external flag for PCI SF ports Shay Drory
@ 2026-08-03 13:49 ` Przemek Kitszel
2026-08-03 18:21 ` Parav Pandit
2026-08-05 23:50 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Przemek Kitszel @ 2026-08-03 13:49 UTC (permalink / raw)
To: Shay Drory, Parav Pandit
Cc: netdev, jiri, kuba, edumazet, davem, pabeni, horms
On 8/3/26 11:00, Shay Drory wrote:
> 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")
Cited commit has neither introduced a user-observed bug nor a buggy
feature, merely a "backend for a feature", and now you exposes it,
making "the frontend".
IOW: I will rather call it a next material.
OTOH, code is fine
> 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:
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH net] devlink: Expose external flag for PCI SF ports
2026-08-03 13:49 ` Przemek Kitszel
@ 2026-08-03 18:21 ` Parav Pandit
0 siblings, 0 replies; 4+ messages in thread
From: Parav Pandit @ 2026-08-03 18:21 UTC (permalink / raw)
To: Przemek Kitszel, Shay Drori
Cc: netdev@vger.kernel.org, jiri@resnulli.us, kuba@kernel.org,
edumazet@google.com, davem@davemloft.net, pabeni@redhat.com,
horms@kernel.org
> From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Sent: 03 August 2026 07:20 PM
>
> On 8/3/26 11:00, Shay Drory wrote:
> > 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")
>
> Cited commit has neither introduced a user-observed bug nor a buggy
> feature, merely a "backend for a feature", and now you exposes it,
> making "the frontend".
> IOW: I will rather call it a next material.
>
It is indeed a user observable bug to an extent that SF port is external, but user is not able to see the same.
External attribute was exposed as devlink port 'frontend' attribute.
A script that was supposed to work for the external PF, fails to find the attribute on the SF of the external PF.
The cited patch missed to expose the attribute, which was the patch's original intent; which in my view is a bug and fixes tag.
But at the same time, one can also say, that external flag itself was not exposed...
Inclined for net because of presence of fixes tag.
Not very strong opinion though...
> OTOH, code is fine
>
> > 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:
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] devlink: Expose external flag for PCI SF ports
2026-08-03 9:00 [PATCH net] devlink: Expose external flag for PCI SF ports Shay Drory
2026-08-03 13:49 ` Przemek Kitszel
@ 2026-08-05 23:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-05 23:50 UTC (permalink / raw)
To: Shay Drory; +Cc: netdev, jiri, kuba, edumazet, davem, pabeni, horms, parav
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 3 Aug 2026 12:00:12 +0300 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net] devlink: Expose external flag for PCI SF ports
https://git.kernel.org/netdev/net-next/c/cb59bfd419d0
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-05 23:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 9:00 [PATCH net] devlink: Expose external flag for PCI SF ports Shay Drory
2026-08-03 13:49 ` Przemek Kitszel
2026-08-03 18:21 ` Parav Pandit
2026-08-05 23:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox