Releases: karangandhi-projects/vnet-driver
Releases · karangandhi-projects/vnet-driver
v0.7: ethtool stats + per-protocol counters
v0.7
Highlights
- Adds
ethtool -Sextended statistics forvnet0 - Adds per-protocol TX/RX counters (ARP / IPv4 / IPv6 / other)
- Improves observability via TX EtherType debug logging
- Hardens RX ring behavior under pressure (drops tracked, skb freed)
How to Try
make clean && make
sudo insmod src/vnet_main.ko
sudo ip link set vnet0 up
sudo tcpdump -i vnet0 -e -n arp
ethtool -S vnet0v0.6 — Driver Statistics & ethtool Support
v0.6 — Driver Statistics & ethtool Support
Highlights
- Added 64-bit TX/RX counters
- Implemented ndo_get_stats64
- Added basic ethtool ops (get_drvinfo, get_link)
- Updated driver metadata and documentation
- Bumped module version to 0.6
Behavior
- ip -s link now shows live driver statistics
- ethtool provides driver info and link status
- All counters update during TX/RX/NAPI activity
This release makes the vnet driver behave more like a real Linux NIC.
v0.5 – Phase 5: NAPI-based RX + Stable Driver Architecture
Phase 5 – NAPI-based RX polling
Highlights
- Added NAPI support to the vnet virtual NIC driver.
- Extended
struct vnet_privwithstruct napi_struct napi. - Implemented
vnet_napi_poll()to drain the RX ring in poll context with a configurable budget. - Registered NAPI via
netif_napi_add()invnet_init(). - Enabled NAPI in
vnet_open()and disabled it invnet_stop(). - Updated the RX timer to:
- Allocate dummy RX packets,
- Enqueue them into the RX ring,
- Schedule NAPI via
napi_schedule_prep()/__napi_schedule().
Behavior
- RX is no longer processed directly in the timer callback.
- Timer behaves like an RX interrupt: it only enqueues packets and schedules NAPI.
- NAPI poll hands packets to the kernel networking stack using
netif_rx().
Status
- Driver has:
- TX ring (Phase 3)
- RX ring + RX timer (Phase 4)
- NAPI-based RX processing (Phase 5)
- Future phases may add ethtool support, stats, and more realistic packet formats.
v0.4 – Phase 4: RX ring and timer
Phase 4 – RX ring and timer-based packet generator
Highlights
- Added RX ring (
VNET_RX_RING_SIZE,struct vnet_rx_slot). - Added RX helpers:
vnet_rx_ring_init,vnet_rx_enqueue,vnet_rx_dequeue. - Implemented
vnet_rx_process_all()to drain RX ring (log + free SKBs). - Added
vnet_rx_timer_fn()to simulate hardware RX every 1 second. - Updated
vnet_open()to init TX/RX rings and start RX timer. - Updated
vnet_stop()to stop timer and drain both TX and RX rings.
Status
- RX traffic is synthetic (generated by timer).
- Packets are not yet passed into the networking stack (NAPI planned for Phase 5).
v0.3 – Phase 3: TX ring buffer implementation
Phase 3: TX Ring Buffer Implementation
This release adds a realistic TX ring to the vnet virtual NIC driver.
Highlights
- Introduced
VNET_TX_RING_SIZEandstruct vnet_tx_slot. - Added
vnet_tx_ring_init(),vnet_tx_enqueue(),vnet_tx_dequeue(), andvnet_tx_complete_all(). - Updated
struct vnet_privto include:- TX ring array
tx_head/tx_tailindices
ndo_opennow initializes the TX ring.ndo_stopdrains any remaining packets from the TX ring.ndo_start_xmit:- Enqueues packets into the TX ring
- Returns
NETDEV_TX_BUSYand stops the queue when the ring is full - Simulates immediate TX completion via
vnet_tx_complete_all()
- All new code is Doxygen-documented for easier browsing and learning.
Status
- RX path and NAPI are not implemented yet (planned for Phase 4).
- TX completion is synchronous for now (will be moved to async path in later phases).
v0.2 - Phase 2: Minimal net_device skeleton
- Added vnet_main.ko
- register_netdev()
- alloc_etherdev()
- net_device_ops (open, stop, xmit)
- Doxygen documented