mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
card: call stop on all ips when destructor is called
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
parent
c730412e98
commit
b0ccbddc6f
1 changed files with 15 additions and 11 deletions
|
@ -15,21 +15,25 @@ using namespace villas::fpga;
|
|||
|
||||
Card::~Card()
|
||||
{
|
||||
// Ensure IP destructors are called before memory is unmapped
|
||||
ips.clear();
|
||||
for (auto ip = ips.rbegin(); ip != ips.rend(); ++ip){
|
||||
(*ip)->stop();
|
||||
}
|
||||
// Ensure IP destructors are called before memory is unmapped
|
||||
ips.clear();
|
||||
|
||||
auto &mm = MemoryManager::get();
|
||||
auto &mm = MemoryManager::get();
|
||||
|
||||
// Unmap all memory blocks
|
||||
for (auto &mappedMemoryBlock : memoryBlocksMapped) {
|
||||
auto translation = mm.getTranslation(addrSpaceIdDeviceToHost, mappedMemoryBlock.first);
|
||||
// Unmap all memory blocks
|
||||
for (auto &mappedMemoryBlock : memoryBlocksMapped) {
|
||||
auto translation =
|
||||
mm.getTranslation(addrSpaceIdDeviceToHost, mappedMemoryBlock.first);
|
||||
|
||||
const uintptr_t iova = translation.getLocalAddr(0);
|
||||
const size_t size = translation.getSize();
|
||||
const uintptr_t iova = translation.getLocalAddr(0);
|
||||
const size_t size = translation.getSize();
|
||||
|
||||
logger->debug("Unmap block {} at IOVA {:#x} of size {:#x}",
|
||||
mappedMemoryBlock.first, iova, size);
|
||||
vfioContainer->memoryUnmap(iova, size);
|
||||
logger->debug("Unmap block {} at IOVA {:#x} of size {:#x}",
|
||||
mappedMemoryBlock.first, iova, size);
|
||||
vfioContainer->memoryUnmap(iova, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue