Lightweight Approach to Kickstart Development of a NIC Driver


David Ahern


Nuts and Bolts

Session Type




Typically, writing S/W drivers for H/W in development involves building the PCIe stubs for qemu, building the actual data pipeline models, writing S/W drivers which use the pipeline, and eventually getting to system effects and integration with the kernel networking stack - both control plane and data plane APIs. However, the most interesting initial questions are around the system effects and what changes to the H/W-S/W interfaces will cause.

This tutorial shows a lighter weight approach for developing S/W and H/W in parallel. As H/W design discussions progress, a simplified software model can be built in parallel, capturing the essence of the data pipeline and descriptors. When run with the Linux networking stack, design proposals can be examined from a S/W perspective with actual data based on a networking load.

There are limitations to the approach of course - no interrupts, DMA setup, and such - but those fall into the standardized domain of NIC driver operation. The limitations can be managed to allow exercising what is important for the specific hardware under development, as well as allowing code to be written for many of the Linux APIs associated with ethernet drivers.

This tutorial will show how to integrate a S/W only device model with Linux and the networking stack - from mimicking PCI probe and init, creating a netdevice, configuring queues and using those queues to send and receive data. Namespaces are used to imitate hosts and allow end-to-end connectivity, facilitating a complete, closed-loop datapath.