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-next>] [day] [month] [year] [list]
Message-Id: <20251130131657.65080-1-vladimir.oltean@nxp.com>
Date: Sun, 30 Nov 2025 15:16:42 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
	Alvin Šipraga <alsi@...g-olufsen.dk>,
	Clément Léger <clement.leger@...tlin.com>,
	"Chester A. Unal" <chester.a.unal@...nc9.com>,
	Daniel Golle <daniel@...rotopia.org>,
	David Yang <mmyangfl@...il.com>,
	DENG Qingfang <dqfext@...il.com>,
	Florian Fainelli <florian.fainelli@...adcom.com>,
	George McCollister <george.mccollister@...il.com>,
	Hauke Mehrtens <hauke@...ke-m.de>,
	Jonas Gorski <jonas.gorski@...il.com>,
	Kurt Kanzenbach <kurt@...utronix.de>,
	Linus Walleij <linus.walleij@...aro.org>,
	Lukasz Majewski <lukma@...x.de>,
	Sean Wang <sean.wang@...iatek.com>,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Woojung Huh <woojung.huh@...rochip.com>,
	Xiaoliang Yang <xiaoliang.yang_1@....com>,
	linux-renesas-soc@...r.kernel.org,
	UNGLinuxDriver@...rochip.com
Subject: [PATCH net-next 00/15] DSA simple HSR offload

Provide a "simple" form of HSR offload for 8 DSA drivers (just the
NETIF_F_HW_HSR_DUP feature) based on the fact that their taggers use the
dsa_xmit_port_mask() function. This is in patches 6-13/15.

The helpers per se are introduced in patch 5/15, and documented in patch
15/15. Patch 14/15 is another small (and related) documentation update.

For HSR interlink ports the offloading rules are not quite so clear, and
for now we completely reject the offload. We can revise that once we see
a full offload implementation and understand what is needed.

To reject the offload, we need to know the port type, and patch 2/15
helps with that.

xrs700x is another driver which should have rejected offload based on
port type (patch 4/15). This is a bug fix submitted through net-next due
to the extra API required to fix it. If necessary, it could also be
picked up separately for backporting.

There is also patch 3/15, which makes the HSR offload like the others
supported by DSA: if we fall back to the software implementation, don't
call port_hsr_leave(), because by definition there won't be anything to
do.

A slightly unrelated change is patch 1/15, but I noticed this along the
way, and if I were to submit it separately, it would conflict with this
work (it would appear in patch 12/15's context).

Most of the driver additions are trivial. By far the most complex was
ocelot (which I could test). Microchip ksz (which I cannot test, and did
not patch) would also have some complexity. Essentially, ksz_hsr_join()
could fall back to a partial offload through the simple helpers, if the
full offload is not possible. But keeping track of which offload kind
was used is necessary later in ksz_hsr_leave(). This is left as homework
for interested developers.

With this patch set, one can observe a 50% reduction in transmitted
traffic over HSR interfaces.

Cc: "Alvin Šipraga" <alsi@...g-olufsen.dk>
Cc: "Clément Léger" <clement.leger@...tlin.com>
Cc: "Chester A. Unal" <chester.a.unal@...nc9.com>
Cc: Daniel Golle <daniel@...rotopia.org>
Cc: David Yang <mmyangfl@...il.com>
Cc: DENG Qingfang <dqfext@...il.com>
Cc: Florian Fainelli <florian.fainelli@...adcom.com>
Cc: George McCollister <george.mccollister@...il.com>
Cc: Hauke Mehrtens <hauke@...ke-m.de>
Cc: Jonas Gorski <jonas.gorski@...il.com>
Cc: Kurt Kanzenbach <kurt@...utronix.de>
Cc: Linus Walleij <linus.walleij@...aro.org>
Cc: Lukasz Majewski <lukma@...x.de>
Cc: Sean Wang <sean.wang@...iatek.com>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Woojung Huh <woojung.huh@...rochip.com>
Cc: Xiaoliang Yang <xiaoliang.yang_1@....com>
Cc: linux-renesas-soc@...r.kernel.org
Cc: UNGLinuxDriver@...rochip.com

Vladimir Oltean (14):
  net: dsa: mt7530: unexport mt7530_switch_ops
  net: dsa: avoid calling ds->ops->port_hsr_leave() when unoffloaded
  net: dsa: xrs700x: reject unsupported HSR configurations
  net: dsa: add simple HSR offload helpers
  net: dsa: yt921x: use simple HSR offloading helpers
  net: dsa: ocelot: use simple HSR offload helpers
  net: dsa: realtek: use simple HSR offload helpers
  net: dsa: lantiq_gswip: use simple HSR offload helpers
  net: dsa: mv88e6060: use simple HSR offload helpers
  net: dsa: hellcreek: use simple HSR offload helpers
  net: dsa: mt7530: use simple HSR offload helpers
  net: dsa: a5psw: use simple HSR offload helpers
  Documentation: net: dsa: mention availability of RedBox
  Documentation: net: dsa: mention simple HSR offload helpers

Xiaoliang Yang (1):
  net: hsr: create an API to get hsr port type

 Documentation/networking/dsa/dsa.rst         | 17 +++--
 drivers/net/dsa/hirschmann/hellcreek.c       |  2 +
 drivers/net/dsa/lantiq/lantiq_gswip_common.c |  2 +
 drivers/net/dsa/mt7530.c                     |  5 +-
 drivers/net/dsa/mt7530.h                     |  1 -
 drivers/net/dsa/mv88e6060.c                  |  2 +
 drivers/net/dsa/ocelot/felix.c               | 70 +++++++++++++++++++-
 drivers/net/dsa/realtek/rtl8365mb.c          |  2 +
 drivers/net/dsa/realtek/rtl8366rb.c          |  2 +
 drivers/net/dsa/rzn1_a5psw.c                 |  2 +
 drivers/net/dsa/xrs700x/xrs700x.c            | 11 +++
 drivers/net/dsa/yt921x.c                     |  3 +
 include/linux/if_hsr.h                       |  9 +++
 include/net/dsa.h                            |  9 +++
 net/dsa/dsa.c                                | 65 ++++++++++++++++++
 net/dsa/port.c                               |  3 +
 net/hsr/hsr_device.c                         | 20 ++++++
 net/hsr/hsr_slave.c                          |  7 +-
 18 files changed, 220 insertions(+), 12 deletions(-)

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ