oxidecomputer / oxidecomputer/hubris

improve humility net counters/net status

Open
#2,641 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3.6k
Forks
239
Avg merge
1d 12h
Merged PRs (30d)
23

Description

I have a cosmo that I'm doing some management network "work" on (trying to get a cosmo to talk out a mgm port via an FPGA bridge) and have been struggling to debug what is wrong (def things in my design!) but this has pointed out some fairly serious gaps in our statistics reporting.

In my current config, I have and FPGA connected and doing SGMII on port 0, so the port1 being down is expected.
I'm not getting inbound packets counted and am trying to figure out why.

after a bunch of investigation and poking via hiffy, I discovered the MAC_SERDES_PCS_STATUS register on the VSC8562
and reading that I find:
MAC_SERDES_PCS_STATUS = 0xC405 which decodes to:

mac_pcs_sig_detect (bit 0) = 1 — the VSC sees our electrical signal
mac_link_status (bit 2) = 1
mac_sync_fail (bit 15) = 1 — the PCS is failing to sync
mac_cgbad (bit 14) = 1 — it's seeing bad code groups

The PCS failing to sync, and bad code groups are bad, and no PCS would definately mean we can't rx data, but there's 0 indication of this being true in net counters and net status, both of which I reached for immediately. We should first class more of this stuff to help future us, and mfg. We report no errors in the counters block, and that the SGMII link is up in the status (presumably looking only at mac_pcs_sig_detect or similar?)

➜  hubris git:(1a6600c33) ✗ humility net counters
humility: attached via 1fc9:143:Some("XG5KKNDI5J1UO") MCU-LINK r0FF CMSIS-DAP V0.078
 -------------------------------------------------------------------
 |  KSZ8463  |         Transmit         |         Receive          |
 |           |   UC   |   BC   |   MC   |   UC   |   BC   |   MC   |
 |-----------|--------|--------|--------|--------|--------|--------|
 | Port 1    |      0 |      0 |   1145 |      0 |      0 |      0 |
 | Port 2    |      0 |      0 |   1146 |      0 |      0 |      0 |
 | Port 3    |      0 |      0 |      0 |      0 |      0 |   2291 |
 -------------------------------------------------------------------

 -------------------------------------------------------
 |     VSC8562     |     Transmit    |     Receive     |
 |                 |  Good  |   Bad  |  Good  |   Bad  |
 |-----------------------------------------------------|
 | Port 0 | MAC    |   1145 |      0 |      0 |      0 |
 |        | Media  |      0 |      0 |   1145 |      0 |
 | Port 1 | MAC    |   1146 |      0 |      0 |      0 |
 |        | Media  |      0 |      0 |   1146 |      0 |
 -------------------------------------------------------

            ┌──────────────────┐            ┌───────────────────┐
            │ KSZ8463          │            │ VSC85x2           │
            │                  │tx        rx│                   │tx
            │              1145├───────────►│1145           1145├───────►
            │                  │1          0│                   │0
┌────┐    rx│                 0│◄───────────┤0                 0│◄───────
│    ├─────►│2291              │rx        tx│                   │rx
│ SP │     3│                  │            │                   │
│    │◄─────┤0                 │tx        rx│                   │tx
└────┘    tx│              1146├───────────►│1146           1146├───────►
            │                  │2          1│                   │1
            │                 0│◄───────────┤0                 0│◄───────
            │                  │rx        tx│                   │rx
            └──────────────────┘            └───────────────────┘
                                             MEDIA           MAC

➜  hubris git:(1a6600c33) ✗ humility net status
humility: attached via 1fc9:143:Some("XG5KKNDI5J1UO") MCU-LINK r0FF CMSIS-DAP V0.078
          ------------------              ---------------------
          |            UP  1 <----------> 0  UP           UP  0 <------>
  SP <--> 3  KSZ8463       |              |      VSC85x2      |
     RMII |            UP  2 <----------> 1  UP          DOWN 1 <------>
          ------------------  100BASE-FX  ---------------------  SGMII

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the humility net counters and humility net status command entry points, then trace how VSC8562 PCS state and error counters are read and displayed. Compare the reported output with MAC_SERDES_PCS_STATUS, especially sync failures and bad code groups. Done means the commands clearly expose link and receive-status problems that currently appear as healthy.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, embedded-iot, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.