MACsec Intel® FPGA System Design User Guide

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

6.4.2. MACsec IP APIs

The MACsec IP APIs are exposed/included with McDMA(or can be added to any network driver).

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:
    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 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.