Skip to content

Releases: karangandhi-projects/vnet-driver

v0.7: ethtool stats + per-protocol counters

16 Dec 06:07
9dd1cdc

Choose a tag to compare

v0.7

Highlights

  • Adds ethtool -S extended statistics for vnet0
  • 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 vnet0

v0.6 — Driver Statistics & ethtool Support

28 Nov 06:34
99c38a3

Choose a tag to compare

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

28 Nov 05:06
f9dfc9e

Choose a tag to compare

Phase 5 – NAPI-based RX polling

Highlights

  • Added NAPI support to the vnet virtual NIC driver.
  • Extended struct vnet_priv with struct 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() in vnet_init().
  • Enabled NAPI in vnet_open() and disabled it in vnet_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

28 Nov 03:36
f373859

Choose a tag to compare

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

28 Nov 02:09

Choose a tag to compare

Phase 3: TX Ring Buffer Implementation

This release adds a realistic TX ring to the vnet virtual NIC driver.

Highlights

  • Introduced VNET_TX_RING_SIZE and struct vnet_tx_slot.
  • Added vnet_tx_ring_init(), vnet_tx_enqueue(), vnet_tx_dequeue(), and vnet_tx_complete_all().
  • Updated struct vnet_priv to include:
    • TX ring array
    • tx_head / tx_tail indices
  • ndo_open now initializes the TX ring.
  • ndo_stop drains any remaining packets from the TX ring.
  • ndo_start_xmit:
    • Enqueues packets into the TX ring
    • Returns NETDEV_TX_BUSY and 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

28 Nov 01:34

Choose a tag to compare

  • Added vnet_main.ko
  • register_netdev()
  • alloc_etherdev()
  • net_device_ops (open, stop, xmit)
  • Doxygen documented