config buffer サブコマンド¶
概要¶
config buffer は dynamic buffer が有効なシステムで、CONFIG_DB の BUFFER_PROFILE を追加・更新する CLI グループ。グループ入口で DEVICE_METADATA|localhost の buffer_model を確認し、dynamic 以外では実行を拒否する1。
コマンド一覧¶
| コマンド | 用途 |
|---|---|
config buffer profile add <profile> [options] |
BUFFER_PROFILE|<profile> を新規作成 |
config buffer profile set <profile> [options] |
既存 profile を更新 |
各コマンドの詳細¶
config buffer profile add <profile>¶
用法:
config buffer profile add <profile>
[--xon <bytes>]
[--xoff <bytes>]
[--size <bytes>]
[--dynamic_th <value>]
[--pool <pool>]
BUFFER_PROFILE|<profile> が既に存在する場合はエラー。存在しない場合、update_profile() を通じて pool, xon, xoff, size, dynamic_th を組み立て、ValidatedConfigDBConnector で CONFIG_DB に書き込む2。
--pool を省略すると ingress_lossless_pool が使われる。指定 pool は BUFFER_POOL に存在する必要がある。
config buffer profile set <profile>¶
用法:
config buffer profile set <profile>
[--xon <bytes>]
[--xoff <bytes>]
[--size <bytes>]
[--dynamic_th <value>]
[--pool <pool>]
既存 BUFFER_PROFILE|<profile> を更新する。profile が存在しなければエラー。既存 profile が xoff を持たない dynamic headroom 計算型の場合、--xoff を指定して非 dynamic 型へ変える操作は拒否される3。
関連する CONFIG_DB¶
| テーブル | キー | 操作 |
|---|---|---|
BUFFER_PROFILE |
<profile> |
profile の作成・更新 |
BUFFER_POOL |
<pool> |
指定 pool の存在確認 |
DEFAULT_LOSSLESS_BUFFER_PARAMETER |
任意 | shared headroom pool 判定 |
注意¶
config interface buffer priority_group ...とconfig interface buffer queue ...は別グループで、port 上のBUFFER_PG/BUFFER_QUEUEバインドを操作する。本ページは root のconfig buffer profileを対象にする。- CLI 抽出上の
config buffer priority-group/queue候補は、実装上はconfig interface buffer ...配下にある。
関連リファレンス¶
引用元¶
データフロー (自動生成)¶
flowchart LR
CLI["config buffer"]
SC["sonic-cfggen<br/>(config CLI のみ)"]
CLI --> SC
CDB0[("CONFIG_DB<br/>BUFFER_PROFILE")]
SC --> CDB0
DM0["buffermgrd"]
CDB0 --> DM0
CDB1[("CONFIG_DB<br/>BUFFER_POOL")]
SC --> CDB1
DM1["buffermgrd"]
CDB1 --> DM1
CDB2[("CONFIG_DB<br/>DEFAULT_LOSSLESS_BUFFER_PARAMETER")]
SC --> CDB2
DM2["buffermgrdyn"]
CDB2 --> DM2
凡例
config 系 (CLI → CONFIG_DB → daemon) のミニ図。テーブル → daemon 対応は docs/reference/config-db-orch-map.md から機械生成。
関連 Topics¶
運用ヒント¶
典型的な利用シーン¶
- dynamic buffer モードと traditional モードの切り替え。
- lossless プロファイル ($headroom$) の最適化。
よくある落とし穴¶
- switchmode 変更は
config save+ reload 必須。即時切替不可。 - PG/queue から profile を外す前に profile を削除すると orchagent が拒否する。
関連する show / debug¶
関連 CLI コマンド¶
show buffer— show buffer サブコマンドshow buffer pool— show buffer_pool / headroom-pool サブコマンドshow pfc— show pfc サブコマンドshow priority group— show priority-group サブコマンドshow queue— show queue サブコマンド
-
config bufferグループ定義と dynamic buffer チェック。https://github.com/sonic-net/sonic-utilities/blob/39732bceb8bdefe706518ab40623bbbba6ff33b9/config/main.py#L8481 ↩ -
profile addは既存 entry を確認してからupdate_profile()を呼ぶ。https://github.com/sonic-net/sonic-utilities/blob/39732bceb8bdefe706518ab40623bbbba6ff33b9/config/main.py#L8494 ↩ -
profile setの存在確認とxoff変更制限。https://github.com/sonic-net/sonic-utilities/blob/39732bceb8bdefe706518ab40623bbbba6ff33b9/config/main.py#L8514 ↩