From bc9158bd238cd9c2e2491949aa621d4fccbe2776 Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Thu, 12 Mar 2020 13:36:18 -0400 Subject: [PATCH] Changed the queue size to only take one page. --- risc_v/ch9/src/virtio.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/risc_v/ch9/src/virtio.rs b/risc_v/ch9/src/virtio.rs index 33b35ed..8bb6e86 100755 --- a/risc_v/ch9/src/virtio.rs +++ b/risc_v/ch9/src/virtio.rs @@ -17,7 +17,10 @@ pub const VIRTIO_AVAIL_F_NO_INTERRUPT: u16 = 1; pub const VIRTIO_USED_F_NO_NOTIFY: u16 = 1; -pub const VIRTIO_RING_SIZE: usize = 256; +// 157 is the maximum ring size so that the structure +// takes up only 1 - 4KiB page. Kinda' an odd number, +// but let's go with it. +pub const VIRTIO_RING_SIZE: usize = 157; // VirtIO structures #[repr(C)]