Skip to content

Commit

Permalink
[Chassis][Voq]Update sonic-buffer-queue and sonic-queue for Voq Chass…
Browse files Browse the repository at this point in the history
…is (#18875)

Why I did it

The configuration for QUEUE and BUFFER_QUEUE differs between a VOQ device and a Non-VOQ devices.
For the Voq device:
The queue and buffer queue is applied on the system port. The system port is a representation of every port in a chassis, the key for systemport consists of Linecard Name , Asic Name and portname
On a Non voq device:
the queue and buffer queue configuration is applied on the front panel port.

Due to this differences the yang models sonic-queue.yang and sonic-buffer-queue.yang does not work for Voq devices
This is address in this PR

Microsoft ADO (27252773 and 27252696):

How I did it
Update the yang model to have different CONFIG_LIST with different keys based on the following condition

when the switch_type is not present or switch_type is not voq, the yang LIST will have key of port and queue_index
when the switch_type is present and switch_type is voqhe yang LIST will have key of Linecard name, asi name, port and queue_index
How to verify it
UT and incremental config push on chassis
  • Loading branch information
arlakshm authored and gechiang committed Jun 5, 2024
1 parent dd83cdc commit ce1229c
Show file tree
Hide file tree
Showing 7 changed files with 334 additions and 107 deletions.
1 change: 0 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@
"region": "usfoo",
"asic_name": "Asic0",
"switch_id": "2",
"switch_type": "voq",
"max_cores": "8",
"sub_role": "FrontEnd",
"dhcp_server": "disabled",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"BUFFER_QUEUE_WRONG_PORT_VALUE": {
"desc": "BUFFER_QUEUE_WRONG_PORT_VALUE pattern failure",
"eStr": "wrong"
},
"VOQ_BUFFER_QUEUE_CONFIG": {
"desc": "VOQ_BUFFER_QUEUE_CONFIG has no failure"
}
}
3 changes: 3 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/qos.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,8 @@
"QUEUE_WRED_NOT_EXIST": {
"desc": "Referring non-existing WRED table.",
"eStrKey" : "LeafRef"
},
"VOQ_QUEUE_CONFIG": {
"desc": "Attach scheduler and wred profiles to VOQ."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,51 @@
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": "9000",
"name": "Ethernet4",
"tpid": "0x8100",
"speed": "25000"
}
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": "9000",
"name": "Ethernet4",
"tpid": "0x8100",
"speed": "25000"
}
]
}
},
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "egress_lossless_pool",
"mode": "static",
"size": "12766208",
"type": "ingress"
}
{
"name": "egress_lossless_pool",
"mode": "static",
"size": "12766208",
"type": "ingress"
}
]
}
},
"sonic-buffer-profile:sonic-buffer-profile": {
"sonic-buffer-profile:BUFFER_PROFILE": {
"BUFFER_PROFILE_LIST": [
{
"name": "lossless_buffer_profile",
"size": 1518,
"dynamic_th": "2",
"pool": "egress_lossless_pool"
}
{
"name": "lossless_buffer_profile",
"size": 1518,
"dynamic_th": "2",
"pool": "egress_lossless_pool"
}
]
}
},
"sonic-buffer-queue:sonic-buffer-queue": {
"sonic-buffer-queue:BUFFER_QUEUE": {
"BUFFER_QUEUE_LIST": [
{
"port": "Ethernet4",
"qindex": "15",
"profile": "lossless_buffer_profile"
}
{
"port": "Ethernet4",
"qindex": "15",
"profile": "lossless_buffer_profile"
}
]
}
}
Expand All @@ -56,50 +56,50 @@
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": "9000",
"name": "Ethernet4",
"tpid": "0x8100",
"speed": "25000"
}
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": "9000",
"name": "Ethernet4",
"tpid": "0x8100",
"speed": "25000"
}
]
}
},
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "egress_lossless_pool",
"mode": "static",
"size": "12766208",
"type": "ingress"
}
{
"name": "egress_lossless_pool",
"mode": "static",
"size": "12766208",
"type": "ingress"
}
]
}
},
"sonic-buffer-profile:sonic-buffer-profile": {
"sonic-buffer-profile:BUFFER_PROFILE": {
"BUFFER_PROFILE_LIST": [
{
"name": "lossless_buffer_profile",
"size": "1518",
"pool": "egress_lossless_pool"
}
{
"name": "lossless_buffer_profile",
"size": "1518",
"pool": "egress_lossless_pool"
}
]
}
},
"sonic-buffer-queue:sonic-buffer-queue": {
"sonic-buffer-queue:BUFFER_QUEUE": {
"BUFFER_QUEUE_LIST": [
{
"port": "Ethernet4",
"qindex": "3",
"profile": "wrong"
}
{
"port": "Ethernet4",
"qindex": "3",
"profile": "wrong"
}
]
}
}
Expand All @@ -108,50 +108,50 @@
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": "9000",
"name": "Ethernet4",
"tpid": "0x8100",
"speed": "25000"
}
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": "9000",
"name": "Ethernet4",
"tpid": "0x8100",
"speed": "25000"
}
]
}
},
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "egress_lossless_pool",
"mode": "static",
"size": "12766208",
"type": "ingress"
}
{
"name": "egress_lossless_pool",
"mode": "static",
"size": "12766208",
"type": "ingress"
}
]
}
},
"sonic-buffer-profile:sonic-buffer-profile": {
"sonic-buffer-profile:BUFFER_PROFILE": {
"BUFFER_PROFILE_LIST": [
{
"name": "lossless_buffer_profile",
"size": "1518",
"pool": "egress_lossless_pool"
}
{
"name": "lossless_buffer_profile",
"size": "1518",
"pool": "egress_lossless_pool"
}
]
}
},
"sonic-buffer-queue:sonic-buffer-queue": {
"sonic-buffer-queue:BUFFER_QUEUE": {
"BUFFER_QUEUE_LIST": [
{
"port": "Ethernet4",
"qindex": "16",
"profile": "lossless_buffer_profile"
}
{
"port": "Ethernet4",
"qindex": "16",
"profile": "lossless_buffer_profile"
}
]
}
}
Expand All @@ -160,52 +160,98 @@
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": "9000",
"name": "Ethernet4",
"tpid": "0x8100",
"speed": "25000"
}
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": "9000",
"name": "Ethernet4",
"tpid": "0x8100",
"speed": "25000"
}
]
}
},
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "egress_lossless_pool",
"mode": "static",
"size": "12766208",
"type": "ingress"
}
{
"name": "egress_lossless_pool",
"mode": "static",
"size": "12766208",
"type": "ingress"
}
]
}
},
"sonic-buffer-profile:sonic-buffer-profile": {
"sonic-buffer-profile:BUFFER_PROFILE": {
"BUFFER_PROFILE_LIST": [
{
"name": "lossless_buffer_profile",
"size": "1518",
"pool": "egress_lossless_pool"
}
{
"name": "lossless_buffer_profile",
"size": "1518",
"pool": "egress_lossless_pool"
}
]
}
},
"sonic-buffer-queue:sonic-buffer-queue": {
"sonic-buffer-queue:BUFFER_QUEUE": {
"BUFFER_QUEUE_LIST": [
{
"port": "wrong",
"qindex": "4",
"profile": "lossless_buffer_profile"
{
"port": "wrong",
"qindex": "4",
"profile": "lossless_buffer_profile"
}
]
}
}
},
"VOQ_BUFFER_QUEUE_CONFIG": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"switch_type": "voq"
}
}
},
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "egress_lossless_pool",
"mode": "static",
"size": "12766208",
"type": "ingress"
}
]
}
},
"sonic-buffer-profile:sonic-buffer-profile": {
"sonic-buffer-profile:BUFFER_PROFILE": {
"BUFFER_PROFILE_LIST": [
{
"name": "lossless_buffer_profile",
"size": 1518,
"dynamic_th": "2",
"pool": "egress_lossless_pool"
}
]
}
},
"sonic-buffer-queue:sonic-buffer-queue": {
"sonic-buffer-queue:BUFFER_QUEUE": {
"VOQ_BUFFER_QUEUE_LIST": [
{
"hostname": "lc1",
"asic_name": "asic0",
"port": "Ethernet4",
"qindex": "15",
"profile": "lossless_buffer_profile"
}
]
}
}
}
}
}
Loading

0 comments on commit ce1229c

Please sign in to comment.