diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 562ef837acac..b439d4d26e47 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -845,6 +845,8 @@ instance is supported in SONiC. { "DEVICE_METADATA": { "localhost": { + "asic_id": "06:00.0", + "asic_name": "asic0", "hwsku": "Force10-S6100", "default_bgp_status": "up", "docker_routing_config_mode": "unified", @@ -1375,7 +1377,10 @@ optional attributes. "speed": "40000", "link_training": "off", "laser_freq": "191300", - "tx_power": "-27.3" + "tx_power": "-27.3", + "coreId": "1", + "corePortId": "1", + "numVoq": "8" }, "Ethernet1": { "index": "1", @@ -1387,7 +1392,10 @@ optional attributes. "speed": "40000", "link_training": "on", "laser_freq": "191300", - "tx_power": "-27.3" + "tx_power": "-27.3", + "coreId": "0", + "corePortId": "14", + "numVoq": "8" }, "Ethernet63": { "index": "63", @@ -1397,7 +1405,10 @@ optional attributes. "alias": "fortyGigE1/4/16", "speed": "40000", "laser_freq": "191300", - "tx_power": "-27.3" + "tx_power": "-27.3", + "coreId": "0", + "corePortId": "15", + "numVoq": "8" } } } 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 16b652fb23b0..d34ec328c459 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -305,6 +305,7 @@ "DEVICE_METADATA": { "localhost": { "type": "ToRRouter", + "asic_id": "06:00.0", "mac": "00:11:22:33:dd:5a", "hostname": "asw.dc", "bgp_asn": "64850", @@ -449,6 +450,9 @@ "PORT": { "Ethernet0": { "alias": "Eth1/1", + "coreId": "1", + "corePortId": "1", + "numVoq": "8", "lanes": "65", "description": "", "speed": "11100", @@ -464,6 +468,9 @@ }, "Ethernet1": { "alias": "Eth1/2", + "coreId": "1", + "corePortId": "1", + "numVoq": "8", "lanes": "66", "description": "", "speed": "11100", @@ -478,6 +485,9 @@ }, "Ethernet2": { "alias": "Eth1/3", + "coreId": "1", + "corePortId": "1", + "numVoq": "8", "lanes": "67", "description": "", "speed": "11100", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index d2779804d594..8c96fdc4558f 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -2,6 +2,12 @@ "DEV_META_DEV_NEIGH_VERSION_TABLE": { "desc": "DEVICE_METADATA DEVICE_NEIGHBOR VERSION TABLE." }, + "DEVICE_METADATA_ASIC_ID": { + "desc": "DEVICE_METADATA ASIC ID." + }, + "DEVICE_METADATA_ASIC_NAME": { + "desc": "DEVICE_METADATA ASIC NAME." + }, "DEVICE_METADATA_DEFAULT_BGP_STATUS": { "desc": "DEVICE_METADATA DEFAULT VALUE FOR BGP_STATUS FIELD.", "eStrKey" : "Verify", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests/port.json index c8a3ce102c25..e93df4e6af93 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/port.json @@ -49,6 +49,15 @@ "PORT_VALID_TYPE_TEST": { "desc": "PORT_VALID_TYPE_TEST no failure." }, + "PORT_COREID_TYPE_TEST": { + "desc": "PORT_COREID_TYPE_TEST no failure." + }, + "PORT_COREPORTID_TYPE_TEST": { + "desc": "PORT_COREPORTID_TYPE_TEST no failure." + }, + "PORT_NUMVOQ_TYPE_TEST": { + "desc": "PORT_NUMVOQ_TYPE_TEST no failure." + }, "PORT_INVALID_TYPE_TEST": { "desc": "PORT_INVALID_TYPE_TEST InvalidValue condition failure.", "eStrKey" : "InvalidValue", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index 21cf3808a636..16c42a92a398 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -11,6 +11,34 @@ } } }, + "DEVICE_METADATA_ASIC_ID": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "bgp_asn": "65001", + "default_bgp_status": "up", + "hostname": "DUT-CSW", + "asic_id": "06:00.0", + "asic_name": "asic0", + "platform": "Stone-DX010" + } + } + } + }, + "DEVICE_METADATA_ASIC_NAME": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "bgp_asn": "65001", + "default_bgp_status": "up", + "hostname": "DUT-CSW", + "asic_id": "06:00.0", + "asic_name": "asic0", + "platform": "Stone-DX010" + } + } + } + }, "DEVICE_METADATA_DEFAULT_DOCKER_ROUTING_CONFIG_MODE": { "sonic-device_metadata:sonic-device_metadata": { "sonic-device_metadata:DEVICE_METADATA": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json index 7444040036e9..090c6ba76d4c 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json @@ -226,6 +226,66 @@ } }, + "PORT_COREID_TYPE_TEST": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet8", + "alias": "eth8", + "coreId": "1", + "corePortId": "1", + "numVoq": "8", + "lanes": "65", + "speed": 25000, + "autoneg": "on", + "interface_type": "CR4" + } + ] + } + } + }, + + "PORT_COREPORTID_TYPE_TEST": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet8", + "alias": "eth8", + "coreId": "1", + "corePortId": "1", + "numVoq": "8", + "lanes": "65", + "speed": 25000, + "autoneg": "on", + "interface_type": "CR4" + } + ] + } + } + }, + + "PORT_NUMVOQ_TYPE_TEST": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet8", + "alias": "eth8", + "coreId": "1", + "corePortId": "1", + "numVoq": "8", + "lanes": "65", + "speed": 25000, + "autoneg": "on", + "interface_type": "CR4" + } + ] + } + } + }, + "PORT_INVALID_TYPE_TEST": { "sonic-port:sonic-port": { "sonic-port:PORT": { diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 83e113cff3ae..5657e55ef22f 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -40,6 +40,13 @@ module sonic-device_metadata { type stypes:hwsku; } + leaf asic_id { + type string { + length 1..16; + } + description "asic_id is unique identifier of the asic used by SAI for initialization."; + } + leaf default_bgp_status { type enumeration { enum up; diff --git a/src/sonic-yang-models/yang-models/sonic-port.yang b/src/sonic-yang-models/yang-models/sonic-port.yang index 1b9c6b14b5a9..86331fafec74 100644 --- a/src/sonic-yang-models/yang-models/sonic-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-port.yang @@ -39,6 +39,27 @@ module sonic-port{ } } + leaf numVoq { + description "The number of virtual output queue supportted on this port."; + type string { + length 1..16; + } + } + + leaf coreId { + description "The ASIC core where the port belongs to."; + type string { + length 1..16; + } + } + + leaf corePortId { + description "The ASIC core port for this port."; + type string { + length 1..16; + } + } + leaf alias { type string { length 1..128; @@ -163,8 +184,8 @@ module sonic-port{ leaf tpid { description "This leaf describes the possible TPID value that can be configured - to the specified port if the HW supports TPID configuration. The possible - values are 0x8100, 0x9100, 0x9200, 0x88a8, and 0x88A8"; + to the specified port if the HW supports TPID configuration. The possible + values are 0x8100, 0x9100, 0x9200, 0x88a8, and 0x88A8"; type stypes:tpid_type; }