The whole ixy repo
Not excerpts โ the actual source, every file, syntax-highlighted, with a diagram and a one-line orientation up top. This is the complete emmericp/ixy driver (BSD-licensed, ยฉ 2017 Paul Emmerich). Read it in the order below โ it's designed to be read start to finish.
src/app/ โ example applications
src/driver/ โ the NIC drivers
device.hThe generic struct ixy_device vtable and the MMIO register helpers.device.cixy_init(): read PCI config, then install ixgbe or virtio callbacks.ixgbe.cThe ixgbe driver: bring-up plus the RX/TX batch hot paths.ixgbe.hixgbe device struct and the public ixgbe_* entry points.ixgbe_type.hIntel 82599 register map and descriptor formats (mostly #defines).virtio.cThe virtio driver โ same vtable, virtqueue avail/used rings.virtio.hvirtio device struct.virtio_type.hvirtio-net register and virtqueue definitions.
src/ โ core (memory, pci, interrupts, vfio, stats)
memory.cDMA memory: hugepages, virt_to_phys, and the packet-buffer mempool.memory.hstruct pkt_buf and struct mempool โ the 64-byte buffer header.pci.cPCI: unbind the kernel driver, set bus-master, mmap BAR0.pci.hPCI helper declarations.interrupts.cOptional interrupt handling over a VFIO eventfd + epoll.interrupts.hInterrupt state structs and timing.libixy-vfio.cVFIO / IOMMU: groups, containers, and IOVA DMA mappings.libixy-vfio.hVFIO entry-point declarations.stats.cPer-device packet/byte counters and rate printing.stats.hDevice stats structs.log.hLogging, error, and hexdump macros.