BUFFER_PROFILE テーブル¶
概要¶
バッファプロファイル(プール参照、reserved size、admission threshold、PFC xon/xoff など)を名前付きで定義する1。buffermgrd がこのテーブルを APPL_DB の BUFFER_PROFILE_TABLE に転送し、orchagent BufferOrch が SAI buffer profile を生成する。BUFFER_PG / BUFFER_QUEUE から leafref で参照される。
データフロー (自動生成)¶
flowchart LR
CDB[("CONFIG_DB<br/>BUFFER_PROFILE")]
DM["buffermgrd"]
CDB --> DM
APPDB[("APP_DB<br/>APP_BUFFER_PROFILE_TABLE")]
DM --> APPDB
SYNCD["syncd"]
APPDB --> SYNCD
SAI["SAI<br/>sai_buffer_api"]
SYNCD --> SAI
凡例
CONFIG_DB から SAI までの典型経路を docs/reference/config-db-orch-map.md から機械生成したミニ図。詳細・例外は本ページ本文と対応表を参照。
key 構造¶
フィールド一覧¶
| フィールド | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
name (key) |
string | ✅ | - | プロファイル名 |
pool |
leafref BUFFER_POOL.name |
✅ | - | バインドする buffer pool |
size |
uint64 | ✅ | - | 予約バッファサイズ [byte] |
static_th |
uint64 | - | - | static threshold [byte](最大占有量) |
dynamic_th |
int32 (-8..7) | - | - | dynamic threshold alpha 値 |
xon |
uint64 | - | 0 |
PFC xon 閾値 [byte] |
xon_offset |
uint64 | - | 0 |
xon offset [byte](resume を max(xon, limit-offset) で発火) |
xoff |
uint64 | - | 0 |
PFC xoff 閾値 [byte](pause 生成) |
headroom_type |
enum static/dynamic |
- | static |
headroom 動的計算かどうか |
packet_discard_action |
enum drop/trim |
- | - | shared buffer に admit できないときの動作 |
例外条件・特殊挙動¶
- pool 参照未解決 → retry:
poolフィールドに参照するBUFFER_POOLが未存在の場合、orchagentはtask_need_retryを返しプール到着後に再処理する。 - pending remove エントリへの SET → retry: 削除待ち状態のエントリに SET が来ると
task_need_retryを返す。 - pool / threshold_type は create-only → 更新スキップ: 既存 SAI オブジェクトに対して
poolフィールドやdynamic_th/static_thの閾値モード変更は スキップ される。SAI の create-only 属性であるため変更不可。 - packet_discard_action の不正値 → task_failed:
drop/trim以外の値はtask_failedとなる。 - trimming 禁止制約違反 → task_failed:
packet_discard_action=trimのプロファイルが ingress profile list や PG に既に関連付けられている場合、isTrimmingProhibited()が true →task_failed。 - SAI が ATTR_NOT_IMPLEMENTED を返した場合 → task_ignore: 属性が未実装の場合、警告ログを出力して処理を継続 (ignore)。
値依存挙動マトリクス¶
| フィールド | 値 | 挙動 |
|---|---|---|
headroom_type |
static(既定) |
ユーザが size/xon/xoff を明示指定。buffermgrd がそのまま APPL_DB へ転送。 |
headroom_type |
dynamic |
buffermgrdyn が dynamic_calculated=true をセットし、ポート速度・ケーブル長・MTU から headroom を自動計算(buffermgrdyn.cpp:2788)。static-buffer モード(DEVICE_METADATA.buffer_model=static)では無効。 |
packet_discard_action |
drop(既定) |
isTrimmingEligible=false。ingress/egress いずれの profile list・PG にも制限なく適用可能(bufferhelper.cpp:23)。 |
packet_discard_action |
trim |
isTrimmingEligible=true(bufferhelper.cpp:23)。ingress PG(bufferorch.cpp:1382)・ingress profile list(bufferorch.cpp:1725)・egress profile list(bufferorch.cpp:1915)への適用が 禁止(task_failed)。egress shared buffer への適用のみ有効。 |
購読者¶
buffermgrd: dynamic buffer model のとき、ポート速度・ケーブル長・MTU からheadroom_type=dynamicのサイズを計算orchagentBufferOrch: SAI buffer profile を生成pfcwd: profile の xon/xoff を参照
関連 CONFIG_DB / YANG / CLI¶
- 関連 CONFIG_DB:
BUFFER_POOL、BUFFER_PG、BUFFER_QUEUE、DEVICE_METADATA(buffer_model) - 関連 CLI: 通常は
config_db.jsonからロード。CLI 直接編集は限定的 - 関連 YANG:
sonic-buffer-profile
関連リファレンス¶
引用元¶
関連 Topics¶
運用ヒント¶
典型値¶
- key 形式:
BUFFER_PROFILE|<profile-name>(例pg_lossless_100000_5m_profile)。 pool:ingress_lossless_pool等。xon/xoff/size: PFC 閾値(バイト)。dynamic_th:-3〜3(α 値)。
よくある誤設定¶
xoffをsizeより大きく設定すると PFC が常時 ON。poolのサイズを超える profile を多数バインドするとbufferorchがエラーログを吐き続ける。