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

Minor virtIO fixes in block and ethernet driver #266

Merged
merged 2 commits into from
Oct 9, 2024
Merged
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: 0 additions & 2 deletions drivers/blk/virtio/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,5 @@ static void virtio_blk_print_features(uint64_t features)
if (features & ((uint64_t)1 << VIRTIO_BLK_F_ZONED)) {
LOG_DRIVER(" VIRTIO_BLK_F_ZONED\n");
}
/* The reserved feature bits, that are not device specific, sit in the middle
* of all the network feature bits, which is why we print them here. */
virtio_print_reserved_feature_bits(features);
}
8 changes: 8 additions & 0 deletions drivers/network/virtio/ethernet.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ static inline bool virtio_avail_full_tx(struct virtq *virtq)
static void rx_provide(void)
{
/* We need to take all of our sDDF free entries and place them in the virtIO 'free' ring. */
bool transferred = false;
bool reprocess = true;
while (reprocess) {
while (!virtio_avail_full_rx(&rx_virtq) && !net_queue_empty_free(&rx_queue)) {
Expand Down Expand Up @@ -135,6 +136,8 @@ static void rx_provide(void)
// this list, but we are adding two desc entries.
rx_virtq.avail->idx++;
rx_last_desc_idx += 2;

transferred = true;
}

net_request_signal_free(&rx_queue);
Expand All @@ -145,6 +148,11 @@ static void rx_provide(void)
reprocess = true;
}
}

if (transferred) {
/* We have added more avail buffers, so notify the device */
regs->QueueNotify = VIRTIO_NET_RX_QUEUE;
}
}

static void rx_return(void)
Expand Down
Loading