-
Notifications
You must be signed in to change notification settings - Fork 1.8k
sonic-yang-mgmt: Generic Config Updater - performance dependencies #22254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
qiluo-msft
merged 6 commits into
sonic-net:master
from
bhouse-nexthop:bhouse-nexthop/gcu-perf
May 13, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e59d031
loadData: do not mutate user-provided data
bradh352 d7b006b
test yang models: they need to closer mimic sonic models
bhouse-nexthop f3209b0
libyang: schema leaf nodes need to expose must clauses
bradh352 0d217f8
implement configdb<>xpath conversion
bradh352 09eff1e
find_schema_dependencies() and find_schema_must_count() implementations
bhouse-nexthop a095f03
fix python 3.7 since azure vs is still building buster
bhouse-nexthop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| diff --git a/swig/cpp/src/Tree_Schema.cpp b/swig/cpp/src/Tree_Schema.cpp | ||
| index 3587320..8da206a 100644 | ||
| --- a/swig/cpp/src/Tree_Schema.cpp | ||
| +++ b/swig/cpp/src/Tree_Schema.cpp | ||
| @@ -344,6 +344,7 @@ S_Schema_Node Schema_Node_Choice::dflt() { | ||
| Schema_Node_Leaf::~Schema_Node_Leaf() {}; | ||
| S_Set Schema_Node_Leaf::backlinks() LY_NEW_CASTED(lys_node_leaf, node, backlinks, Set); | ||
| S_When Schema_Node_Leaf::when() LY_NEW_CASTED(lys_node_leaf, node, when, When); | ||
| +std::vector<S_Restr> Schema_Node_Leaf::must() LY_NEW_LIST_CASTED(lys_node_leaf, node, must, must_size, Restr); | ||
| S_Type Schema_Node_Leaf::type() {return std::make_shared<Type>(&((struct lys_node_leaf *)node)->type, deleter);} | ||
| S_Schema_Node_List Schema_Node_Leaf::is_key() { | ||
| uint8_t pos; | ||
| diff --git a/swig/cpp/src/Tree_Schema.hpp b/swig/cpp/src/Tree_Schema.hpp | ||
| index d506891..f8ecc50 100644 | ||
| --- a/swig/cpp/src/Tree_Schema.hpp | ||
| +++ b/swig/cpp/src/Tree_Schema.hpp | ||
| @@ -683,8 +683,12 @@ public: | ||
| ~Schema_Node_Leaf(); | ||
| /** get backlinks variable from [lys_node_leaf](@ref lys_node_leaf)*/ | ||
| S_Set backlinks(); | ||
| + /** get must_size variable from [lys_node_leaf](@ref lys_node_leaf)*/ | ||
| + uint8_t must_size() {return ((struct lys_node_leaf *)node)->must_size;}; | ||
| /** get when variable from [lys_node_leaf](@ref lys_node_leaf)*/ | ||
| S_When when(); | ||
| + /** get must variable from [lys_node_leaf](@ref lys_node_leaf)*/ | ||
| + std::vector<S_Restr> must(); | ||
| /** get type variable from [lys_node_leaf](@ref lys_node_leaf)*/ | ||
| S_Type type(); | ||
| /** get units variable from [lys_node_leaf](@ref lys_node_leaf)*/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the new fields are only used in python, is it possible not to patch cpp files? #Closed
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, libyang1 used SWIG to generate python bindings off the C++ bindings, so this is the only way to do it. Libyang3 uses CFFI which is in a separate package than the C library, so its different once we upgrade to libyang3.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry let clarify my question: are the new fields only used in python? If yes, we do not need to patch cpp, we could just add this functionality inside python code, without worrying about SWIG/CFFI at all.
Let me know if it is not true - ie, cpp also need this functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, unfortunately that's not true. libyang is a C library. Then they generate python bindings off the C++ wrapper code using SWIG, so it must exist in the C++ code since the python bindings are generated off that automatically. That's why you don't see anything python-specific in the changeset for that. The C++ code actually is never used anywhere in sonic except to facilitate the python bindings.
Its a different story for CFFI that libyang3 uses, there is no C++ there at all