From: "Łukasz Majewski" <lukma@nabladev.com>
To: Frieder Schrempf <frieder.schrempf@kontron.de>
Cc: Frieder Schrempf <frieder@fris.de>,
netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
linux-kernel@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
UNGLinuxDriver@microchip.com, Vladimir Oltean <olteanv@gmail.com>,
Woojung Huh <woojung.huh@microchip.com>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Jesse Van Gavere <jesseevg@gmail.com>,
Oleksij Rempel <o.rempel@pengutronix.de>,
Pieter Van Trappen <pieter.van.trappen@cern.ch>,
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
Simon Horman <horms@kernel.org>,
Tristram Ha <tristram.ha@microchip.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>
Subject: Re: [RFC PATCH] net: dsa: microchip: Prevent overriding of HSR port forwarding
Date: Thu, 14 Aug 2025 09:23:09 +0200 [thread overview]
Message-ID: <20250814092309.1534e1b4@wsk> (raw)
In-Reply-To: <a838b848-8633-4312-b246-17af9175535c@kontron.de>
On Wed, 13 Aug 2025 17:57:02 +0200
Frieder Schrempf <frieder.schrempf@kontron.de> wrote:
> Am 13.08.25 um 17:45 schrieb Łukasz Majewski:
> > [Sie erhalten nicht h?ufig E-Mails von lukma@nabladev.com. Weitere
> > Informationen, warum dies wichtig ist, finden Sie unter
> > https://aka.ms/LearnAboutSenderIdentification ]
> >
> > Hi Frieder,
> >
> >> From: Frieder Schrempf <frieder.schrempf@kontron.de>
> >>
> >> The KSZ9477 supports NETIF_F_HW_HSR_FWD to forward packets between
> >> HSR ports. This is set up when creating the HSR interface via
> >> ksz9477_hsr_join() and ksz9477_cfg_port_member().
> >>
> >> At the same time ksz_update_port_member() is called on every
> >> state change of a port and reconfiguring the forwarding to the
> >> default state which means packets get only forwarded to the CPU
> >> port.
> >>
> >> If the ports are brought up before setting up the HSR interface
> >> and then the port state is not changed afterwards, everything works
> >> as intended:
> >>
> >> ip link set lan1 up
> >> ip link set lan2 up
> >> ip link add name hsr type hsr slave1 lan1 slave2 lan2 supervision
> >> 45 version 1 ip addr add dev hsr 10.0.0.10/24
> >> ip link set hsr up
> >>
> >> If the port state is changed after creating the HSR interface, this
> >> results in a non-working HSR setup:
> >>
> >> ip link add name hsr type hsr slave1 lan1 slave2 lan2 supervision
> >> 45 version 1 ip addr add dev hsr 10.0.0.10/24
> >> ip link set lan1 up
> >> ip link set lan2 up
> >> ip link set hsr up
> >>
> >> In this state, packets will not get forwarded between the HSR ports
> >> and communication between HSR nodes that are not direct neighbours
> >> in the topology fails.
> >>
> >> To avoid this, we prevent all forwarding reconfiguration requests
> >> for ports that are part of a HSR setup with NETIF_F_HW_HSR_FWD
> >> enabled.
> >>
> >> Fixes: 2d61298fdd7b ("net: dsa: microchip: Enable HSR offloading
> >> for KSZ9477") Signed-off-by: Frieder Schrempf
> >> <frieder.schrempf@kontron.de> ---
> >> I'm posting this as RFC as my knowledge of the driver and the
> >> stack in general is very limited. Please review thoroughly and
> >> provide feedback. Thanks!
> >
> > I don't have the HW at hand at the moment (temporary).
> >
> > Could you check if this patch works when you create two hsr
> > interfaces
> > - i.e. hsr1 would use HW offloading from KSZ9744 and hsr2 is just
> > the one supporting HSR in software.
>
> My hardware only has three user ports. So that might get a bit
> difficult to test. I will try to configure one unconnected port to
> set up two HSR links, but I won't be able to fully test this due to
> the lack of the fourth physical link.
>
Ok, I see...
I was using the Atmel's/Microchip Devel board with 5 ports...
--
Best regards,
Lukasz Majewski
--
Nabla Software Engineering GmbH
HRB 40522 Augsburg
Phone: +49 821 45592596
E-Mail: office@nabladev.com
Geschftsfhrer : Stefano Babic
next prev parent reply other threads:[~2025-08-14 7:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 15:26 [RFC PATCH] net: dsa: microchip: Prevent overriding of HSR port forwarding Frieder Schrempf
2025-08-13 15:45 ` Łukasz Majewski
2025-08-13 15:57 ` Frieder Schrempf
2025-08-14 7:23 ` Łukasz Majewski [this message]
2025-08-14 22:59 ` Andrew Lunn
2025-08-15 18:30 ` Frieder Schrempf
2025-08-16 0:53 ` Tristram.Ha
2025-08-18 11:00 ` Frieder Schrempf
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=20250814092309.1534e1b4@wsk \
--to=lukma@nabladev.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=frieder.schrempf@kontron.de \
--cc=frieder@fris.de \
--cc=horms@kernel.org \
--cc=jesseevg@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=pieter.van.trappen@cern.ch \
--cc=rmk+kernel@armlinux.org.uk \
--cc=tristram.ha@microchip.com \
--cc=vadim.fedorenko@linux.dev \
--cc=woojung.huh@microchip.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.