-
Notifications
You must be signed in to change notification settings - Fork 531
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
VNET/VRF Changes #632
VNET/VRF Changes #632
Conversation
retest this please |
orchagent/vnetorch.cpp
Outdated
{ | ||
SWSS_LOG_ERROR("Failed to create virtual router name: %s, rv: %d", | ||
vnet_name.c_str(), status); | ||
return false; |
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.
Shouldn't you throw an exception on false and use try where you call the constructor from?
orchagent/vnetorch.cpp
Outdated
} | ||
else if (!attrs.empty()) | ||
{ | ||
it->second->updateObj(attrs); |
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.
Check return value.
} | ||
|
||
const std::string& vnet_name = request.getKeyString(0); | ||
SWSS_LOG_INFO("VNET '%s' add request", vnet_name.c_str()); |
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.
SWSS_LOG_INFO [](start = 4, length = 13)
is this debug level?
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.
Prefer to have it as INFO for now since this is executing only during VNET scenario and DEBUG logs, if enable is considerably high
orchagent/intfsorch.cpp
Outdated
@@ -149,7 +173,7 @@ void IntfsOrch::doTask(Consumer &consumer) | |||
auto it_intfs = m_syncdIntfses.find(alias); | |||
if (it_intfs == m_syncdIntfses.end()) | |||
{ | |||
if (addRouterIntfs(port)) | |||
if (addRouterIntfs(vrf_name, port)) |
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.
When the interface is enslaved in a vrf, the connected (subnet route) and receive (ip2me route) need to be removed from the old vrf. Is the expectation that SAI will do this automatically?
I don't see this PR taking care of that and I don't see #635 taking care of that either.
Please clarify whether it's been agreed that SAI will do this. If not, then either this PR or the one I mentioned above, need to take care of it, unless I've missed something.
orchagent/vnetorch.h
Outdated
{ | ||
return vr_ids.at(VR_TYPE::ING_VR_VALID); | ||
} | ||
return 0x0; |
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.
0x0 [](start = 15, length = 3)
use SAI_NULL_OBJECT_ID
{ } // no mandatory attributes | ||
}; | ||
|
||
enum class VNET_EXEC |
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.
what does VNET_EXEC mean? VNET_TYPE?
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.
it means the Vnet execution model. (VRF vs BRIDGE)
orchagent/vnetorch.h
Outdated
{ | ||
return vr_ids.at(VR_TYPE::EGR_VR_VALID); | ||
} | ||
return 0x0; |
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.
0x0 [](start = 15, length = 3)
SAI_NULL_OBJECT_ID
orchagent/vnetorch.cpp
Outdated
|
||
if (vnet_table_.find(vnet_name) == std::end(vnet_table_)) | ||
{ | ||
SWSS_LOG_ERROR("VNET '%s' doesn't exist", vnet_name.c_str()); |
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.
SWSS_LOG_ERROR [](start = 8, length = 14)
not sure this error, it should be warning since the program still can run without problem.
orchagent/vnetorch.cpp
Outdated
|
||
vnet_table_.erase(vnet_name); | ||
|
||
SWSS_LOG_NOTICE("VNET '%s' del request", vnet_name.c_str()); |
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.
SWSS_LOG_NOTICE [](start = 4, length = 15)
INFO level to match with add/update operation.
orchagent/vnetorch.h
Outdated
|
||
void setPeerList(set<string>& p_list) | ||
{ | ||
peer_list = p_list; |
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.
How is peer_list used after getting it?
|
||
template <class T> | ||
std::unique_ptr<T> VNetOrch::createObject(const string& vnet_name, set<string>& plist, | ||
vector<sai_attribute_t>& attrs) |
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 make it a template, are there class other than VNetVrfObject using the same parameters of (const string&, set&, vector<sai_attribute_t>&) ?
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 is also a bridge model for Vnet. Hence the template.
|
||
VNetTable vnet_table_; | ||
VNetRequest request_; | ||
VNET_EXEC vnet_exec_; |
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.
What is the reason to have trailing "_" here for them? I don't see it at other implementation.
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.
Few of the orchs, (vrf, vxlan) has member variables with trailing _. So keeping it consistent with that.
* Vnet route table handling * Addressed review comments * Fix for interface routes, add debug logs
retest this please |
retest this please |
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
…-net#632) * builds on support for multiple switches in sonic-sairedis * new vslib switch BCM81724 implements a virtual gearbox phy. * support for launching second (BCM81724 is supported by its own syncd) * simple refactoring of tests to support switches by part number, still working with sairedis to support multiple switch in tests so BCM81724 will be a separate pull request) * changed example context_config.json to reflect renaming of phy REDIS tables (see sonic-swss-common commit 292b08a3a80b24b23663020b37e6260039a311c0) Note that a future commit to sonic-buildimage will be required to trigger launch of physyncd (launching is based on device config files which are currently not present in sonic-buildimage). Testing done in multiple environments (broadcom fork and pure upstream). Example CLI output based on changes pushed to sonic-utilities (commit a6c4456) running in VS switch supporting BCM81724: root@sonic:/home/admin# show gearbox interfaces status PHY Id Interface MAC Lanes MAC Lane Speed PHY Lanes PHY Lane Speed Line Lanes Line Lane Speed Oper Admin -------- ----------- ----------- ---------------- ----------- ---------------- ------------ ----------------- ------ ------- 1 Ethernet0 25,26,27,28 10G 200,201 20G 206 40G up up 1 Ethernet4 29,30,31,32 10G 202,203 20G 207 40G up up 1 Ethernet8 33,34,35,36 10G 204,205 20G 208 40G up up HLD is located at https://github.com/Azure/SONiC/blob/master/doc/gearbox/gearbox_mgr_design.md Signed-off-by: syd.logan@broadcom.com
What I did
Introduce VNetOrch to support VNet peering feature.
Why I did it
Support VNet peering using Vxlan (VNI <-> VRF)
How I verified it
VS test case, Testing in-progress
Details if related
Design Document:
https://github.com/prsunny/SONiC/blob/gh-pages/doc/vxlan/Vxlan_hld.md