Skip to content

[vlan] Add support of VLAN host interface#1645

Merged
prsunny merged 4 commits intosonic-net:masterfrom
volodymyrsamotiy:vnet_ping_tool
Apr 8, 2021
Merged

[vlan] Add support of VLAN host interface#1645
prsunny merged 4 commits intosonic-net:masterfrom
volodymyrsamotiy:vnet_ping_tool

Conversation

@volodymyrsamotiy
Copy link
Copy Markdown
Collaborator

  • Infrastructure needed for the VNET ping tool

Signed-off-by: Volodymyr Samotiy [email protected]

What I did

Add support of VLAN host interface

Why I did it

It is infrastructure needed for the VNET ping tool

How I verified it
Configured new VLAN with "hostif_name" attribute and verified that it created in HW

Details if related
N/A

* Infrastructure needed for the VNET ping tool

Signed-off-by: Volodymyr Samotiy <[email protected]>
@lguohan lguohan requested a review from prsunny February 18, 2021 04:07
@lguohan
Copy link
Copy Markdown
Contributor

lguohan commented Feb 18, 2021

missing pytest

Comment thread orchagent/portsorch.cpp Outdated
{
if (!createVlanHostIntf(vl, hostif_name))
{
throw runtime_error("Cannot create VLAN host interface");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lets handle the failure gracefully as this is for monitoring Vlan. We can erase it and continue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Changed.

Comment thread cfgmgr/vlanmgr.cpp
mac = fvValue(i);
setHostVlanMac(vlan_id, mac);
}
else if (fvField(i) == "hostif_name")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this mean, for every Vlan thats in VNET, a corresponding host if shall be created?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, since it is per VLAN attribute and created for specific VLAN.

* Add VS test

Signed-off-by: Volodymyr Samotiy <[email protected]>
@volodymyrsamotiy
Copy link
Copy Markdown
Collaborator Author

In order for VS test to pass first need to merge the following PR for "vslib": sonic-net/sonic-sairedis#804

@liat-grozovik
Copy link
Copy Markdown
Collaborator

@prsunny can you please review?

@liat-grozovik
Copy link
Copy Markdown
Collaborator

In order for VS test to pass first need to merge the following PR for "vslib": Azure/sonic-sairedis#804

@volodymyrsamotiy it was merged. please check that submodule is updated and then retest.

* Handle gracefully faiure for creating monitoring VLAN hostif

Signed-off-by: Volodymyr Samotiy <[email protected]>
@prsunny
Copy link
Copy Markdown
Collaborator

prsunny commented Apr 6, 2021

retest this please

@prsunny
Copy link
Copy Markdown
Collaborator

prsunny commented Apr 6, 2021

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread orchagent/portsorch.cpp Outdated
return false;
}

if (!removeVlanHostIntf(vlan))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This must be called only if host_intf_id is present, else skip

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment thread orchagent/portsorch.cpp Outdated
if (!createVlanHostIntf(vl, hostif_name))
{
// No need to fail in case of error as this is for monitoring VLAN.
// Error message is printed by "createVlanHostIntf" so just handle faiure gracefully.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

failure - typo

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@prsunny
Copy link
Copy Markdown
Collaborator

prsunny commented Apr 7, 2021

@volodymyrsamotiy , can you please take a look at the test failures?

@liat-grozovik
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

* Fix review comments

Signed-off-by: Volodymyr Samotiy <[email protected]>
@volodymyrsamotiy
Copy link
Copy Markdown
Collaborator Author

Fixed last review comments and test failure

@prsunny prsunny merged commit ca8ba6d into sonic-net:master Apr 8, 2021
@abdosi
Copy link
Copy Markdown
Contributor

abdosi commented Apr 8, 2021

Need pr for 201911. cherry-pick has conflict.

@prsunny @volodymyrsamotiy

yxieca pushed a commit that referenced this pull request Apr 8, 2021
* [vlan] Add support of VLAN host interface
* Infrastructure needed for the VNET ping tool

Signed-off-by: Volodymyr Samotiy <[email protected]>
abdosi pushed a commit that referenced this pull request Apr 8, 2021
* [vlan] Add support of VLAN host interface
* Infrastructure needed for the VNET ping tool

Signed-off-by: Volodymyr Samotiy <[email protected]>
@abdosi
Copy link
Copy Markdown
Contributor

abdosi commented Apr 8, 2021

Included without dvs test. Please create new pr for dvs test in 201911.

@abdosi
Copy link
Copy Markdown
Contributor

abdosi commented Apr 10, 2021

@volodymyrsamotiy we should optimize the PR to use addHostIntfs() as this can support VLAN based Host router interface. There should not be need of new set of create/remove API's().

We can just add this check

    if (port.m_type == Port::VLAN)
    {
        attr.value.oid = port.m_vlan_info.vlan_oid;
    }
    else
    {
        attr.value.oid = port.m_port_id;
    }

@prsunny

liat-grozovik pushed a commit to sonic-net/sonic-buildimage that referenced this pull request May 4, 2021
- Why I did it
To include below changes:
Set monitoring VLAN hostif up dy default (for VNET ping tool)

- How I did it
Updated SAI submodule pointer

- How to verify it
Create VLAN hostif according to changes in PR: sonic-net/sonic-swss#1645
Verify it is admin up by default

Signed-off-by: Volodymyr Samotiy <[email protected]>
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-swss that referenced this pull request Oct 5, 2021
* [vlan] Add support of VLAN host interface
* Infrastructure needed for the VNET ping tool

Signed-off-by: Volodymyr Samotiy <[email protected]>
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