From: Lukasz Majewski <lukma@denx.de>
To: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kuba@kernel.org" <kuba@kernel.org>,
"n.zhandarovich@fintech.ru" <n.zhandarovich@fintech.ru>,
"edumazet@google.com" <edumazet@google.com>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"horms@kernel.org" <horms@kernel.org>,
"m-karicheri2@ti.com" <m-karicheri2@ti.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [EXT] Re: [RFC PATCH net-next] net: hsr: create an API to get hsr port type
Date: Thu, 24 Jul 2025 13:24:49 +0200 [thread overview]
Message-ID: <20250724132449.38f0e59a@wsk> (raw)
In-Reply-To: <DB9PR04MB92591B3DA0F1CB9CBDE83C24F05EA@DB9PR04MB9259.eurprd04.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 3381 bytes --]
Hi Xiaoliang,
> Hi Lukasz,
>
> >
> > Hi Xiaoliang,
> >
> > > If a switch device has HSR hardware ability and HSR configuration
> > > offload to hardware. The device driver needs to get the HSR port
> > > type when joining the port to HSR. Different port types require
> > > different settings for the hardware, like HSR_PT_SLAVE_A,
> > > HSR_PT_SLAVE_B, and HSR_PT_INTERLINK. Create the API
> > > hsr_get_port_type() and export it.
> >
> > Could you describe the use case in more detail - as pointed out by
> > Vladimir?
> >
> > In my use case - when I use the KSZ9477 switch I just provide
> > correct arguments for the iproute2 configuration:
> >
> > # Configuration - RedBox (EVB-KSZ9477):
> > if link set lan1 down;ip link set lan2 down ip link add name hsr0
> > type hsr slave1 lan1 slave2 lan2 supervision 45
> > version 1
> > ip link add name hsr1 type hsr slave1 lan4 slave2 lan5 interlink
> > lan3 supervision 45 version 1
> > ip link set lan4 up;ip link set lan5 up
> > ip link set lan3 up
> > ip addr add 192.168.0.11/24 dev hsr1
> > ip link set hsr1 up
> >
> > # Configuration - DAN-H (EVB-KSZ9477):
> > ip link set lan1 down;ip link set lan2 down ip link add name hsr0
> > type hsr slave1 lan1 slave2 lan2 supervision 45
> > version 1
> > ip link add name hsr1 type hsr slave1 lan4 slave2 lan5 supervision
> > 45 version 1
> > ip link set lan4 up;ip link set lan5 up
> > ip addr add 192.168.0.12/24 dev hsr1
> > ip link set hsr1 up
> >
> > More info (also regarding HSR testing with QEMU) can be found from:
> > https://lpc.events/event/18/contributions/1969/attachments/1456/3092/lpc-
> > 2024-HSR-v1.0-e26d140f6845e94afea.pdf
> >
> >
> > As fair as I remember - the Node Table can be read from debugfs.
> >
> > However, such approach has been regarded as obsolete - by the
> > community.
> >
> > In the future development plans there was the idea to use netlink
> > (or iproute separate program) to get the data now available in
> > debugfs and extend it to also print REDBOX node info (not only
> > DANH).
> I need to offload the NETIF_F_HW_HSR_TAG_INS and NETIF_F_HW_HSR_TAG_RM
> to hardware.
I've recently added some "offloading" support for KSZ9477 switch IC.
You can use it as a reference.
> The hardware needs to know which ports are slave ports,
> which is interlink port.
This information you provide to the network driver when you call:
ip link add name hsr0 type hsr slave1 lan1 slave2 lan2 supervision 45
version 1
Then the lan1 is configured as slave 1 and lan2 as slave 2
For interlink (RedBOX):
ip link add name hsr1 type hsr slave1 lan4 slave2 lan5 interlink
lan3 supervision 45 version 1
>
> Hardware remove HSR tag on interlink port if it is egress port, keep
> the HSR tag on HSR slave ports. The frames from ring network are
> removed HSR tag and forwarded to interlink port in hardware, not
> received in HSR stack.
Just out of curiosity - which HW IP block has such great capability to
remove in HW HSR tag from RedBox frames?
>
> Thanks,
> Xiaoliang
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Johanna Denk,
Tabea Lutz HRB 165235 Munich, Office: Kirchenstr.5, D-82194
Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-07-24 11:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-23 10:47 [RFC PATCH net-next] net: hsr: create an API to get hsr port type Xiaoliang Yang
2025-07-23 12:14 ` Lukasz Majewski
2025-07-24 10:54 ` [EXT] " Xiaoliang Yang
2025-07-24 11:24 ` Lukasz Majewski [this message]
2025-08-25 15:55 ` Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250724132449.38f0e59a@wsk \
--to=lukma@denx.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m-karicheri2@ti.com \
--cc=n.zhandarovich@fintech.ru \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vladimir.oltean@nxp.com \
--cc=xiaoliang.yang_1@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox