Allow NULL Buffer Profile in buffer pg/queue yang files for Dynamic B…#10353
Allow NULL Buffer Profile in buffer pg/queue yang files for Dynamic B…#10353neethajohn merged 3 commits intosonic-net:masterfrom
Conversation
dgsudharsan
left a comment
There was a problem hiding this comment.
Should port related buffer profiles too be considered for NULL? https://github.com/Azure/sonic-buildimage/blob/928261845058a177c4b65ebaf20495e85d48a497/src/sonic-yang-models/yang-models/sonic-buffer-port-egress-profile-list.yang#L47
@stephenxs Can you please comment? NJ> I believe no |
| path "/bpf:sonic-buffer-profile/bpf:BUFFER_PROFILE/bpf:BUFFER_PROFILE_LIST/bpf:name"; | ||
| } | ||
| type string { | ||
| pattern "NULL"; |
There was a problem hiding this comment.
The dynamic calculation is supported in BUFFER_PG only.
For BUFFER_QUEUE table, the profile should always be defined in the BUFFER_PROFILE table. So no need to change BUFFER_QUEUE.
There was a problem hiding this comment.
@stephenxs Are there other scenarios where NULL buffer profile may be configured apart from Dynamic calculation?
There was a problem hiding this comment.
@dgsudharsan Only two:
profileinBUFFER_PGcan beNULL, which is covered in this PRsizeinBUFFER_POOLis optional, which has been taken into account
No need to support |
|
@neethajohn Could you check again? |
|
@qiluo-msft @neethajohn Can we merge this? |
…uffer Model
Why I did it
To address #10342 (Yang validation fails when Buffer profiles are configured with "NULL" values)
How I did it
Allowed NULL as valid data for the BUFFER_PG/BUFFER_QUEUE yang models
How to verify it
------------------- Test 1: BUFFER_PG_WRONG_PROFILE_VALUE pattern failure---------------------
test_yang_model.py 189 INFO Invalid value "wrong" in "profile" element.
test_yang_model.py 210 INFO BUFFER_PG_WRONG_PROFILE_VALUE pattern failure Passed
test_yang_model.py 150 INFO
------------------- Test 2: BUFFER_PG_WRONG_PG_VALUE pattern failure---------------------
test_yang_model.py 189 INFO Invalid Buffer PG number
test_yang_model.py 210 INFO BUFFER_PG_WRONG_PG_VALUE pattern failure Passed
test_yang_model.py 150 INFO
------------------- Test 3: BUFFER_PG_NULL_PROFILE_VALUE no failure---------------------
test_yang_model.py 210 INFO BUFFER_PG_NULL_PROFILE_VALUE no failure Passed
test_yang_model.py 150 INFO
------------------- Test 4: BUFFER_QUEUE_WRONG_PORT_VALUE pattern failure---------------------
test_yang_model.py 189 INFO Leafref "/sonic-port:sonic-port/sonic-port:PORT/sonic-port:PORT_LIST/sonic-port:name" of value "wrong" points to a non-existing leaf.
test_yang_model.py 210 INFO BUFFER_QUEUE_WRONG_PORT_VALUE pattern failure Passed
test_yang_model.py 150 INFO
------------------- Test 5: BUFFER_PG_CORRECT_PROFILE_VALUE no failure---------------------
test_yang_model.py 210 INFO BUFFER_PG_CORRECT_PROFILE_VALUE no failure Passed
test_yang_model.py 150 INFO
------------------- Test 6: BUFFER_QUEUE_WRONG_PROFILE_VALUE pattern failure---------------------
test_yang_model.py 210 INFO BUFFER_QUEUE_WRONG_PROFILE_VALUE pattern failure Passed
test_yang_model.py 150 INFO
------------------- Test 7: BUFFER_QUEUE_WRONG_PROFILE_VALUE pattern failure---------------------
test_yang_model.py 189 INFO Invalid value "wrong" in "profile" element.
test_yang_model.py 210 INFO BUFFER_QUEUE_WRONG_PROFILE_VALUE pattern failure Passed
test_yang_model.py 150 INFO
------------------- Test 8: BUFFER_PG_WRONG_PORT_VALUE pattern failure---------------------
test_yang_model.py 189 INFO Leafref "/sonic-port:sonic-port/sonic-port:PORT/sonic-port:PORT_LIST/sonic-port:name" of value "wrong" points to a non-existing leaf.
test_yang_model.py 210 INFO BUFFER_PG_WRONG_PORT_VALUE pattern failure Passed
test_yang_model.py 150 INFO
------------------- Test 9: BUFFER_QUEUE_WRONG_QUEUE_VALUE pattern failure---------------------
test_yang_model.py 189 INFO Invalid Q-index
test_yang_model.py 210 INFO BUFFER_QUEUE_WRONG_QUEUE_VALUE pattern failure Passed
test_yang_model.py 150 INFO
------------------- Test 10: BUFFER_QUEUE_CORRECT_PROFILE_VALUE no failure---------------------
test_yang_model.py 210 INFO BUFFER_QUEUE_CORRECT_PROFILE_VALUE no failure Passed
test_yang_model.py 150 INFO
Which release branch to backport (provide reason below if selected)
Description for the changelog
Allow NULL Buffer Profile in buffer pg/queue yang files for Dynamic Buffer Model, added the new Test cases for the same.Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)