Skip to content

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

Merged
neethajohn merged 3 commits intosonic-net:masterfrom
AmitKaushik7:buf_profile_NULL
Mar 31, 2022
Merged

Allow NULL Buffer Profile in buffer pg/queue yang files for Dynamic B…#10353
neethajohn merged 3 commits intosonic-net:masterfrom
AmitKaushik7:buf_profile_NULL

Conversation

@AmitKaushik7
Copy link
Contributor

…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)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

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)

Copy link
Collaborator

@dgsudharsan dgsudharsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgsudharsan
Copy link
Collaborator

dgsudharsan commented Mar 25, 2022

neethajohn
neethajohn previously approved these changes Mar 25, 2022
path "/bpf:sonic-buffer-profile/bpf:BUFFER_PROFILE/bpf:BUFFER_PROFILE_LIST/bpf:name";
}
type string {
pattern "NULL";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephenxs Are there other scenarios where NULL buffer profile may be configured apart from Dynamic calculation?

Copy link
Collaborator

@stephenxs stephenxs Mar 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgsudharsan Only two:

  • profile in BUFFER_PG can be NULL, which is covered in this PR
  • size in BUFFER_POOL is optional, which has been taken into account

@stephenxs
Copy link
Collaborator

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

No need to support NULL in either BUFFER_PORT_xxGRESS_PROFILE_LIST or BUFFER_QUEUE. It should be supported in BUFFER_PG only.

@dgsudharsan dgsudharsan added the Request for 202111 Branch For PRs being requested for 202111 branch label Mar 28, 2022
@dgsudharsan dgsudharsan requested a review from neethajohn March 31, 2022 17:15
@qiluo-msft
Copy link
Collaborator

@neethajohn Could you check again?

@dgsudharsan
Copy link
Collaborator

@qiluo-msft @neethajohn Can we merge this?

@neethajohn neethajohn merged commit 0bce0a7 into sonic-net:master Mar 31, 2022
judyjoseph pushed a commit that referenced this pull request Apr 4, 2022
#10353)

Why I did it
To address #10342 (Yang validation fails when Buffer profiles are configured with "NULL" values)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Included in 202111 Branch Request for 202111 Branch For PRs being requested for 202111 branch YANG YANG model related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants