Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/device/blk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use log::info;
use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout};

const QUEUE: u16 = 0;
const QUEUE_SIZE: u16 = 16;
const QUEUE_SIZE: u16 = 256;
const SUPPORTED_FEATURES: BlkFeature = BlkFeature::RO
.union(BlkFeature::FLUSH)
.union(BlkFeature::RING_INDIRECT_DESC)
Expand Down
6 changes: 4 additions & 2 deletions src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
pub fn new<T: Transport>(
transport: &mut T,
idx: u16,
indirect: bool,

Check warning on line 88 in src/queue.rs

View workflow job for this annotation

GitHub Actions / build

unused variable: `indirect`

Check warning on line 88 in src/queue.rs

View workflow job for this annotation

GitHub Actions / build

unused variable: `indirect`
event_idx: bool,
access_platform: bool,
) -> Result<Self> {
Expand Down Expand Up @@ -201,8 +201,10 @@
}

// Write barrier so that device sees changes to descriptor table and available ring before
// change to available index.
fence(Ordering::SeqCst);
// change to available index. A Release fence is sufficient: it ensures all prior writes
// (descriptor table, avail ring entry) are ordered before the subsequent Release store to
// avail.idx. This matches Linux's dma_wmb() / virtio_wmb() semantics.
fence(Ordering::Release);

// increase head of avail ring
self.avail_idx = self.avail_idx.wrapping_add(1);
Expand Down
Loading