Improve types for channels and lanes
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:
-
Should we actually have a distinction between channel and lane? This comment makes me question if we should. https://github.com/oxidecomputer/dendrite/blob/f6d41dd821f88f09ce7539ec981642efd32797d5/asic/src/tofino_asic/ports.rs#L23-L25
-
There's a matrix of numbers involved. There's the maximum quantity of lanes/channels on a port and the lane/channel indexes. I believe the range of acceptable lane counts is
1..=8, and the range of acceptable channel counts is1..=4. The indexes are then0..8and0..4. Lane count currently usesu32.
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 usesbase + offsetduring port creation, so we'd never have a port using non-contiguous lanes.
Some non-contiguous tracking is required, but we also have a BTreeSet for available_channels.
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 whyVecis 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di oxidecomputer/dendrite
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
oxidecomputer/dendrite#380 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
oxidecomputer/dendrite#375 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
oxidecomputer/dendrite#369 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
oxidecomputer/dendrite#368 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
oxidecomputer/dendrite#359 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di oxidecomputer/dendrite
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
bytecodealliance/wasmtime#14433 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno