-
Notifications
You must be signed in to change notification settings - Fork 549
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
[vrf orchagent]: Add Request parser class and VRF orchagent based on it #424
[vrf orchagent]: Add Request parser class and VRF orchagent based on it #424
Conversation
…where it using, otherwise it would uninitialized
orchagent/vrforch.cpp
Outdated
} | ||
|
||
sai_object_id_t router_id; | ||
sai_status_t status = sai_virtual_router_api->create_virtual_router(&router_id, |
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.
create_virtual_router [](start = 50, length = 21)
if the vrf exists, then we need to do a set operation, i think.
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.
You mean 'update' operation? Don't create a new vrf, but update existing one?
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.
yes
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.
ok. In this case 'update' operation might have two semantics:
- remove old attributes and add the new one from the request. Currently impossible in SAI (no function to remove attributes or setting them into default value).
- merge old attributes with new ones from the request..
I'll implement the second approach.
{ | ||
std::vector<request_types_t> key_item_types; | ||
std::unordered_map<std::string, request_types_t> attr_item_types; | ||
std::vector<std::string> mandatory_attr_items; |
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.
std::vectorstd::string mandatory_attr_items; [](start = 4, length = 46)
I am ok with current implementation.
but, it would be more extensible to add different property for the attribute item, for example, the type, whether it is mandatory or not, whether it depends on other attribute item of not.
tests/test_vrf.py
Outdated
# check that the vrf entry was removed | ||
assert how_many_entries_exist(asic_db, "ASIC_STATE:SAI_OBJECT_TYPE_VIRTUAL_ROUTER") == 1, "The vrf wasn't removed" | ||
|
||
# check that the correct vrv entry was removed |
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.
vrv [](start = 29, length = 3)
vrf
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.
we need to add set operation for the vrf.
tests/request_parser_ut.cpp
Outdated
} | ||
// FIXME: add a test to test an unsupported key type and attr type REQ_T_NOT_USED | ||
// FIXME: expect_no_throw for constructors | ||
// FIXME: Add a test to test 'empry' attribute |
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.
empty
…SONiC/issues/268)" (sonic-net#424) Signed-off-by: [email protected]
…erface names (sonic-net#474) * Avoid shutdown/startup commands on invalid interface names * sonic-utilities: Fix bug in the show command to display a specific interface status * sonic-utilities: Check for the presence of interface in port table instead of the optional alias attribute * Addressed review comment for sonic-net#424 * Undone the change in intfutil file to push that fix in a seperate PR. * Corrected the error message string for 'config interface <invalid-interface-name> tartup/shutdown'. * [sonic-utilities] Fix to shutdown and startup on valid PortChannel interface names * [sonic-utilities] Allow shutdown/startup commands to be done using the alias names of PORTs.
Signed-off-by: Volodymyr Samotiy <[email protected]>
What I did
Implemented VRF orchagent.
Why I did it
To support virtual routers configurations on SONiC.
How I verified it
Usings tests/tests_vrf.py
Details if related
I've added a request parser (see orchagent/request_parser.cpp, orchagent/request_parser.h and tests/request_parser-ut.cpp). When using this class for any orchagent the class can parse and validate
request parameters for an orchagent. It allows us to create new orchagents faster with less errors.