Skip to content

About

Drivers for the QNIC SmartNIC shell for FPGA Accelerators.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

QNIC Driver

This repository contains the Linux kernel module, DPDK userspace library, and management utilities for the QNIC FPGA network interface card.

Overview

The QNIC driver stack provides complete support for QNIC shells implemented using the Xilinx QDMA IP core. It provides two parallel bring-up paths: a standard Linux kernel driver with a netdev interface, and a userspace DPDK library. Both paths share utilities for system management, partial reconfiguration (PR) loading, and status monitoring.

Repository Layout

Directory Description / Design Rationale
linux-kernel/ Kernel module (qnic.ko). Reuses Xilinx's mainline libqdma for PCI enumeration, DMA engine, and MSI-X interrupts; adds netdev (NAPI datapath), CMAC shell bring-up, partial reconfiguration, and BAR mmap char devices.
libqnic/ Userspace C library for DPDK. Provides register-level access over vfio-pci, CMAC control, packet router configuration, partial reconfiguration, and app-info metadata management.
utils/ Kernel-mode utilities (qnic_pr, qnic_reg, qnic_info). Simple ioctl-based CLI tools for PR programming, register peek/poke, and infopage readout.
utils/qnic-smi/ System management CLI (qnic-smi). Enumerates QNIC boards via sysfs/DPDK, displays status, configures ports, and manages PR package loading.
examples/ Example DPDK applications demonstrating CMAC/router bring-up and partial reconfiguration loading.
dpdk/ Script to patch standard DPDK source trees (20.11, 21.11, 22.11) with the Xilinx QDMA PMD.
dma_ip_drivers/ Xilinx QDMA driver codebase. Forked to apply QNIC-specific H2C descriptor framing patches.

Hardware Compatibility

  • Boards: Xilinx Alveo U280 (PCI ID 10ee:9048), Alveo U50 (PCI ID 10ee:903f)
  • Shells: Requires QNIC shell version v0.3.2 or later (which contains the axil_infopage write-FSM fix). Avoid running writable commands against pre-v0.3.2 shells to prevent host hangs.

Quick Start Build Instructions

Build components in the following order:

  1. Submodule Setup:
    git submodule update --init
  2. Kernel Module:
    make -C linux-kernel/
  3. Patch DPDK (for Userspace/DPDK):
    dpdk/apply-qdma.sh /path/to/dpdk-source-tree
  4. Build libqnic:
    cd libqnic && meson setup build && ninja -C build && cd ..
  5. Build Examples:
    make -C examples/
  6. Build Management Tools:
    make -C utils/
    make -C utils/qnic-smi/

Submodule Patches

The dma_ip_drivers submodule uses a forked repository (branch 2023.2.1.qnic) that contains the following modifications to QDMA/linux-kernel/driver/libqdma/qdma_descq.c required by the QNIC shell:

  • SOP/EOP framing: Stock libqdma only sets the Start-of-Packet (SOP) and End-of-Packet (EOP) flags in descriptor-bypass mode. The QNIC shell expects these in the internal ST H2C path as well; patched to set them unconditionally.
  • cdh_flags clear: Stock libqdma OR-s S_H2C_DESC_F_ZERO_CDH (=13) into H2C descriptors. The QNIC shell expects cdh_flags = 0; patched to clear these flags.

License

This repository is dual-licensed:

  • Kernel-level code (linux-kernel/): GNU General Public License v2.0 (LICENSE-GPL-2.0)
  • Userspace components (libqnic/, utils/, examples/, dpdk/): Apache License v2.0 (LICENSE-Apache-2.0)
  • Submodule (dma_ip_drivers/): Retains its original Xilinx/AMD licensing.

Refer to the component directories (libqnic/README.md, utils/qnic-smi/README.md) for detailed configuration and API manuals.

About

Drivers for the QNIC SmartNIC shell for FPGA Accelerators.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages