MACsec Intel® FPGA System Design User Guide

ID 767516
Date 3/31/2024
Public
Document Table of Contents

7.5. Simulation Test Cases

The following test cases are located in the <project directory>/sim/Testcase directory.
Table 12.  Simulation Test Cases
Test Case Name Test Case Description
The list of testcases below contains the basic tests which include CSR and traffic test (full duplex) on both controlled and uncontrolled ports of the MACsec IP.
basicCSRTest.sv Basic CSR Test: Test runs CSR writes and reads on the MACsec IP and Packet Client module. This is the basic test to be run to ensure that the CSR registers are accessible from the host (here the testbench mimics the host machine with two VM instances). You can modify this test. CSR registers can be added or removed by referring to this testcase.
Note: For any new addition you need to make sure the CSR is declared and mapped to the correct register offsets in /sim/tbTop/common_defines.sv.
basicDynTrafficTest.sv

Basic Dynamic TrafficTest: Enables traffic flow from packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and from other direction. This works in a full duplex mode.

This test only sends a fixed pattern with minimum packet size.

eapolTrafficTest.sv

EAPol traffic test: Enables MKA traffic from the host. The EAPol traffic flow is host_vm0 -> mcdma -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> mcdma -> host_vm1.

In this test vm0 initiates MKA packet and vm1 validates the reception of MKA packet within the PCIe RP_BFM.

fullDynTrafficTest.sv Full Dynamic TrafficTest: Enables traffic flow from packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and from other macsec direction. This works in a full duplex mode.

This test sends various min and max size packets with fixed and incremental data patterns. You can modify this test for different packet sizes and traffic patterns.

combinedTrafficTest.sv Combined Traffic test: Combines both basic dynamic traffic and EAPoL traffic, i.e. both controlled and uncontrolled ports are driven with respective traffic simultaneously. This mimics the real traffic test scenario as it is in a SW+HW test on board.
pcieUserMsixTest.sv PCIe user MSIX test: Checks the interrupt function. Each MACsec IP has its own corresponding interrupt controller. There are 3 registers (i.e. enable, clear, and status) in each controller to manage the interrupt service. In this test case an interrupt is forced and the test scenario is created and tested.
jumboDynTrafficTest.sv Jumbo Traffic test: Verifies the jumbo frame traffic test capability. It enables traffic flow from packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> lpbk at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and vice versa.

This test sends a fixed pattern with a packet size of maximum 9000 bytes but can be modified by the user for different traffic patterns and sizes.

The list of testcases below recreates the SW+HW validation tests in the RTL simulation in which they mainly check the datapath.
rx_sc1_not_receiving_pckts.sv RX SC1 not receiving packet: Is an IP scenario test where you configure the Tx and Rx with SC1 and SA0, and the RX inuse register is expected to be 0x1.
fullDynTrafficTest_enc_off_pro_on_fail.sv

Full Dynamic TrafficTest with Encryption ON and Protection ON: With SCI not included is an IP scenario test where the MACsec IP is configured with Enc_on, Pro_on, and SCIs disabled and it is expected that the traffic has to pass through without any issue.

Refer to this test case to see the list of MACsec IP registers that needs to be updated.

Traffic flow: packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and vice versa.

This test sends a basic fixed data pattern traffic.

You can modify this test to support different packet sizes and traffic patterns.

fullDynTrafficTest_enc_on_pro_on.sv

Full Dynamic TrafficTest with Encryption ON and Protection ON: Is an IP scenario test where the MACsec IP is configured with Enc_on and Pro_on and it is expected that the traffic has to pass through without any issue.

Refer to this test case to see the list of MACsec IP registers that needs to be updated.

Traffic flow: packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and vice versa.

This test sends a basic fixed data pattern traffic. You can modify this test to support different packet sizes and traffic patterns.

Eyn_On_pro_on_outpkt_toolong.sv

Encryption on, protection on and outpacket too long Test: Is a scenario test where the MACsec IP is configured with Enc_on, Pro_on and it is expected that the RX traffic should drop if outpacket too long error is reported.

Refer to this test case to check the list of MACsec IP registers that needs to be updated.

Traffic flow: packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and vice versa.

This test sends a basic fixed data pattern traffic.

Eyn_off_Pro_Off.sv

Encryption off and protection off Test: Is a scenario test where the MACsec IP is configured with Enc_off, Pro_off and it is expected that the traffic has to pass through without any issue.

Refer to this test case to check the list of MACsec IP registers that needs to be updated.

Traffic flow: packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and vice versa.

This test sends a basic fixed data pattern traffic.

You can modify this test to support different packet sizes and traffic patterns.

Eyn_off_pro_on_with_end_station_on.sv

TrafficTest with Encryption OFF and Protection ON with end station ON: Is an IP scenario test where the MACsec IP is configured with Enc_off and Pro_on and it is expected that the traffic has to pass through without any issue.

Refer to this test case to see the list of MACsec IP registers that needs to be updated.

Traffic flow: packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and vice versa.

This test sends a basic fixed data pattern traffic.

You can modify this test to support different packet sizes and traffic patterns.

Eyn_on_pro_on_with_RX_config_only_SCI.sv

Encryption on, protection on with RX config only SCI Test: Is a scenario test where the MACsec IP is configured with Enc_on, Pro_on and RX config only SCI and it is expected that the traffic has to pass through without any issue.

Refer to this test case to check the list of MACsec IP registers that needs to be updated.

Traffic flow: packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and vice versa.

This test sends a basic fixed data pattern traffic.

You can modify this test to support different packet sizes and traffic patterns.

Eyn_on_pro_on_with_cport_off.sv

Encryption on, protection on with cport off Test: Is a scenario test where the MACsec IP is configured with Enc_on, Pro_on with cport off and it is expected that the traffic has to pass through without any issue.

Refer to this test case to check the list of MACsec IP registers that needs to be updated.

Traffic flow: packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and vice versa.

This test sends a basic fixed data pattern traffic.

You can modify this test to support different packet sizes and traffic patterns.

FullDynTest_EynON_Pro_Off.sv

TrafficTest with Encryption ON and Protection OFF: Is an IP scenario test where the MACsec IP is configured with Enc_on, Pro_off and it is expected that the traffic has to pass through without any issue.

Refer to this test case to check the list of MACsec IP registers that needs to be updated.

Traffic flow: packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and vice versa.

This test sends a basic fixed data pattern traffic.

You can modify this test to support different packet sizes and traffic patterns.

FullDynTest_Confidentiality_offset_50bytes.sv

TrafficTest with Confidentiality offset selected 0x32 : Is an IP scenario test where the MACsec IP is configured with cipher confidentiality offset to 50 bytes. It is expected that the traffic has to pass through without any issue.

Refer to this test case to see the list of MACsec IP registers that needs to be updated.

Traffic flow: packet_client_0 -> macsec_ip_0 -> ethernet_p0 -> loopback at qsfp end -> ethernet_p1 -> macsec_ip_1 -> packet_client_1 and vice versa.

This test sends a basic fixed data pattern traffic.

You can modify this test to support different packet sizes and traffic patterns.