Skip to content

Commit 141424b

Browse files
author
Dimitris Charisis
committed
riscv64: add interrupt support for net devices
Add interrupt support for VirtIO net devices on riscv64. This follows the logic used for VirtIO block devices, inserting interrupts via the `KVM_IRQ_LINE` ioctl. Signed-off-by: Dimitris Charisis <dchar@cslab.ece.ntua.gr>
1 parent 5ce8a7d commit 141424b

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/vmm/src/builder.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ use crate::devices::virtio::balloon::Balloon;
5454
use crate::devices::virtio::block::device::Block;
5555
use crate::devices::virtio::device::VirtioDevice;
5656
use crate::devices::virtio::mmio::MmioTransport;
57-
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
5857
use crate::devices::virtio::net::Net;
5958
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
6059
use crate::devices::virtio::rng::Entropy;
@@ -291,7 +290,6 @@ pub fn build_microvm_for_boot(
291290
event_manager,
292291
)?;
293292

294-
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
295293
attach_net_devices(
296294
&mut vmm,
297295
&mut boot_cmdline,
@@ -847,7 +845,6 @@ fn attach_block_devices<'a, I: Iterator<Item = &'a Arc<Mutex<Block>>> + Debug>(
847845
Ok(())
848846
}
849847

850-
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
851848
fn attach_net_devices<'a, I: Iterator<Item = &'a Arc<Mutex<Net>>> + Debug>(
852849
vmm: &mut Vmm,
853850
cmdline: &mut LoaderKernelCmdline,

src/vmm/src/devices/virtio/net/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ impl VirtioDevice for Net {
968968

969969
#[cfg(target_arch = "riscv64")]
970970
fn interrupt_trigger_mut(&mut self) -> &mut IrqTrigger {
971-
unimplemented!()
971+
&mut self.irq_trigger
972972
}
973973

974974
fn read_config(&self, offset: u64, data: &mut [u8]) {

0 commit comments

Comments
 (0)