Skip to content

Commit

Permalink
Merge pull request #1289 from hermit-os/flags_avail-fixup
Browse files Browse the repository at this point in the history
fix(virtqueue/packed): set flags according to wrap count
  • Loading branch information
mkroening authored Jun 20, 2024
2 parents 9fd9dcd + 4e20fb2 commit c41204e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/drivers/virtio/virtqueue/packed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@ impl<'a> WriteCtrl<'a> {
desc_ref.id = (self.buff_id).into();
// Remove possibly set avail and used flags and then set avail and used
// according to the current WrapCount.
desc_ref.flags = flags - virtq::DescF::AVAIL - virtq::DescF::USED;
desc_ref.flags = (flags - virtq::DescF::AVAIL - virtq::DescF::USED)
| self.desc_ring.drv_wc.as_flags_avail();

self.incrmt()
}
Expand Down

0 comments on commit c41204e

Please sign in to comment.