From 8249704c8f6f46e5bd2c22aff33f190638e07bd7 Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Fri, 8 Nov 2024 06:11:25 +0000 Subject: [PATCH 1/2] [YANG] Add DPU support in chassis module --- .../tests/files/sample_config_db.json | 3 +++ .../tests_config/chassis_module.json | 13 +++++++++++++ .../yang-models/sonic-chassis-module.yang | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) 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 a9ab004008b6..93283acee587 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..cf7f64c882b5 100644 --- a/src/sonic-yang-models/yang-models/sonic-chassis-module.yang +++ b/src/sonic-yang-models/yang-models/sonic-chassis-module.yang @@ -20,7 +20,7 @@ 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"; } From dc83eeb171bda93042b69cdc6fdcbb957ed1b2f3 Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Fri, 8 Nov 2024 07:15:35 +0000 Subject: [PATCH 2/2] descp --- src/sonic-yang-models/yang-models/sonic-chassis-module.yang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cf7f64c882b5..34cc3b2d9906 100644 --- a/src/sonic-yang-models/yang-models/sonic-chassis-module.yang +++ b/src/sonic-yang-models/yang-models/sonic-chassis-module.yang @@ -22,7 +22,7 @@ module sonic-chassis-module { type string { 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 {