Skip to content

[vxlan]add L2-vxlan [#376]#867

Open
shine4chen wants to merge 4 commits intosonic-net:masterfrom
shine4chen:l2-vxlan
Open

[vxlan]add L2-vxlan [#376]#867
shine4chen wants to merge 4 commits intosonic-net:masterfrom
shine4chen:l2-vxlan

Conversation

@shine4chen
Copy link
Copy Markdown
Contributor

What I did
Add L2 vxlan feature

Why I did it
Current vxlan implementation only support VNET scenario. We add vxlan support on L2 scenario.

How I verified it
Tested it in nephos lab

Details if related
[vxlanorch]

  • When creating vxlan tunnel, create its bridge port. If VXLAN tunnel
    without bridge port, FDB MAC can not be learnt from or set to VXLAN
    tunnel in ASIC.
  • Add the tunnel name map to counter table, so that the ‘show mac’
    command can display the FDB learnt from VXLAN tunnel.
  • Send command to Linux kernel to create L2 VXLAN tunnel interface.

[fdborch]

  • FDB MAC can be learnt from or set to VXLAN tunnel in ASIC

@shine4chen
Copy link
Copy Markdown
Contributor Author

@jianjundong

[vxlanorch]

* Adding the following logic:
- When creating vxlan tunnel, create its bridge port. If VXLAN tunnel
without bridge port, FDB MAC can not be learnt from or set to VXLAN
tunnel in ASIC.
- Add the tunnel name map to counter table, so that the ‘show mac’
command can display the FDB learnt from VXLAN tunnel.
- Send command to Linux kernel to create L2 VXLAN tunnel interface.

[fdborch]
* FDB MAC can be learnt from or set to VXLAN tunnel in ASIC

Signed-off-by: jianjun.dong <jianjun.dong@nephosinc.com>
Copy link
Copy Markdown
Collaborator

@prsunny prsunny left a comment

Choose a reason for hiding this comment

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

Please see comments

Comment thread orchagent/vxlanorch.cpp Outdated
Comment thread orchagent/vxlanorch.cpp
Comment thread orchagent/vxlanorch.cpp Outdated
Comment thread orchagent/fdborch.cpp Outdated
Comment thread orchagent/fdborch.cpp Outdated
Comment thread orchagent/vxlanorch.cpp
Comment thread orchagent/fdborch.cpp
Port port;
/* Retry until port is created */
if (!m_portsOrch->getPort(port_name, port))
sai_object_id_t bridge_port_id = SAI_NULL_OBJECT_ID;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Sonic VxLAN HLD refers to a separate VXLAN_FDB_TABLE for MACs pointing to remote VTEP. addFdbEntry is to handle entry additions in APP_FDB_TABLE. The current code changes seem to indicate that the VxLAN MACs are populated in the APP_FDB_TABLE. Is there a change in the design ?

Either way It is better to handle VxLAN FDB entry add/remove in a different function to keep it clean instead of checking for port_name against VTT in multiple places.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes, vxlan tunnel MAC is set in APP_FDB_TABLE currently. Packet forwarding is correctly in lab test.
In Sonic VxLAN HLD, I don't see any description about VXLAN_FDB_TABLE, only 'Add VxlanOrch as a member of FDBOrch. For FDB entries learnt on remote VTEP, app-fdb-table shall be updated and programmed to SAI by getting the BridgeIf/RemoteVTEP mapping from VxlanOrch. (TBD)'.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks. I think that VXLAN_FDB_TABLE is used for L3 vxlan scenario, such as EVPN, entries in the table are exchanged by MBGP. The modification here is only for L2 vxlan scenario, entries are learned by ASIC.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The existing fdborch can't listen to VXLAN_FDB_TABLE. We can refine the code after fdbOrch support listening to vxlan_fdb_table event.

Comment thread orchagent/fdborch.cpp
leoli-nps and others added 3 commits May 31, 2019 03:35
Signed-off-by: leo.li <leo.li@nephosinc.com>
Signed-off-by: shine.chen <shine.chen@nephosinc.com>
Signed-off-by: shine.chen <shine.chen@nephosinc.com>
@shine4chen
Copy link
Copy Markdown
Contributor Author

retest this please

EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
- Fix Python warnings flagged by "LGTM" plugin.
- Also make all 'except' statements Python3-compliant
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
jianyuewu pushed a commit to jianyuewu/sonic-swss that referenced this pull request Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants