Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Improve types for channels and lanes

Aperta
#348 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust
Ambito
networking

Direzione di ricerca

Inizia con asic/src/tofino_common/ports.rs, asic/src/tofino_asic/ports.rs e asic/src/tofino_asic/serdes.rs, includendo i commenti referenziati e il codice di tracciamento dei canali. Verifica se lanes e channels debbano rimanere distinti, se un newtype possa imporre i rispettivi intervalli e se Vec sia appropriato. Il lavoro è completo quando la rappresentazione scelta è implementata e le sue distinzioni, i suoi limiti e la motivazione relativa all'archiviazione sono documentati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Explanation

Dendrite refers to channels in connector code and lanes in serdes code. I believe the types used for representing these could be improved. Here are some concerns in the current design:

https://github.com/oxidecomputer/dendrite/blob/f6d41dd821f88f09ce7539ec981642efd32797d5/asic/src/tofino_common/ports.rs#L19-L25
https://github.com/oxidecomputer/dendrite/blob/f6d41dd821f88f09ce7539ec981642efd32797d5/asic/src/tofino_asic/serdes.rs#L50-L58

  • The channels used by a port are stored in a Vec<u8>. But afaict the SDE uses base + offset during port creation, so we'd never have a port using non-contiguous lanes.

https://github.com/oxidecomputer/dendrite/blob/f6d41dd821f88f09ce7539ec981642efd32797d5/asic/src/tofino_common/ports.rs#L68-L72

Some non-contiguous tracking is required, but we also have a BTreeSet for available_channels.

https://github.com/oxidecomputer/dendrite/blob/f6d41dd821f88f09ce7539ec981642efd32797d5/asic/src/tofino_common/ports.rs#L221-L227

A final design will require further investigation, but I feel like we can use a more descriptive type than Vec<u8> for this. And if not, a doc comment is warranted.

Proposal
  • Decide whether we should continue differentiating lanes and channels in this code. Changes if warranted.
  • Explore if a newtype wrapper makes sense for lanes/channels. If keeping lanes and channels distinct, define and document how exactly they're different and why we're differentiating. Move boundary and range checking into the type(s).
  • Determine whether there's any more appropriate way to track channels than a Vec<u8>. If not, document why Vec is needed here.
Lingua principale
Rust
Stelle
20
Fork
3
Merge medio
8h 29m
PR unite (30g)
2

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oxidecomputer/dendrite

Tutte le issue di oxidecomputer/dendrite

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.