`tofino_stub` returns port not found when trying to apply settings to `qsfp31`
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- rust
- 領域
- networking
調査の方向性
asic/src/tofino_stub/ports.rs から始め、特に tofino_stub::ports::init() を確認し、PortMap と PortData が QSFP コネクタをどのように表現しているかを追跡します。Linux dpd stub に対する curl リクエストを再現し、そのうえで qsfp31 が成功し、qsfp0–qsfp30 の settings リクエストにリグレッションがないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
On main, attempting to apply settings to port qsfp31 fails. Little dummy test with curl that hits the dpd stub binary built for Linux:
# request body
% cat req.json
{"links":{"0":{"addrs":[],"params":{"autoneg":false,"kr":false,"lane":0,"speed":"Speed0G"}}}}
# posting to qsfp0, ..., qsfp30 is fine
% curl -X POST -H 'content-type: application/json' -H 'api-version: 12.0.0' --data @req.json 'http://[::1]:12224/port/qsfp0/settings'
{"links":{"0":{"params":{"lane":0,"speed":"Speed0G","fec":null,"autoneg":false,"kr":false,"tx_eq":null},"addrs":[]}}}
% curl -X POST -H 'content-type: application/json' -H 'api-version: 12.0.0' --data @req.json 'http://[::1]:12224/port/qsfp30/settings'
{"links":{"0":{"params":{"lane":0,"speed":"Speed0G","fec":null,"autoneg":false,"kr":false,"tx_eq":null},"addrs":[]}}}
# posting to qsfp31 fails
% curl -X POST -H 'content-type: application/json' -H 'api-version: 12.0.0' --data @req.json 'http://[::1]:12224/port/qsfp31/settings'
{
"request_id": "038b79cd-d798-41d8-8a73-90dbef511cfc",
"error_code": "invalid data: no such port",
"message": "no such port"
}
qsfp31 definitely works in the product (@sion42x has tested it on a racklette), so this appears to be a stub-only bug. I tried tracing through what's going on, and I think there's an off-by-one disagreement in Connector numbering between PortMap (which maps an API-level PortId to a Connector) and PortData (which maps a (Connector, channel) tuple to an ASIC ID):
PortMapmapsPortId::Rear(0..32)to connectorsQSFP(1..33)(but the order is scrambled) and then mapsPortId::Qsfp(0..32)to connectorsQsfp(33..65)(not scrambled:PortId::Qsfp(0)becomes connectorQSFP(33), up throughPortId::Qsfp(31)mapping to connectorQSFP(64)).PortData's map of connectors to ASIC IDs contains keys for connectorsQSFP(0..64); this does not have an entry forQSFP(64)itself.
When we try to map PortId::Qsfp(31) to an ASIC ID, PortMap tells us it's connector QSFP(64), and then we get the not found error when trying to look up QSFP(64) in PortData.
I'm very unfamiliar with all of this, but AFAICT, PortMap is shared between the stub and real ASIC, so the problem is presumably in the stub's PortData. If I change this line in asic::tofino_stub::ports::init():
+++ b/asic/src/tofino_stub/ports.rs
@@ -249,12 +249,13 @@ pub fn init() -> AsicResult<PortData> {
let eth_port = Some(CPU_PORT as u16);
connectors.insert(Connector::CPU, PhysPort::new(Connector::CPU)?);
- for id in 0..QSFP_PORT_COUNT {
+ for id in 1..=QSFP_PORT_COUNT {
let connector = Connector::QSFP(id);
let mut phys_port = PhysPort::new(connector)?;
phys_port.media = PortMedia::Optical;
I'm able to apply settings to qsfp31. But I don't know if shifting the connector indexing like this may cause other problems somewhere else in the stub.
- 主要言語
- 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
-
`categorize_command` has no `uv` arm, so every `rtk uv …` row counts as `other` in the ecosystem mixオープンarea:api bug good first issue priority:low
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
area/cli kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
good first issue open-endedness: low type: new feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100