Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Improve types for channels and lanes

オープン
#348 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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:

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.
主要言語
Rust
スター
20
フォーク
3
平均マージ
8時間 29分
マージ済み PR(30日)
2

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oxidecomputer/dendrite のほかの issue

oxidecomputer/dendrite の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。