* [PATCH v3 net-next] net/hsr: add protocol version to fill_info output
@ 2025-10-09 21:09 Jan Vaclav
2025-10-14 8:48 ` Fernando Fernandez Mancera
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jan Vaclav @ 2025-10-09 21:09 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Simon Horman, Jakub Kicinski
Cc: Paolo Abeni, netdev, Jan Vaclav
Currently, it is possible to configure IFLA_HSR_VERSION, but
there is no way to check in userspace what the currently
configured HSR protocol version is.
Add it to the output of hsr_fill_info(), when the interface
is using the HSR protocol. Let's not expose it when using
the PRP protocol, since it only has one version and it's
not possible to set it from userspace.
This info could then be used by e.g. ip(8), like so:
$ ip -d link show hsr0
12: hsr0: <BROADCAST,MULTICAST> mtu ...
...
hsr slave1 veth0 slave2 veth1 ... proto 0 version 1
---
v3: Changed after discussion so that IFLA_HSR_VERSION is filled
only when the protocol is HSR (and not PRP, since setting
the version is prohibited if the protocol is PRP).
v2: https://lore.kernel.org/netdev/20250922093743.1347351-3-jvaclav@redhat.com/
v1: https://lore.kernel.org/netdev/20250918125337.111641-2-jvaclav@redhat.com/
net/hsr/hsr_netlink.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c
index b12047024..4461adf69 100644
--- a/net/hsr/hsr_netlink.c
+++ b/net/hsr/hsr_netlink.c
@@ -166,6 +166,8 @@ static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev)
goto nla_put_failure;
if (hsr->prot_version == PRP_V1)
proto = HSR_PROTOCOL_PRP;
+ else if (nla_put_u8(skb, IFLA_HSR_VERSION, hsr->prot_version))
+ goto nla_put_failure;
if (nla_put_u8(skb, IFLA_HSR_PROTOCOL, proto))
goto nla_put_failure;
--
2.51.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v3 net-next] net/hsr: add protocol version to fill_info output
2025-10-09 21:09 [PATCH v3 net-next] net/hsr: add protocol version to fill_info output Jan Vaclav
@ 2025-10-14 8:48 ` Fernando Fernandez Mancera
2025-10-14 8:54 ` Jan Vaclav
2025-10-14 12:20 ` Andrew Lunn
2025-10-14 13:20 ` patchwork-bot+netdevbpf
2 siblings, 1 reply; 5+ messages in thread
From: Fernando Fernandez Mancera @ 2025-10-14 8:48 UTC (permalink / raw)
To: Jan Vaclav, David S. Miller, Eric Dumazet, Simon Horman,
Jakub Kicinski
Cc: Paolo Abeni, netdev
On 10/9/25 11:09 PM, Jan Vaclav wrote:
> Currently, it is possible to configure IFLA_HSR_VERSION, but
> there is no way to check in userspace what the currently
> configured HSR protocol version is.
>
> Add it to the output of hsr_fill_info(), when the interface
> is using the HSR protocol. Let's not expose it when using
> the PRP protocol, since it only has one version and it's
> not possible to set it from userspace.
>
> This info could then be used by e.g. ip(8), like so:
> $ ip -d link show hsr0
> 12: hsr0: <BROADCAST,MULTICAST> mtu ...
> ...
> hsr slave1 veth0 slave2 veth1 ... proto 0 version 1
I think this is missing the 'Signed-off-by' tag. Other than that, it
looks good to me. Not sure if it can be added while merging.
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 net-next] net/hsr: add protocol version to fill_info output
2025-10-14 8:48 ` Fernando Fernandez Mancera
@ 2025-10-14 8:54 ` Jan Vaclav
0 siblings, 0 replies; 5+ messages in thread
From: Jan Vaclav @ 2025-10-14 8:54 UTC (permalink / raw)
To: Fernando Fernandez Mancera, David S. Miller, Eric Dumazet,
Simon Horman, Jakub Kicinski
Cc: Paolo Abeni, netdev
On 14.10.2025 10:48, Fernando Fernandez Mancera wrote:
> On 10/9/25 11:09 PM, Jan Vaclav wrote:
>> Currently, it is possible to configure IFLA_HSR_VERSION, but
>> there is no way to check in userspace what the currently
>> configured HSR protocol version is.
>>
>> Add it to the output of hsr_fill_info(), when the interface
>> is using the HSR protocol. Let's not expose it when using
>> the PRP protocol, since it only has one version and it's
>> not possible to set it from userspace.
>>
>> This info could then be used by e.g. ip(8), like so:
>> $ ip -d link show hsr0
>> 12: hsr0: <BROADCAST,MULTICAST> mtu ...
>> ...
>> hsr slave1 veth0 slave2 veth1 ... proto 0 version 1
>
> I think this is missing the 'Signed-off-by' tag. Other than that, it
> looks good to me. Not sure if it can be added while merging.
>
> Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
>
Yes, it looks like I dropped my signoff somewhere along the way, my
apologies. If it's possible to add it while merging, please consider
this patch as:
Signed-off-by: Jan Vaclav <jvaclav@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 net-next] net/hsr: add protocol version to fill_info output
2025-10-09 21:09 [PATCH v3 net-next] net/hsr: add protocol version to fill_info output Jan Vaclav
2025-10-14 8:48 ` Fernando Fernandez Mancera
@ 2025-10-14 12:20 ` Andrew Lunn
2025-10-14 13:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2025-10-14 12:20 UTC (permalink / raw)
To: Jan Vaclav
Cc: David S. Miller, Eric Dumazet, Simon Horman, Jakub Kicinski,
Paolo Abeni, netdev
On Thu, Oct 09, 2025 at 11:09:08PM +0200, Jan Vaclav wrote:
> Currently, it is possible to configure IFLA_HSR_VERSION, but
> there is no way to check in userspace what the currently
> configured HSR protocol version is.
>
> Add it to the output of hsr_fill_info(), when the interface
> is using the HSR protocol. Let's not expose it when using
> the PRP protocol, since it only has one version and it's
> not possible to set it from userspace.
>
> This info could then be used by e.g. ip(8), like so:
> $ ip -d link show hsr0
> 12: hsr0: <BROADCAST,MULTICAST> mtu ...
> ...
> hsr slave1 veth0 slave2 veth1 ... proto 0 version 1
> ---
Patchwork probably accepted your delayed Signed-off-by, so this might
be accepted as is. But please wait 3 days and if you don't see a merge
email, resubmit.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v3 net-next] net/hsr: add protocol version to fill_info output
2025-10-09 21:09 [PATCH v3 net-next] net/hsr: add protocol version to fill_info output Jan Vaclav
2025-10-14 8:48 ` Fernando Fernandez Mancera
2025-10-14 12:20 ` Andrew Lunn
@ 2025-10-14 13:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-14 13:20 UTC (permalink / raw)
To: Jan Vaclav; +Cc: davem, edumazet, horms, kuba, pabeni, netdev
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Thu, 9 Oct 2025 23:09:08 +0200 you wrote:
> Currently, it is possible to configure IFLA_HSR_VERSION, but
> there is no way to check in userspace what the currently
> configured HSR protocol version is.
>
> Add it to the output of hsr_fill_info(), when the interface
> is using the HSR protocol. Let's not expose it when using
> the PRP protocol, since it only has one version and it's
> not possible to set it from userspace.
>
> [...]
Here is the summary with links:
- [v3,net-next] net/hsr: add protocol version to fill_info output
https://git.kernel.org/netdev/net-next/c/16a2206354d1
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] 5+ messages in thread
end of thread, other threads:[~2025-10-14 13:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09 21:09 [PATCH v3 net-next] net/hsr: add protocol version to fill_info output Jan Vaclav
2025-10-14 8:48 ` Fernando Fernandez Mancera
2025-10-14 8:54 ` Jan Vaclav
2025-10-14 12:20 ` Andrew Lunn
2025-10-14 13:20 ` 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;
as well as URLs for NNTP newsgroup(s).