Skip to content

Commit

Permalink
netkvm: Delete virtqueues on shutdown
Browse files Browse the repository at this point in the history
Virtqueues are completely reinitialized on power-on so they should
also be completely shutdown/deleted on power-off. We still reuse
the same page-contiguous memory (CVirtQueue::m_SharedMemory) but
pool allocations (virtio 1.0) are freed and then reallocated.
  • Loading branch information
ladipro authored and vrozenfe committed Aug 9, 2016
1 parent 3e294db commit cdbb567
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions NetKVM/Common/ParaNdis-VirtQueue.cpp
Expand Up @@ -79,6 +79,7 @@ void CVirtQueue::Delete()
if (m_VirtQueue != nullptr)
{
virtio_delete_queue(m_VirtQueue);
m_VirtQueue = nullptr;
}
}

Expand Down
5 changes: 4 additions & 1 deletion NetKVM/Common/ParaNdis-VirtQueue.h
Expand Up @@ -171,7 +171,10 @@ class CVirtQueue
void Renew();

void Shutdown()
{ virtqueue_shutdown(m_VirtQueue); }
{
virtqueue_shutdown(m_VirtQueue);
Delete();
}

u16 SetMSIVector(u16 vector);

Expand Down

0 comments on commit cdbb567

Please sign in to comment.