lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250724132449.38f0e59a@wsk>
Date: Thu, 24 Jul 2025 13:24:49 +0200
From: Lukasz Majewski <lukma@...x.de>
To: Xiaoliang Yang <xiaoliang.yang_1@....com>
Cc: "davem@...emloft.net" <davem@...emloft.net>, "netdev@...r.kernel.org"
 <netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org"
 <linux-kernel@...r.kernel.org>, "kuba@...nel.org" <kuba@...nel.org>,
 "n.zhandarovich@...tech.ru" <n.zhandarovich@...tech.ru>,
 "edumazet@...gle.com" <edumazet@...gle.com>, "pabeni@...hat.com"
 <pabeni@...hat.com>, "horms@...nel.org" <horms@...nel.org>,
 "m-karicheri2@...com" <m-karicheri2@...com>, Vladimir Oltean
 <vladimir.oltean@....com>
Subject: Re: [EXT] Re: [RFC PATCH net-next] net: hsr: create an API to get
 hsr port type

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@...x.de

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ