From bb062d3e02010ed44efd92f7a305a59707ac6baa Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Thu, 14 Nov 2024 03:22:24 +0800 Subject: [PATCH] [YANG] Add DPU support in chassis module (#20733) Why I did it Add DPU support in CHASSIS_MODULE Check HLD: https://github.com/sonic-net/SONiC/blob/master/doc/smart-switch/pmon/smartswitch-pmon.md?plain=1#L93-L105 --- .../tests/files/sample_config_db.json | 3 +++ .../tests_config/chassis_module.json | 13 +++++++++++++ .../yang-models/sonic-chassis-module.yang | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index d3d9f93d1994..def646e90cd9 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1895,6 +1895,9 @@ }, "FABRIC-CARD1": { "admin_status": "down" + }, + "DPU2": { + "admin_status": "down" } }, "COPP_GROUP": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json index a742f91ef54e..b64367bb3cd2 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json @@ -18,6 +18,15 @@ { "name": "FABRIC-CARD1", "admin_status": "up" + }, + { + "name": "DPU0", + "admin_status": "up" + }, + { + "name": "DPU1", + "admin_status": "up" + } ] } @@ -34,6 +43,10 @@ { "name": "FABRIC-CARD1", "admin_status": "down" + }, + { + "name": "DPU2", + "admin_status": "down" } ] } diff --git a/src/sonic-yang-models/yang-models/sonic-chassis-module.yang b/src/sonic-yang-models/yang-models/sonic-chassis-module.yang index e31c252d8a9d..34cc3b2d9906 100644 --- a/src/sonic-yang-models/yang-models/sonic-chassis-module.yang +++ b/src/sonic-yang-models/yang-models/sonic-chassis-module.yang @@ -20,9 +20,9 @@ module sonic-chassis-module { key "name"; leaf name { type string { - pattern "LINE-CARD[0-9]+|FABRIC-CARD[0-9]+"; + pattern "LINE-CARD[0-9]+|FABRIC-CARD[0-9]+|DPU[0-9]+"; } - description "Line-card or fabric-card module name"; + description "Line-card or fabric-card or dpu module name"; } leaf admin_status {