Subject: Re: [PATCH v2 net-next] net: dsa: Allow only up to two HSR HW offloaded ports for KSZ9477

From: Lukasz Majewski <[email-masked]>
Date: Thu, 20 Jun 2024 09:59:20 +0200

Hi Vladimir,

> On Wed, Jun 19, 2024 at 06:48:14PM +0300, Vladimir Oltean wrote:
> > Granted, this isn't an actual functional problem, but given that you
> > are fixing a newly developed feature for net-next, and that this is
> > API that gets progressively harder to change as more devices
> > implement offloads, I would expect a more obvious signaling
> > mechanism to exist for this, and now seems a good time to do it,
> > rather than opting for the most minimal fix.  
> 
> Actually I'm not even so sure about this basic fact, that it isn't a
> functional problem already.
> 
> xrs700x_hsr_join() has explicit checks for port 1 and 2. Obviously it
> expects those ports to be ring ports.

Yes.

> 
> But if you configure from user space ports 0 and 1 to be ring ports,
> and port 2 to be an interlink port, the kernel will accept that
> configuration. 

Yes.

> It will return -EOPNOTSUPP for port 0, 

This comment is for xrs700x_hsr_join()?

For the ksz_hsr_join() we do explicitly check for the KSZ9477_CHIP_ID.

I do regard this fix as a ksz9477 specific one, as there are some
issues (IMHO - this is the "unexpected behaviour" case for this IC) when
we add interlink to SoC VLAN.

I don't understand why you bring up xrs700x case here? Is it to get a
"broader context"?

> falling back to
> software mode for the first ring port, then accept offload for ring
> ports 1 and 2. But it doesn't match what user space requested, because
> port 2 should be interlink...

Please correct me if I'm wrong, but this seems to not be the case for
ksz9477 - as I stated in the other mail - the ordering is correct (I've
checked it).

> 
> I think you really should pass the port type down to drivers and
> reject offloading interlink ports...

As stated above - IMHO I do provide a fix for this particular IC
(KSZ9477). With xrs700x we do have fixed ports supporting HSR (port
1,2), so there is no other choice. As a result the HSR Interlink would
be supporting only SW emulation.

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: [email-masked]