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

[mirror] erspan ipv6 underlay #1817

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7da16c0
erspan ipv6 underlay
wendani Jul 6, 2021
d0c5d5f
Introduce src, dst ips
wendani Jul 6, 2021
0c79782
Introduce interface address
wendani Jul 6, 2021
f60b974
Introduce next hop ip
wendani Jul 6, 2021
726e600
Refactor route add
wendani Jul 6, 2021
e9ecc9b
test MirrorAddRemove ipv6 encap
wendani Jul 7, 2021
090410f
Refactor MirrorToLagAddRemove
wendani Jul 7, 2021
cd2c779
Uncomment test
wendani Jul 7, 2021
f9c211c
Introduce _test_MirrorToLagAddRemove
wendani Jul 7, 2021
ad07aa5
test MirrorToLagAddRemove ipv6 encap
wendani Jul 7, 2021
61149a5
Refactor MirrorToVlanAddRemove
wendani Jul 7, 2021
af5e1e1
Introduce _test_MirrorToVlanAddRemove
wendani Jul 7, 2021
6e96186
test MirrorToVlanAddRemove ipv6 encap
wendani Jul 7, 2021
21ce117
test_MirrorToLagAddRemove check IPHDR_VERSION
wendani Jul 7, 2021
12d4267
Refactor MirrorDestMoveVlan
wendani Jul 7, 2021
fbed725
Introduce _test_MirrorDestMoveVlan
wendani Jul 7, 2021
1e24562
test MirrorDestMoveVlan ipv6 encap
wendani Jul 7, 2021
8f45af5
Refactor MirrorDestMoveLag
wendani Jul 7, 2021
ca4dbf3
Introduce _test_MirrorDestMoveLag
wendani Jul 7, 2021
320efa0
test MirrorDestMoveLag ipv6 encap
wendani Jul 8, 2021
9744601
Merge remote-tracking branch 'public/master' into v6erspan_master
wendani Jul 9, 2021
fef1dfa
ipv6 next hop key
wendani Jul 9, 2021
07689ba
Add missing test run
wendani Jul 9, 2021
b2f8475
Add comment
wendani Jul 9, 2021
f25b22f
Address comment: use !isV4() for ipv6
wendani Jul 15, 2021
e47d8ab
Stablize test MirrorDestMoveVlan
wendani Jul 16, 2021
7c9dff2
Update neigh table family field value
wendani Aug 4, 2021
6f3315c
Merge remote-tracking branch 'public/master' into v6erspan_master
wendani Aug 5, 2021
f9a3d74
Merge remote-tracking branch 'public/master' into v6erspan_master
wendani Dec 15, 2021
ba31e8e
Address comment: src & dst family check
wendani Dec 15, 2021
9ea7873
Merge remote-tracking branch 'public/master' into v6erspan_master
wendani Dec 20, 2021
7420a30
Merge remote-tracking branch 'public/master' into v6erspan_master
wendani Dec 23, 2021
d988374
Merge remote-tracking branch 'public/master' into v6erspan_master
wendani Jan 10, 2022
05a5c98
Merge remote-tracking branch 'public/master' into v6erspan_master
wendani Jan 11, 2022
e93819c
Merge branch 'master' into v6erspan
prsunny Oct 2, 2024
c8e873e
Merge branch 'master' into v6erspan
prsunny Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions orchagent/mirrororch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@

#define MIRROR_SESSION_DEFAULT_VLAN_PRI 0
#define MIRROR_SESSION_DEFAULT_VLAN_CFI 0
#define MIRROR_SESSION_DEFAULT_IP_HDR_VER 4
#define MIRROR_SESSION_IP_HDR_VER_4 4
#define MIRROR_SESSION_IP_HDR_VER_6 6
#define MIRROR_SESSION_DSCP_SHIFT 2
#define MIRROR_SESSION_DSCP_MIN 0
#define MIRROR_SESSION_DSCP_MAX 63
Expand Down Expand Up @@ -396,20 +397,10 @@ task_process_status MirrorOrch::createEntry(const string& key, const vector<Fiel
if (fvField(i) == MIRROR_SESSION_SRC_IP)
{
entry.srcIp = fvValue(i);
if (!entry.srcIp.isV4())
{
SWSS_LOG_ERROR("Unsupported version of sessions %s source IP address", key.c_str());
return task_process_status::task_invalid_entry;
}
}
else if (fvField(i) == MIRROR_SESSION_DST_IP)
{
entry.dstIp = fvValue(i);
if (!entry.dstIp.isV4())
{
SWSS_LOG_ERROR("Unsupported version of sessions %s destination IP address", key.c_str());
return task_process_status::task_invalid_entry;
}
}
else if (fvField(i) == MIRROR_SESSION_GRE_TYPE)
{
Expand Down Expand Up @@ -493,6 +484,12 @@ task_process_status MirrorOrch::createEntry(const string& key, const vector<Fiel
return task_process_status::task_failed;
}
}
// Entry validation as a whole
if (entry.srcIp.getIp().family != entry.dstIp.getIp().family)
{
SWSS_LOG_ERROR("Address family of source and destination IPs is different");
return task_process_status::task_invalid_entry;
}

if (!isHwResourcesAvailable())
{
Expand Down Expand Up @@ -992,7 +989,7 @@ bool MirrorOrch::activateSession(const string& name, MirrorEntry& session)
attrs.push_back(attr);

attr.id = SAI_MIRROR_SESSION_ATTR_IPHDR_VERSION;
attr.value.u8 = MIRROR_SESSION_DEFAULT_IP_HDR_VER;
attr.value.u8 = session.dstIp.isV4() ? MIRROR_SESSION_IP_HDR_VER_4 : MIRROR_SESSION_IP_HDR_VER_6;
attrs.push_back(attr);

// TOS value format is the following:
Expand Down Expand Up @@ -1341,7 +1338,7 @@ void MirrorOrch::updateNextHop(const NextHopUpdate& update)
else
{
string alias = "";
session.nexthopInfo.nexthop = NextHopKey("0.0.0.0", alias);
session.nexthopInfo.nexthop = session.dstIp.isV4() ? NextHopKey("0.0.0.0", alias) : NextHopKey("::", alias);
}

// Update State DB Nexthop
Expand Down
Loading
Loading