コンテンツにスキップ

PORT テーブル

概要

物理スイッチポートの設定を保持するテーブル。ポート名(Ethernet0 など)をキーに、speed、lanes、MTU、admin status、FEC、auto-negotiation、breakout subport、MACsec プロファイル、TPID、mux cable 情報、400G ZR トランシーバ向けの tx-power / laser_freq などを記載する1

portmgrd / orchagentPortsOrch が PORT テーブルを購読し、SAI 経由で hardware に設定を反映する。speedlanes は通常 port_config.ini 由来の初期値で、運用中に CLI で変更可能。

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

flowchart LR
  CDB[("CONFIG_DB<br/>PORT")]
  DM["portmgrd"]
  CDB --> DM
  APPDB[("APP_DB<br/>APP_PORT_TABLE")]
  DM --> APPDB
  SYNCD["syncd"]
  APPDB --> SYNCD
  SAI["SAI<br/>sai_port_api"]
  SYNCD --> SAI

凡例

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

key 構造

PORT|<name>

<name>Ethernet<N> 形式の物理ポート名。

フィールド一覧

フィールド 必須 デフォルト 説明
name (key) string (1..128) - 物理ポート名(例: Ethernet0
core_id string (1..16) - - ポートが属する ASIC コア
core_port_id string (1..16) - - ASIC コア上のポート ID
num_voq string (1..16) - - このポートでサポートする VoQ 数
alias string (1..128) - - ベンダ固有のポート別名/フロントパネル表記
lanes string (1..128) ✅ (chassis 例外あり) - ハードウェアレーン数(chassis では条件付き)
mode switchport_mode (routed/access/trunk) - routed スイッチポートモード
description string (0..255) - - ユーザ定義説明
speed uint32 (1..1600000) - ポート速度 [Mbps]
dhcp_rate_limit uint32 - 300 DHCP DOS 緩和レート
link_training string on/off - - リンクトレーニング
autoneg string on/off - - オートネゴシエーション
adv_speeds leaf-list uint32 | all - - 広告する速度。all は単独でのみ
interface_type interface_type - - ポートインタフェースタイプ
adv_interface_types leaf-list interface_type | all - - 広告するインタフェースタイプ
mtu uint16 (68..9216) - - MTU [byte]
subport uint8 (0..8) - - breakout で生成された論理サブポート番号
index uint16 - - フロントパネルポートインデックス
asic_port_name string - - ASIC 内部のポート名(例: Eth0-ASIC1
role string Ext/Int/Inb/Rec/Dpc - Ext 多 ASIC / SmartSwitch のロール
admin_status admin_status (up/down) - down 管理状態
fec string rs/fc/none/auto - - 前方誤り訂正モード
dom_polling admin_mode (enabled/disabled) - - DOM (Digital Optical Monitoring) ポーリング
pfc_asym string on/off - - 非対称 PFC
tpid tpid_type (0x8100 / 0x9100 / 0x9200 / 0x88a8) - - TPID。HW 対応時のみ
mux_cable boolean - - dual-ToR mux cable 接続フラグ
macsec leafref MACSEC_PROFILE.name - - 適用する MACsec プロファイル
tx_power decimal64 - - 400G ZR 向け目標出力 [dBm]
laser_freq int32 - - 400G ZR 向け目標レーザ周波数 [GHz]
fast_linkup boolean - false fast link-up

制約

  • lanes は通常 mandatory true だが、switch_typevoq / chassis-packet / fabric または hwskumsft_*_asic_vs の場合は除外(when 条件)1
  • adv_speeds / adv_interface_typesall を指定する場合 1 要素のみ(must

購読者

  • orchagentPortsOrch: PORT 全フィールドを購読し、SAISAI_PORT_ATTR_* に反映
  • portmgrd: ポート status と admin_status をモニタ
  • xcvrd: トランシーバ関連 (tx_powerlaser_freqdom_polling) をモニタ
  • linkmgrd: mux_cable = true のポートを mux 制御対象として扱う
  • macsecmgrd: macsec 参照をもとに MACsec セッション確立

関連 CONFIG_DB テーブル / YANG / CLI

  • 関連 CONFIG_DB: VLAN_MEMBER(PORT を leafref 参照)、PORTCHANNEL_MEMBER(PORT を leafref)、INTERFACE(L3 用 PORT 上の IP)、MACSEC_PROFILEBUFFER_PG / BUFFER_QUEUE
  • 関連 CLI: config interface(speed / mtu / admin / fec / autoneg を変更)
  • 関連 YANG: sonic-portsonic-typesswitchport_modeadmin_statusinterface_typetpid_type

値依存挙動マトリクス

PORT.admin_status

PortsOrch / portmgrd 挙動
up SAI SAI_PORT_ATTR_ADMIN_STATE=true、Linux netdev も up
down (デフォルト) SAI SAI_PORT_ATTR_ADMIN_STATE=false、netdev down

PORT.fec

SAI 属性 挙動
rs SAI_PORT_FEC_MODE_RS Reed-Solomon FEC (100G+ 向け)
fc SAI_PORT_FEC_MODE_FC FireCode FEC (25G 向け)
none SAI_PORT_FEC_MODE_NONE FEC 無効
auto SAI_PORT_FEC_MODE_AUTO 対向とネゴシエーションで決定
不正 - Failed to set FEC mode SWSS_LOG_ERROR
挙動
on オートネゴ / リンクトレーニングを有効化
off 無効化
on (非サポート HW) autoneg is not supported (cap=%d) SWSS_LOG_ERROR

PORT.mode (switchport_mode)

挙動
routed (デフォルト) L3 ルーテッドポートとして扱う
access L2 access ポート (single VLAN)
trunk L2 trunk ポート (複数 VLAN)

PORT.role (multi-ASIC / SmartSwitch)

意味
Ext (デフォルト) 外部向けポート
Int 内部 ASIC 間接続
Inb inband 管理ポート
Rec recirculation ポート
Dpc DPC (Data Plane CPU) ポート

PORT.tpid

SAI 属性 備考
0x8100 標準 802.1Q デフォルト TPID
0x9100 / 0x9200 Q-in-Q / VLAN Stacking HW 対応が必要
0x88a8 / 0x88A8 802.1ad (Provider Bridging) HW 対応が必要

speed は uint32 (1..1600000 Mbps)、mtu は uint16 (68..9216 byte)。adv_speeds/adv_interface_types で all と他値の混在は must 制約で reject。

例外条件・特殊挙動

YANG スキーマ検証

  • lanes は mandatory (chassis 以外)、length 1..128。
  • speed は mandatory、range 1..1600000 (Kbps)。
  • mtu range: 68..9216。fec pattern: rs|fc|none|autoautoneg / pfc_asym pattern: on|off
  • adv_speeds: all と他値の混在は must 制約で reject。adv_interface_types も同様。

consumer (portsorch / portmgr) 例外動作

  • 非サポート speed: SAI supported speed リストと照合; 不一致は SWSS_LOG_ERROR + 処理中断。
  • MTU 設定失敗: Failed to set MTU %u to port pid → SWSS_LOG_ERROR。
  • FEC モード不正: Failed to set FEC mode → SWSS_LOG_ERROR。
  • AutoNeg 設定失敗: Failed to set AutoNeg %u to port %s → SWSS_LOG_ERROR。
  • autoneg 非サポート: autoneg is not supported (cap=%d) → SWSS_LOG_ERROR。
  • portmgr MTU netdev 設定失敗: Setting mtu to alias:%s netdev failed → SWSS_LOG_WARN + return false
  • portmgr admin_status netdev 設定失敗: Setting admin_status to alias:%s netdev failed → SWSS_LOG_WARN + return false

関連リファレンス

引用元

関連 Topics

運用ヒント

典型値

  • Ethernet0 等の EthernetN 形式キー。Nport_config.ini 由来の lane base。
  • speed: 10000 / 25000 / 40000 / 100000 / 400000 (Mbps)。
  • mtu: 9100(jumbo を有効にする一般運用値)。
  • admin_status: up(運用ポート)。
  • fec: rs (100G+) / fc (25G) / none
  • autoneg: on/off(25G/100G の対向と合わせる)。

よくある誤設定

  • speedlanes 数と不整合な値にすると SAISAI_STATUS_INVALID_PARAMETER を返してポートが down のまま。
  • 対向と fec が不一致だと PHY は up しても link 不安定。両端を同じ FEC モードに揃える。
  • mtuVLAN/PortChannel メンバ間で揃えないと L2 で巨大フレームがドロップされる。
  • Breakout 中の親ポートに admin_status: up を残すと subport と二重設定で orchagent エラー。

確認コマンド

sonic-db-cli CONFIG_DB hgetall 'PORT|Ethernet0'
show interfaces status
show interfaces transceiver eeprom Ethernet0