コンテンツにスキップ

DOT1P_TO_TC_MAP テーブル

概要

DOT1P_TO_TC_MAP テーブルは IEEE 802.1p Priority Code Point (PCP, 0-7) を SONiC の Traffic Class へマップするテーブル1QoS 入口分類で使われ、PORT_QOS_MAP.dot1p_to_tc_map から参照される。qosorch (sonic-swss) が CONFIG_DB を読み、SAISAI_QOS_MAP_TYPE_DOT1P_TO_TC オブジェクトを生成する。

YANG は親 DOT1P_TO_TC_MAP_LIST(key: name)と、その下の inner list DOT1P_TO_TC_MAP(key: dot1p)の 2 段構造。

データフロー (自動生成)

flowchart LR
  CDB[("CONFIG_DB<br/>DOT1P_TO_TC_MAP")]
  DM["QosOrch"]
  CDB --> DM
  SAI["SAI<br/>sai_qos_map_api"]
  DM --> SAI

凡例

CONFIG_DB から SAI までの典型経路を docs/reference/config-db-orch-map.md から機械生成したミニ図。詳細・例外は本ページ本文と対応表を参照。

key 構造

DOT1P_TO_TC_MAP|<name>             # マップ全体(hash で dot1p→tc の dict)

CONFIG_DB 上は DOT1P_TO_TC_MAP|<name> の単一ハッシュで dot1ptc の対応を保持する(一般的な SONiC QoS map と同形式)。

キー 説明
name string (1..32) マップ名。[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{0,31})

フィールド

inner list で定義される各エントリ:

フィールド 説明
dot1p string パターン [0-7]? 802.1p PCP 値(0-7)
tc sonic-types:tc_type マップ先 Traffic Class

値依存挙動マトリクス

dot1p (string pattern [0-7])

挙動
0..7 qosorch が SAI_QOS_MAP_TYPE_DOT1P_TO_TC エントリを生成
範囲外(8 以上等) YANG pattern 違反で reject

tc (tc_type: 0..7)

挙動
0..7 SAI QoS map オブジェクトの Traffic Class 値として設定
8 以上 ASIC が拒否(SAI エラー)

明示的な enum 制約なし(任意の 0-7 ペアで構成可能)。PORT_QOS_MAP.dot1p_to_tc_map から参照されない限り SAI に反映されない。

制約

  • dot1p は 0-7 の単一文字
  • name 文字列長 1..32、パターン制約あり

購読者

  • qosorch (sonic-swss) — SAI QoS Map オブジェクト生成
  • PORT_QOS_MAPdot1p_to_tc_map leaf から参照

関連 CONFIG_DB / YANG / CLI

  • 関連 CONFIG_DB: PORT_QOS_MAPDSCP_TO_TC_MAPTC_TO_QUEUE_MAP
  • 関連 YANG: sonic-dot1p-tc-mapsonic-port-qos-map
  • 関連 CLI: config qos

関連リファレンス

引用元

関連ページ

運用ヒント

典型値

  • key 形式: DOT1P_TO_TC_MAP|<map-name>
  • 0-7 の dot1p 値→ TC 値。COS6/7 を TC3 などコントロールトラフィック用に分離する設計が一般的。

よくある誤設定

  • PORT_QOS_MAP から参照されていないとマップを定義しても有効化されない。

確認コマンド

sonic-db-cli CONFIG_DB keys 'DOT1P_TO_TC_MAP|*'
show qos map dot1p-tc

例外条件・特殊挙動

consumer 条件 挙動
orchagent DEL 時に他テーブル (PORT 等) から参照中 m_pendingRemove=true を立てて task_need_retry を返す。参照解放後に削除実行(qosorch.cpp:181-186)
orchagent pending remove 中に SET が到着 "Entry is pending remove, need retry" を LOG_NOTICE して task_need_retry を返す(qosorch.cpp:136-139)
orchagent SAI オブジェクト生成 (addQosItem) 失敗 "Failed to create [DOT1P_TO_TC_MAP:...]" を LOG_ERROR して task_failed を返す(qosorch.cpp:162-166)
orchagent SAI オブジェクト変更 (modifyQosItem) 失敗 "Failed to set [DOT1P_TO_TC_MAP:...]" を LOG_ERROR して task_failed を返す(qosorch.cpp:151-155)
orchagent DEL 対象が type map に存在しない "Object with name:%s not found." を LOG_ERROR して task_invalid_entry を返す(qosorch.cpp:176-179)

Evidence: sonic-swss orchagent/qosorch.cpp:124-201