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

SRv6: update for uSID endpoint behavior mapping #3414

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 11 additions & 6 deletions orchagent/srv6orch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ const map<string, sai_my_sid_entry_endpoint_behavior_t> end_behavior_map =
{"end.b6.encaps.red", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS_RED},
{"end.b6.insert", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT},
{"end.b6.insert.red", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT_RED},
{"udx6", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX6},
{"udx4", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX4},
{"udt6", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT6},
{"udt4", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT4},
{"udt46", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT46},
{"udx6", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDX6},
{"udx4", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDX4},
{"udt6", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDT6},
{"udt4", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDT4},
{"udt46", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDT46},
{"un", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UN},
{"ua", SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UA}
};
Expand Down Expand Up @@ -622,7 +622,10 @@ bool Srv6Orch::mySidVrfRequired(const sai_my_sid_entry_endpoint_behavior_t end_b
if (end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_T ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT4 ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT6 ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT46)
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT46 ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDT4 ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDT6 ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDT46)
{
return true;
}
Expand All @@ -634,6 +637,8 @@ bool Srv6Orch::mySidNextHopRequired(const sai_my_sid_entry_endpoint_behavior_t e
if (end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_X ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX4 ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX6 ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDX4 ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDX6 ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_ENCAPS_RED ||
end_behavior == SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_B6_INSERT ||
Expand Down
10 changes: 5 additions & 5 deletions tests/test_srv6.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def test_mysid(self, dvs, testlog):
if fv[0] == "SAI_MY_SID_ENTRY_ATTR_NEXT_HOP_ID":
assert fv[1] == next_hop_ipv4_id
if fv[0] == "SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR":
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX4"
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDX4"
elif fv[0] == "SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR_FLAVOR":
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_FLAVOR_PSP_AND_USD"

Expand All @@ -331,7 +331,7 @@ def test_mysid(self, dvs, testlog):
if fv[0] == "SAI_MY_SID_ENTRY_ATTR_NEXT_HOP_ID":
assert fv[1] == next_hop_ipv6_id
if fv[0] == "SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR":
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DX6"
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDX6"
elif fv[0] == "SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR_FLAVOR":
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_FLAVOR_PSP_AND_USD"

Expand Down Expand Up @@ -1181,7 +1181,7 @@ def test_AddRemoveSrv6MySidUDT4(self, dvs, testlog):
assert status == True
for fv in fvs:
if fv[0] == "SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR":
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT4"
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDT4"
if fv[0] == "SAI_MY_SID_ENTRY_ATTR_VRF":
assert fv[1] == self.vrf_id

Expand Down Expand Up @@ -1228,7 +1228,7 @@ def test_AddRemoveSrv6MySidUDT6(self, dvs, testlog):
assert status == True
for fv in fvs:
if fv[0] == "SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR":
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT6"
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDT6"
if fv[0] == "SAI_MY_SID_ENTRY_ATTR_VRF":
assert fv[1] == self.vrf_id

Expand Down Expand Up @@ -1278,7 +1278,7 @@ def test_AddRemoveSrv6MySidUDT46(self, dvs, testlog):
assert status == True
for fv in fvs:
if fv[0] == "SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR":
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_DT46"
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_UDT46"
if fv[0] == "SAI_MY_SID_ENTRY_ATTR_VRF":
assert fv[1] == self.vrf_id

Expand Down
Loading