[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d7bf939b-040c-49da-8769-0f230d5dcb51@suse.de>
Date: Wed, 24 Sep 2025 14:01:24 +0200
From: Fernando Fernandez Mancera <fmancera@...e.de>
To: Ján Václav <jvaclav@...hat.com>,
Jakub Kicinski <kuba@...nel.org>
Cc: "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/24/25 1:21 PM, Ján Václav wrote:
> On Wed, Sep 24, 2025 at 2:06 AM Jakub Kicinski <kuba@...nel.org> wrote:
>>
>> On Mon, 22 Sep 2025 11:37:45 +0200 Jan Vaclav wrote:
>>> if (hsr->prot_version == PRP_V1)
>>> proto = HSR_PROTOCOL_PRP;
>>> + if (nla_put_u8(skb, IFLA_HSR_VERSION, hsr->prot_version))
>>> + goto nla_put_failure;
>>
>> Looks like configuration path does not allow setting version if proto
>> is PRP. Should we add an else before the if? since previous if is
>> checking for PRP already
>>
>
> The way HSR configuration is currently handled seems very confusing to
> me, because it allows setting the protocol version, but for PRP_V1
> only as a byproduct of setting the protocol to PRP. If you configure
> an interface with (proto = PRP, version = PRP_V1), it will fail, which
> seems wrong to me, considering this is the end result of configuring
> only with proto = PRP anyways.
>
IMO, that is a good point.
> I think the best solution would be to introduce another change that
> allows explicitly setting the version to PRP_V1 if the protocol is set
> to PRP.
>
I think it would be nice to unify the logic inside the else statement
when parsing IFLA_HSR_VERSION and the later check for HSR_PROTOCOL_PRP.
It could be simplified while supporting PRP_V1 explicitly set when PRP
protocol is set.
Which also makes me wonder, should the enum hsr_version be exposed as
UAPI? Currently it is under include/linux/if_hsr.h. But then, the naming
should be something like "HSR_VERSION_HSR_0" or similar.
Powered by blists - more mailing lists