diff --git a/Makefile b/Makefile index 8509c2e37..691dba474 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,12 @@ else SAITHRIFT_PATH=test/saithrift endif +# Passed to genrpc.pl via "make saithrift-build": +GEN_SAIRPC_OPTS?= + +# Passed to meta/Makefile via "make saithrift-build, can specify add'l libraries along with libsai +SAIRPC_EXTRA_LIBS?= + .PHONY: test doc clean doc: @@ -37,7 +43,7 @@ test: make -C test saithrift-build: - make -C $(SAITHRIFT_PATH) + SAIRPC_EXTRA_LIBS="$(SAIRPC_EXTRA_LIBS)" GEN_SAIRPC_OPTS=$(GEN_SAIRPC_OPTS) make -C $(SAITHRIFT_PATH) saithrift-install: saithrift-build make -C $(SAITHRIFT_PATH) install diff --git a/debian/copy_installer.sh b/debian/copy_installer.sh index 8997e87d0..556899e9a 100755 --- a/debian/copy_installer.sh +++ b/debian/copy_installer.sh @@ -1,8 +1,14 @@ if [[ x"$1" =~ x"v2" ]] then - echo "Copy python-saithriftv2.install as python-saithrift.install" - cp ./debian/installerFiles/python-saithriftv2.install ./debian/python-saithrift.install + echo "Copy python3-saithrift.install as python-saithrift.install" + cp ./debian/installerFiles/python3-saithrift.install ./debian/python-saithrift.install else - echo "Copy python-saithriftv1.install as python-saithrift.install" - cp ./debian/installerFiles/python-saithriftv1.install ./debian/python-saithrift.install + if [ $(lsb_release -sr) -ge 11 ] + then + echo "Copy python3-saithrift.install as python-saithrift.install after Ver.11 releases" + cp ./debian/installerFiles/python3-saithrift.install ./debian/python-saithrift.install + else + echo "Copy python2.7-saithrift.install as python-saithrift.install" + cp ./debian/installerFiles/python2.7-saithrift.install ./debian/python-saithrift.install + fi fi diff --git a/debian/installerFiles/python-saithriftv1-bullseye.install b/debian/installerFiles/python-saithriftv1-bullseye.install new file mode 100644 index 000000000..5745e926a --- /dev/null +++ b/debian/installerFiles/python-saithriftv1-bullseye.install @@ -0,0 +1,2 @@ +#compatiable with bullseye python 3.9 environment +debian/usr/local/lib/python3.9/site-packages/* /usr/lib/python3/dist-packages/ diff --git a/debian/installerFiles/python-saithriftv2.install b/debian/installerFiles/python-saithriftv2.install deleted file mode 100644 index e3d2e8c13..000000000 --- a/debian/installerFiles/python-saithriftv2.install +++ /dev/null @@ -1 +0,0 @@ -debian/usr/local/lib/python3*/site-packages/* /usr/lib/python3/dist-packages/ diff --git a/debian/installerFiles/python-saithriftv1.install b/debian/installerFiles/python2.7-saithrift.install similarity index 100% rename from debian/installerFiles/python-saithriftv1.install rename to debian/installerFiles/python2.7-saithrift.install diff --git a/debian/installerFiles/python3-saithrift.install b/debian/installerFiles/python3-saithrift.install new file mode 100644 index 000000000..38be43db2 --- /dev/null +++ b/debian/installerFiles/python3-saithrift.install @@ -0,0 +1,2 @@ +#compatiable with bullseye python 3.9 environment and saithriftv2 build with python3 +debian/usr/local/lib/python3*/site-packages/* /usr/lib/python3/dist-packages/ diff --git a/doc/sai-ptf/config_data/config_t0.md b/doc/sai-ptf/config_data/config_t0.md index fe5fac4c9..abe68026d 100644 --- a/doc/sai-ptf/config_data/config_t0.md +++ b/doc/sai-ptf/config_data/config_t0.md @@ -2,20 +2,28 @@ - [Overriew](#overriew) - [IP and MAC naming convention](#ip-and-mac-naming-convention) - [MAC](#mac) - - [IP](#ip) + - [IP v4](#ip-v4) + - [IP v6](#ip-v6) - [1. L2 Configurations](#1-l2-configurations) - [1.1 FDB Configuration](#11-fdb-configuration) - [1.2 VLAN configuration](#12-vlan-configuration) - [2. L3 configuration](#2-l3-configuration) - [2.1 VLAN Interfaces](#21-vlan-interfaces) - - [2.2 LAG configuration](#22-lag-configuration) - - [2.2.1 LAG Hash Rule](#221-lag-hash-rule) + - [2.2 Route Interfaces](#22-route-interfaces) - [2.3 Route Configuration](#23-route-configuration) - - [2.3.1 VLAN interfaces route entries](#231-vlan-interfaces-route-entries) - - [2.3.2 LAG Route entry](#232-lag-route-entry) - [2.4 Neighbor Configuration](#24-neighbor-configuration) - - [2.4.1 VLAN Neighbors](#241-vlan-neighbors) - - [2.4.2 LAG Neighbors](#242-lag-neighbors) + - [2.5 Default route entry and interface](#25-default-route-entry-and-interface) +- [3 LAG configuration](#3-lag-configuration) + - [3.1 LAG Hash Rule](#31-lag-hash-rule) +- [4. Tunnel Configuration](#4-tunnel-configuration) +- [5. Tunnel QoS remapping (pcbb)](#5-tunnel-qos-remapping-pcbb) + - [Port TC MAP](#port-tc-map) + - [Tunnel TC MAP](#tunnel-tc-map) + - [PCBB DSCP Config](#pcbb-dscp-config) + - [PCBB IP_in_IP Tunnel Config](#pcbb-ip_in_ip-tunnel-config) +- [6. Buffer](#6-buffer) +- [7. QoS](#7-qos) + - [Lossless Queue and Priority](#lossless-queue-and-priority) # Overriew This document describes the sample configuration data. @@ -28,13 +36,12 @@ In this configuration, we mapped the IP and MAC address into different parts of For MAC addresses, we can use different sections in the MAC addresses to map different title numbers. The pattern is ``` -00:TITLE_L1_NUM:TITLE_L2_NUM:ROLE:EXTRA:SEQ +L1_NUM:L2_NUM:L3_NUM:ROLE:EXTRA:SEQ ROLE: T1=1, Server=99 ``` For example: -For the MAC address in ``1.1 FDB Configuration``. -`1.1` is the title number. +For the MAC address in ``1.1 FDB Configuration``. ``` #Server MAC 00:01:01:99:02:01~00:01:01:99:02:32 @@ -43,15 +50,21 @@ For the MAC address in ``1.1 FDB Configuration``. ``` -## IP +## IP v4 For IP addresses, we will use different prefix for different role Format: ROLE.NUM.GROUP_ID.SEQ - ROLE_NUM -T0: 10.0.0.0 -T1: 10.1.0.0 -Server: 192.168.0.0 + ``` + T0: 10.0.0.0 + T0 ECMP: 10.0.50.0 + T1: 10.1.0.0 + T1 ECMP: 10.1.50.0 + Server: 192.168.0.0 + Server ECMP: 192.168.50.0 + Server Remote:192.168.10.0 + ``` For example ``` @@ -63,6 +76,21 @@ For example 192.168.2.1~ 192.168.2.8 ``` +## IP v6 +For IP addresses, we will use different prefix for different role + +Format: ROLE.NUM.GROUP_ID.SEQ + +- ROLE_NUM + ``` + T0: fc00:0:: + T0 ECMP: fc00:0:50:: + T1: fc00:1:: + T1 ECMP: fc00:1:50:: + Server: fc02:: + Server ECMP: fc02:50:: + Server Remote:fc02:10:: + ``` @@ -73,8 +101,9 @@ For example The MAC Table for VLAN L2 forwarding as below |Name|MAC|PORT|VLAN|HostIf| |-|-|-|-|-| -|mac0|01:01:00:99:00:00|Port0||Ethernet0| +|mac0|00:01:01:99:00:00|Port0||Ethernet0| |mac1-8 |00:01:01:99:01:01 - 00:01:01:99:01:08|Port1-8|10|Ethernet4-Ethernet32| +|mac1-8 |00:01:01:99:01:91 - 00:01:01:99:01:98|Port1-8|10|Ethernet4-Ethernet32| |mac9-16 |00:01:01:99:02:09 - 00:01:01:99:02:16|Port9-16|20|Ethernet36-Ethernet64| ## 1.2 VLAN configuration @@ -93,19 +122,77 @@ Host interface IP |port0|10.0.0.100| ## 2.1 VLAN Interfaces -|VLAN ID | VLAN Interface IP| +|VLAN ID | VLAN Interface IP v4| VLAN Interface IP v6 +|-|-|-| +|10|192.168.1.100|fc02::1:100| +|20|192.168.2.100|fc02::2:100| + +## 2.2 Route Interfaces +|Port|Type| +|-|-| +|port0|port| +|port5-8|port| +|port13-16|port| +|Lag1-4|Lag| +|VLAN10|VLAN| +|VLAN20|VLAN| + + + +## 2.3 Route Configuration + +|Dest IPv4|Dest IPv6| Next Hop/Group | Next hop IPv4 | Next hop IPv6 | next hop port| +|-|-|-|-|-|-| +|192.168.1.0/24|fc02::1::/112|Next Hop|192.168.1.0|fc02::1::|VLAN10| +|192.168.2.0/24|fc02::2::/112|Next Hop|192.168.2.0|fc02::2::|VLAN20| +|192.168.11.0/24|fc02::11:0/112|Next Hop|10.1.1.101|fc02::1:101|LAG1| +|192.168.12.0/24|fc02::12:0/112|Next Hop|10.1.2.101|fc02::2:101|LAG2| +|192.168.13.0/24|fc02::13:0/112|Next Hop|10.1.3.101|fc02::3:101|LAG3| +|192.168.14.0/24|fc02::14:0/112|Next Hop|10.1.4.101|fc02::4:101|LAG4| +|192.168.60.0/24|fc02::60:0/112|Next Hop Group|10.1.1.101; 10.1.2.101; 10.1.3.101; 10.1.4.101|fc00:1::1:101; fc00:1::2:101; fc00:1::3:101; fc00:1:4:101|LAG1-4| +|192.168.20.0/24|fc02::20:0/112|Next Hop|10.1.2.100|fc00:1::2:100|Tunnel| +|192.168.30.0/24|fc02::30:0/112|Next Hop|10.1.3.100|fc00:1::3:100|Tunnel| +|192.168.40.0/24|fc02::40:0/112|Next Hop|10.1.4.100|fc00:1::4:100|Tunnel| +|192.168.70.0/24|fc02::70:0/112|Next Hop Group|10.1.2.100;10.1.4.100|fc00:1::2:100; fc00:1::4:100|Tunnel| + +## 2.4 Neighbor Configuration + +|IPv4|IPv6|Port|No_host_route|dest_mac| +|-|-|-|-|-| +|192.168.1.0/24|fc02::1::/112|SVI:VLAN10|No|00:01:01:99:01:a0| +|192.168.1.255/32||SVI:VLAN10|No|ff:ff:ff:ff:ff:ff| +|192.168.2.0/24|fc02::2::/112|SVI:VLAN20|No|00:01:01:99:02:a0| +|192.168.2.255/32||SVI:VLAN20|No|ff:ff:ff:ff:ff:ff| +|10.1.1.100|fc00:1::1:100|LAG:lag1|No|00:01:01:01:01:a0| +|10.1.2.100|fc00:1::2:100|LAG:lag2|No|00:01:01:01:02:a0| +|10.1.3.100|fc00:1::3:100|LAG:lag3|No|00:01:01:01:03:a0| +|10.1.4.100|fc00:1::4:100|LAG:lag4|No|00:01:01:01:04:a0| +|192.168.1.1 ~ 192.168.1.8 |fc02::1:1 - fc02::1:8|Port1-8 | Yes|00:01:01:99:01:01 - 00:01:01:99:01:08| +|192.168.2.9 ~ 192.168.2.16| fc02::2:9 - fc02::2:16|Port9-16| Yes|00:01:01:99:02:09 - 00:01:01:99:02:16| +|192.168.1.91 ~ 192.168.1.98 |fc02::1:91 - fc02::1:98|VLAN10 | Yes|00:01:01:99:01:91 - 00:01:01:99:01:98| + +## 2.5 Default route entry and interface + +Default Route Interface +|Virtual Router|interface type| |-|-| -|10|192.168.1.100| -|20|192.168.2.100| +|default_virtual_router|LOOPBACK| + +Default route +|Virtual Router|IPv4|IPv6|Action| +|-|-|-|-| +|default_virtual_router|0.0.0.0/0|::/0|Drop| + -## 2.2 LAG configuration +# 3 LAG configuration |HostIf|LAG ID|Ports| |-|-|-| |Ethernet76-80|lag1|Port17-18| |Ethernet84-88|lag2|Port19-20| - -### 2.2.1 LAG Hash Rule +|Ethernet84-88|lag3|Port21-22| +|Ethernet92|lag4|Port23| +## 3.1 LAG Hash Rule - Set hash algorithm as SAI_HASH_ALGORITHM_CRC - Set switch hash attribute as below, which means switch computes hash using the five fields and seed(SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_SEED) as the hash configuration. ``` @@ -116,33 +203,124 @@ SAI_NATIVE_HASH_FIELD_L4_DST_PORT SAI_NATIVE_HASH_FIELD_L4_SRC_PORT ``` -## 2.3 Route Configuration +# 4. Tunnel Configuration +- Config t0 loopback: + + |Name|IP| + |-|-| + |Router_lpb_ip1_v4| 10.10.10.1| + |Router_lpb_ip2_v4| 10.10.10.2| + |Router_lpb_ip1_v6| 4001:0E98:03EE::0D25| + |Router_lpb_ip2_v6| 4001:0E98:03EE::0D26| -### 2.3.1 VLAN interfaces route entries -|VLAN ID | route IP | Type | -|-|-| - | -|10| 192.168.1.100/24 | Direct Connect| -|20| 192.168.2.100/24 | Direct Connect| -### 2.3.2 LAG Route entry -|LAG ID | route IP | Type | VALUE| -|-|-| - |-| -|1| 10.0.1.100/31 | Direct Connect|| -|2| 10.0.2.100/31 | Direct Connect|| -|1| 192.168.10.1-192.168.10.100| NH|lag1_nb| -|2| 192.168.11.1-192.168.11.100| NH|lag2_nb| +- IP IN IP Tunnel: + 1. Create ipinip tunnel with these attributes below, + |Attribute Name|Value| + |-|-| + |encap_ttl_mode|SAI_TUNNEL_TTL_MODE_PIPE_MODEL| + |encap_ttl_val|50| + |decap_ttl_mode|SAI_TUNNEL_TTL_MODE_PIPE_MODEL| + |encap_dscp_mode|SAI_TUNNEL_DSCP_MODE_PIPE_MODEL| + |encap_dscp_vale|10| + |decap_dscp_mode|SAI_TUNNEL_DSCP_MODE_PIPE_MODEL| + + 2. Create tunnel type nexhop + |type|IP|MAC| + |-|-|-| + |SAI_NEXT_HOP_TYPE_TUNNEL_ENCAP|10.1.2.101| 02:02:02:01:02:01| + |SAI_NEXT_HOP_TYPE_TUNNEL_ENCAP|10.1.4.101| 04:04:04:01:04:01| + + 3. Create tunnel term table entry with attribute + |term type|dst_ip|src_ip| + |-|-|-| + |SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2MP|10.10.10.1| 10.1.2.100| -## 2.4 Neighbor Configuration -### 2.4.1 VLAN Neighbors -|Name|Port|IP|dest_mac| -|-|-|-|-| -|vlan10_nb1-nb8|Port1-8 |192.168.1.1 ~ 192.168.1.8 |00:01:01:99:01:01 - 00:01:01:99:01:08| -|vlan20_nb1-nb8|Port9-16|192.168.2.9 ~ 192.168.2.16 |00:01:01:99:02:09 - 00:01:01:99:02:16| +- Vxlan Tunnel: + 1. Create overlay loopback interface, underlay loopback interface, pass them when creating tunnel. + 2. Create tunnel with these attributes below, + |property name|value| + |-|-| + |encap_ttl_mode|SAI_TUNNEL_TTL_MODE_PIPE_MODEL| + |encap_ttl_val|ttl_val| + |decap_ttl_mode|SAI_TUNNEL_TTL_MODE_PIPE_MODEL| + |encap_dscp_mode|SAI_TUNNEL_DSCP_MODE_PIPE_MODEL| + |encap_dscp_vale|tunnnel_dscp_val| + |decap_dscp_mode|SAI_TUNNEL_DSCP_MODE_PIPE_MODEL| + 3. Create encap/decap mapper entry + |type|vni|virtual router| + |-|-|-| + |SAI_TUNNEL_MAP_TYPE_VNI_TO_VIRTUAL_ROUTER_ID|1000| default vr id| + |SAI_TUNNEL_MAP_TYPE_VIRTUAL_ROUTER_ID_TO_VNI|default vr id| 1000| -### 2.4.2 LAG Neighbors + 4. Create tunnel term table entry with attribute + |term type|dst_ip|src_ip| + |-|-|-| + |SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2MP|10.10.10.2| 10.1.3.100| -|Name|Port|IP|dest_mac| + 5. Create tunnel type nexhop + |type|IP|MAC| + |-|-|-| + |SAI_NEXT_HOP_TYPE_TUNNEL_ENCAP|10.1.3.101| 03:03:03:01:03:01| + +# 5. Tunnel QoS remapping (pcbb) +## Port TC MAP +|TC Value|DSCP Value|PRIORITY_GROUP Value|QUEUE Value|DSCP (Source)| +|-|-|-|-|-| +|0||0|0|8| +|1||0|1|0| +|2||2|2|2| +|3||3|3|3| +|4||4|4|4| +|5||0|5|46| +|6||6|6|6| +|7||7|7|48| +|8||0|1|33| + +**p.s. For DSCP (Source), there should be a DSCP to TC map for them.** + +## Tunnel TC MAP +|TC Value|DSCP Value|PRIORITY_GROUP Value|QUEUE Value|DSCP (Source)| +|-|-|-|-|-| +|0|8|0|0|8| +|1|0|0|1|0| +|2|0|0|1|1| +|3|2|2|2|3| +|4|6|6|6|4| +|5|46|0|5|46| +|6|0|0|1|| +|7|48|0|7|48| +|8|33|0|1|33| + +**p.s. For DSCP (Source), there should be a DSCP to TC map for them.** + +## PCBB DSCP Config +|Port|MAP GROUP|MAPs| +|-|-|-| +|Port1-8|PORT|DSCP_TO_TC_MAP; TC_TO_QUEUE; TC_TO_PRIORITY_GROUP| +|Tunnel_IP_IP|TUNNEL|DSCP_TO_TC_MAP; TC_TO_PRIORITY_GROUP_MAP; TC_TO_QUEUE_MAP; TC_TO_DSCP_MAP(TC_AND_COLOR_TO_DSCP_MAP)| + +**For port map, please refer the table [Port TC MAP], for tunnel map, please refer the table [Tunnel TC MAP].** + +## PCBB IP_in_IP Tunnel Config +|Tunnel|ECN MODE|DSCP MODE| +|-|-|-| +|IP_IN_IP|SAI_TUNNEL_ATTR_DECAP_ECN_MODE=SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER; SAI_TUNNEL_ATTR_ENCAP_ECN_MODE=SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD|SAI_TUNNEL_ATTR_DECAP_DSCP_MODE=SAI_TUNNEL_DSCP_MODE_PIPE_MODEL; SAI_TUNNEL_ATTR_ENCAP_DSCP_MODE=SAI_TUNNEL_DSCP_MODE_PIPE_MODEL;| + +# 6. Buffer +**For the buffer configurations, they are different from different platform, please get the data from the config_db.json** + +The SAI objects need to config includes: +- BUFFER_POOL: THRESHOLD_MODE, SIZE, TYPE +- BUFFER_PROFILE: POOL, RESERVED_BUFFER_SIZE, THRESHOLD_MODE, SHARED_DYNAMIC_TH, XOFF_TH, XON_TH, XON_OFFSET_TH +- QUEUE(BUFFER_QUEUE) +- INGRESS_PRIORITY_GROUP(BUFFER_PG) + +# 7. QoS +## Lossless Queue and Priority +|Port|Queue Number| Priority Number| Attribute| |-|-|-|-| -|lag1_nb|lag1| 10.1.1.101 | 02:04:02:01:01:01| -|lag2_nb|lag2| 10.1.2.101 | 02:04:02:01:02:01| +|0-32|3,4|3,4|PRIORITY_FLOW_CONTROL / SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL_TX| + +**The property PRIORITY_FLOW_CONTROL or SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL_TX depend on port's property pfc_asym.** \ No newline at end of file diff --git a/doc/sai-ptf/pcbb_test_plan.md b/doc/sai-ptf/pcbb_test_plan.md new file mode 100644 index 000000000..c20ee7493 --- /dev/null +++ b/doc/sai-ptf/pcbb_test_plan.md @@ -0,0 +1,333 @@ +# SAI PCBB Test plan +- [Test Group1: Encapsulation](#test-group1-encapsulation) + - [Case1: encap_dscp_remap_v4_in_v4](#case1-encap_dscp_remap_v4_in_v4) + - [Case2: encap_dscp_remap_v6_in_v4](#case2-encap_dscp_remap_v6_in_v4) + - [Case3: encap_dscp_queue_v4_in_v4](#case3-encap_dscp_queue_v4_in_v4) + - [Case4: encap_dscp_queue_v6_in_v4](#case4-encap_dscp_queue_v6_in_v4) + - [Case5: encap_pfc_pause_v4_in_v4](#case5-encap_pfc_pause_v4_in_v4) + - [Case6: encap_pfc_pause_v6_in_v4](#case6-encap_pfc_pause_v6_in_v4) + - [Case7: encap_ecn_no_congestion_v4_in_v4](#case7-encap_ecn_no_congestion_v4_in_v4) + - [Case9: encap_ecn_no_congestion_v6_in_v4](#case9-encap_ecn_no_congestion_v6_in_v4) + - [Case10: encap_ecn_congestion_v4_in_v4](#case10-encap_ecn_congestion_v4_in_v4) + - [Case11: encap_ecn_congestion_v6_in_v4](#case11-encap_ecn_congestion_v6_in_v4) +- [Test Group2: Decapsulation](#test-group2-decapsulation) + - [Case1: decap_inner_dscp_preserve_v4_in_v4](#case1-decap_inner_dscp_preserve_v4_in_v4) + - [Case2: decap_inner_dscp_preserve_v6_in_v4](#case2-decap_inner_dscp_preserve_v6_in_v4) + - [Case3: decap_dscp_priority_v4_in_v4](#case3-decap_dscp_priority_v4_in_v4) + - [Case4: decap_dscp_priority_v6_in_v4](#case4-decap_dscp_priority_v6_in_v4) + - [Case5: decap_dscp_queue_v4_in_v4](#case5-decap_dscp_queue_v4_in_v4) + - [Case6: decap_dscp_queue_v6_in_v4](#case6-decap_dscp_queue_v6_in_v4) + - [Case7: decap_pfc_pause_v4_in_v4](#case7-decap_pfc_pause_v4_in_v4) + - [Case8: decap_pfc_pause_v6_in_v4](#case8-decap_pfc_pause_v6_in_v4) + - [Case9: decap_ecn_no_congestion_v4_in_v4](#case9-decap_ecn_no_congestion_v4_in_v4) + - [Case10: decap_ecn_no_congestion_v6_in_v4](#case10-decap_ecn_no_congestion_v6_in_v4) + - [Case11: decap_ecn_congestion_v4_in_v4](#case11-decap_ecn_congestion_v4_in_v4) + - [Case12: decap_ecn_congestion_v6_in_v4](#case12-decap_ecn_congestion_v6_in_v4) + - [Case13: decap_global_dscp_to_tc_map_v4_in_v4](#case13-decap_global_dscp_to_tc_map_v4_in_v4) + - [Case14: decap_global_dscp_to_tc_map_v6_in_v4](#case14-decap_global_dscp_to_tc_map_v6_in_v4) + +## Test Group1: Encapsulation + +### Case1: encap_dscp_remap_v4_in_v4 +### Case2: encap_dscp_remap_v6_in_v4 +### Case3: encap_dscp_queue_v4_in_v4 +### Case4: encap_dscp_queue_v6_in_v4 +### Case5: encap_pfc_pause_v4_in_v4 +### Case6: encap_pfc_pause_v6_in_v4 +### Case7: encap_ecn_no_congestion_v4_in_v4 +### Case9: encap_ecn_no_congestion_v6_in_v4 +### Case10: encap_ecn_congestion_v4_in_v4 +### Case11: encap_ecn_congestion_v6_in_v4 + +### Testing Objective +- encap_dscp_remap: This verifies on encapsulation, the DSCP field is preserved end-to-end in inner header and the outer header is mapped to the expect encap value base on the DSCP map. +- encap_dscp_queue: This verifies on encapsulation, the DSCP field is preserved end-to-end in inner header and the outer header is mapped to the expect encap value base on the queue map ``DSCP_MAP_TABLE``. +- encap_pfc_pause: This verifies if the buffer is filled up, the pfc frame generated as expected in encap. +- encap_ecn_no_congestion: This verifies the ecn generated as expected in encap when no congestion happens, like ``ECN_NON_CGN_TABLE``. +- encap_ecn_congestion: This verifies the ecn generated as expected in encap when congestion happens, as the ``ECN_CGN_TABLE`` + + + We will send a decapsulated packet from port1 and expect an encapsulated packet on any lag1-4 member + + + | Ingress side[port1] | Egress side[lag1] [lag2] [lag3] [lag4] | + |--------------------------|---------------------------------------- + | ipv4's falls in 192.168.60.0 | ipv4's falls in 10.1.0.0 | + | ipv6's falls in fc02::60:0 | ipv6's falls in fc00:1:: | + +### Testing Data Packet + +This test should cover all the data in the table below (traverse all data) + +DSCP_MAP_TABLE +|DSCP|TC to verify| Expected DSCP after encap(outer)|Outgoing Queue(Tunnel)|Priority(Port)| +| ---- | ---- | --- |-|-| +|8|0|8|0|0| +|0-1|1|0|1|0| +|3|3|2|2|3| +|4|4|6|6|4| +|5-32|1|0|1|0| +|33|8|33|1|0| +|34-45|1|0|1|0| +|47|1|0|1|0| +|46|5|46|5|0| +|48|7|48|7|7| +|49-63|1|0|1|0| + + +For ECN testing + +ECN_NON_CGN_TABLE: +|DSCP| ECN Outer DSCP |Outer ECN |Inner DSCP |Inner ECN| +|-|-|-|-|-| +|33|3|33|3|33|3| +|33|2|33|2|33|2| +|33|1|33|1|33|1| +|3|3|2|3|3|3| +|3|2|2|2|3|2| +|3|1|2|1|3|1| +|4|3|6|3|4|3| +|4|2|6|2|4|2| +|4|1|6|1|4|1| + +ECN_CGN_TABLE: +|DSCP|ECN|Outer DSCP|Outer ECN|Inner DSCP|Inner ECN| +|-|-|-|-|-|-| +|3|3|2|3|3|3| +|3|2|2|3|3|3| +|3|1|2|3|3|3| +|4|3|6|3|4|3| +|4|2|6|3|4|3| +|4|1|6|3|4|3| + + +#### IPV4 IN IPV4 Packet +- expected egress encap packet=Ether(dst=ROUTER_MAC)/IP(dst=``ACTIVE_TOR_IP``,src=`STAND_BY_TOR_IP``,ip_dscp=``EXP_DSCP COL``, ip_ecn=``OUTER_ECN``)/IP(dst=192.168.60.1,src=192.168.1.1, ip_dscp=``DSCP COL``, ip_ecn=``INNER_ECN``)/TCP() +- ingress packet = Ether(dst=00:01:01:01:02:a0,src=ROUTER_MAC)/IP(dst=192.168.60.1,src=192.168.1.1, ip_dscp=``DSCP COL``, ip_ecn=``INNER_ECN``)/TCP() + +#### IPV6 IN IPV4 Packet +- expected egress encap packet=Ether(dst=ROUTER_MAC)/IP(dst=``ACTIVE_TOR_IP``,src=`STAND_BY_TOR_IP``,ip_dscp=``EXP_DSCP COL``, ip_ecn=``OUTER_ECN``)/IP(fc02::60:1,src=fc02::1:1,ip_dscp=``EXP_DSCP COL``, ip_ecn=``INNER_ECN``)/TCP() +- ingress packet = Ether(dst=00:01:01:01:02:a0,src=ROUTER_MAC)/IP(dst=``REMOTE_SERVER_IPv6``,src=fc02::1:1,ip_dscp=``EXP_DSCP COL``, ip_ecn=``INNER_ECN``)/TCP() + + +### Test steps: +- encap_dscp_remap: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map, and priority map as basic [config](./config_data/config_t0.md) +3. Generate packet, take one row from the ``DSCP_MAP_TABLE``, set the ``ip_dscp`` accordingly +4. Send input packet from port1. +5. Create the expected ipinip packet with ``Inner DSCP`` and ``Outer dscp`` according to ``DSCP_MAP_TABLE``. +6. Recieve ipinip packet from any lag1-4 member port. Compare it with the expected ipinip packet. + +- encap_dscp_queue: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map, and priority map as basic [config](./config_data/config_t0.md) +3. According to DSCP_MAP_TABLE check the corrosponding queue's packets stats on the possible ports(use sai_thrift_get_queue_stats with "SAI_QUEUE_STAT_PACKETS") +4. Generate packet, take one row from the ``DSCP_MAP_TABLE``, set the ``ip_dscp`` accordingly +5. Send input packet from port1. +6. Create the expected ipinip packet with ``Inner DSCP`` and ``Outer dscp`` according to ``DSCP_MAP_TABLE``. +7. For each packet received port check the corresponding queue packets stats + +- encap_pfc_pause: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map and priority map as basic [config](./config_data/config_t0.md) +3. Set the dest ports with lossless buffer pool profile +4. According to DSCP_MAP_TABLE check the corrosponding priority_group packets stats on the possible ports(use sai_thrift_get_ingress_priority_group_stats with "SAI_INGRESS_PRIORITY_GROUP_STAT_PACKETS") +5. Get the packet number for different meanings, pkts_num_egr_mem for filling up memory, pkts_num_leak_out for leakout packets, pkts_num_trig_pfc for triggering PFC and margin for a tolerance ( reference [config](https://github.com/Azure/sonic-mgmt/blob/master//ansible/vars/qos.yml) which use in case [PFCTest](https://github.com/Azure/sonic-mgmt/blob/master/tests/saitests/sai_qos_tests.py#665)) +6. Disable ports (set port SAI_PORT_ATTR_PKT_TX_ENABLE) +7. Send N packets from lag1 to fill up the shared buffer (pkts_num_egr_mem + pkts_num_leak_out + pkts_num_trig_pfc - 1 - margin) +8. Recording the counters on the receiving and transmit ports +9. Send the packets again +10. Verify PFC drop happened(Receive port counters are larger than transmit port counters). +11. Check the packet counter on QoS queue, verify the PFC pause frame gets generated on expected queue(SAI_QUEUE_STAT_PACKETS) + +- encap_ecn_no_congestion: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map, and priority map as basic [config](./config_data/config_t0.md) +3. Make sure set PCBB ECN configurations +4. Generate packet, take one row from the ``DSCP_MAP_TABLE``, set the ``ip_dscp`` accordingly, according to DSCP_MAP_TABLE set the ``ip_ecn`` +5. Send input packet from port1. +6. Create expected ipinip packet with ``Inner_ECN`` ``Outer_ECN`` ``Inner DSCP`` and ``Outer dscp`` according to ``DSCP_MAP_TABLE``. +7. Recieve ipinip packet from any lag1-4 member port. Compare it with the expected ipinip packet. + +- encap_ecn_congestion: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map, and priority map as basic [config](./config_data/config_t0.md) +3. Make sure set PCBB ECN configurations +4. Set all the dest ports with lossless buffer pool profile +5. According to DSCP_MAP_TABLE check the corrosponding priority_group packets stats on the possible ports(use sai_thrift_get_ingress_priority_group_stats with "SAI_INGRESS_PRIORITY_GROUP_STAT_PACKETS") +6. Disable ports (set port SAI_PORT_ATTR_PKT_TX_ENABLE) +7. Check the corrosponding priority_group buffer state(SAI_INGRESS_PRIORITY_GROUP_STAT_SHARED_CURR_OCCUPANCY_BYTES, SAI_INGRESS_PRIORITY_GROUP_STAT_CURR_OCCUPANCY_BYTES, SAI_INGRESS_PRIORITY_GROUP_STAT_WATERMARK_BYTES) +8. Generate N packets, take one row from the ``DSCP_MAP_TABLE``, set the ``ip_dscp`` accordingly, according to DSCP_MAP_TABLE set the ``ip_ecn`` +9. Use the similar approach in decap_pfc_pause test to fill up the buffer +10. Enable ports (set port SAI_PORT_ATTR_PKT_TX_ENABLE) +11. Recieve decap packet from port1. Compare it with the expected packet for the ECN and DSCP values. + + +## Test Group2: Decapsulation + +### Case1: decap_inner_dscp_preserve_v4_in_v4 +### Case2: decap_inner_dscp_preserve_v6_in_v4 +### Case3: decap_dscp_priority_v4_in_v4 +### Case4: decap_dscp_priority_v6_in_v4 +### Case5: decap_dscp_queue_v4_in_v4 +### Case6: decap_dscp_queue_v6_in_v4 +### Case7: decap_pfc_pause_v4_in_v4 +### Case8: decap_pfc_pause_v6_in_v4 +### Case9: decap_ecn_no_congestion_v4_in_v4 +### Case10: decap_ecn_no_congestion_v6_in_v4 +### Case11: decap_ecn_congestion_v4_in_v4 +### Case12: decap_ecn_congestion_v6_in_v4 +### Case13: decap_global_dscp_to_tc_map_v4_in_v4 +### Case14: decap_global_dscp_to_tc_map_v6_in_v4 + + +### Testing Objective +- decap_inner_dscp_preserve: This verifies on decapsulation, the DSCP inner field is preserved end-to-end and mapping to the expect dscp value base on the DSCP map. +- decap_dscp_priority: This verifies on decapsulation, the DSCP inner field is preserved end-to-end and mapping to the expect priority value base on the DSCP map. +- decap_dscp_queue: This verifies on decapsulation, the DSCP inner field is preserved end-to-end and mapping to the expect queue value base on the DSCP map. +- decap_pfc_pause: This verifies the pfc frame generated as expected in decap. +- decap_ecn_no_congestion: This verifies the ecn generated as expected in decap when no congestion happens. +- decap_ecn_congestion: This verifies the ecn generated as expected in decap when congestion happens. +- decap_global_dscp_to_tc_map: This verifies on decapsulation, the DSCP inner field is preserved end-to-end and mapping to the expect dscp value base on the DSCP map. + + + We will send a decapsulated packet from LAG1 and expect a decapsulated packet on port1 + + Egress side[port1] | Ingress side[lag1] + -----------------------------|------------------------------------- + ipv4's falls in 192.168.1.0 | ipv4's falls in 10.1.0.0 + ipv6's falls in fc02::1:0 | ipv6's falls in fc00:1:: +### Testing Data Packet + +This test should cover all the data in the table below (traverse all data) + +DSCP_MAP_TABLE +|DSCP(Base on Inner)|TC to verify| Outgoing Queue(Port)|Priority(Tunnel)| +| ---- | ---- | -|-| +|0-2|1|1|0| +|3|3|3|2| +|4|4|4|6| +|5-7|1|1|0| +|8|0|0|0| +|9-32|1|1|0| +|33|8|1|0| +|34-45|1|1|0| +|46|5|5|0| +|48|7|7|7| +|49-63|1|1|0| + +For ECN testing +ECN_NON_CGN_TABLE: +|Outer_DSCP|Outer_ECN|Inner_DSCP|Inner_ECN|Decap_DSCP|Decap_ECN| +|-|-|-|-|-|-| +|2|3|3|3|3|3| +|2|2|3|2|3|2| +|2|1|3|1|3|1| +|2|3|3|2|3|3| +|2|2|3|3|3|2| +|6|3|4|3|4|3| +|6|2|4|2|4|2| +|6|1|4|1|4|1| + + +ECN_CGN_TABLE: +|Outer_DSCP|Outer_ECN|Inner_DSCP|Inner_ECN|Decap_DSCP|Decap_ECN| +|-|-|-|-|-|-| +|2|2|3|2|3|3| +|6|2|4|2|4|3| + + +- PIPE MODE Packet: +#### IPV4 IN IPV4 Packet +- expected egress packet = Ether(dst=00:01:01:99:01:01,src=ROUTER_MAC)/IP(dst=192.168.1.1,src=192.168.60.1, ip_dscp=``DSCP COL``, ip_ecn=``INNER_ECN``)/TCP() +- Ingress encap packet=Ether(dst=ROUTER_MAC)/IP(dst=`STAND_BY_TOR_IP``,src=``ACTIVE_TOR_IP``,ip_dscp=``EXP_DSCP COL``, ip_ecn=``OUTER_ECN``)/IP(src=192.168.60.1,dst=192.168.1.1, ip_dscp=``DSCP COL``, ip_ecn=``INNER_ECN``)/TCP() + + +#### IPV6 IN IPV4 Packet +- Expected egress packet = Ether(dst=00:01:01:99:01:01,src=ROUTER_MAC)/IP(src=fc02::60:1,dst=fc02::1:1,ip_dscp=``EXP_DSCP COL``, ip_ecn=``INNER_ECN``)/TCP() +- Ingress encap packet=Ether(dst=ROUTER_MAC)/IP(src=``ACTIVE_TOR_IP``,dst=`STAND_BY_TOR_IP``,ip_dscp=``EXP_DSCP COL``, ip_ecn=``OUTER_ECN``)/IP(src=fc02::60:1,dst=fc02::1:1,ip_dscp=``EXP_DSCP COL``, ip_ecn=``INNER_ECN``)/TCP() + + +### Test steps: +- decap_inner_dscp_preserve: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map, and priority map as basic [config](./config_data/config_t0.md) +3. Generate packet, take one row from the ``DSCP_MAP_TABLE``, set the ``ip_dscp`` accordingly +4. Send input ipinip packet from lag1 with ``Inner DSCP`` and ``Outer dscp`` according to ``DSCP_MAP_TABLE`` (only inner take effect). +5. Create the expected decap packet with ``Inner dscp`` according to ``DSCP_MAP_TABLE``. +6. Recieve decapped packet from port1. Compare it with the expected decap packet. + +- decap_dscp_priority: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map, and priority map as basic [config](./config_data/config_t0.md) +3. According to DSCP_MAP_TABLE check the corrosponding priority_group packets stats on the possible ports(use sai_thrift_get_ingress_priority_group_stats with "SAI_INGRESS_PRIORITY_GROUP_STAT_PACKETS") +4. Generate packet, take one row from the ``DSCP_MAP_TABLE``, set the ``ip_dscp`` accordingly +5. Send input ipinip packet from lag1 with ``Inner DSCP`` and ``Outer dscp`` according to ``DSCP_MAP_TABLE`` (only inner take effect). +6. Create the expected decap packet with ``Inner dscp`` according to ``DSCP_MAP_TABLE``. +7. Recieve decapped packet from port1. Compare it with the expected decap packet. +8. For received port check the corresponding priority_group packets stats (SAI_INGRESS_PRIORITY_GROUP_STAT_PACKETS) + +- decap_dscp_queue: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map, and priority map as basic [config](./config_data/config_t0.md) +3. According to DSCP_MAP_TABLE check the corrosponding queue's packets stats on the possible ports(use sai_thrift_get_queue_stats with "SAI_QUEUE_STAT_PACKETS") +4. Generate 1000 packets, take one row from the ``DSCP_MAP_TABLE``, set the ``ip_dscp`` accordingly +5. Send input ipinip packet from lag1 with ``Inner DSCP`` and ``Outer dscp`` according to ``DSCP_MAP_TABLE`` (only inner take effect). +6. Create the expected decap packet with ``Inner dscp`` according to ``DSCP_MAP_TABLE``. +7. Recieve decapped packet from port1. Compare it with the expected decap packet. +8. For received port check the corresponding queue packets stats + +- decap_pfc_pause: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map and priority map as basic [config](./config_data/config_t0.md) +3. Set dest ports with lossless buffer pool profile +4. According to DSCP_MAP_TABLE check the corrosponding priority_group packets stats on the possible ports(use sai_thrift_get_ingress_priority_group_stats with "SAI_INGRESS_PRIORITY_GROUP_STAT_PACKETS") +5. Get the packet number for different meanings, pkts_num_egr_mem for filling up memory, pkts_num_leak_out for leakout packets, pkts_num_trig_pfc for triggering PFC and margin for a tolerance ( reference [config](https://github.com/Azure/sonic-mgmt/blob/master//ansible/vars/qos.yml) which use in case [PFCTest](https://github.com/Azure/sonic-mgmt/blob/master/tests/saitests/sai_qos_tests.py#665)) +6. Disable ports (set port SAI_PORT_ATTR_PKT_TX_ENABLE) +7. Send N packets from lag1 to fill up the shared buffer (pkts_num_egr_mem + pkts_num_leak_out + pkts_num_trig_pfc - 1 - margin) +8. Recording the counters on the receiving and transmit ports +9. Send the packets again +10. Verify PFC drop happened(Receive port counters are larger than transmit port counters). +11. Check the packet counter on QoS queue, verify the PFC pause frame gets generated on expected queue(SAI_QUEUE_STAT_PACKETS) + +- decap_ecn_no_congestion: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map and priority map as basic [config](./config_data/config_t0.md) +3. Make sure set PCBB ECN configurations +4. Generate 100 packets, take one row from the ``DSCP_MAP_TABLE``, set the ``ip_dscp`` accordingly, according to DSCP_MAP_TABLE set the ``ip_ecn`` +5. Send input ipinip packet from lag1 with ``Inner_ECN`` ``Outer_ECN`` ``Inner DSCP`` and ``Outer dscp`` according to ``DSCP_MAP_TABLE`` (only inner take effect). +5. Create expected decap packet with ``ECN`` and ``Inner DSCP`` according to ``DSCP_MAP_TABLE`` and ``ECN_TABLE`` +6. Recieve decapped packet from port1. Compare it with the expected decap packet. + +- decap_ecn_congestion: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, port and tunnel binding to the DSCP map, queue map, and priority map as basic [config](./config_data/config_t0.md) +3. Make sure set PCBB ECN configurations +4. Set all the dest port with lossless buffer pool profile +5. Disable ports (set port SAI_PORT_ATTR_PKT_TX_ENABLE) +6. According to DSCP_MAP_TABLE check the corrosponding priority_group packets stats on the possible ports(use sai_thrift_get_ingress_priority_group_stats with "SAI_INGRESS_PRIORITY_GROUP_STAT_PACKETS") +7. Generate N packets, take one row from the ``DSCP_MAP_TABLE``, set the ``ip_dscp`` accordingly, according to DSCP_MAP_TABLE set the ``ip_ecn`` +8. Use the similar approach in decap_pfc_pause test to fill up the buffer +8. Enable ports (set port SAI_PORT_ATTR_PKT_TX_ENABLE) +9. Recieve decap packet from port1. Compare it with the expected packet for the ECN and DSCP values. + +- decap_global_dscp_to_tc_map: + +1. Make sure LAGs and NextHop groups set as basic [config](./config_data/config_t0.md) +2. Make sure tunnel DSCP in PIPE mode, config port with ``Port DSCP MAP`` and switch_dscp_to_tc with dscp map in ``Tunnel TC MAP`` as basic [config](./config_data/config_t0.md) (Test switch_dscp_to_tc, don't config on ``Tunnel TC MAP`` on tunnel for this case, tunnel qos configuration will override the global dscp_to_to_map). +3. Generate packet, take one row from the ``DSCP_MAP_TABLE``, set the ``ip_dscp`` accordingly +4. Send input ipinip packet from port1. +5. Create the expected decap packet with ``Inner dscp`` according to ``DSCP_MAP_TABLE``. +6. Recieve ipinip packet from any lag1-4 member port. Compare it with the expected decap packet. diff --git a/inc/sainexthopgroup.h b/inc/sainexthopgroup.h index fb586d204..1e87356b4 100644 --- a/inc/sainexthopgroup.h +++ b/inc/sainexthopgroup.h @@ -546,8 +546,8 @@ typedef struct _sai_next_hop_group_api_t sai_remove_next_hop_group_map_fn remove_next_hop_group_map; sai_set_next_hop_group_map_attribute_fn set_next_hop_group_map_attribute; sai_get_next_hop_group_map_attribute_fn get_next_hop_group_map_attribute; - sai_bulk_object_get_attribute_fn get_next_hop_group_members_attribute; sai_bulk_object_set_attribute_fn set_next_hop_group_members_attribute; + sai_bulk_object_get_attribute_fn get_next_hop_group_members_attribute; } sai_next_hop_group_api_t; /** diff --git a/inc/saiport.h b/inc/saiport.h index 8975a5d62..8f1a0ee88 100644 --- a/inc/saiport.h +++ b/inc/saiport.h @@ -2104,6 +2104,38 @@ typedef enum _sai_port_attr_t */ SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE, + /** + * @brief List of port's PMD lanes rx signal detect + * + * @type sai_port_lane_latch_status_list_t + * @flags READ_ONLY + */ + SAI_PORT_ATTR_RX_SIGNAL_DETECT, + + /** + * @brief List of port's PMD lanes rx lock status + * + * @type sai_port_lane_latch_status_list_t + * @flags READ_ONLY + */ + SAI_PORT_ATTR_RX_LOCK_STATUS, + + /** + * @brief Port's PCS RX Link Status + * + * @type sai_latch_status_t + * @flags READ_ONLY + */ + SAI_PORT_ATTR_PCS_RX_LINK_STATUS, + + /** + * @brief List of port's FEC lanes alignment marker lock + * + * @type sai_port_lane_latch_status_list_t + * @flags READ_ONLY + */ + SAI_PORT_ATTR_FEC_ALIGNMENT_LOCK, + /** * @brief End of attributes */ diff --git a/inc/saitunnel.h b/inc/saitunnel.h index a9bddbad5..712bc50ab 100644 --- a/inc/saitunnel.h +++ b/inc/saitunnel.h @@ -1132,8 +1132,10 @@ typedef struct _sai_tunnel_api_t sai_remove_tunnel_map_entry_fn remove_tunnel_map_entry; sai_set_tunnel_map_entry_attribute_fn set_tunnel_map_entry_attribute; sai_get_tunnel_map_entry_attribute_fn get_tunnel_map_entry_attribute; - sai_bulk_object_get_attribute_fn get_tunnels_attribute; + sai_bulk_object_create_fn create_tunnels; + sai_bulk_object_remove_fn remove_tunnels; sai_bulk_object_set_attribute_fn set_tunnels_attribute; + sai_bulk_object_get_attribute_fn get_tunnels_attribute; } sai_tunnel_api_t; diff --git a/inc/saitypes.h b/inc/saitypes.h index 0c67f5224..c9169c152 100644 --- a/inc/saitypes.h +++ b/inc/saitypes.h @@ -441,6 +441,27 @@ typedef struct _sai_prbs_rx_state_t uint32_t error_count; } sai_prbs_rx_state_t; +typedef struct _sai_latch_status_t +{ + /** Current status at the time of read */ + bool current_status; + + /** Indicates that the status changed at least once since the last read */ + bool changed; +} sai_latch_status_t; + +typedef struct _sai_port_lane_latch_status_t +{ + uint32_t lane; + sai_latch_status_t value; +} sai_port_lane_latch_status_t; + +typedef struct _sai_port_lane_latch_status_list_t +{ + uint32_t count; + sai_port_lane_latch_status_t *list; +} sai_port_lane_latch_status_list_t; + /** * @brief Field match mask * @@ -1308,6 +1329,12 @@ typedef union _sai_attribute_value_t /** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_PORT_ERR_STATUS_LIST */ sai_port_err_status_list_t porterror; + + /** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_PORT_LANE_LATCH_STATUS_LIST */ + sai_port_lane_latch_status_list_t portlanelatchstatuslist; + + /** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_LATCH_STATUS */ + sai_latch_status_t latchstatus; } sai_attribute_value_t; /** diff --git a/meta/Makefile b/meta/Makefile index ce5423721..dc41edab9 100644 --- a/meta/Makefile +++ b/meta/Makefile @@ -22,6 +22,9 @@ # @brief This module defines SAI Metadata Makefile # +# Passed to genrpc.pl: +GEN_SAIRPC_OPTS?= + WARNINGS = \ -ansi \ -Wall \ @@ -114,7 +117,7 @@ saimetadatatest.c saimetadata.c saimetadata.h: xml $(XMLDEPS) parse.pl $(CONSTHE perl -I. parse.pl rpc sai.thrift sai_rpc_server.cpp sai_adapter.py: xml $(XMLDEPS) gensairpc.pl - perl -Irpc gensairpc.pl + perl -Irpc gensairpc.pl $(GEN_SAIRPC_OPTS) HEADERS = saimetadata.h $(CONSTHEADERS) diff --git a/meta/README.md b/meta/README.md index d0e2f89fa..c93bea510 100644 --- a/meta/README.md +++ b/meta/README.md @@ -13,5 +13,9 @@ Parser also forces headers to be well formated when adding new code. To test your changes just type: ```sh -make +[GEN_SAIRPC_OPTS=