The purpose is to test the functionality of QoS remapping of tunnel traffic.
The test is targeting a running SONiC system with fully functioning configuration.
PFC deadlock can happen in dualtor deployment because the bounded back traffic is delivered in the same queue as regular traffic.
As a result, a cyclic buffer dependency can happen among T1 and both ToRs.
To avoid the issue, a solution was proposed in [HLD] DSCP/TC remapping for tunnel traffic
The general idea is to deliver the bounced back traffic in another lossless queue.
In current design, the bounced traffic for queue 3 is delivered in queue 2, and the bounced traffic for queue 4 is delivered in queue 6.
To achieve the remap, 4 new QoS maps are introduced for tunnel.
The purpose of the test is to verify SONiC correctly performs the QoS remapping for tunnel traffic, and PFC pause is generated as expected.
Supported topologies: dual-tor testbed
No setup pre-configuration is required, test will configure and return testbed to the initial state.
The test suite is categorized into two groups.
- Randomly select a ToR for testing, say
upper_tor
- Randomly select a server (say ip
192.168.0.2
) facing interface on the selected ToR in step 1 (upper_tor
), and toggle the mux status tostandby
in order to do packet encapsulation - Startup
garp_service
on ptf to populate arp for servers
- Generate packet with various
DSCP
values (listed below),target_ip = 192.168.0.2
,src_ip = 1.1.1.1
- Send the packets to
standby_tor
via a portchannel - Verify the packets are encaped, and bounced back to T1
- Verify the
DSCP
value of bounced back packet is as expected.
The expected DSCP values is as below
DSCP | Expected DSCP after encap | TC to verify |
---|---|---|
8 | 8 | 0 |
0 | 0 | 1 |
33 | 33 | 8 |
3 | 2 | 3 |
4 | 6 | 4 |
46 | 46 | 5 |
48 | 48 | 7 |
- Generate
100
packets with variousDSCP
values (listed below),target_ip = 192.168.0.2
,src_ip = 1.1.1.1
- Clear
queuecounter
with CLIsonic-clear queuecounters
- Send the packets to
upper_tor
via a portchannel - Verify the packets are encaped, and bounced back to T1
- Verify the bounced back traffic is egressed at expected queue with CLI
show queue counter
. The packet counter for expected queue is supposed to be larger or equal to100
.
The expected DSCP to queue mapping is as below
DSCP | Expected outgoing queue | TC to verify |
---|---|---|
8 | 0 | 0 |
0 | 1 | 1 |
33 | 1 | 8 |
3 | 2 | 3 |
4 | 6 | 4 |
46 | 5 | 5 |
48 | 7 | 7 |
- Swap
syncd
docker withsyncd-rpc
assaithrift
call is required to do the validation - Randomly select a ToR for testing, say
upper_tor
, and the unselected ToR would belower_tor
- Randomly select a server (say ip
192.168.0.2
) facing interface on the selected ToR in step 1 (upper_tor
), and toggle the mux status tostandby
in order to do packet encapsulation. server192.168.0.2
would be active onlower_tor
- Startup
garp_service
on ptf to populate arp for servers
- Generate
100
encapped packets with different variousDSCP
combinations (listed below),target_ip = 10.1.0.33
,src_ip = 10.1.0.32
- Send the
100
packets toactive_tor
via a portchannel - Verify the packets are mapped to expected PGs on
active_tor
by sai_thrift apisai_thrift_read_pg_counters
.
The DSCP
combinations and expected PGs are as below
DSCP outter | DSCP inner | Expected PG |
---|---|---|
2 | 3 | 2 |
6 | 4 | 6 |
0 | 0 | 0 |
1 | 1 | 0 |
- Generate
100
encapped packets with different variousDSCP
combinations (listed below),target_ip = 10.1.0.33
,src_ip = 10.1.0.32
- Send the
100
packets toactive_tor
via a portchannel - Verify the decapped packets is egressed to server at expected queue with CLI
show queue counter
. The packet counter for expected queue is supposed to be larger or equal to100
.
The DSCP
combinations and expected Queues are as below
DSCP outter | DSCP inner | Expected Queue |
---|---|---|
2 | 3 | 3 |
6 | 4 | 4 |
0 | 0 | 0 |
2 | 2 | 1 |
5 | 5 | 5 |
6 | 6 | 6 |
7 | 7 | 7 |
- Block a random port between
active_tor
and server with sai_thrift apisai_thrift_port_tx_disable
- Generate encapsulated packet with different DSCP combinations as below, set
dst_ip = 192.168.0.2
,src_ip = loopback0 of standby_tor
.
DSCP outter | DSCP inner | Expected PFC priority |
---|---|---|
2 | 3 | 2 |
6 | 4 | 6 |
- Send
N
packets toactive_tor
via a portchannel to fill the shared buffer, and verify PFC pause frames are generated on expected priority - Send the packets again, and check the
PG
dropcounters to verify the counter increased as expected.
- Block a random port between
active_tor
and server with sai_thrift apisai_thrift_port_tx_disable
- Generate one encapsulated packet with
outer_dscp=2, inner_dscp=3, dst_ip = 192.168.0.2
,src_ip = loopback0 of standby_tor
, and one regular packet withdscp=3, dst_ip = 192.168.0.2, src_ip = 1.1.1.1
. - Send
N
packets toactive_tor
via a portchannel to fill the shared buffer, and verify PFC pause frames are generated on both priority 2 and 3 - Send the packets again, and check the
PG
dropcounters to verify the counter increased as expected.
As we are having extra lossless PG/Queue for ports between T1
and dualtor
, the current qos_sai_test
will be separated into two groups
- For regular T0/T1 testbed, the test is running as before
- For
dualtor
testbeds, since we have two extra lossless PGs and Queues, the extra PGs and Queues are to be verified
The fixed lossless PG/Queue 3-4
is hardcoded in a few test cases. These test cases are to be updated to be compatible with new extra lossless PG/Queue.