Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c5bb56e
[doc] Add SAI metadata introduction presentation (#1487)
kcudnik Jun 6, 2022
5212f65
Add GEN_SAIRPC_OPTS to pass flags to gensairpc.pl from top-level Make…
chrispsommers Jun 25, 2022
49d03ae
Add static_cast<> to sairpcgen templates to avoid type mismatches for…
chrispsommers Jul 6, 2022
170d3c5
Add new env variable SAIRPC_EXTRA_LIBS which gets passed to final lin…
chrispsommers Jul 7, 2022
9c6a99e
Add experimental to include path.
chrispsommers Jul 9, 2022
5170c04
Add experimental headers to CPPFLAGS passed to ctypesgen.
chrispsommers Jul 10, 2022
68faf1f
Add VLAN and PortChannel test plan (#1480)
richardyu-ms Jun 19, 2022
f5539e4
[SAI-PTF] SAI PTF test structure for T0 test and VLAN,FDB sample case…
richardyu-ms Jun 20, 2022
7159969
[meta] Add sai_status_t to ancestry check (#1501)
kcudnik Jun 20, 2022
a103b06
reset sleep time during turning up ports (#1502)
RyoYang Jun 21, 2022
45f932d
[saineighbor] Bulk API support for Neighbor entries (#1504)
prsunny Jun 22, 2022
7adb04f
add vlan testcases from Group6 to Group10 (#1506)
RyoYang Jun 23, 2022
5f76920
Support counters on IP MC route entries. This is similar to the suppo…
rck-innovium Jun 23, 2022
f3aecf1
Add thr missing API into saithriftv2 missing for syncd (#1484)
vivekrnv Jun 23, 2022
98ed901
add vlan test case (#1510)
allen-xf Jun 24, 2022
1d872c1
add more waiting time for test (#1511)
richardyu-ms Jun 24, 2022
1410039
add read config_db.json (#1519)
allen-xf Jul 1, 2022
14ccb36
[Fix]Add necessary test data file for sai test (#1520)
richardyu-ms Jul 3, 2022
f4521bc
Zitingguo/add lag test (#1522)
Gfrom2016 Jul 6, 2022
eb41dfd
add teardown for testing multiple cases at a time (#1521)
allen-xf Jul 6, 2022
905da92
Added missing dependencies required to run gensairpc.pl (#1492)
chrispsommers Jul 7, 2022
c42da72
Update saitam.h (#1496)
JaiOCP Jul 7, 2022
da95162
Merge remote-tracking branch 'upstream/master' into saithriftv2-fixes…
chrispsommers Jul 11, 2022
662650c
Pass SAIRPC_EXTRA_LIBS flag in Makefile
chrispsommers Jul 11, 2022
38d15a8
gensairpc.pl: perform check for null func ptr before calling SAI api.
chrispsommers Jul 14, 2022
3feb459
Remove changes for SAI extension include paths, as it turns out the c…
chrispsommers Jul 28, 2022
4489f42
Add bulk create and remove for tunnel (#1462)
kcudnik Jul 14, 2022
5f31298
Fdb test cases (#1539)
richardyu-ms Jul 20, 2022
5c8b002
Build saithrift with python3.9 in bullseye (#1541)
richardyu-ms Jul 25, 2022
d694861
Sai ptf server v2 user guide (#1512)
reshmaintel Jul 25, 2022
b63111c
Add GEN_SAIRPC_OPTS to pass flags to gensairpc.pl from top-level Make…
chrispsommers Jul 26, 2022
e013b00
[SAI Test] Add Mac generate method and retry when turnning up port (#…
richardyu-ms Jul 27, 2022
f3b5f87
[Test Plan] SAI test plan for tunnel QoS remapping (pcbb) (#1524)
richardyu-ms Jul 29, 2022
d3658b3
[SAI Test] Add lag test (#1549)
allen-xf Aug 1, 2022
97ab857
config lag neighbor and route according to config (#1553)
Gfrom2016 Aug 2, 2022
8de8afe
Changes for supporting some PHY Diagnostics (#1527)
harshitgulati18 Aug 4, 2022
6756c91
Saithriftv2 fixes for extensions (#1533)
chrispsommers Aug 4, 2022
01f4f1b
[SAI-PTF]Align the sai rpc front name with swss and syncd (#1552)
richardyu-ms Aug 4, 2022
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
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
14 changes: 10 additions & 4 deletions debian/copy_installer.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions debian/installerFiles/python-saithriftv1-bullseye.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#compatiable with bullseye python 3.9 environment
debian/usr/local/lib/python3.9/site-packages/* /usr/lib/python3/dist-packages/
1 change: 0 additions & 1 deletion debian/installerFiles/python-saithriftv2.install

This file was deleted.

2 changes: 2 additions & 0 deletions debian/installerFiles/python3-saithrift.install
Original file line number Diff line number Diff line change
@@ -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/
266 changes: 222 additions & 44 deletions doc/sai-ptf/config_data/config_t0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand All @@ -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
```
Expand All @@ -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::
```



Expand All @@ -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
Expand All @@ -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.
```
Expand All @@ -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.**
Loading