Cisco ExaNIC Software

repository·master·Indexed 41 days ago

https://github.com/cisco/exanic-software

Drivers, utilities, and development libraries for Cisco/Exablaze ultra-low-latency network cards. Features include kernel bypass via the exasock wrapper, direct hardware access through the libexanic API, and tools for high-precision timestamping, packet capture, and FPGA-based reconfiguration.

Tokens
1.9K
Snippets
6
Records
14
Agent score
53%

What's inside ExaNIC

  1. Overview of ExaNIC software components

    master

    The ExaNIC software repository provides several tools and libraries to unlock the performance of Exablaze (Cisco) ultra-low-latency network cards:

    • Drivers: Located in modules/, these include ExaNIC and exasock drivers for Linux.
    • Libraries: Located in libs/, providing libexanic and exasock APIs.
    • Utilities: Located in util/, including:
      • exanic-config: Provides an overview of device configuration and status.
      • exanic-capture: Performs packet capture (supports lossless 10G line rate capture with hardware timestamps).
      • exanic-clock-sync: For clock synchronization.
      • exanic-fwupdate: For firmware updates.
    • Wrappers: The scripts/ directory contains the exasock wrapper script.
    • Performance Testing: perf_test/ contains tools for benchmarking ExaNICs and other vendor devices.
    • Examples: The examples/ directory contains usage demonstrations for exanic, exasock, filters, and the Firmware Development Kit (devkit).
  2. Use ExaNIC example programs for libexanic development

    master
    The examples/exanic/ directory provides a collection of C programs demonstrating various capabilities of the libexanic interface. These examples cover basic frame transmission and reception, high-precision timestamping (HPT), buffer preloading, and latency benchmarking.
  3. Accelerate Linux socket applications with exasock

    master

    For low-latency applications, you can accelerate standard Linux socket applications using the exasock wrapper. This wrapper hooks socket calls and sends data directly to the card, bypassing the kernel without requiring application recompilation.

    Additionally, exasock provides an extensions API for a hybrid model: using standard sockets for most TCP functions while bypassing the kernel on the critical path for performance.

  4. Access ExaNIC hardware via libexanic API

    master
    Developers requiring direct hardware access can use the libexanic API. This allows for direct sending and receiving of packets, providing the lowest possible latency and highest control over the hardware.
  5. Exasock bonding support constraints

    master

    The Exasock.ko kernel module has been extended to support network bonding, but it is subject to the following constraints:

    • Mode Support: It only supports active-backup mode.
    • Device Compatibility: It is designed to manage bonds containing ExaNIC devices.
    • Exclusivity: The module will reject attempts to:
      • Bind to existing bonding interfaces that contain non-ExaNIC devices.
      • Add a non-ExaNIC device to a bond that is currently under Exasock.ko management.
  6. Benchmark external device latency with exanic-measure

    master

    The exanic-measure application is used to benchmark external devices with high precision using ExaNIC HPT (or other devices like ExaNIC X10/X25/X40/X100). To achieve high precision, follow this two-step calibration process to compensate for cabling and internal NIC delays:

    1. Calibration: Measure a device with zero latency (e.g., an optical coupler). Note the "average" number reported; this represents your calibration offset.
    2. Measurement: Replace the coupler with the target device (using the same cables). Run the application again using the -O parameter with the offset value obtained in step 1.

    This process ensures the result is compensated for cabling delays and internal NIC delays.

    # Example usage pattern for calibration
    # Step 1: Measure zero-latency device
    ./exanic-measure
    
    # Step 2: Measure target device with offset
    ./exanic-measure -O <OFFSET_FROM_STEP_1>
  7. Perform STAC_T0 latency tests with exanic-benchmarker-stac-t0

    master

    The exanic-benchmarker-stac-t0 application implements the STAC_T0 latency test as defined by the Securities Technology Analysis Center. It works with the stac_t0 FDK example.

    Workflow:

    1. The application generates UDP datagrams containing random indexes.
    2. It expects echoed indexes to return in TCP segments from the stack under test (e.g., an ExaNIC).
    3. Hardware timestamps are utilized to calculate the precise latency within the stack.
  8. Use ExaNIC Accelerated TCP Engine (ATE) with ate-connect.c

    master

    The ate-connect.c example demonstrates how to use the ExaNIC Accelerated TCP Engine (ATE) to accelerate TCP connections. The program creates a socket, enables ATE for that socket, and connects to a TCP server. Once connected, ATE is capable of sending TCP segments directly from hardware when triggered. The program continuously receives and prints data sent from the server.

    Requirement: You must run this program using the exasock wrapper to enable and control the Accelerated TCP Engine. Running it directly will fail.

    exasock ./ate-connect 192.168.1.10 11111
  9. Perform multicast UDP echo with multicast-echo.c

    master

    The multicast-echo.c example receives multicast UDP packets and echoes them out via a different unicast UDP socket.

    To run this with Exasock socket acceleration, use the exasock wrapper.

    Constraints:

    • The source address (e.g., 192.168.1.11) must be the address of an ExaNIC interface.
    • The route to the destination address (e.g., 192.168.2.10) must go out via an ExaNIC interface.
    exasock ./multicast-echo 224.1.2.3:192.168.1.11:14159 192.168.2.10:26535
  10. Use the Exasock Extensions API with tcp-raw-send.c

    master

    The tcp-raw-send.c example demonstrates the Exasock extensions API. It allows you to retrieve a raw TCP header from an accelerated socket, manually construct a TCP segment, and send it using the raw API (libexanic).

    This API is useful for performing TCP transmission from outside standard sockets, such as from the ExaNIC FPGA or by preloading transmit buffers on the card.

    Requirement: You must run this program using the exasock wrapper. If run without it, the extensions API function stubs will not be replaced by the preloaded Exasock versions, and the program will fail.

    exasock ./tcp-raw-send 192.168.1.11 11111