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

VNET/VRF Changes #632

Merged
merged 7 commits into from
Oct 10, 2018
Merged

VNET/VRF Changes #632

merged 7 commits into from
Oct 10, 2018

Conversation

prsunny
Copy link
Collaborator

@prsunny prsunny commented Sep 28, 2018

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

@prsunny
Copy link
Collaborator Author

prsunny commented Oct 2, 2018

retest this please

{
SWSS_LOG_ERROR("Failed to create virtual router name: %s, rv: %d",
vnet_name.c_str(), status);
return false;
Copy link
Contributor

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?

}
else if (!attrs.empty())
{
it->second->updateObj(attrs);
Copy link
Contributor

Choose a reason for hiding this comment

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

Check return value.

orchagent/vnetorch.cpp Outdated Show resolved Hide resolved
orchagent/intfsorch.cpp Outdated Show resolved Hide resolved
}

const std::string& vnet_name = request.getKeyString(0);
SWSS_LOG_INFO("VNET '%s' add request", vnet_name.c_str());
Copy link
Contributor

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?

Copy link
Collaborator Author

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

@@ -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))
Copy link
Contributor

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.

{
return vr_ids.at(VR_TYPE::ING_VR_VALID);
}
return 0x0;
Copy link
Contributor

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

orchagent/vnetorch.h Outdated Show resolved Hide resolved
orchagent/vnetorch.cpp Outdated Show resolved Hide resolved
orchagent/vnetorch.h Outdated Show resolved Hide resolved
{ } // no mandatory attributes
};

enum class VNET_EXEC
Copy link
Contributor

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?

Copy link
Collaborator Author

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)

{
return vr_ids.at(VR_TYPE::EGR_VR_VALID);
}
return 0x0;
Copy link
Contributor

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


if (vnet_table_.find(vnet_name) == std::end(vnet_table_))
{
SWSS_LOG_ERROR("VNET '%s' doesn't exist", vnet_name.c_str());
Copy link
Contributor

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.


vnet_table_.erase(vnet_name);

SWSS_LOG_NOTICE("VNET '%s' del request", vnet_name.c_str());
Copy link
Contributor

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.cpp Outdated Show resolved Hide resolved

void setPeerList(set<string>& p_list)
{
peer_list = p_list;
Copy link
Contributor

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

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>&) ?

Copy link
Collaborator Author

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_;
Copy link
Contributor

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.

Copy link
Collaborator Author

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
@lguohan
Copy link
Contributor

lguohan commented Oct 9, 2018

retest this please

@prsunny
Copy link
Collaborator Author

prsunny commented Oct 10, 2018

retest this please

@prsunny prsunny merged commit 8d57ae0 into sonic-net:master Oct 10, 2018
@prsunny prsunny mentioned this pull request Oct 16, 2018
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
…-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
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.

6 participants