Skip to content

Tofino PCIe link status should tell us more than a bool #2333

@rmustacc

Description

@rmustacc

Currently the code to tell if a PCIe link is up looks something like this:

    /// Poll the PCIe Dev Info register to determine if the PCIe link with a
    /// host is up. Note that this function should only be called when Tofino is
    /// in A0, otherwise it may cause the debug port in the mainboard controller
    /// to get stuck.
    pub fn pcie_link_up(&mut self) -> Result<bool, SeqError> {
        // There is no bit description in the documentation available for this
        // register, so make use of observed magic values.
        Ok(self.debug_port.read_direct(
            DirectBarSegment::Bar0,
            TofinoBar0Registers::PcieDevInfo,
        )? & 0xf 
            == 0xf)
    }   

Even if I don't know the meaning of all the bits, when we have cases where two ends disagree if the link is up, it'd be helpful to see if this was 0 or some of the bits are there rather than just false.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions