[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9289aa3e-86d3-4300-8213-4edb112943f2@suse.de>
Date: Fri, 26 Sep 2025 11:33:11 +0200
From: Fernando Fernandez Mancera <fmancera@...e.de>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Ján Václav <jvaclav@...hat.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
netdev@...r.kernel.org
Subject: Re: [PATCH v2 net-next] net/hsr: add protocol version to fill_info
output
On 9/26/25 4:00 AM, Jakub Kicinski wrote:
> On Thu, 25 Sep 2025 10:37:38 +0200 Fernando Fernandez Mancera wrote:
>>> I'm not very familiar with HSR or PRP. But The PRP_V1 which has value
>>> of 3 looks like a kernel-internal hack. Or does the protocol actually
>>> specify value 3 to mean PRP?
>>>
>>> I don't think there's anything particularly wrong with the code.
>>> The version is for HSR because PRP only has one version, there's no
>>> ambiguity.
>>>
>>> But again, I'm just glancing at the code I could be wrong..
>>>
>>
>> No you are right, this is a hack made to integrate PRP with HSR driver.
>> PRP does not have a version other than PRP_V1 therefore it does not make
>> much sense to configure it. Having said that, I think it's weird to
>> report HSR_VERSION 3 but fail when configuring it.
>>
>> IMHO HSR_VERSION should be hidden for PRP or it should be possible to
>> configure it to "3" (which now that you say it, it looks weird).
>
> I think we're in agreement then? i was suggesting:
>
> --- 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;
>
> This will not report the HSR version if prot is PRP
Looks good to me. Jan could you send a v3? Thanks!
Powered by blists - more mailing lists