-
Notifications
You must be signed in to change notification settings - Fork 549
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: add dscp_mode configuration for MySID entry #3443
base: master
Are you sure you want to change the base?
Changes from 1 commit
471a7df
fb84d26
5477a16
b5bbd93
a5cd890
8f5f6ad
b13ac29
0bba0ae
9f4d9b8
2c45f30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1259,9 +1259,6 @@ def test_AddRemoveSrv6MySidUDT46(self, dvs, testlog): | |
# enable VRF strict mode | ||
dvs.runcmd("sysctl -w net.vrf.strict_mode=1") | ||
|
||
# create an empty entry in confg db. The UDT46 entry processing will query config db for optional dscp_mode configuration | ||
self.cdb.create_entry("SRV6_MY_SIDS", "loc1|fc00:0:2:ff05::", {"NULL": "NULL"}) | ||
|
||
# configure srv6 usid locator | ||
dvs.runcmd("vtysh -c \"configure terminal\" -c \"segment-routing\" -c \"srv6\" -c \"locators\" -c \"locator loc1\" -c \"prefix fc00:0:2::/48 block-len 32 node-len 16 func-bits 16\" -c \"behavior usid\"") | ||
|
||
|
@@ -1294,8 +1291,6 @@ def test_AddRemoveSrv6MySidUDT46(self, dvs, testlog): | |
# verify that the mysid has been removed from the ASIC | ||
self.adb.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_MY_SID_ENTRY", len(self.initial_my_sid_entries)) | ||
|
||
self.cdb.delete_entry("SRV6_MY_SIDS", "loc1|fc00:0:2:ff05::") | ||
|
||
# unconfigure srv6 locator | ||
dvs.runcmd("vtysh -c \"configure terminal\" -c \"segment-routing\" -c \"no srv6\"") | ||
|
||
|
@@ -1310,15 +1305,15 @@ def verify_attribute_value(self, table, key, attribute, expected_value): | |
|
||
def add_mysid_cfgdb(self, locator, prefix, addr, dscp_mode): | ||
self.cdb.create_entry("SRV6_MY_LOCATORS", locator, {"prefix": prefix, "block_len": "32", "node_len": "16", "func_len": "16", "arg_len": "0"}) | ||
self.cdb.create_entry("SRV6_MY_SIDS", f'{locator}|{addr}', {"decap_dscp_mode": dscp_mode}) | ||
self.cdb.create_entry("SRV6_MY_SIDS", f'{locator}|{addr}/48', {"decap_dscp_mode": dscp_mode}) | ||
|
||
def remove_mysid_cfgdb(self, locator, addr): | ||
self.cdb.delete_entry("SRV6_MY_SIDS", f"{locator}|{addr}") | ||
self.cdb.delete_entry("SRV6_MY_SIDS", f"{locator}|{addr}/48") | ||
self.cdb.delete_entry("SRV6_MY_LOCATORS", locator) | ||
|
||
@pytest.mark.skipif(LooseVersion(platform.release()) < LooseVersion('5.14'), | ||
reason="This test requires Linux kernel 5.14 or higher") | ||
def test_Srv6MySidUDT46TunnelDscpMode(self, dvs, testlog): | ||
def test_Srv6MySidUNTunnelDscpMode(self, dvs, testlog): | ||
|
||
_, output = dvs.runcmd(f"vtysh -c 'show zebra dplane providers'") | ||
if 'dplane_fpm_sonic' not in output: | ||
|
@@ -1339,7 +1334,7 @@ def test_Srv6MySidUDT46TunnelDscpMode(self, dvs, testlog): | |
|
||
# Create MySID entry with dscp_mode uniform | ||
dvs.runcmd("vtysh -c \"configure terminal\" -c \"segment-routing\" -c \"srv6\" -c \"locators\" -c \"locator loc1\" -c \"prefix fc00:0:2::/48 block-len 32 node-len 16 func-bits 16\" -c \"behavior usid\"") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need to add both FRR config and Linux Kernel Table config here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is how all the SRv6 vstests are done now, the new test is aligned to use the same approach |
||
dvs.runcmd("ip -6 route add fc00:0:2:ff05::/128 encap seg6local action End.DT46 vrftable {} dev sr0".format(self.vrf_table_id)) | ||
dvs.runcmd("ip -6 route add fc00:0:2:ff05::/128 encap seg6local action End vrftable {} dev sr0".format(self.vrf_table_id)) | ||
|
||
self.pdb.wait_for_entry("SRV6_MY_SID_TABLE", "32:16:16:0:fc00:0:2:ff05::") | ||
self.adb.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_MY_SID_ENTRY", len(self.initial_my_sid_entries) + 1) | ||
|
@@ -1351,7 +1346,7 @@ def test_Srv6MySidUDT46TunnelDscpMode(self, dvs, testlog): | |
|
||
# Create MySID entry with dscp_mode pipe | ||
dvs.runcmd("vtysh -c \"configure terminal\" -c \"segment-routing\" -c \"srv6\" -c \"locators\" -c \"locator loc1\" -c \"prefix fd00:0:2::/48 block-len 32 node-len 16 func-bits 16\" -c \"behavior usid\"") | ||
dvs.runcmd("ip -6 route add fd00:0:2:ff05::/128 encap seg6local action End.DT46 vrftable {} dev sr0".format(self.vrf_table_id)) | ||
dvs.runcmd("ip -6 route add fd00:0:2:ff05::/128 encap seg6local action End vrftable {} dev sr0".format(self.vrf_table_id)) | ||
|
||
self.pdb.wait_for_entry("SRV6_MY_SID_TABLE", "32:16:16:0:fd00:0:2:ff05::") | ||
self.adb.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_MY_SID_ENTRY", len(self.initial_my_sid_entries) + 2) | ||
|
@@ -1366,6 +1361,8 @@ def test_Srv6MySidUDT46TunnelDscpMode(self, dvs, testlog): | |
self.verify_attribute_value(my_sid_table, my_sid_pipe, "SAI_MY_SID_ENTRY_ATTR_TUNNEL_ID", tunnel_pipe) | ||
self.verify_attribute_value(tunnel_table, tunnel_uniform, "SAI_TUNNEL_ATTR_DECAP_DSCP_MODE", "SAI_TUNNEL_DSCP_MODE_UNIFORM_MODEL") | ||
self.verify_attribute_value(tunnel_table, tunnel_pipe, "SAI_TUNNEL_ATTR_DECAP_DSCP_MODE", "SAI_TUNNEL_DSCP_MODE_PIPE_MODEL") | ||
self.verify_attribute_value(my_sid_table, my_sid_uniform, "SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR_FLAVOR", "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_FLAVOR_USD") | ||
self.verify_attribute_value(my_sid_table, my_sid_pipe, "SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR_FLAVOR", "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_FLAVOR_USD") | ||
|
||
# Validate tunnel term configuration | ||
self.verify_attribute_value(tunnel_term_table, mysid_uniform_term_entry, "SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_ACTION_TUNNEL_ID", tunnel_uniform) | ||
|
@@ -1375,7 +1372,7 @@ def test_Srv6MySidUDT46TunnelDscpMode(self, dvs, testlog): | |
|
||
# Add another MySID entry with dscp_mode pipe | ||
dvs.runcmd("vtysh -c \"configure terminal\" -c \"segment-routing\" -c \"srv6\" -c \"locators\" -c \"locator loc1\" -c \"prefix fe00:0:2::/48 block-len 32 node-len 16 func-bits 16\" -c \"behavior usid\"") | ||
dvs.runcmd("ip -6 route add fe00:0:2:ff05::/128 encap seg6local action End.DT46 vrftable {} dev sr0".format(self.vrf_table_id)) | ||
dvs.runcmd("ip -6 route add fe00:0:2:ff05::/128 encap seg6local action End vrftable {} dev sr0".format(self.vrf_table_id)) | ||
|
||
self.pdb.wait_for_entry("SRV6_MY_SID_TABLE", "32:16:16:0:fe00:0:2:ff05::") | ||
self.adb.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_MY_SID_ENTRY", len(self.initial_my_sid_entries) + 3) | ||
|
@@ -1387,9 +1384,9 @@ def test_Srv6MySidUDT46TunnelDscpMode(self, dvs, testlog): | |
self.verify_attribute_value(my_sid_table, my_sid_pipe2, "SAI_MY_SID_ENTRY_ATTR_TUNNEL_ID", tunnel_pipe) | ||
|
||
# Remove MySID entries | ||
dvs.runcmd("ip -6 route del fc00:0:2:ff05::/128 encap seg6local action End.DT46 vrftable {} dev sr0".format(self.vrf_table_id)) | ||
dvs.runcmd("ip -6 route del fd00:0:2:ff05::/128 encap seg6local action End.DT46 vrftable {} dev sr0".format(self.vrf_table_id)) | ||
dvs.runcmd("ip -6 route del fe00:0:2:ff05::/128 encap seg6local action End.DT46 vrftable {} dev sr0".format(self.vrf_table_id)) | ||
dvs.runcmd("ip -6 route del fc00:0:2:ff05::/128 encap seg6local action End vrftable {} dev sr0".format(self.vrf_table_id)) | ||
dvs.runcmd("ip -6 route del fd00:0:2:ff05::/128 encap seg6local action End vrftable {} dev sr0".format(self.vrf_table_id)) | ||
dvs.runcmd("ip -6 route del fe00:0:2:ff05::/128 encap seg6local action End vrftable {} dev sr0".format(self.vrf_table_id)) | ||
|
||
self.pdb.wait_for_deleted_entry("SRV6_MY_SID_TABLE", "32:16:16:0:fc00:0:2:ff05::") | ||
self.pdb.wait_for_deleted_entry("SRV6_MY_SID_TABLE", "32:16:16:0:fd00:0:2:ff05::") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the prefix length of SID is equal to block_len + node_len + fucn_len in APPL_DB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 0bba0ae