Skip to content

net: dsa: b53: Preliminary fixes

Florian Fainelli lkml netdev 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest6 patches 2 repliesIn review
  2. v68 patches 1 replySuperseded
  3. v58 patches 5 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v48 patches2 repliesSuperseded
v3 posting 2/28 patches7 repliesSuperseded
v3 posting 1/28 patches0 repliesSuperseded
v25 patches2 repliesSuperseded
v15 patches8 repliesSuperseded

Changes in v7 from the cover letter

- reduce the series from eight patches to six, following Sashiko's review
- move the BCM5325/BCM5365 mirror encoding fix ahead of the other mirror changes, adapting it to the original add/delete paths (now patch 5)
- combine v6 patches 4, 6 and 7 into patch 6 so destination ownership, source reference counting, register error handling and initialization are introduced together, without intermediate regressions
- introduce b53_mirror_init(), its declaration and both setup callers in the same patch; explicitly document the dependency on the encoding fix
- drop Jonas' Reviewed-by from the combined mirror patch because its scope has changed substantially
- keep the other four fixes unchanged; the override-register fix is now patch 4, and the final tree is identical to v6
- validate both mirror patches with ARM built-in and module builds, strict B53/SF2 driver compilation and mocked register regression tests; no switch hardware or suspend/resume hardware testing was performed

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6net: dsa: b53: initialize the jumbo frame size register offsetdrivers/net/dsa/b53/b53_common.c+1 -00 replies
2/6net: dsa: b53: fix the SRAB grant timeout checkdrivers/net/dsa/b53/b53_srab.c+1 -10 replies
3/6net: dsa: b53: clear stale state when creating an ARL entrydrivers/net/dsa/b53/b53_common.c+4 -00 replies
4/6net: dsa: b53: use the correct override register 2 Gbps bitdrivers/net/dsa/b53/b53_common.c+6 -30 replies
5/6net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365drivers/net/dsa/b53/b53_common.c drivers/net/dsa/b53/b53_regs.h+31 -50 replies
6/6net: dsa: b53: fix mirror destination and source state trackingdrivers/net/dsa/b53/b53_common.c drivers/net/dsa/b53/b53_priv.h drivers/net/dsa/bcm_sf2.c+140 -362 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchJonas GorskiDaniel MachonJoseph Telaak
1/6R-b
2/6R-b R-b
3/6
4/6R-b
5/6
6/6T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v7 thread

Cover letter [PATCH net v7 0/6] net: dsa: b53: Preliminary fixes

This patch series contains fixes to issues reported by Sashiko on the b53 PCS bug fixes being submitted, and then some more that came from code review and testing.

Except for issue #2, all of the other issues did trigger in testing and needed to be corrected.

Changes in v7:

- reduce the series from eight patches to six, following Sashiko's review
- move the BCM5325/BCM5365 mirror encoding fix ahead of the other mirror changes, adapting it to the original add/delete paths (now patch 5)
- combine v6 patches 4, 6 and 7 into patch 6 so destination ownership, source reference counting, register error handling and initialization are introduced together, without intermediate regressions
- introduce b53_mirror_init(), its declaration and both setup callers in the same patch; explicitly document the dependency on the encoding fix
- drop Jonas' Reviewed-by from the combined mirror patch because its scope has changed substantially
- keep the other four fixes unchanged; the override-register fix is now patch 4, and the final tree is identical to v6
- validate both mirror patches with ARM built-in and module builds, strict B53/SF2 driver compilation and mocked register regression tests; no switch hardware or suspend/resume hardware testing was performed

Changes in v6:

- patch 3: drop the commit message paragraph claiming that deleting an absent entry now returns -ENOENT, the return value is unchanged (0)
- patch 4: describe the b53_mirror_del() capture port clear as a cleanup rather than a separate fix
- patch 5: add a Fixes: tag for 41af38324341, which covers the 2 Gbps set path on GMII override registers
- patch 6: do not propagate the ds->ops->setup() error from bcm_sf2_sw_resume(), setup re-registers the devlink VLAN resource on resume and would return -EEXIST, leaving the user ports down
- patch 7: document that active mirror rules are restored on resume and that the patch depends on patches 4 and 6; verified the mirror register offsets against the BCM6368, BCM6362 and BCM63268 datasheets

Changes in v5:

- resolved build warning in patch #7 by moving b53_mirror_init()'s declaration into patch #6

Changes in v4:

- Return success when deleting an ARL entry that does not exist per
Sashiko's review
- Restrict the 2 Gbps override bit to BCM5301x and BCM58xx
- Restore mirror configuration on resume, moving mirror initialization into the reference-counting patch
- Propagate SF2 setup errors on resume and disable the clock on failure when WoL is inactive
- Add a patch fixing BCM5325/BCM5365 mirror port encoding, including CPU port bitmap translation

Changes in v3:

- patch 2: added Daniel's R-b tag
- patch 3: mention in the commit message that deleting an absent entry now returns -ENOENT, including when the lookup runs out of space
- patch 4: document that the patch also fixes the clear of the capture port field in b53_mirror_del()
- patch 6: reference count the mirror source bits per port and direction, ignoring deletions without a matching reference
- patch 7: new, harden mirror register programming:
- reset the mirror capture and source control registers at setup for b53 and bcm_sf2, since not all switches are reset
- check and propagate all mirror register read/write errors, only taking a source reference once hardware programming succeeded
- use the source masks rather than MIRROR_EN to decide whether the destination is occupied, and write the destination before the source
- log failures in b53_mirror_del() since it cannot return an error
- patch 8: new, fix the mirror capture port encoding on BCM5325 and BCM5365, which use an 11-bit bitmap (CPU port at bit 8) instead of a port ID, and translate the CPU port in the ingress/egress source masks as well (verified against the BCM5325E, BCM5325M and BCM5365P datasheets)

Changes in v2:

- collected Jonas' R-b tags
- corrected logic in patch #3 to propagate -ENOENT, memset after the debug print, translate -ENOSPC to -ENOENT when deleting

Florian Fainelli (6):
net: dsa: b53: initialize the jumbo frame size register offset
net: dsa: b53: fix the SRAB grant timeout check
net: dsa: b53: clear stale state when creating an ARL entry
net: dsa: b53: use the correct override register 2 Gbps bit
net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365
net: dsa: b53: fix mirror destination and source state tracking

 drivers/net/dsa/b53/b53_common.c | 209 +++++++++++++++++++++++++------
 drivers/net/dsa/b53/b53_priv.h   |   4 +
 drivers/net/dsa/b53/b53_regs.h   |   1 +
 drivers/net/dsa/b53/b53_srab.c   |   2 +-
 drivers/net/dsa/bcm_sf2.c        |   4 +
 5 files changed, 179 insertions(+), 41 deletions(-)

base-commit: 7e1392a42ea288d70a266f6553fe06f57f8647ea

Signature · 1 line
2.53.0