Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • T TurrisHW
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • TurrisTurris
  • TurrisHW
  • Merge requests
  • !15

mox: Adjust detection of which eth port belongs to which module

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Martin Matějek requested to merge fix/detect-which-module-is-port-on into master Jun 21, 2022
  • Overview 1
  • Commits 1
  • Pipelines 2
  • Changes 2

Detection of mox switch module number fails to tell modules apart, because phys_switch_id always has value 00000000 for all switch ports.

On TOS 5.3.x different switch ports returned different phys_switch_id based on the physical Mox module, e.g.:

  • 00000000 -> switch 0
  • 01000000 -> switch 1
  • 02000000 -> switch 2

Determine the Mox module number by looking into /sys/class/net/<iface>/device/of_node real path.

For example single topaz module:

/sys/class/net/lan4/device/of_node -> [..]/firmware/devicetree/base/soc/internal-regs@d0000000/mdio@32004/switch0@2

Will identify switch as switch0@2 -> switch 0.

These switchX@Y identifiers should be stable, because they are defined in kernel DTS.

Closes: #16 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/detect-which-module-is-port-on