Skip to content

Commit

Permalink
Merge pull request sonic-net#271 from BRCM-SONIC/nnag-knet-update
Browse files Browse the repository at this point in the history
Modified the test cases as per the latest HLD
  • Loading branch information
nnag-broadcom authored Sep 30, 2021
2 parents 0e7710c + ca3435e commit 97f5fd9
Showing 1 changed file with 80 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Rev 1.9
| ---- | ---------- | ----------------------------- | ----------------------------------------------------- |
| 1 | 05/19/2021 | Naveen Nag | Initial Version |
| 2 | 06/30/2021 | Naveen Nag | Changed the test case ID |
| | | | |
| 3 | 09/02/2021 | Naveen Nag | Modified few test cases to cover interface statistics |
| | | | |
| | | | |
| | | | |
Expand All @@ -34,10 +34,10 @@ Rev 1.9

## Definition/Abbreviation

| **Term** | **Meaning** |
| -------- | ----------- |
| | |
| | |
| **Term** | **Meaning** |
| -------- | --------------------- |
| KNET | Kernel Network Driver |
| | |

## Introduction

Expand Down Expand Up @@ -80,6 +80,67 @@ The supported protocols are
16. IPMTU
17. SFLOW

### **1.2 Protocol Classification Criteria**

| Protocols | Queue | Classification Criteria
|----------------------|-------|----------------------------
| LACP | 23 | (EType==0x8809) && (MAC DA == {01:80:C2:00:00:02})
| UDLD | 22 | (MAC DA == {01:00:0C:CC:CC:CC})
| STP | 21 | (MAC DA == {01:80:C2:00:00:00})
| PVRSTP | 21 | (MAC DA == {01:00:0C:CC:CC:CD}
| BFDv4 | 20 | (EType==0x800) && (IpProtocol == 17) && (L4DstPort == 3784 or 4784)
| BFDv6 | 20 | (EType==0x86DD) && (IpProtocol == 17) && (L4DstPort == 3784 or 4784)
| PTP | 19 | (EType==0x88F7)
| LLDP | 18 | (EType==0x88CC) && (MAC DA == {01:80:C2:00:00:00} or {01:80:C2:00:00:03} or {01:80:C2:00:00:0e})
| VRRP | 17 | (EType==0x800) && (IpProtocol == 112)
| ICCP | 16 | (IpProtocol == 6) && (IpProtocol == 8888)
| OSPFv4 | 15 | (EType==0x800) && (IpProtocol == 89)
| BGPv4 | 14 | (EType==0x800) && (IpProtocol == 6) && (L4Port == 179)
| BGPv6 | 14 | (EType==0x86DD) && (IpProtocol == 6) && (L4Port == 179)
| PIM | 13 | (IpProtocol == 103)
| IGMP | 12 | (EType==0x800) && (IpProtocol == 2)
| ARP Request | 10 | (EType == 0x806) && (ArpOpCode == 1)
| ARP Reply | 10 | (EType == 0x806) && (ArpOpCode == 2)
| ARP | 10 | (EType == 0x806)
| NDP | 10 | (EType == 0x86DD) && (IPv6NextHeader == 58) && (IPv6HopLimit == 255) && (Type Code is 133 ~ 137)
| DHCPv4 | 9 | (EType == 0x800) && (IpProtocol == 17) && ((L4SrcPort == 68) && (L4DstPort == 67)) or (L4SrcPort == 67) && (L4DstPort == 68))
| DHCPv6 | 9 | (EType == 0x86DD) && (IpProtocol == 17) && (L4DstPort == 547 or 546)
| ICMP Echo Request | 8 | (IpProtocol == 1) && (ICMP type == 0)
| ICMP Echo Reply | 8 | (IpProtocol == 1) && (ICMP type == 8)
| ICMP | 8 | (IpProtocol == 1)
| SSH | 7 | (IpProtocol == 6) && ((L4Port == 22))|
| INET | 7 | (Etype==0x800)
| INETv6 | 7 | (Etype==0x88DD)
| Subnet | 6 | Not classified (Rx queue counters only)
| NAT | 5 | Not classified (Rx queue counters only)
| MTU | 4 | Not classified (Rx queue counters only)
| Sflow | 3 | Rx: Pkt sample metadata, Tx: (L4Port == 6343 for inband sflow datagram to collector)
| TTL | 0 | TTL == 0 or TTL == 1

### 1.3 LINK_DOWN pkt drops

* The following command can directly set netdevice link status down while physical link is up. Packets will continue to be punted up to CPU but will drop with LINK_DOWN reason. CPU Tx direction should also show drops
```
DUT# echo "Ethernet0=down" > /proc/bcm/knet/link
DUT# cat /proc/bcm/knet/link
Software link status:
Ethernet0 down
```
### 1.4 NO_BUFFER Tx pkt drops
* Decrease the KNET Tx buffers to a low value (8 or 4) to increase chance of congestion then send flood ping to congest the CPU Tx path and induce out of DMA buffer resource Tx drops. This operation should be used for testing only with all interfaces down. Changing the max number of Tx buffers may cause a crash if packets are being processed in KNET.
```
echo "max_tx_dcbs=4" > /proc/bcm/knet/dma
```
* Then check the Tx high watermark stats after sending CPU Tx burst.
```
DUT# cat /proc/bcm/knet/dstats | grep "Tx used DCBs hi wm"
Tx used DCBs hi wm 4
```





## 2 Topologies

2.1 Topology
Expand Down Expand Up @@ -110,7 +171,7 @@ In order to verify the CPU counters we need to create a custom packet from TGEN
| **Test Name** | To verify the STP protocol CPU pkt counter |
| **Test Setup** | **Topology1** |
| **Type** | **Functional** |
| **Steps** | 1) As per the topology, enable STP on both the edge ports and make sure the STP states are established<br/> 2) Set the bridge priority such that TGEN is the root bridge and STP BPDU's are sent out to the dut<br/> 3) Verify the CPU counters and make sure STP Rx & TX counter is getting incrementing <br/> 4) We need to simulate the Rx error, using the internal command shutdown the net device by keeping the physical interface up and running<br/> 5) Now verify Rx error is incrementing <br/> 6) Disable the simulation and make sure CPU Rx counter is incrementing instead of Rx err <br/> 7) Change the root bridge to Dut and verify now the CPU Tx counter is incremented <br/> 8) We need to simulate the Tx error by decreasing the KNET buffer to pile up the CPU queue and pump in traffic <br /> 9) Now verify the Tx error is incrementing, clear the counters and make sure the counters are cleared and Tx error counter is incremented again once the traffic starts to flow<br /> |
| **Steps** | 1) As per the topology, configure vlan from 2 - 500 and enable STP on both the edge ports and make sure the STP states are established<br/> 2) Set the bridge priority such that TGEN is the root bridge and STP BPDU's are sent out to the dut<br/> 3) Verify the CPU counters and make sure STP Rx & TX counter is getting incrementing <br/> 4) We need to simulate the Rx error by shutting down the net device using the internal command as mentioned in section 1.3 while keeping the physical interface up and running<br/> 5) Now verify Rx error is incrementing both in global and interface levels <br/> 6) Disable the simulation and make sure CPU Rx counter is incrementing instead of Rx err <br/> 7) Change the root bridge to Dut and verify now the CPU Tx counter is incremented <br/> 8) We need to simulate the Tx error by decreasing the KNET buffer to pile up the CPU queue and pump in traffic <br /> 9) Now verify the Tx error is incrementing, clear the counters and make sure the counters are cleared and Tx error counter is incremented again once the traffic starts to flow<br /> |



Expand All @@ -132,7 +193,7 @@ In order to verify the CPU counters we need to create a custom packet from TGEN
| **Test Name** | To verify the VRRP protocol CPU pkt counter |
| **Test Setup** | **Topology1** |
| **Type** | **Functional** |
| **Steps** | 1) Enable VRRP on the dut and make sure the edge port is part of the vlan on which VRRP is enabled<br/> 2) On the spirent port create the a VRRP stream and start sending traffic <br/> 3) Verify the CPU counters and make sure VRRP Rx & TX counter is getting incrementing <br/> 4) Clear and make sure the counter is incremented again <br/> |
| **Steps** | 1) Enable VRRP on the dut and make sure the edge port is part of the vlan on which VRRP is enabled<br/> 2) On the spirent port create the a VRRP stream and start sending traffic <br/> 3) Verify the CPU counters and make sure VRRP Rx & TX counter is getting incrementing <br/> 4) Clear and make sure the counter is incremented again <br/> 5) Simulate the Rx error by shutting down the net device using the internal command as mentioned in section 1.3 while keeping the physical interface up and running <br/> 6) Execute "show knet <intf> stats protocol" and verify the VRRP rx error counters are incrementing<br /> |



Expand All @@ -156,7 +217,7 @@ In order to verify the CPU counters we need to create a custom packet from TGEN
| **Test Name** | To verify the BGP protocol CPU pkt counter |
| **Test Setup** | **Topology1** |
| **Type** | **Functional** |
| **Steps** | 1) Configure BGP on the dut <br/> 2) Create a BGP host and make sure BGP adjacencies are established<br/> 3) Verify both Tx and Rx counter is being incremented since the BGP neighborship is established<br/> 4) Set a aggressive BGP 3/9 timer to pump in more BGP control pkt <br/> 5) Verify the counters accordingly <br/> |
| **Steps** | 1) Configure BGP on the dut <br/> 2) Create a BGP host and make sure BGP adjacencies are established<br/> 3) Verify both Tx and Rx counter is being incremented since the BGP neighborship is established<br/> 4) Set a aggressive BGP 3/9 timer to pump in more BGP control pkt <br/> 5) Verify the counters accordingly both globally and interface specific as well. <br/> |



Expand Down Expand Up @@ -224,6 +285,17 @@ In order to verify the CPU counters we need to create a custom packet from TGEN



#### **3.1.13 To verify the LACP CPU pkt counter** ####

| **Test ID** | CPU_KNET_DEBUG_FUNC_313 |
| -------------- | :----------------------------------------------------------- |
| **Test Name** | To verify the LACP CPU pkt counter |
| **Test Setup** | **Topology1** |
| **Type** | **Functional** |
| **Steps** | 1) Configure a LACP between the 2 nodes <br/> 2) Verify the portchannel is up and running <br/> 3) Remove the interface from portchannel on one of the node <br />4) The LACP pkt from the other node will still be received on this interface and this will be punted to CPU<br/> 5) Execute "show knet <intf> stats protocol" and verify the Kernal_drop is incrementing under LACP <br/> 6) Clear the counter and verify the same <br/> |



## **Reference Links**

HLD document -->
Expand Down

0 comments on commit 97f5fd9

Please sign in to comment.