]> Gentwo Git Trees - linux/.git/commit
net: dsa: ocelot: use simple HSR offload helpers
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 30 Nov 2025 13:16:49 +0000 (15:16 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 2 Dec 2025 00:45:07 +0000 (16:45 -0800)
commit4b65d445556d398b54fbeed8780ea9f07813f757
tree2e46e5a5e9fe142e34031a408d6ce697724f29ee
parent42e63b1373a32bd136dc51325684727f3b9a4986
net: dsa: ocelot: use simple HSR offload helpers

Accelerate TX packet duplication with HSR rings.

This is only possible with the NPI-based "ocelot" tagging protocol, not
with "ocelot-8021q", because the latter does not use dsa_xmit_port_mask().

This has 2 implications:
- Depending on tagging protocol, we should set (or not set) the offload
  feature flags. Switching tagging protocols is done with ports down, by
  design. Additional calls to dsa_port_simple_hsr_join() can be put in
  the ds->ops->change_tag_protocol() path, as I had originally tried,
  but this would not work: dsa_user_setup_tagger() would later clear
  the feature flag that we just set. So the additional call to
  dsa_port_simple_hsr_join() should sit in the ds->ops->port_enable()
  call.

- When joining a HSR ring and we are currently using "ocelot-8021q",
  there are cases when we should return -EOPNOTSUPP (pessimistic) and
  cases when we shouldn't (optimistic). In the pessimistic case, it is a
  configuration that the port won't support even with the right tagging
  protocol. Distinguishing between these 2 cases matters because if we
  just return -EOPNOTSUPP regardless, we lose the dp->hsr_dev pointer
  and can no longer replay the offload later for the optimistic case,
  from felix_port_enable().

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20251130131657.65080-8-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/ocelot/felix.c