Repository navigation
refactor(drivers): moved the virtio PCI transport into a base class shared by virtio drivers - #339
Merged
Merged
Conversation
FlareCoding
added this pull request to stack #342
October 6, 2026 06:09
FlareCoding
force-pushed
the
pr/virtio-transport
branch
from
October 6, 2026 06:27
d92f565 to
63d1c32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
virtio_pci_driverbase class indrivers/virtio, next to the shared PCI definitions and the virtqueue. virtio-net derives from it and behaves as before.Note
Medium Risk
Refactors kernel virtio-net bring-up and MMIO/virtqueue setup without intended behavior change; regressions would affect network attach and PCI feature negotiation.
Overview
Extracts the virtio modern PCI transport (capability walk, BAR mapping, status handshake, feature negotiation, virtqueue registration, MSI-X routing helpers, ISR ack, device reset) from
virtio_netinto a newvirtio_pci_driverbase underdrivers/virtio. virtio-net now derives from that class and keeps only net-specific attach/queue buffer logic, callingstart_transport(),setup_queue(),set_driver_ok(), anddevice_config()instead of inlined transport code.Shared virtio pieces are relocated and renamed: generic PCI definitions stay in
virtio_pci.h(net-only constants/structs move tovirtio_net.h), and the virtqueue implementation moves fromdrivers/nettodrivers/virtio/virtqueue.*. Feature negotiation in the base class now takes required vs optional feature masks; virtio-net treats MAC, STATUS, and VERSION_1 as optional and reads negotiated bits from the returned mask. Link-up checks useVIRTIO_NET_S_LINK_UPinstead of a raw status bit.Reviewed by Cursor Bugbot for commit 63d1c32. Bugbot is set up for automated code reviews on this repo. Configure here.