Intel MACSec
Intel MACSec
User Guide
Updated for Intel® Quartus® Prime Design Suite: 22.4
Contents
1. Introduction................................................................................................................... 4
1.1. Terminology..........................................................................................................7
1.2. Release Information...............................................................................................7
1.3. System Requirements............................................................................................ 7
2. Architecture.................................................................................................................... 8
2.1. System Architecture...............................................................................................8
2.2. Data Path Between Ethernet MAC and MACsec......................................................... 10
2.2.1. Ethernet Subsystem................................................................................. 10
2.3. Data Path Between MACsec and MCDMA................................................................. 14
2.3.1. AXI-ST Multi-Segment to Single-Segment Conversion................................... 15
2.3.2. MCDMA.................................................................................................. 16
2.4. Data Path Between MACsec and Packet Generator/Checker (Packet Client).................. 19
2.4.1. Packet Client........................................................................................... 20
2.4.2. Packet Generation and Check.................................................................... 20
2.5. Data Path Illustrations.......................................................................................... 21
2.5.1. MACsec Interface Signal Names................................................................. 23
2.6. Interrupts........................................................................................................... 24
2.6.1. MCDMA MSI-X Table Configuration..............................................................25
2.7. Packet FIFO........................................................................................................ 25
2.8. AXI-ST Rate Controller......................................................................................... 26
2.9. Error Handling..................................................................................................... 27
2.10. Top Level Signals............................................................................................... 28
3. Interface Overview....................................................................................................... 29
3.1. Clocking............................................................................................................. 29
3.2. Resets................................................................................................................30
4. Parameters................................................................................................................... 32
5. Configuration Registers................................................................................................ 33
5.1. System Register Map............................................................................................33
5.1.1. Packet Client Register Map........................................................................ 34
5.1.2. Interrupt Controller Register Map............................................................... 40
6. Software Architecture................................................................................................... 42
6.1. MACsec Key Agreement Protocol............................................................................ 42
6.2. Driver Functional Requirements............................................................................. 43
6.3. Software Requirements.........................................................................................43
6.4. Software Overview...............................................................................................43
6.4.1. McDMA Driver Kernel Module..................................................................... 45
6.4.2. MACsec IP APIs....................................................................................... 46
6.4.3. Linux MACsec Driver Kernel Module............................................................ 48
6.4.4. IP Tool....................................................................................................48
6.4.5. WPA Supplicant....................................................................................... 49
6.5. MACsec IP APIs Sequence..................................................................................... 49
6.5.1. MACsec Initialization Sequence.................................................................. 49
6.6. Functions............................................................................................................57
6.6.1. macsec_initilize....................................................................................... 57
2
Contents
6.6.2. macsec_get_attributes............................................................................. 58
6.6.3. macsec_get_sa_attributes.........................................................................59
6.6.4. macsec_set_attributes..............................................................................59
6.6.5. macsec_set_sa_attributes......................................................................... 60
6.6.6. macsec_read_register.............................................................................. 61
6.6.7. macsec_write_register..............................................................................61
6.6.8. macsec_set_port_configuration..................................................................62
6.6.9. macsec_rate_configuration........................................................................62
6.6.10. macsec_single_or_multi_port.................................................................. 63
6.6.11. macsec_crypto_mode............................................................................. 63
6.6.12. macsec_port_priority.............................................................................. 64
6.6.13. macsec_register_isr................................................................................64
6.7. Software Tools.....................................................................................................64
6.7.1. IP Tool....................................................................................................65
6.7.2. WPA_Supplicant.......................................................................................66
6.7.3. CLI Debug Tool........................................................................................ 67
7. Generating the System Design...................................................................................... 72
7.1. Software Requirements.........................................................................................72
7.2. Obtaining the Reference Design............................................................................. 72
7.3. Reference Design Directory Structure..................................................................... 72
7.4. Simulation Command Arguments........................................................................... 73
7.4.1. Simulation -d Options............................................................................... 74
7.5. Simulation Test Cases...........................................................................................75
7.6. Complete Simulation Command............................................................................. 78
7.7. Simulation Requirements...................................................................................... 79
7.8. Running the Simulation ........................................................................................79
7.9. Building, Installing, and Running the Software......................................................... 81
8. Document Revision History for MACsec System Design User Guide............................... 86
3
767516 | 2023.03.03
Send Feedback
1. Introduction
MACsec was standardized in 2006 by the IEEE (standard IEEE 802.1AE-2006) as a
point-to-point security protocol providing data confidentiality, integrity, and origin
authenticity for traffic over Layer 2 links in a larger security ecosystem for ethernet
LAN. In MACsec, packets flow over unidirectional secure channels (SC), which are
supported by secure associations (SA). The secure associations each use a separate,
randomly generated key.
0:3
SA 0:3
SA
SC TX
Host 3 SC 1T
SC2
1R X RX
X SC2
c3 Host 2
SA
cse
ma
ma
SA 0:3
cse
0:3
c2
macsec1
As shown in the figure above, each node has at least one unidirectional secure channel
(transmitter to receiver). Each secure channel is associated with an identifier called
Secure Channel Identifier (SCI). Each node, which expects to receive the traffic sent
through a particular transmit secure channel, must be configured with a matching
receive secure channel. This receive secure channel must have an SCI corresponding
to the SCI of the transmit secure channel of the peer. Control logic that maintains the
key look-up tables stores the keys based on SCI. If the incoming packet does not have
the optional SCI field, then the receiver MACsec frame uses a local SCI with the
received destination MAC address along with a fixed port number.
Within each secure channel (both transmit and receive) secure associations are
defined. Each secure association has a corresponding Secure Association Key and is
identified by the Association Number (AN) field of the SecTAG header. Secure
associations have a limited duration, hence both sides need to establish a new secure
association and switch to it once the old one expires. This is called key rotation.
MACsec 802.1AE protocol does not cover the key exchange between a key server
within the LAN and any key client. There is another standard defined for this called
"IEEE 802.1X for port-based network access control".
Intel Corporation. All rights reserved. Intel, the Intel logo, and other Intel marks are trademarks of Intel
Corporation or its subsidiaries. Intel warrants performance of its FPGA and semiconductor products to current
specifications in accordance with Intel's standard warranty, but reserves the right to make changes to any ISO
products and services at any time without notice. Intel assumes no responsibility or liability arising out of the 9001:2015
application or use of any information, product, or service described herein except as expressly agreed to in Registered
writing by Intel. Intel customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
*Other names and brands may be claimed as the property of others.
1. Introduction
767516 | 2023.03.03
The figure above also indicates that on a receive node, a host (Host 4 in this example)
can have multiple secure channels as the number of transmit nodes which can
communicate with it (for ease of understanding, consider a dummy switch in
between). This ensures that Host 3 would not be able to decrypt the communication
between Host 1 and Host 4. Similarly Host 1 can’t decrypt the communication between
Host 4 and Host 2 because of their secure channel number differentiation.
Figure 2. An Ethernet Frame Before and After MACsec Processing and Encryption
ETH Payload
GCM-AES
ETH Sec TAG Payload (Encrypted) ICV
A MACsec packet starts with an Ethernet header with an EtherType of 0x88E5. This is
followed by the MACsec SecTAG, which contains information that helps the receiver
identify the decryption key, as well as a packet number (for replay protection). Within
each secure association, replay protection can be performed by checking the Packet
Number field of the SecTAG header against the packet number locally incremented.
For strict reception ordering and replay protection, the replay protection window is to
set to 0. A non-zero replay window is necessary to support the use of MACsec over
provider networks that reorder frames. Frames within the window can be received out
of order. Each MACsec packet has a unique sequential packet number and each packet
number can only be used once in a given secure association. A secure association
retires once the packet number reaches the maximum possible or programmed value.
After the SecTAG comes the payload, which can be encrypted, and the ICV (Integrity
Check Value), which is compared against a re-generated one by the crypto algorithm
being used to guarantee that the packet is indeed created by a node which is in
possession of the key and has not been modified on the way.
5
1. Introduction
767516 | 2023.03.03
macsec
LAN
P-Tile HW
Host Interface
Interrupt
Control MCDMA PIO [vf_active,
clog2 (PF_NUM),
clog2 (VF_NUM),
Channel Decoder (CH0-PF 0, CH1-PF 1) PIO BAR2 Address
AVST AVST
AXI-AVST
FIFOs
CSR *EAPOL
Rate Cnt Pkt Parse
QSFP
AXI-AVST
Loopback
FIFOs
CSR *EAPOL
Rate Cnt Pkt Parse
The MACsec system level example design provides you with a starting point for your
application development. It can help accelerate your design cycle and enable you to
invest your resources to add unique value to your product. Currently, only the MACsec
IP is released in Quartus without any integrated MACsec software. When using the
stand-alone MACsec IP, you need to integrate it with your own MACsec software for
both the data path and control path to make your solution functional.
This design demonstrates the key integrated components of Intel Agilex 7 FPGA which
supports IPs such as PCIe Endpoint HIP, MCDMA, Crypto HIP, MACsec and Ethernet
MAC HIP. It presents the example of an inline MACsec function between two host
systems on a LAN connected through the QSFP link with Ethernet MACs configured to
support 25G or 100G. The whole system is arranged in a single development kit
(DevKit) which supports multiple MAC and MACsec IPs. A Host machine connected
through the PCIe interface is configured as two Virtual Machines (VMs) tied to two
PCIe PFs (physical functions), each driving the data and control paths independently.
Software running on the host machines also enables CLI (Command Line Interface) for
any user-specific testing.
6
1. Introduction
767516 | 2023.03.03
1.1. Terminology
Table 1. Terminology
Terminology Description
SA Security Association
SC Secure Channel
PN Packet Number
Common Port Provides the interface to the Ethernet IP. This port carries traffic from/to both the
Controlled and Uncontrolled ports. The MACsec IP provides up to 64 Common
ports.
Controlled Port A virtual access point which provides full access to the network. This traffic
requires encryption or decryption. The MACsec IP provides up to 64 Controlled
ports.
Uncontrolled Port A virtual access point which provides full access to the network. You must filter
the required packets on this port. In the case of the reference design, EAPOL
packets are filtered. This traffic does not require encryption or decryption. The
MACsec IP provides one Uncontrolled port.
7
767516 | 2023.03.03
Send Feedback
2. Architecture
This section includes components for the MACsec system design architecture.
••••
Custom RTL Logic PF0
Quartus IP PF0 •••• PF1
Packet
Inter- CSR Generator Interconnect
connect ICA
& Checker HIP
Cypto
AES
AXI-ST
AVMM
Bar AVMM to
AXI-ST
Clock Rate CTL
Bridge Interpreter AXI-Lite
CSR
Controlled Port CSR
PIO Port MUX/
CDC Packet Multi Seg DeMUX
Common Port
AXI-St AXI-St
P-Tile
to AVST MUX/
Bridge DeMux F back
I Packet Multi Seg CSR
Uncontrolled Port
F Drop/Ctrl to Single
O (Packet Seg &
VM0 Filter) Width Conv AXI-ST
Common Port
SW HW Rate CTL
AXI-ST
Cypto
AES
Packet ICA
Generator HIP
CSR
& Checker
In this reference design, the same QSFP loopback acts as LAN for both MACsec control
and datapath transfers. The MACsec protocol provides two different standards for data
and control transfers respectively: IEEE 802.1AE and IEEE 802.1X. Two Ethernet MACs
are enabled with 2 different MAC addresses connected and controlled through two
host VMs and get data from two different Ethernet MAC ports.
Intel Corporation. All rights reserved. Intel, the Intel logo, and other Intel marks are trademarks of Intel
Corporation or its subsidiaries. Intel warrants performance of its FPGA and semiconductor products to current
specifications in accordance with Intel's standard warranty, but reserves the right to make changes to any ISO
products and services at any time without notice. Intel assumes no responsibility or liability arising out of the 9001:2015
application or use of any information, product, or service described herein except as expressly agreed to in Registered
writing by Intel. Intel customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
*Other names and brands may be claimed as the property of others.
2. Architecture
767516 | 2023.03.03
The data path is offloaded to FPGA hardware but controlled through the CSR interface
from host VMs. MCDMA enables the CSR path through the PIO interface. The same
PIO is driving all the components in the two MACsec paths. The FPGA Platform
Designer (Standard) fabric interconnect takes the responsibility of driving to correct
VM path as the PF number is also part of the PIO AVMM address. Before any data
transfer starts, the MACsecs need to be configured with appropriate keys for each
supported security association in a given secure channel along with the SCI info for
look up which contains the destination MAC address. All these are programmed into
the MACsec IP registers using the MACsec driver in the Linux software stack. The
MACsec IP driver acts as an underlying layer for Linux’s default MKA protocol stack
(WPA). Different machines on the LAN interact and elect one machine as Key Server
based on a priority number. The same machine is responsible for providing keys to all
the clients over the same LAN.
In this reference design, one of the 2 VMs acts as a key server and the other acts as a
key client to configure the keys for the MACsecs in the datapath using Linux’s default
MKA protocol stack (WPA). Once the keys are written to the MKA stack, the underlying
MACsec driver writes the keys into the respective registers inside the MACsec IP
through the CSR interface.
Once the keys are established, the application running in a VM can start sending the
Ethernet data packets from the Packet Generators continuously or in one-hot mode
depending on its configuration. The MACsec and Crypto IPs inline in the datapath
provide encryption to the packets. The Ethernet MAC and PHY transmits these
ciphertext packets by appending the required preamble + CRC over the QSFP. On the
other side, these ciphertext packets are received through another Ethernet MAC port
and the data is fed to the MACsec core (RX) attached to the particular MAC to decrypt
the packet. The encryption and decryption parameters are managed by the MACsec
stack running on the host machine.
The MACsec IP in the datapath monitors the 32-bit packet numbers received or
calculated internally and informs the Host VM through an interrupt or poll mechanism
once it reaches the terminal/limit count. The security association (SA) needs to be
changed to the next one and new keys are chosen for the datapath which is called
"key rotation". The MCDMA in the host path enables the communication between
various VM-clients and MACsec’s uncontrolled ports. It operates on queues set up by
the MCDMA driver software to transfer the data between the local FPGA and the host.
The elements of each queue are descriptors. The MCDMA’s control logic reads the
queue descriptors and executes them. Separate queues are used for reading and
writing DMA operations for each channel. Each PF consumes one MCDMA channel in
this design. The logic in the FPGA fabric needs to route the packets based on their
channel ID sideband signal from the AVST streaming interface. The channel adaptor
logic takes care of packet routing in both D2H and H2D directions for 2 PFs.
The host offloads the data transfer overhead to MCMDA for transferring EAPOL packets
or any non-SecTAG packets between the host and MACsec’s uncontrolled ports. In
MCDMA, once configured with channel specific BDs, as soon as it sees a packet in the
packet buffer, it forms a PCIe TLP for the actual length of packet received and sends it
to the host. It may consume multiple BDs if the Ethernet packet length is higher than
the MPS value configured in the PCIe EP. In addition to that, it also updates the BD
status and hands it over to the SW control once served. The MACSec uncontrolled
ports get the plaintext as well as ciphertext data. It is your responsibility to filter the
packets and decide on which packets go to the host.
9
2. Architecture
767516 | 2023.03.03
There are multiple protocol bridges and CDC bridges in the design to accommodate
the data transfers between AXI streaming and AVST, and between different clock
domains. The details are discussed in the later sections.
The reference design is flexible enough to use one of the MACsec paths with external
test equipment as the key client/server based on the priority setting at the SW stack
level for interoperability testing. At the packet client interface, you can enable the
loopback and use a 3rd party tester as a pattern generator.
Start Preamble SFD Destination Source Type/ Payload Pad FCS Term Control IPG
Control [47:0] [7:0] Addr[47:0] Addr[47:0] Length[15:0] [<p>-1:0] [<s>-1:0] [31:0] [7:0] [<g>-1:0]
In the receive direction, the PHY passes frames to the MAC. The MAC accepts frames
from the PHY, performs checks, updates statistics counters, strips out the CRC,
preamble, and SFD, and passes the rest of the frame to the user interface that
connects to the MACsec IP.
10
2. Architecture
767516 | 2023.03.03
The E/F-Tile Hard IP for Ethernet supports the AVST protocol and the MACsec IP
supports AXI-ST. So, the AXI-ST to AVST conversion is done before giving to E/F-tile
Hard IP.
Figure 7. Timing Diagram for Packet Receiving at E/F-Tile Hard IP from MACsec
i_clk_tx
i_tx_data[63:0] D0 D1 D2 D2 D3 D4 D5
i_tx_empty[5:0] 5
i_tx_startofpacket
i_tx_endofpacket
i_tx_valid
0_tx_ready
The figure above shows how to transmit data using the TX MAC. Data valid
(i_sl_tx_valid) must be held high from the start to end of a packet, unless ready
(o_tx_ready) is low. Valid can be low outside of a packet boundary. A packet FIFO
between the MACsec and E/F-tile TX path takes care of this.
The E/F-Tile Hard IP’s MAC receives data from PHY and transfers it over the AVST
interface. The AVST to AXI-ST conversion logic converts RX MAC data to AXI-ST before
giving it to MACsec IP.
Figure 8. Timing Diagram for Packet Transmitting from E/F-Tile Hard IP to MACsec
i_clk_rx
o_rx_data[63:0] D0 D1 D2 D3 D4 D5
o_rx_empty[5:0] 5
o_rx_startofpacket
o_rx_endofpacket
o_rx_valid
The TX MAC transmits bytes on the Ethernet link starting with the preamble and
ending with the FCS in accordance with the IEEE 802.3 standard. On the transmit
client interface, the IP core expects the client to send the most significant bytes of the
frame first, and to send each byte in big-endian format. Similarly, on the receive client
interface, the IP core sends the client the most significant bytes of the frame first, and
orders each byte in big-endian format. Whereas the MACsec IP sends and expects
frames to be in least significant bytes first and each byte in little-endian format. The
AVST-AXI-ST bridge handles this ordering between the MACsec and E/F-tile IP.
11
2. Architecture
767516 | 2023.03.03
For example, the destination MAC address includes the following six octets AC-
DE-48-00-00-80. The first octet transmitted (octet 0 of the MAC address described in
the 802.3 standard) is AC and the last octet transmitted (octet 7 of the MAC address)
is 80. The first bit transmitted is the low-order bit of AC, a zero. The last bit
transmitted is the high order bit of 80, a one. The following figure shows that in this
example, 0xAC(DA5) is driven on [511:504] in case of AVST and on[7:0] in case of
AXI-ST and 0x80(DA0)is driven on [471:464] in case of AVST and on [47:40] in case
of AXI-ST.
12
2. Architecture
767516 | 2023.03.03
From the figure above, we see that there are several steps for IP reset.
1. The i_csr_rst_n reset returns all Ethernet registers to their original values,
including the statistics counters.
2. The assertion of i_tx_pll_locked leads to desertion of the i_csr_rst_n output signal.
3. Once i_csr_rst_n deserted, its leads to assertion of o_tx_lane_stable output
signal.
4. After deassertion of i_csr_rst_n reset and once PHY is ready to receive data it
asserts o_rx_block_lock and io_rx_pcs_ready output signal.
5. Asserting the i_csr_rst_n reset leads to desertion of i_tx_lane_stable,
o_rx_block_lock and rx_pcs_ready output signal.
13
2. Architecture
767516 | 2023.03.03
CDC
Multi Packet F
Seg to Packet Drop/ I
Single Parser F
Seg Ctrl O
MAC
Sec0 AXI-ST
F
Rate Pkt FIFO I
Ctrl F
O
AXI-ST MC
MUX/ AXI-ST to AVST DMA
DeMUX AVST Bride
Multi Packet F
Seg to Packet Drop/ I
Single Parser F
Seg Ctrl O
MAC AXI-ST
Sec1 F
Rate Pkt FIFO I
Ctrl F
O
Figure 14. Timing Diagram for Packet Boundary Alignment (Pkt FIFO in AVST)
clk
tvalid
sop
eop/tlast
tready
tdata D0 D1 D2 D3 D4
tvalid
sop
eop/tlast
tready
tdata D0 D1 D2 D3 D4
The bridge logic shown in Figure 13 above between the MACsec and the MCDMA
supports a few functions as mentioned below:
14
2. Architecture
767516 | 2023.03.03
• The MACsec AXI-St interface supports multi-packet mode where a packet can start
at a next segment when the current packet ends. But the MCDMA’s AVST interface
treats the entire bus as single segment.Therefore, there is conversion logic which
converts multi-packet to single packet in AXI-St first. This conversion also eases
the packet filtering logic at a fixed bit fields during the start of a packet.
• This path includes CDC FIFOs (DC FIFO) in both the directions to accommodate
the clock domain crossing between MACsec 400MHz and MCDMA 250/500 MHz.
This interface is 512-bits wide.
• The MACsec expects AXI-St valid not be de-asserted in between a packet’s SOP
and EOP unless Ready is deasserted. Therefore, a complete packet must be
available in the FIFO before asserting Valid on the MACsec AXI-St RX interface of
an uncontrolled port using a packet FIFO.
• Handling the packets from the MACsec TX uncontrolled port to MCDMA path as
handshake is not supported. Therefore, you need to either drop the packet or
maintain a bigger buffer. Consider a scenario where the packet is in flight and the
buffer gets filled. To avoid such issues, write a packet into a buffer only when the
empty space in buffer is higher than the MTU (Ethernet packet size). Assume
MCDMA is already prepopulated with a descriptor for D2H Transfer.
• It is understood that MACsec forwards all its received packets on decryption line to
uncontrolled RX interface, without any type of filtering. The encrypted packets are
also routed in this manner. Your logic should implement packet filtering based on
the required Ether type. An example would be dropping every packet when Ether
type is not 0x888E(EAPOL).
Certain applications might require Gen4x8 instead of the Gen4x16 PCIe configuration.
For these cases there can be an adaptor block that converts 256-bit user interface to
512-bit user interface to retain the logic which targets the Gen4x16 PCIe MCDMA.
15
2. Architecture
767516 | 2023.03.03
As shown below, short packets may introduce an additional cycle to transfer the same
amount of data coming in multi-segment mode. Your implementation should try to
match the incoming rate by minimizing the unrequired throttling.
2.3.2. MCDMA
The Multi Channel DMA for PCI Express enables you to efficiently transfer data
between the host and device. It supports multiple DMA channels between the host and
device over the underlying PCIe link. A DMA channel consists of an H2D (host to
device) and D2H (device to host) queue pair.
As shown in the figure below, the Multi Channel DMA can be used in a server’s
hardware infrastructure to allow communication between various VM clients and their
FPGA-device based counterparts. The Multi Channel DMA operates on descriptor-based
queues set up by driver software to transfer data between local FPGA and the host.
The Multi Channel DMA ’s control logic reads the queue descriptors and executes
them.
The Multi Channel DMA IP integrates the Intel® PCIe Hard IP and interfaces with the
host Root Complex via the PCIe serial lanes. On the user logic interface, the Avalon-
MM/Avalon-ST interfaces allow the designer easy integration of the multi Channel DMA
IP for PCI Express with other Platform Designer components.
16
2. Architecture
767516 | 2023.03.03
Ch. 0 MCDMA
H2D
Queue H2D
VM QCSR
D2H D2H
Queue QCSR
Ch. 1
H2D H2D
Queue QCSR
VM D2H
D2H Virtual QCSR AVMM/ User
Queue Root PCIe AVST Logic
Machine
Complex HIP Port
Manager
Ch. n
H2D H2D
Queue QCSR
VM
D2H D2H
Queue QCSR
The MCDMA engine operates on a software DMA queue to transfer data between the
local FPGA and the host. The elements of each queue are software descriptors that are
written by driver/software. Hardware reads the queue descriptors and executes them.
Data Mover Blocks for both the directions (D2H, H2D) fetch the descriptors and are
responsible for data transfers to or from the system memory locations specified in the
descriptors or from/to the user application in the hardware.
17
2. Architecture
767516 | 2023.03.03
A DMA channel to support Multi Channel DMA data movement consists of a pair of the
descriptor queues: one H2D descriptor queue and one D2H descriptor queue. As
shown in the figure above, the descriptors are arranged contiguously within a 4 KB
page. Each descriptor is 32 bytes in size. The descriptors are kept in host memory in a
linked-list of 4 KB pages. For a 32 byte descriptor and a 4 KB page, each page
contains up to 128 descriptors. The last descriptor in a 4 KB page must be a “link
descriptor” – a descriptor containing a link to the next 4 KB page with the link bit set
to 1. The last entry in the linked list must be a link pointing to the base address
programmed in the QCSR, in order to achieve a circular buffer containing a linked-list
of 4 KB pages.
Software and hardware communicate and manage the descriptors using tail index
pointer (Q_TAIL_POINTER) and head index pointer (Q_HEAD_POINTER) QCSR
registers as shown in the figure below. The DMA starts when software writes the last
valid descriptor index to the Q_TAIL_POINTER register.
DESC_IDX
1 Q_HEAD_POINTER
DESC_IDX (Descriptor last fetched by HW)
2
DESC_IDX
3
DESC_IDX
n
Q_TAIL_POINTER
(Last valid descriptor added by SW)
DESC_IDX
1 Q_HEAD_POINTER
DESC_IDX (Descriptor last fetched by HW)
2
DESC_IDX
3
DESC_IDX
n
Q_TAIL_POINTER
(Last valid descriptor added by SW)
18
2. Architecture
767516 | 2023.03.03
It also offers a DMA-bypass capability to the host for doing PIO Read/Writes to device
memory. This interface is used for downstream logic CSR access. PCIe BAR2 is
mapped to the Avalon-MM PIO Master. Any TLP targeting BAR2 is forwarded to the
user logic. TLP addresses targeting the PIO interface should be 8 bytes aligned. The
PIO interface supports non-bursting 64-bit write and read transfers.
The PIO interface address mapping is as follows: PIO address = {vf_active, pf, vf,
csr_addr}
1. vf_active: This indicates that SRIOV is enabled.
2. pf [PF_NUM-1:0]: Physical function number decoded from the PCIe header
received from the HIP; PF_NUM which is ($clog2(pf_num_tcl)) is the RTL design
parameter selected by you such that Multi Channel DMA IP only allocates required
number of the bits on Avalon-MM side to limit the number of the wires on the user
interface.
3. vf [VF_NUM-1:0]: Virtual function number decoded from the PCIe header received
from the HIP; VF_NUM which is ($clog2(vf_num_tcl)) is the RTL design parameter
selected by you such that Multi Channel DMA IP only allocates required number of
the bits on Avalon-MM side to limit the number of the wires on the user interface.
4. csr_addr [ADDR_SIZE-1:0]: Number of bits required for BAR2 size requested
across all Functions (PFs and VFs) Example: If BAR2 is selected as 4 MB, the
ADDR_SIZE = 22.
The table below shows the DMA channel mapping w.r.t MCDMA IP parameter setting.
• Number of PFs – 2
• Number of VFs per PF – 0
• Number of DMA channels per PF – 1
0 0 0
1 0 1
19
2. Architecture
767516 | 2023.03.03
Below is an example sequence of the CSR access needed to enable the packet client.
Please note that the sequence below does not cover all the available CSR options.
1. Start Packet client Tx by setting CFG_PKT_CL_CTRL[0] to ‘1’ (offset 0x0, value
0x01).
2. Wait for data traffic to complete & counters to update.
3. Set Status Snapshot capture bit by setting CFG_PKT_CL_CTRL[6] to ‘1’ (offset
0x0, value 0x41).
4. Read Status counters (offsets 0x20 to 0x4C) & verify.
5. Clear Status Snapshot capture bit by setting CFG_PKT_CL_CTRL[6] to ‘0’ (offset
0x0, value 0x1).
6. Set CSR Status Clear bit by setting CFG_PKT_CL_CTRL[7] to ‘1’ (offset 0x0, value
0x81).
7. Clear CSR Status Clear bit by setting CFG_PKT_CL_CTRL[7] to ‘0’ (offset 0x0,
value 0x1).
8. Stop Packet client & clear all internal counters (offset 0x0, value 0x100).
20
2. Architecture
767516 | 2023.03.03
Packet Generator
dmac_addr
smac_addr
pkt_start_size AVST AXI-ST
pkt_end_size
Stats
FSM Counters
Packet Client stats
CSR ASVT
--
AXI-ST
csr_clk stats Packet Checker
cfg_tx_pkt_gen AVST AXI-ST
Stats
AVMM Counters
macsec_clk
AXI-Lite to
AXI-Lite AVMM Bridge
This solution enables full duplex data transfers so the patten generation and checking
can be similar in both directions. The packet checker received data is compared with
the reference data from the packet generator. It increments the error count if the
reference data does not match with the received data. The packet checker also
includes statistics counters which count the tx_sop,rx_sop,tx_eop and rx_eop signal
assertions. If the received and transmitted byte count matches the packet size, then
the test done signal gets asserted and produces the packet count on the CSR.
The packet generator supports dynamic packet sizes where subsequent packet sizes
increment in size by a programmed value which is defaulted to 1.
21
2. Architecture
767516 | 2023.03.03
••••
PF0
PF0 •••• PF1
Custom RTL Logic
Quartus IP Packet
Inter- Generator
CSR
connect ICA Interconnect
& Checker HIP
Crypto
AES
AXI-ST
AVMM
Bar AVMM to
AXI-ST
Clock Rate CTL
Bridge Interpreter AXI-Lite
CSR
Controlled Port CSR
PIO Port MUX/
CDC Packet Multi Seg DeMUX
Common Port
F Drop/Ctrl to Single Port AXI-ST P0
I (Packet Seg & MACSec0
Uncontrolled Port
VM1 F Filter) Width Conv MUX/ Pkt
(Server)
O
AXI-ST DeMUX FIFO
F Pkt Rate
I
F FIFO CTL
O QSFP
E/F-Tile Loop-
MCDMA
AXI-St AXI-St
P-Tile
to AVST MUX/
Bridge DeMux F back
I Packet Multi Seg CSR
Uncontrolled Port
F Drop/Ctrl to Single
O (Packet Seg &
VM0 Filter) Width Conv AXI-ST
Common Port
(Key F
I
Port AXI-ST P8
Client) F Pkt Rate
MACSec1 MUX/ Pkt
O DeMUX
FIFO CTL Port MUX/ FIFO
DeMUX
Host Controlled Port
HSSI SS
AXI-ST
SW HW Rate CTL
AXI-ST
Crypto
AES
Packet ICA
Generator HIP
CSR
& Checker
Once a key exchange is done, the host may configure the MACsec IP with the key
information and turn on its packet generator to start transmitting data. Here, since
packets are received at the destination, it is important to have the same packet
generator configuration at both ends in order to transmit and verify the received data.
Once a packet generator is started, it generates the AXI stream packets until a stop
condition is reached. The MACsec encrypts all the received packets using the Crypto
engine and transmits them over a LAN. Upon receiving the packets at the other
MACsec, traffic is decrypted and fed to a packet checker. The checker module
compares the traffic against a reference pattern and updates its status registers. The
application may stop the traffic generator and restart if the system undergoes a
rekeying sequence.
22
2. Architecture
767516 | 2023.03.03
Port Enable
w.r.t PF/VF
••••
Custom RTL Logic PF0
Quartus IP Packet
Inter- PF0 •••• PF1
Generator
CSR
connect ICA
& Checker HIP
Crypto Inter-
AES connect
AXI-ST
AVMM
Bar AVMM to
AXI-ST
Clock Rate CTL
Bridge Interpreter AXI-Lite
CSR
Controlled Port CSR
PIO Port MUX/
CDC Packet Multi Seg
DeMUX
Common Port
F Drop/Ctrl to Single Port
I (Packet Seg & AXI-ST P0
Uncontrolled Port
VM1 F Filter) Width Conv MACSec0 MUX/ Pkt
(Server)
O
AXI-ST DeMUX FIFO
F Pkt
I Rate
F FIFO CTL
O E/F-Tile QSFP
Loop-
MCDMA
AXI-St AXI-St
P-Tile
to AVST MUX/
Bridge DeMux F back
I Packet Multi Seg CSR
Uncontrolled Port
F Drop/Ctrl to Single
O (Packet Seg &
VM0 Filter) Width Conv AXI-ST
Common Port
(Key F
I
Port AXI-ST P8
Client) F Pkt Rate
MACSec1 MUX/ Pkt
O DeMUX
FIFO CTL Port MUX/ FIFO
DeMUX
Host Controlled Port
HSSI SS
AXI-ST
SW HW Rate CTL
AXI-ST Crypto
AES
Packet ICA
Generator HIP
CSR
& Checker
decrypt_ss_user_p0
Crypto
app_pp
pp_app
Lorem ipsum
AXI-ST
AXI-ST
Port
dec_byp_ip_app_tx MACSec0 MUX/ AXI-ST ETH
Uncontrolled
DeMUX MAC
AXI-ST encrypt_ss_user_p0
Port
MCDMA
pp_app
enc_byp_app_ip_rx
Lorem ipsum
Send Feedback MACsec Intel FPGA System Design User Guide
23
2. Architecture
767516 | 2023.03.03
2.6. Interrupts
The MCMDA interface supports 4 MSI-X interrupts per channel for one user interrupt
per queue in each direction. If your logic needs to support multiple interrupts, then
you should implement local logic which retains the interrupt requests from different
sources and waits for their turn to request an interrupt to the MCDMA which in turn
generates the MSI-X. A SW routine to read the interrupt source can then take further
action.
You may use H2D event interrupt or D2H event interrupt to signal pre-defined events.
In the interrupt vector table, these 4 vector entries are available per channel. The SW
is expected to configure the entries if it is expecting an interrupt from your logic.
AXI-Lite
Channel 0
Interrupt
MACSec 0 IRQ Controller
MSIx Valid
MUX MSIx Data MCDMA
AXI-Lite MSIx Ready
Channel 1
Interrupt
Controller
MACSec 1 IRQ
Each channel’s interrupt controller may support up to N number of IRQ signals from
different modules. The usr_event_msix_data_i that goes to MCDMA indicates the
IRQ from which channel only. The SW Interrupt routine’s responsibility is to probe the
24
2. Architecture
767516 | 2023.03.03
register space of each interrupt controller to know which input IRQ caused the channel
specific interrupt. Based on this the SW can go and read the interrupt status register
of the IP module that asserted the IRQ. The two-step process from the SW is
mentioned above. The SW application can clear any particular interrupt bit in the
interrupt controller after servicing it and can then service the next one if it is asserted
again.
MSI-X (Table and PBA) 22'h10_0000 - 22'h1F_FFFF 1MB MSI-X Table and PBA space.
The current solution supports only 4 MSI-X vectors per PF, out of it 2 are dedicated for
the MCDMA internal use. The table below gives the exact offsets for each usage per
PF.
BAR0 + 0x10_0000 + 0x00 H2D DMA Vector DMA Internal Use for H2D descriptor
updates
BAR0 + 0x10_0000 + 0x20 H2D DMA Vector DMA Internal Use for D2H descriptor
updates
25
2. Architecture
767516 | 2023.03.03
the FIFO. The packet counter value does not change when both the increment and
decrement flags get asserted in the same clock cycle. The packet FIFO works in a
single clock domain.
cnt ≠ 0
sop sop
eop ~fifo empty eop
SC FIFO
The design to control the aggregated input rate to accommodate the overheads
inserted by MACSec which targets the actual line rate is shown in the figure below.
There are multiple ways of doing this.
26
2. Architecture
767516 | 2023.03.03
P-Tile HW
Host Interface
Interrupt
Control MCDMA PIO
AXI-AVST
CDC FIFOs
Pkt FIFO
tready Pkt Filter * EAPOL
5 Gbps 12 Gbps
Rate Cnt Multi-seg con v
E-Tile tready=1
Uncontrolled Port CSR CSR
Controlled Port
Rate Cnt
Common Port
AXI-AVST
TX Pkt FIFO
tready=1 tready Packet Gen
AXI-ST Pkt Filter
RX
MACSec0 & Chk
Crypto ICA
25 Gbps AES HIP
If the MACsec IP expects the controlled rate at every packet level, then the number of
idle cycles to be inserted by rate controller depends on the number of valid data cycles
received. Granularity of these calculations are restricted to clock cycle for ease of
timing, i.e. it assumes that all the data bytes are valid in EOP (8 Byte granularity on a
64 bit bus). The design assumes the maximum possible data rate as “Bus width x
Clock frequency”, i.e. for a 25G MACSec, controlled port data width is 64b running at
400 MHz which results in max rate of 25.6 Gbps (MACSEC_MAX_RATE) passed to
module as a parameter. The number of idle cycles required after end of the current
packet depends on another parameter (MACSEC_MAX_IN_RATE) that defines the
expected input rate. For example, if the expected input rate is 12 Gbps then the
number of idle cycles for each valid clock cycle in a packet is defined by a local
parameter as (MACSEC_MAX_RATE/MACSEC_MAX_IN_RATE). The design maintains a
counter that increments by this ratio on every valid cycle between start of packet and
end of packet. The same counter decrements after EOP cycle until it reaches 0. During
this time, the AXI-ST TREADY is de-asserted.
27
2. Architecture
767516 | 2023.03.03
Ethernet Interface
PCIe Interface
28
767516 | 2023.03.03
Send Feedback
3. Interface Overview
This section covers the interface overview.
3.1. Clocking
This design uses multiple clock domains as the Ethernet MAC (25G/100G) works at a
different rate compared to the PCIe+MCDMA (128G) and the MACsec (200G). The
interface clocks are shown below.
HSSI-SS AXI-Lite Interface 100 CSR clock. Use a bridge for MCDMA
app_clk to 100
Crypto AXI-ST Interface 400 As per Crypto solution HAS for inline
processing
Intel Corporation. All rights reserved. Intel, the Intel logo, and other Intel marks are trademarks of Intel
Corporation or its subsidiaries. Intel warrants performance of its FPGA and semiconductor products to current
specifications in accordance with Intel's standard warranty, but reserves the right to make changes to any ISO
products and services at any time without notice. Intel assumes no responsibility or liability arising out of the 9001:2015
application or use of any information, product, or service described herein except as expressly agreed to in Registered
writing by Intel. Intel customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
*Other names and brands may be claimed as the property of others.
3. Interface Overview
767516 | 2023.03.03
CSR
Bridge AXI-Lite
CDC
CDC CSR
PIO Multi
F Packet
I Seg to
F Drop/ Single Port
O Ctrl Seg CSR MACSec0 MUX/
F
DeMUX
I Pkt Rate i_macsec_clk P0
AXI-St F FIFO CTL
to AXI-St O
AVST MUX/ o_p0_pll_clk
MCDMA
I Seg to o_p8_pll_clk
F Drop/ Single
O Ctrl Seg
P8
F CSR Port
I Pkt Rate
F FIFO CTL MACSec1 MUX/
O
i_macsec_clk DeMUX
i_ref_clk[0] HSSI SS
Packet Cypto
External Generator AES External
IO PLL
CSR
3.2. Resets
The system reset for PCI Express (pin_perst_n) driven by the downstream port
through the edge connector is the only hard reset available to the entire design. This
reset is provided as an output by the endpoint core which is connected to the MCDMA.
30
3. Interface Overview
767516 | 2023.03.03
CSR CSR
PIO Multi
subsystem_cold_
F
I Packet Seg to rst_n
F Drop/ Single
O Ctrl Seg
rst- MACSec0 P0
F Hand- Single ctrl
I shake Seg to subsystem_cold_
F at pkt Multi rst_n
AXI-St AXI-St O boundary Seg subsystem_cold_
to AVST MUX/ rst_ack_n
Bridge DeMux rst-
MCDMA
F Multi
E/F-Tile
P-Tile
subsystem_cold_ HSSI SS
reset_status_n app_rst_n rst_ack_n aes_ip_app_rst_n
aes_app_ip_rst_ack_n
Packet Crypto
Generator AES
& Checker ICA
HIP
31
767516 | 2023.03.03
Send Feedback
4. Parameters
This table below lists the parameters.
Table 8.
Name Default Value Description
Intel Corporation. All rights reserved. Intel, the Intel logo, and other Intel marks are trademarks of Intel
Corporation or its subsidiaries. Intel warrants performance of its FPGA and semiconductor products to current
specifications in accordance with Intel's standard warranty, but reserves the right to make changes to any ISO
products and services at any time without notice. Intel assumes no responsibility or liability arising out of the 9001:2015
application or use of any information, product, or service described herein except as expressly agreed to in Registered
writing by Intel. Intel customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
*Other names and brands may be claimed as the property of others.
767516 | 2023.03.03
Send Feedback
5. Configuration Registers
This section covers configuration registers.
This path supports 64-bit register access as well as 32-bit register access with
adapters in the path. Port MUX/DeMUX/Crypto interfaces all are 32-bit accesses. The
current MACsec IP does not support these interfaces but it is under evaluation to
expose them in the future.
Intel Corporation. All rights reserved. Intel, the Intel logo, and other Intel marks are trademarks of Intel
Corporation or its subsidiaries. Intel warrants performance of its FPGA and semiconductor products to current
specifications in accordance with Intel's standard warranty, but reserves the right to make changes to any ISO
products and services at any time without notice. Intel assumes no responsibility or liability arising out of the 9001:2015
application or use of any information, product, or service described herein except as expressly agreed to in Registered
writing by Intel. Intel customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
*Other names and brands may be claimed as the property of others.
5. Configuration Registers
767516 | 2023.03.03
0x0200_3000 – 0x0200_6FFF
Port MUX0
0x0200_B000 – 0x0200_B1FF
ICA0
512 kBytes
0x0400_0000 – 0x0500_FFFF
MACSec1 32 MBytes
0x0600_1000 – 0x0600_12FF
IRQ CTL1 256 Bytes
0x0600_3000 – 0x0600_6FFF
Port MUX1
16 kBytes
Based on MACSec IP Support
0x0600_B000 – 0x0600_B1FF
ICA0
512 Bytes
34
5. Configuration Registers
767516 | 2023.03.03
35
5. Configuration Registers
767516 | 2023.03.03
Checker block
generates
reference data
based on its own
packet generator
setting.
[15:0]
[15:0]
36
5. Configuration Registers
767516 | 2023.03.03
37
5. Configuration Registers
767516 | 2023.03.03
38
5. Configuration Registers
767516 | 2023.03.03
39
5. Configuration Registers
767516 | 2023.03.03
40
5. Configuration Registers
767516 | 2023.03.03
be asserted for
the valid
msix_data to be
sent to MCDMA.
41
767516 | 2023.03.03
Send Feedback
6. Software Architecture
This chapter discusses software architecture.
MAC Security Key Agreement protocol (MKA -IEEE 802.1X REV-2010) is used for
discovering MACsec peers and negotiating keys.
The root of the key hierarchy for any given instance of MKA is the Secure Connectivity
Association Key (CAK). For every MACsec potential peer of the same LAN, the
possession of the same CAK for the connectivity association is a must.
Each CAK is identified by a secure Connectivity Association Key Name (CKN) that
allows each of the MKA participants to select which CAK or CAK-derived key, to
process a received MKPDU.
Every key used by MKA is derived from the CAK. MKA does not use this CAK directly, it
derives two further keys, namely:
• The ICV Key (ICV): It is used to verify the integrity of MPDUs and to prove that
the transmitter of the MKPDU possesses the CAK.
• The Key Encrypting Key (KEK): It is used by Key Server which is elected by MKA,
to transport a succession of Secure Association Keys (SAKs) to the other members
of a Connectivity Association (CA).
The Key Server uses these ICK and KEK to transport/distribute the SAKs. Here, a Key
Server is elected based on the lower priority among the peers.
Pre-shared Key CKN Exchange and Key Server Secure Data Exchange
SAK Distribution
Configuration ICV Validation Selection with MACsec Peers
Intel Corporation. All rights reserved. Intel, the Intel logo, and other Intel marks are trademarks of Intel
Corporation or its subsidiaries. Intel warrants performance of its FPGA and semiconductor products to current
specifications in accordance with Intel's standard warranty, but reserves the right to make changes to any ISO
products and services at any time without notice. Intel assumes no responsibility or liability arising out of the 9001:2015
application or use of any information, product, or service described herein except as expressly agreed to in Registered
writing by Intel. Intel customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
*Other names and brands may be claimed as the property of others.
6. Software Architecture
767516 | 2023.03.03
Pre-shared keys (CAK) are configured on MACsec enabled devices. Once peer
authentication is done, Connectivity Association is formed between the peers. Further,
the peers exchange CKN and validate ICV with the pre-shared keys.
Key sever election takes space based on the priority and it generates and distributes
SAKs. Peers then use these SAKs to encrypt the data traffic and forwards it over the
protected link.
The following functional features are supported from the MACsec IP APIs:
• Able to initialize and reset the MACsec HW IP.
— SW reset, port and SA reset.
— Initialize all the CSR registers.
• Able to set and get the Tx/Rx registers.
• Able to configure the TX/RX rekeying path.
• Able to configure the dynamic port.
• Single/multi packet mode support.
• Priority of the port grant is based on CSR setting.
• Able to set "cut through OR store/forward mode".
• Able to register the Interrupt Service Routine (i.e. interrupts are generated by
MACsec HW e.g. Packet error, Crypto errors etc.).
43
6. Software Architecture
767516 | 2023.03.03
Figure 32. MACsec Complete Stack with Control and Data Path
Userspace
Data Traffic wpa_supplicant
Applications IP Tool MACSec Driver Interface IEEE_802.1x (MKA)
CLI Debug Tool
(eg: ping/iperf) Request Configuration
Params L2_packet_send/recv()
Kernel
Protocol Handlers (TCP/UDP/IP)
Read/Write
commands from
Linux MACSec Driver EAPol MKA CLI Debug Tool
Packets
CSR Config
MACSec IP APIs
Data Path Control Path
(Future Scope) Network Driver (McDMA) Debug Path
Hardware
MACSec FPGA
Current Scope Future Scope Open Source Intel Proprietary Patched Open Source
Note:
Future Scope – Currently not handling Data Path
Intel Proprietary – Modules which are under development stage and will be outsourced post the develoment phase.
Patched Open Source – Open source modules which will be up-streamed with few aditional features.
Control Path: Software tools like the CLI, IP route tool and wpa_suppliant are used to
trigger control commands to configure the CSRs and initiate static/dynamic key
exchanges via the socket interface.
The IP tool uses Rtnllink and Netlink APIs to create the MACsec net interface and
configure secure association details into the hardware. These calls are later handled by
the Linux MACsec Driver and trigger the macsec_ops() of the McDMA driver to
configure the CSR region.
The wpa_supplicant uses a raw packet to send or receive EAPol packets transferred
between MACsec peers for authentication/session establishment and key exchange.
These packets are directly handled by the base network driver (McDMA) to do xmit()
or recv() to/from the hardware queues. The wpa_supplicant also uses Rtnllink and
Netlink APIs to set or create the MACsec net interface and configure secure association
details into the hardware via Linux MACsec Driver and McDMA Driver(The MACsec IP
APIs are integrated with McDMA Driver).
The CLI debug tool uses Rtnllink and Netlink APIs to set or create the MACsec net
interface and configure secure association details into the hardware. These calls are
later handled by the MACsec IP Driver(with/without McDMA driver based on McDMA IP
in hardware) to configure the CSR region.
Data Path: Utilities like ping, sftp, scp, etc. are used to initiate the data transfers from
userspace to hardware. Depending upon the associated network protocol used by the
data transfer utility, respective protocol handler gets triggered based on send() and
recv() calls from application to physical layer or vice versa.
The data path is handled by the MACsec IP and SW modules are used as bypass the
data flow to above or below layers.
44
6. Software Architecture
767516 | 2023.03.03
In case offload is off, the data path is handled by Linux MACsec Driver as Tx and Rx
path.
Tx Path: The Linux MACsec Driver adds the MACsec header with 0x88e5 protocol
number and other details to the frame. It forwards the encrypted/protected frame to
the base network driver. This network driver copies the packet to the HW Queue.
Rx Path: On the arrival of a packet, the base network driver (McDMA) allocates the
socket buffer (skb) and forwards it to the Linux MACsec driver. The MACsec Driver
takes care of decrypting the packet and delivers it to the upper layers.
The McDMA Driver has the following components which include MACsec IP APIs. The
MCDMA netdev driver is used with a few additional changes made to incorporate the
MACsec IP APIs.
1. ifc_mcdma_netdev_init_module()
This is the module init function of McDMA kernel module. It is called when module
is inserted and has the following functionalities:
a. Registers generic netlink family.
b. Registers McDMA pci driver structure.
c. Allocated the memory for MACsec IP structure.
2. ifc_mcdma_netdev_exit_module()
This is module exit function of McDMA kernel module. It is called when module is
removed. It unregisters netlink family and pci driver structure.
3. ifc_mcdma_probe()
This is the pci driver hardware probe routine. It does the following:
a. Scans the devices and identify device based on vendor ID and device ID.
b. Maps the BAR regions of corresponding devices by using linux existing PCI
framework.
c. Maps available interrupts and registers MACsec interrupt-handler function.
d. Enables PCI device.
4. ifc_mcdma_remove()
This is the pci driver hardware remove routine. It does the following:
a. Unregisters the interrupts.
b. Unmaps the BAR regions.
c. Disables PCI device.
5. ifc_mcdma_netdev_open()
This function does the following:
45
6. Software Architecture
767516 | 2023.03.03
The MACsec IP APIs are available to use by McDMA for the following:
1. MACsec Ops
The APIs below are implemented to perform MACsec control path functionality.
2. intel_macsec_isr()
This is the interrupt service routine registered for MACsec ip interrupts. On
receiving an Interrupt, this signals user which interrupt has been raised. After
signaling it clears the Interrupt line and clears the interrupt status register.
3. genl_ppbb_read_reg() & genl_ppbb_write_reg()
The netlink support is added here to get the netlink request from CLI tool and
response it. In the reference design, the data path is through packet generator
and checker. The CLI debug tool is used to configure the packet generator using
netlink support.
4. Netlink functions
The netlink functions are added to McDMA driver to support register access. In the
reference design, the data flow is from the packet generator/checker. Therefore,
register settings are required from user application (i.e CLI Debug Tool). The linux
kernel module registers a generic netlink family name, on which the kernel routes
any user-space interaction. Linux kernel can have multiple netlink families
registered at a time. User-space application has to mention a corresponding name
to interact with a particular netlink channel. The MACsec IP (i.e McDMA driver)
kernel module registers the "intel_macsec" netlink family name, which is used by
CLI to interact with the kernel module.
The linux kernel module registers 6 handlers for all of the above netlink
commands. These handler functions are as follows:
a. genl_get_attr()
b. genl_set_attr()
c. genl_get_sa_attr()
d. genl_set_sa_attr()
e. genl_ppbb_read_reg()
f. genl_ppbb_write_reg()
g. genl_read_reg()
h. genl_write_reg()
All of the above handlers receive socket buffer information from the CLI and
invoke the respective MACsec IP API. On success, they return the data received
from the API. On failure, they return the error code back to CLI.
46
6. Software Architecture
767516 | 2023.03.03
6.4.2.1. SDK
The SDK directory structure is shown below. It uses the MACsec IP driver via
management interface and provides all management functionalities to application
running on the host.
- drivers.platform.macsec.ipdriver
-- src
-- include
-- mcdma
-- linux_macsec
-- iptool
-- wpa_supplicant
-- utest
-- docs
-- Makefile
The new features of the MACsec IP for iptool is available in iptool.patch. This patch
can be applied to test the MACsec IP.
The new features of the MACsec IP for wpa supplicant is available in the
wpasuplicant.patch. This patch can be applied to test the MACsec IP.
47
6. Software Architecture
767516 | 2023.03.03
IP Tool
Request to create/set macsec dev & configure
secure association/channel
Rtnlnetlink & NetLink Interface to process Rescue Mode
the incoming request
Linux MACSec Driver Error Handling
Soft/Hard IP Ports
It exposes Netlink and RtnlLink interface for interaction with the IP Tool and uses
macsec_ops() functionality to interact with the IP driver.
The Linux MACsec driver is responsible for creating the macsec0 interface over a
parent interface mentioned in the IP tool command line. It uses the created interface
to configure or get the Tx/Rx secure association details by calling respective
macsec_ops().
6.4.4. IP Tool
The IP Tool is used to configure transmit/receive secure associations and channels. It
configures the IEEE Std 802.1AE (MAC security) keys for a particular MACsec type
interface.
The Linux MACsec driver and IP Tool uses rtnetlink and genetlink APIs to handle the
input commands. Rtnetlink creates and sets up the net device whereas the genetlink
APIs are used to set up transmit and receive secure associations on a MACsec device.
The MACsec IP driver provides read/write APIs to configure the CSR region of the
MACsec HW FPGA.
48
6. Software Architecture
767516 | 2023.03.03
wpa_supplicant
Control Path
Linux MACsec Driver
MACsec IP Driver
MACSec HW FPGA
The wpa_supplicant supports the MACsec Key Agreement (MKA) protocol which is
used to set up the required secure channels and associations and to perform key
exchanges between different MACsec peers.
Initially, authentication exchanges are done using the EAPoL packets. The
wpa_supplicant constructs the MKPDU and uses a raw_packet socket interface to send
the Tx EAPol announcement to the Ethernet driver. The Ethernet driver forwards these
packets to the ring buffer and eventually over the network.
MACsec initialization is required to initialize the HW, reset the global, port and SA
configuration registers.
49
6. Software Architecture
767516 | 2023.03.03
Global Reset
Global Reset
Done?
Yes
Port Reset
Done?
Yes
No
Reset the SA
Registers
Port Reset
Done?
Yes
End
macsec_initialize
50
6. Software Architecture
767516 | 2023.03.03
51
6. Software Architecture
767516 | 2023.03.03
No No
No No
Stop Stop
52
6. Software Architecture
767516 | 2023.03.03
No No
Yes Yes
Register Read Register Read
No No
Stop Stop
TX Path Configuration:
Below are the attributes for set_attr() or set_sa_attr()
– Set PN Limit value
– Set max packet bytes supported
– Set SCI value
– Set key value
– Set next PN value
– Set confidentiality offset
– Reset all statistic counters
– Set SA enable
– Set control port enable for the port
Do the following:
• Set the Tx basic configuration for the MACsec instance for the port.
• Set the packet numbering limit value for the MACsec instance.
• Set the maximum packet bytes supported value for the MACsec instance.
• Set SCI value for the port.
53
6. Software Architecture
767516 | 2023.03.03
RX Path Configuration:
Below are the attributes for set_attr() or set_sa_attr()
– Set replay window length
– Set default SCI per port
– Set SCI value for security channel
– Set key value for SA belonging to SC
– Set next PN value
– Set lowest PN value
– Reset all statistic counters
– Set SA enable
– Set control port enable for the port
Do the following:
• Set Rx basic configuration for the MACsec instance.
• Set the replay window length if the Replay protect is enabled for the MACsec
instance.
• Set the default SCI per port.
• Program the security channel that is used on the lane by configuring:
— Set the SCI value for the security channel.
— Initialize all the stats configuration.
• Choose a security association and programming the following configuration:
— Set the Key value for the SA belonging to the SC.
— Set the next packet number value for the SA belonging to the SC.
— Set the lowest PN value for SA belonging to the SC.
— Initialize all the stats configuration.
• Set the “SA Enable” value to the chosen security association. If there are multiple
security associations programmed on Rx, enable them.
• Once all of the above is programmed, enable the control port.
54
6. Software Architecture
767516 | 2023.03.03
When PN is about to expire, rekeying occurs and below is an example of the rekeying
sequence. All of the configuration that needs to happen as part of the rekeying
sequence can be programmed.
• Set “Enable Transmission enable” to False (default value is False) for new SA.
• Program the per-MACsec instance configuration and Tx Configuration Sequence
(section 5.1.2) for the new SA.
• Ensure no TX traffics entering MACsec IP which using expire SA.
• Set “Enable Transmission enable” to False for expire SA.
• Set “Enable Transmission enable” to True for new SA.
When PN is about to expire, rekeying occurs and below is an example of the rekeying
sequence. All of the configuration that needs to happen as part of the rekeying
sequence can be programmed.
• Set “Enable Receive enable” to False (default value is False) for new SA.
• Program the per-MACsec instance configuration and Rx Configuration (section
5.1.3) for the new SA.
• Set “Enable Receive enable” to True (default value is False) for new SA.
• Ensure RX traffics entering MACsec IP which using new SA is observed.
• Set “Enable Receive enable” to False (default value is False) for expire SA.
Multi Interface Buffer supports streaming mode as well store-and-forward mode based
on CSR register settings per interface as a pseudo-static setting (no pending traffic
during mode switching). In store-and-forward mode:
Packet length information is calculated by the Buffer and valid on the Buffer outlet
during AXI start of packet
There is an option to discard packet if the packet contains forwarded fatal error
indicated by AXI tuser_tlast_uerr_fatal or any error in the AXI tuser_rx_client from
HSSI Sub-System.
55
6. Software Architecture
767516 | 2023.03.03
• ENCRYPT_DECRYPT
• ENCRYPT_ONLY
• DECRYPT_ONLY
Based on the traffic sent to Crypto HIP, there are several errors that can be flagged
and the potential list of errors are listed below.
• Invalid AES request [0x13]
• EOB without SOB error [0x3]
• Transfer without SOB error [0x2]
• Key RAM uncorrectable error [1]
• Stream RAM uncorrectable error [0]
• AES Counter overflow indication [0x7]
• No Key received for MACsec patterns [0x17]
• No IV or tweak received for MACsec patterns [0x19]
• No end of packet for data for MACsec [0x1b]
• Crypto Core ECC error [0x20]
• FIFO Overflow [0x21]
• MAC RAM ECC error [0x22]
• Pack/Depack ECC error [0x23]
56
6. Software Architecture
767516 | 2023.03.03
Crypto
MACsec IP
Error Next_PN
Host
Interrupt
SADB
6.6. Functions
This section contains functions.
6.6.1. macsec_initilize
macsec_global_reset
Arguments NA
57
6. Software Architecture
767516 | 2023.03.03
macsec_port_reset
macsec_sa_reset
6.6.2. macsec_get_attributes
macsec_get_attributes
port—MACsec instance.
58
6. Software Architecture
767516 | 2023.03.03
6.6.3. macsec_get_sa_attributes
macsec_get_sa_attributes
Retrieves attribute for a given (sc,sa) pair for the specified port.
attr—MACsec SA attribute.
6.6.4. macsec_set_attributes
macsec_set_attributes
59
6. Software Architecture
767516 | 2023.03.03
port—MACsec instance.
6.6.5. macsec_set_sa_attributes
macsec_set_sa_attributes
Sets attribute for a given (sc,sa) pair for the specified port.
attr—MACsec SA attribute.
60
6. Software Architecture
767516 | 2023.03.03
6.6.6. macsec_read_register
macsec_read_register
port—physical port.
value—read value.
6.6.7. macsec_write_register
macsec_write_register
port—port number.
61
6. Software Architecture
767516 | 2023.03.03
value—write value.
6.6.8. macsec_set_port_configuration
macsec_set_port_configuration
Description Sets the port to Cut Through mode OR Store and Forward mode.
6.6.9. macsec_rate_configuration
macsec_rate_configuration
Description Ethernet Dynamic data rate changes support through Port Mux/
Demux
62
6. Software Architecture
767516 | 2023.03.03
6.6.10. macsec_single_or_multi_port
macsec_single_or_multi_port
6.6.11. macsec_crypto_mode
macsec_crypto_mode
Description Sets the encryption and decryption to transmit and receive port
resp.
crypto_mode—
• if crypto_mode is ENCRYPT_DECRYPT, set both TX/RX ports.
• if crypto_mode is ENCRYPT_ONLY, set to only TX port.
• if crypto_mode is DECRYPT_ONLY, set to only RX port.
63
6. Software Architecture
767516 | 2023.03.03
6.6.12. macsec_port_priority
macsec_port_priority
priority_mode—
• if priority_mode is 0, sets both equal priority.
• if priority_mode is 1, sets controlled port has high priority.
• if priority_mode is 2, sets uncontrolled port has high priority.
6.6.13. macsec_register_isr
macsec_register_isr
Arguments NA
64
6. Software Architecture
767516 | 2023.03.03
6.7.1. IP Tool
Figure 41. Configuration and Software Stack for IP Tool
IP Tool commands to
IP Tool
send port, sc, sa, key etc
IP tool: It can be used to statically configure the Tx/RX information and keys of the
interface.
Linux MACsec: This driver triggers one of the macsec_ops() API depending on the
input received via netlink interface.
The examples below are commands used for configuration and testing:
# ip MACsec show
65
6. Software Architecture
767516 | 2023.03.03
# ip link add link eno0 MACsec0 type MACsec port 11 encrypt on offload mac
6.7.2. WPA_Supplicant
Figure 42. WPA_Supplicant on Two Hosts
Host 1 Host 2
wpa_supplicant wpa_supplicant
Control Path MKA Key MKA Key
Exchange Control Path
Exchange
Kernel Kernel
Wpa_supplicant: It uses a config file that includes pre-shared CAK and CKN keys on
both hosts. Two peers achieve mutual authentication via exchanging MKA keys. The
MACsec Key Agreement protocol uses EAPoL PDUs to transmit and receive MKPDUs
securely among each other.
Secure associations using these keys are configured on both hosts. The
wpa_supplicant translates the information derived through MKA and configures the
kernel's MACsec implementation.
Kernel: It configures the CSR region, and when traffic is initiated, it sends packets
protected by MACsec on the "MACsec0" interface, which is a separate network device
dedicated to encrypted traffic.
Steps 3 and 4 (as mentioned in the above diagram) are later repeated (as many times
as necessary) while wpa_supplicant keeps running to transition to a new key when the
current key expires.
eapol_version=3
ap_scan=0
fast_reauth=1
66
6. Software Architecture
767516 | 2023.03.03
mka_cak=0123456789ABCDEF123456789ABCDEF
mka_ckn=6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435
mka_priority=2
macsec_integ_only=0
macsec_port=0
macsec_replay_protect=1
macsec_replay_window=50
#Newly_added
macsec_val_frames=2
mka_cipher_suit="GCM-AES-XPN-256"
macsec_ssci=0xABCD
macsec_scb=0
macsec_es=0
macsec_send_sci=1
}
Where, -i: Interface to be used; -D: Driver to be used; -c: Config file.
The MACsec IP driver and McDMA provides the MACsec control path APIs to read/write
the SADB registers. Based on these register configuration of the MACsec data path is
performed.
Intel provides a command line software debug tool for debugging and testing
purposes. The tool can be used at the Host to support the features below.
• Implemented to test the functions of the MACsec IP driver.
• Implemented to manage with CLI (command line interface) the system example
design and its tests.
The debug tool is a command line interface application that provides below-mentioned
capabilities to the Host/HPS.
• Debug tool help
• Debug tool version
• Initialize the MACsec IP
• Software reset
• Get the global and port attributes
• Set the global and port attributes
• Get the per SA attributes
• Set the per SA attributes
• Read any register value
67
6. Software Architecture
767516 | 2023.03.03
The figure below shows the CLI debug application diagram which can be used for
debugging, key generation, and configuring the MACsec IP. This information is passed
onto the MACsec IP Driver and then to McDMA driver to do the MACsec HW
configuration.
The HW FPGA has the MACsec IP and Soft/Hard Crypto logic. This HW does the
encryption/decryption and insertion/deletion of MACsec Header to packet data as per
the configuration from MACSEC IP driver. The MACsec can be enabled/disabled from
driver. If enabled, it uses the controlled port to transmit/receive the data otherwise
uses the uncontrolled port.
register_write register_read
CSR Register
MACSec HW FPGA
SADB
Soft/Hard IP Ports
In the FPGA, encryption/decryption are controlled from the SADB registers which are
updated from the MACsec IP driver.
68
6. Software Architecture
767516 | 2023.03.03
The MACsec IP driver accesses memory mapped MACsec IP registers over the AXI bus.
This module communicates with user-space over netlink socket. The details of netlink
structure, family, and API's are as follows:
NETLINK STRUCTURE
The CLI talks with linux kernel module over a netlink communication channel. The
netlink family used to establish this communication is "GENERIC_NETLINK". There are
4 main netlink commands used for configuring the MACsec IP. These are:
1. INTEL_MACSEC_C_GETATTR
2. INTEL_MACSEC_C_SETATTR
3. INTEL_MACSEC_C_GETSAATTR
4. INTEL_MACSEC_C_SETSAATTR
The 2 additional commands, which are used to write/read the MACsec PPBB IP device
registers directly, are:
1. INTEL_MACSEC_C_PPBB_READREG
2. INTEL_MACSEC_C_PPBB_WRITEREG
Apart from the commands above, there are 2 additional commands, which are used to
peek-and-poke MACsec IP device registers directly. This read-write functionality is
helpful in debugging. These commands are:
1. INTEL_MACSEC_C_READREG
2. INTEL_MACSEC_C_WRITEREG
The netlink protocol is a socket based communication. The socket attributes used for
exchange of information between the CLI and Kernel are:
1. INTEL_MACSEC_A_PORT
2. INTEL_MACSEC_A_ATTR
3. INTEL_MACSEC_A_RW_VAL
4. INTEL_MACSEC_A_SC
5. INTEL_MACSEC_A_SA
The above netlink attributes correspond to the MACsec ip port value, MACsec ip
command attribute, read/write value for a particular command attribute, MACsec ip
secure channel value, and MACsec ip secure association value.
Apart from the main attributes above there is 1 additional attribute used for
debugging. This helps program offset the device register to be programmed. The
attribute is:
• INTEL_MACSEC_A_OFFSET
NETLINK FAMILY
69
6. Software Architecture
767516 | 2023.03.03
The linux kernel module registers a generic netlink family name, on which the kernel
routes any user-space interaction. A Linux kernel can have multiple netlink families
registered at a time. A User-space application has to mention the corresponding name
to interact with a particular netlink channel.
The MACsec IP kernel module registers with "intel_MACsec" as a netlink family name,
which is used by the CLI to interact with the Kernel module.
The linux kernel module registers 6 handlers for all of the above netlink commands.
These handler functions are:
1. genl_get_attr()
2. genl_set_attr()
3. genl_get_sa_attr()
4. genl_set_sa_attr()
5. genl_ppbb_read_reg()
6. genl_ppbb_write_reg()
7. genl_read_reg()
8. genl_write_reg()
All of the above handlers receive socket buffer information from the CLI, invoke the
respective MACsec IP API, on success return the data received from the API, on failure
returns the error code back to the CLI.
6.7.3.5. SDK
The SDK directory structure for CLI Debug Tool is shown below. It provides a
reference example application to explain the API usages.
Repo details:
- drivers.platform.macsec.cli
-- src
-- include
-- docs
-- Makefile
The diagram below shows the configuration and design overview of the FPGA debug
tools with respect to the HPS and Host.
70
6. Software Architecture
767516 | 2023.03.03
MACSec IP Driver + McDMA FM7/8 MACSec IP Driver MACSec IP Driver FM7/8 MACSec IP Driver
Debug CLI : This contains debug applications as mentioned above in the feature
overview.
MACsec IP driver: In case of the host example design, the read write calls are taken
care by the McDMA driver and for the HPS design. The MACsec IP Driver is directly
written into the HW.
Where,
Output:
Bytes written: 64
71
767516 | 2023.03.03
Send Feedback
Intel Corporation. All rights reserved. Intel, the Intel logo, and other Intel marks are trademarks of Intel
Corporation or its subsidiaries. Intel warrants performance of its FPGA and semiconductor products to current
specifications in accordance with Intel's standard warranty, but reserves the right to make changes to any ISO
products and services at any time without notice. Intel assumes no responsibility or liability arising out of the 9001:2015
application or use of any information, product, or service described herein except as expressly agreed to in Registered
writing by Intel. Intel customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
*Other names and brands may be claimed as the property of others.
7. Generating the System Design
767516 | 2023.03.03
• env Directory — Contains the environment setting file which needs to be sourced
to get the latest Quartus build and the appropriate Arc Shell.
• sim Directory — Contains the subdirectories and files for simulation. The testcase
directory includes all the testcases for simulation.
runDir subdirectory — Where you run the simulation and the log files, dump
files etc, which are created inside separate subdirectories.
The tbTop and common subdirectories contain defines and other function call
files.
• src Directory — Contains all the RTL files for the design, the IP source files, and
the qsys generated files.
• syn Directory — Contains the required files for Synthesis. The major files are the
Quartus project files, a Quartus settings file, a pin constraints file, clock
constraints, and other synthesis settings files.
-h — Without any other arguments gives help option for the script with an example.
Example: sh run_sim.sh -h
73
7. Generating the System Design
767516 | 2023.03.03
• -g <value>
— 0: run simulation without generating files again.
— 1: If simulation is run for the first time or there is any change in IP file list.
• -c <value>
— 1: To clean up all temporary generated files.
• -b <value>
— 0: to run with lightweight MCDMA BFM.
— 1: to run with rootport bfm.
Note: An E-tile design supports the RootPort_BFM but an F-tile design does
not support it in this release. The RootPort_BFM enabled simulations
take longer simulation times and larger VPD dumps.
• -m <value>
— 0: run without vcd enabled.
— 1: run with vcd enabled.
• - d <"+define+macro"> (Specify the single/multiple verilog defines to be
passed)
74
7. Generating the System Design
767516 | 2023.03.03
-d "+define+QSFP_EXTERNAL_LOOPBACK"
4. 100G with MACsec level loopback: No need to give -d option.
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.
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.
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.
continued...
75
7. Generating the System Design
767516 | 2023.03.03
The list of testcases below recreates the SW+HW validation tests in the RTL simulation in which they mainly check the
datapath.
76
7. Generating the System Design
767516 | 2023.03.03
77
7. Generating the System Design
767516 | 2023.03.03
78
7. Generating the System Design
767516 | 2023.03.03
To obtain the required add-on installer, contact Intel Support and quote case number
14015516629.
The <Project_Directory>/release)1p0/MACSEC_Release_1.0/
MACSEC_SysED_Instruction_Readme_1.0.txt file contains the steps to run the
simulation.
79
7. Generating the System Design
767516 | 2023.03.03
-- source setup.sh
3. For E-tile there is no need for support logic generation, but for F-tile designs follow
the steps below for supporting logic generation.
• Go to $SRD_ROOTDIR/sim/common and source the script below for the
appropriate support logic generation for F-tile based design.
a. Support logic generation 25G full design:
sh support_logic_gen.sh agx_nr_mudv 25G
b. Support logic generation 25G Lightweight MCDMA BFM design:
sh support_logic_gen.sh agx_nr_mudv 25G 1
c. Support logic generation 100G full design:
sh support_logic_gen.sh agx_nr_mudv 100G
d. Support logic generation 100G Lightweight MCDMA BFM design:
sh support_logic_gen.sh agx_nr_mudv 100G 1
4. For E-tile based design simulation: Go to $SRD_ROOTDIR/sim/common_ptile.
For F-tile based design simulation: Go to $SRD_ROOTDIR/sim/common.
Source the script generate_ip.sh, for IP simulation files generation.
The ip_list.f contains the list of all IPs used in the design.
sh generate_ip.sh ip_list.f
5. Navigate to the sim/runDir directory.
6. Run the simulation using the ./run_sim.sh command with arguments. The
supported arguments are shown in Simulation Command Arguments on page 73.
The test cases are provided in the sim/testcase folder. Each test case has the
test description mentioned in the first few lines of the file.
80
7. Generating the System Design
767516 | 2023.03.03
TBINFO: *****************************************
TBINFO: Simulation Passed.
TBINFO: Testbench complete
TBINFO: *****************************************
<project directory>/sim/runDir/combinedTrafficTest
Within this test-specific directory, you can find all log files for the test as well as
a .vpd file (if you used the -m 1 simulation argument) which allows you to bring up
waves for the test run using the Synopsys DVE tool.
81
7. Generating the System Design
767516 | 2023.03.03
Note: All drivers/applications are copied to the binaries folder. To build only
the required drivers/applications, refer to the app folders for patches
and build scripts.
Run the command below:
-- ./build.sh all
In addition to the above, you can do the following to build binaries separately
and they are copied to the binaries folder:
-- ./build.sh iptool
-- ./build.sh wpa_supplicant
-- ./build.sh linux_macsec
-- ./build.sh ipdriver
-- ./build.sh mcdma
c. Build individual applications and drivers.
i. To build the MCDSM driver, run the commands below, which build the
MCDM and the MACsec IP source code:
-- cd mcdma/driver/kmod/mcdma-netdev-driver/
-- make clean all
ii. To build the Linux MACsec driver, run the commands below:
-- cd linux_macsec/
-- ./linux_macsec_build.sh
iii. To build IProute2 – iptool application, run the commands below:
-- cd iptool/
-- ./iptool_build.sh
iv. To build the wpa_supplicant application, run the commands below:
-- cd wpa_supplicant/
-- ./build_wpa.sh
v. To build the CLI tool, run the commands below:
-- cd cli/
-- make clean all
vi. To build the MACsec IP driver code used for the HPS based design, run the
command below from the base folder to create the MACsec IP driver:
-- make clean all
d. Install the drivers.
i. MCDMA + MACsec IP driver.
Run the command below:
-- cd binaries
82
7. Generating the System Design
767516 | 2023.03.03
2. Follow these steps to initiate traffic via the CLI tool after configuring
using the ip tool:
83
7. Generating the System Design
767516 | 2023.03.03
a. Run the command below to check the HSSI status (Read data
should be 0x1E):
--./cli_macsec ppbb_reg_read -d ifc_mcdma0 -i 0 -o
0x0054 -r
b. Run the command below to configure the number of packets to be
transmitted:
--./cli_macsec ppbb_reg_write -d ifc_mcdma0 -i 0 -o
0x001c -w 0x00000400
c. Run the command below to configure the packet size (min size in
[13:0], max size in [29:16]):
--./cli_macsec ppbb_reg_write -d ifc_mcdma0 -i 0 -o
0x0020 -w 0x00500050
d. Run the command below to start traffic in the dynamic mode:
--./cli_macsec ppbb_reg_write -d ifc_mcdma0 -i 0 -o
0x0000 -w 0x00008611
e. Run the command below to read the checker packet counter (wait
for this counter to display equal packet number before proceeding to
the next step):
--./cli_macsec ppbb_reg_read -d ifc_mcdma0 -i 0 -o
0x005c -r
3. To show the MACsec IP statistics, run the command below to login to
the specific console, i.e. ns0 or ns1, to read out the statistics:
--./ip -s macsec show
v. Run the wpa_supplicant.
The WPA is a MACsec MKA reference application.
Follow these steps below:
1. Insert the [McDMA+MACsec IP drivers](#41-mcdma--macsec-ip-
driver).
2. Insert the [Linux MACsec driver](#42-linux-macsec-driver).
3. Run the wpa_supplicant.
Below is an example:
--./wpa_supplicant -i ifc_mcdma0 -Dmacsec_linux -c
mka_default.conf
Below are example steps to evaluate the wpa_supplicant, which needs
three terminals in parallel.
a. In the terminal window 1, do the following:
a. Navigate to binaries folder.
b. Log in to the ns0: ip netns exec ns0 bash.
c. Execute this command: sh wpa_offload.sh.
b. In the terminal window 2, do the following:
a. Navigate to binaries folder.
84
7. Generating the System Design
767516 | 2023.03.03
85
767516 | 2023.03.03
Send Feedback
Intel Corporation. All rights reserved. Intel, the Intel logo, and other Intel marks are trademarks of Intel
Corporation or its subsidiaries. Intel warrants performance of its FPGA and semiconductor products to current
specifications in accordance with Intel's standard warranty, but reserves the right to make changes to any ISO
products and services at any time without notice. Intel assumes no responsibility or liability arising out of the 9001:2015
application or use of any information, product, or service described herein except as expressly agreed to in Registered
writing by Intel. Intel customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
*Other names and brands may be claimed as the property of others.