[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7534483b-c893-4d25-b69e-247123f35c56@suse.de>
Date: Wed, 15 Oct 2025 13:15:34 +0200
From: Fernando Fernandez Mancera <fmancera@...e.de>
To: Jan Vaclav <jvaclav@...hat.com>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Simon Horman <horms@...nel.org>,
Jakub Kicinski <kuba@...nel.org>
Cc: Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net/hsr: add interlink to fill_info output
On 10/15/25 12:10 PM, Jan Vaclav wrote:
> Currently, it is possible to configure the interlink
> port, but no way to read it back from userspace.
>
> Add it to the output of hsr_fill_info(), so it can be
> read from userspace, for example:
>
> $ ip -d link show hsr0
> 12: hsr0: <BROADCAST,MULTICAST> mtu ...
> ...
> hsr slave1 veth0 slave2 veth1 interlink veth2 ...
>
> Signed-off-by: Jan Vaclav <jvaclav@...hat.com>
> ---
> net/hsr/hsr_netlink.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c
> index 4461adf69623..851187130755 100644
> --- a/net/hsr/hsr_netlink.c
> +++ b/net/hsr/hsr_netlink.c
> @@ -160,6 +160,12 @@ static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev)
> goto nla_put_failure;
> }
>
> + port = hsr_port_get_hsr(hsr, HSR_PT_INTERLINK);
> + if (port) {
> + if (nla_put_u32(skb, IFLA_HSR_INTERLINK, port->dev->ifindex))
> + goto nla_put_failure;
> + }
> +
> if (nla_put(skb, IFLA_HSR_SUPERVISION_ADDR, ETH_ALEN,
> hsr->sup_multicast_addr) ||
> nla_put_u16(skb, IFLA_HSR_SEQ_NR, hsr->sequence_nr))
Thank you Jan, it looks good to me.
Reviewed-by: Fernando Fernandez Mancera <fmancera@...e.de>
Powered by blists - more mailing lists