Improve types for channels and lanes
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- rust
- 領域
- networking
調査の方向性
まず asic/src/tofino_common/ports.rs、asic/src/tofino_asic/ports.rs、asic/src/tofino_asic/serdes.rs から始め、参照されているコメントとチャネル追跡コードも確認してください。lanes と channels を別個のものとして維持すべきか、newtype でそれらの範囲を強制できるか、Vec が適切かを調査してください。完了の条件は、選択した表現が実装され、その区別、境界、およびストレージに関する根拠が文書化されていることです。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 20
- フォーク
- 3
- 平均マージ
- 8時間 29分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
oxidecomputer/dendrite のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
oxidecomputer/dendrite#380 ·
メンテナーはふだん 5 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
oxidecomputer/dendrite#375 ·
メンテナーはふだん 5 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
oxidecomputer/dendrite#369 ·
メンテナーはふだん 5 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
oxidecomputer/dendrite#368 ·
メンテナーはふだん 5 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
oxidecomputer/dendrite#359 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
oxidecomputer/dendrite の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
bytecodealliance/wasmtime#14433 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信