Allow NULL Buffer Profile in buffer pg/queue yang files for Dynamic B… (#10353)

Why I did it
To address #10342 (Yang validation fails when Buffer profiles are configured with "NULL" values)
This commit is contained in:
AmitKaushik7 2022-03-31 22:52:03 +05:30 committed by GitHub
parent 106fac5f09
commit 0bce0a7e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 63 additions and 5 deletions

View File

@ -10,6 +10,9 @@
"desc": "BUFFER_PG_WRONG_PG_VALUE pattern failure", "desc": "BUFFER_PG_WRONG_PG_VALUE pattern failure",
"eStr": "Invalid Buffer PG number" "eStr": "Invalid Buffer PG number"
}, },
"BUFFER_PG_NULL_PROFILE_VALUE": {
"desc": "BUFFER_PG_NULL_PROFILE_VALUE no failure"
},
"BUFFER_PG_WRONG_PORT_VALUE": { "BUFFER_PG_WRONG_PORT_VALUE": {
"desc": "BUFFER_PG_WRONG_PORT_VALUE pattern failure", "desc": "BUFFER_PG_WRONG_PORT_VALUE pattern failure",
"eStr": "wrong" "eStr": "wrong"

View File

@ -52,6 +52,58 @@
} }
} }
}, },
"BUFFER_PG_NULL_PROFILE_VALUE": {
"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"
}
]
}
},
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "egress_lossless_pool",
"mode": "static",
"size": "300",
"type": "ingress"
}
]
}
},
"sonic-buffer-profile:sonic-buffer-profile": {
"sonic-buffer-profile:BUFFER_PROFILE": {
"BUFFER_PROFILE_LIST": [
{
"name": "lossless_buffer_profile",
"size": "300",
"pool": "egress_lossless_pool"
}
]
}
},
"sonic-buffer-pg:sonic-buffer-pg": {
"sonic-buffer-pg:BUFFER_PG": {
"BUFFER_PG_LIST": [
{
"port": "Ethernet4",
"pg_num": "3",
"profile": "NULL"
}
]
}
}
},
"BUFFER_PG_WRONG_PROFILE_VALUE": { "BUFFER_PG_WRONG_PROFILE_VALUE": {
"sonic-port:sonic-port": { "sonic-port:sonic-port": {
"sonic-port:PORT": { "sonic-port:PORT": {

View File

@ -2,9 +2,7 @@ module sonic-buffer-pg {
namespace "http://github.com/Azure/sonic-buffer-pg"; namespace "http://github.com/Azure/sonic-buffer-pg";
prefix bpg; prefix bpg;
import sonic-extension { yang-version 1.1;
prefix sonic-ext;
}
import sonic-port { import sonic-port {
prefix prt; prefix prt;
@ -54,8 +52,13 @@ module sonic-buffer-pg {
leaf profile { leaf profile {
default 0; default 0;
type leafref { type union {
path "/bpf:sonic-buffer-profile/bpf:BUFFER_PROFILE/bpf:BUFFER_PROFILE_LIST/bpf:name"; type leafref {
path "/bpf:sonic-buffer-profile/bpf:BUFFER_PROFILE/bpf:BUFFER_PROFILE_LIST/bpf:name";
}
type string {
pattern "NULL";
}
} }
description "Buffer Profile associated with Priority Group number for a port"; description "Buffer Profile associated with Priority Group number for a port";
} }