Skip to content
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

Merged
merged 27 commits into from
Jan 17, 2018

Conversation

pavel-shirshov
Copy link
Contributor

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.

}

sai_object_id_t router_id;
sai_status_t status = sai_virtual_router_api->create_virtual_router(&router_id,
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

Copy link
Contributor Author

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:

  1. 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).
  2. 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;
Copy link
Contributor

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.

# 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
Copy link
Contributor

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

Copy link
Contributor

@lguohan lguohan left a 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.

}
// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

empty

@pavel-shirshov pavel-shirshov merged commit 6634744 into sonic-net:master Jan 17, 2018
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…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.
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants