Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtio-net-device (MMIO) not handling network interrupts #1173

Closed
mkroening opened this issue May 6, 2024 · 0 comments · Fixed by #1206
Closed

virtio-net-device (MMIO) not handling network interrupts #1173

mkroening opened this issue May 6, 2024 · 0 comments · Fixed by #1206
Assignees

Comments

@mkroening
Copy link
Member

mkroening commented May 6, 2024

The feature was introduced in #296.

To reproduce, run in hermit-rs:

export HERMIT_LOG_LEVEL_FILTER=Debug
export HERMIT_IP=192.168.76.9
export HERMIT_GATEWAY=192.168.76.2

cargo build -Zbuild-std=std,panic_abort --target=x86_64-unknown-hermit --package httpd --no-default-features --features hermit/tcp

qemu-system-x86_64 \
    -display none -serial stdio -kernel kernel/hermit-loader-x86_64 \
    -M microvm,x-option-roms=off,pit=off,pic=off,rtc=on,auto-kernel-cmdline=off,acpi=off -global virtio-mmio.force-legacy=off -nodefaults -no-user-config \
    -cpu Skylake-Client -device isa-debug-exit,iobase=0xf4,iosize=0x04 \
    -initrd target/x86_64-unknown-hermit/debug/httpd \
    -smp 1 -m 2G -netdev user,id=u1,hostfwd=tcp::9975-:9975,hostfwd=udp::9975-:9975,net=192.168.76.0/24,dhcpstart=192.168.76.9 -device virtio-net-device,netdev=u1 \
    -append "-freq 3000" \
    -object filter-dump,id=f1,netdev=u1,file=dump.pcap

To reproduce with the original code:

git clone git@github.com:hermit-os/hermit-rs.git hermit-mmio
cd hermit-mmio
git checkout hermit-sys-0.1.25
git submodule update --init

cd loader
make
cd ..

cd libhermit-rs
cargo update --package log --precise 0.4.0
cargo update --package crossbeam-utils --precise 0.8.7

# Change MMIO constants in kernel:
# pub const MMIO_START: usize = 0x00000000feb00000;
# pub const MMIO_END: usize = 0x00000000feb0ffff;
# const IRQ_NUMBER: u32 = 23;

cd ..

cargo build --no-default-features --features smoltcp -p httpd

qemu-system-x86_64 \
    -display none -serial stdio -kernel loader/target/x86_64-unknown-hermit-loader/debug/rusty-loader \
    -M microvm,x-option-roms=off,pit=off,pic=off,rtc=on,auto-kernel-cmdline=off,acpi=off -global virtio-mmio.force-legacy=off -nodefaults -no-user-config \
    -cpu Skylake-Client -device isa-debug-exit,iobase=0xf4,iosize=0x04 \
    -initrd target/x86_64-unknown-hermit/debug/httpd \
    -smp 1 -m 2G -netdev user,id=u1,hostfwd=tcp::9975-:9975,hostfwd=udp::9975-:9975,net=192.168.76.0/24,dhcpstart=192.168.76.9 -device virtio-net-device,netdev=u1 \
    -append "-freq 3000" \
    -object filter-dump,id=f1,netdev=u1,file=dump.pcap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants