mbox series

[v5,net-next,0/5] net: dsa: hsr: Enable HSR HW offloading for KSZ9477

Message ID 20230920114343.1979843-1-lukma@denx.de (mailing list archive)
Headers show
Series net: dsa: hsr: Enable HSR HW offloading for KSZ9477 | expand

Message

Lukasz Majewski Sept. 20, 2023, 11:43 a.m. UTC
This patch series provides support for HSR HW offloading in KSZ9477
switch IC.

To test this feature:
ip link add name hsr0 type hsr slave1 lan1 slave2 lan2 supervision 45 version 1
ip link set dev lan1 up
ip link set dev lan2 up
ip a add 192.168.0.1/24 dev hsr0
ip link set dev hsr0 up

To remove HSR network device:
ip link del hsr0

To test if one can adjust MAC address:
ip link set lan2 address 00:01:02:AA:BB:CC

It is also possible to create another HSR interface, but it will
only support HSR is software - e.g.
ip link add name hsr1 type hsr slave1 lan3 slave2 lan4 supervision 45 version 1

Test HW:
Two KSZ9477-EVB boards with HSR ports set to "Port1" and "Port2".

Performance SW used:
nuttcp -S --nofork
nuttcp -vv -T 60 -r 192.168.0.2
nuttcp -vv -T 60 -t 192.168.0.2

Code: v6.6.0-rc1+ Linux repository
Tested HSR v0 and v1
Results:
With KSZ9477 offloading support added: RX: 100 Mbps TX: 98 Mbps
With no offloading 		       RX: 63 Mbps  TX: 63 Mbps

Lukasz Majewski (2):
  net: dsa: tag_ksz: Extend ksz9477_xmit() for HSR frame duplication
  net: dsa: microchip: Enable HSR offloading for KSZ9477

Vladimir Oltean (3):
  net: dsa: propagate extack to ds->ops->port_hsr_join()
  net: dsa: notify drivers of MAC address changes on user ports
  net: dsa: microchip: move REG_SW_MAC_ADDR to dev->info->regs[]

 drivers/net/dsa/microchip/ksz8795_reg.h |   7 --
 drivers/net/dsa/microchip/ksz9477.c     |  70 +++++++++++
 drivers/net/dsa/microchip/ksz9477.h     |   2 +
 drivers/net/dsa/microchip/ksz9477_reg.h |   7 --
 drivers/net/dsa/microchip/ksz_common.c  | 149 ++++++++++++++++++++++++
 drivers/net/dsa/microchip/ksz_common.h  |  10 ++
 drivers/net/dsa/xrs700x/xrs700x.c       |  18 ++-
 include/net/dsa.h                       |  13 ++-
 net/dsa/port.c                          |   5 +-
 net/dsa/port.h                          |   3 +-
 net/dsa/slave.c                         |   9 +-
 net/dsa/tag_ksz.c                       |   8 ++
 12 files changed, 276 insertions(+), 25 deletions(-)

Comments

Vladimir Oltean Sept. 21, 2023, 7:23 p.m. UTC | #1
Hi Lukasz,

On Wed, Sep 20, 2023 at 01:43:38PM +0200, Lukasz Majewski wrote:
> Code: v6.6.0-rc1+ Linux repository

Your patches conflict with Oleksij's ACL patches, merged on the 14th of September.
https://patchwork.kernel.org/project/netdevbpf/patch/20230914131145.23336-1-o.rempel@pengutronix.de/

Please always submit patches formatted on the most recent tip of the
"main" branch of https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
at the time of submission, not "v6.6.0-rc1+ Linux repository". There is
nothing that will be done with patches formatted on older trees.

https://patchwork.kernel.org/project/netdevbpf/patch/20230920114343.1979843-2-lukma@denx.de/
netdev/apply 	fail 	Patch does not apply to net-next
Lukasz Majewski Sept. 22, 2023, 11:18 a.m. UTC | #2
Hi Vladimir,

> Hi Lukasz,
> 
> On Wed, Sep 20, 2023 at 01:43:38PM +0200, Lukasz Majewski wrote:
> > Code: v6.6.0-rc1+ Linux repository  
> 
> Your patches conflict with Oleksij's ACL patches, merged on the 14th
> of September.
> https://patchwork.kernel.org/project/netdevbpf/patch/20230914131145.23336-1-o.rempel@pengutronix.de/
> 
> Please always submit patches formatted on the most recent tip of the
> "main" branch of
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git

By mistake my net-next repo was pointing to:
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Please correct me if I'm wrong but it looks like the net repo for
current mainline fixes...

> at the time of submission, not "v6.6.0-rc1+ Linux repository". There
> is nothing that will be done with patches formatted on older trees.
> 
> https://patchwork.kernel.org/project/netdevbpf/patch/20230920114343.1979843-2-lukma@denx.de/
> netdev/apply 	fail 	Patch does not apply to net-next

However, after fetching net-next - I can apply v5 without issues on top
of it.

SHA1: 5a1b322cb0b7d0d33a2d13462294dc0f46911172
"Merge branch 'mlxsw-multicast'"

https://source.denx.de/linux/linux-ksz9477/-/commits/net-next-ksz-HSR-devel-v5?ref_type=heads
Linux version from `uname -a`: 6.6.0-rc2+

However, it looks like I would need to prepare v6 anyway...

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: lukma@denx.de
Vladimir Oltean Sept. 22, 2023, 11:31 a.m. UTC | #3
On Fri, Sep 22, 2023 at 01:18:38PM +0200, Lukasz Majewski wrote:
> By mistake my net-next repo was pointing to:
> git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
> 
> Please correct me if I'm wrong but it looks like the net repo for
> current mainline fixes...

Yes, net.git is for fixes to the current mainline branch, and net-next
is for new features to be included in mainline during the next merge window.
They are the same at the beginning of the development cycle and then
they start to diverge.

> However, after fetching net-next - I can apply v5 without issues on top
> of it.
> 
> SHA1: 5a1b322cb0b7d0d33a2d13462294dc0f46911172
> "Merge branch 'mlxsw-multicast'"
> 
> https://source.denx.de/linux/linux-ksz9477/-/commits/net-next-ksz-HSR-devel-v5?ref_type=heads
> Linux version from `uname -a`: 6.6.0-rc2+
> 
> However, it looks like I would need to prepare v6 anyway...

I don't know. "git rebase" is a bit smarter than "git am" and can
automatically resolve some conflicts, on which "git am" will simply bail
out if even the context is not identical. Either way, both patchwork and
me failed to apply your v5 series on net-next, and the patches won't be
accepted without build testing.
Lukasz Majewski Sept. 22, 2023, 11:47 a.m. UTC | #4
Hi Vladimir,

> On Fri, Sep 22, 2023 at 01:18:38PM +0200, Lukasz Majewski wrote:
> > By mistake my net-next repo was pointing to:
> > git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
> > 
> > Please correct me if I'm wrong but it looks like the net repo for
> > current mainline fixes...  
> 
> Yes, net.git is for fixes to the current mainline branch, and net-next
> is for new features to be included in mainline during the next merge
> window. They are the same at the beginning of the development cycle
> and then they start to diverge.
> 
> > However, after fetching net-next - I can apply v5 without issues on
> > top of it.
> > 
> > SHA1: 5a1b322cb0b7d0d33a2d13462294dc0f46911172
> > "Merge branch 'mlxsw-multicast'"
> > 
> > https://source.denx.de/linux/linux-ksz9477/-/commits/net-next-ksz-HSR-devel-v5?ref_type=heads
> > Linux version from `uname -a`: 6.6.0-rc2+
> > 
> > However, it looks like I would need to prepare v6 anyway...  
> 
> I don't know. "git rebase" is a bit smarter than "git am" and can
> automatically resolve some conflicts, on which "git am" will simply
> bail out if even the context is not identical. Either way, both
> patchwork and me failed to apply your v5 series on net-next, and the
> patches won't be accepted without build testing.

Ok. I will test them with git am -3


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: lukma@denx.de