Commit 4ab00cdc authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

harmonize codestyle

parent c5cdee6a
Pipeline #293379 failed with stages
in 4 seconds
Subproject commit 1ddb51d71d13295a76b06a10593102659227f972
Subproject commit e58a611a755b759925b78c6ee2c73ae282cef444
......@@ -50,7 +50,7 @@ GpuAllocator::GpuAllocator(Gpu& gpu) :
{
free = [&](MemoryBlock* mem) {
cudaSetDevice(gpu.gpuId);
if(cudaFree(reinterpret_cast<void*>(mem->getOffset())) != cudaSuccess) {
if (cudaFree(reinterpret_cast<void*>(mem->getOffset())) != cudaSuccess) {
logger->warn("cudaFree() failed for {:#x} of size {:#x}",
mem->getOffset(), mem->getSize());
}
......@@ -92,7 +92,7 @@ public:
std::string Gpu::getName() const
{
cudaDeviceProp deviceProp;
if(cudaGetDeviceProperties(&deviceProp, gpuId) != cudaSuccess) {
if (cudaGetDeviceProperties(&deviceProp, gpuId) != cudaSuccess) {
// logger not yet availabe
villas::logging.get("Gpu")->error("Cannot retrieve properties for GPU {}", gpuId);
throw std::exception();
......@@ -115,7 +115,7 @@ bool Gpu::registerIoMemory(const MemoryBlock& mem)
// overlapping window, so this will fail badly!
auto translation = mm.getTranslation(masterPciEAddrSpaceId,
mem.getAddrSpaceId());
if(translation.getSize() >= mem.getSize()) {
if (translation.getSize() >= mem.getSize()) {
// there is already a sufficient path
logger->debug("Already mapped through another mapping");
return true;
......@@ -159,7 +159,7 @@ bool Gpu::registerIoMemory(const MemoryBlock& mem)
return false;
}
if(sizeOnPci < mem.getSize()) {
if (sizeOnPci < mem.getSize()) {
logger->warn("VA mapping of IO memory is too small: {:#x} instead of {:#x} bytes",
sizeOnPci, mem.getSize());
logger->warn("If something later on fails or behaves strangely, this might be the cause!");
......@@ -169,13 +169,13 @@ bool Gpu::registerIoMemory(const MemoryBlock& mem)
cudaSetDevice(gpuId);
auto baseAddrVA = reinterpret_cast<void*>(baseAddrForProcess);
if(cudaHostRegister(baseAddrVA, sizeOnPci, cudaHostRegisterIoMemory) != cudaSuccess) {
if (cudaHostRegister(baseAddrVA, sizeOnPci, cudaHostRegisterIoMemory) != cudaSuccess) {
logger->error("Cannot register IO memory for block {}", mem.getAddrSpaceId());
return false;
}
void* devicePointer = nullptr;
if(cudaHostGetDevicePointer(&devicePointer, baseAddrVA, 0) != cudaSuccess) {
if (cudaHostGetDevicePointer(&devicePointer, baseAddrVA, 0) != cudaSuccess) {
logger->error("Cannot retrieve device pointer for IO memory");
return false;
}
......@@ -195,7 +195,7 @@ Gpu::registerHostMemory(const MemoryBlock& mem)
auto localBase = reinterpret_cast<void*>(translation.getLocalAddr(0));
int ret = cudaHostRegister(localBase, mem.getSize(), 0);
if(ret != cudaSuccess) {
if (ret != cudaSuccess) {
logger->error("Cannot register memory block {} addr={:p} size={:#x} to CUDA: ret={}",
mem.getAddrSpaceId(), localBase, mem.getSize(), ret);
return false;
......@@ -203,7 +203,7 @@ Gpu::registerHostMemory(const MemoryBlock& mem)
void* devicePointer = nullptr;
ret = cudaHostGetDevicePointer(&devicePointer, localBase, 0);
if(ret != cudaSuccess) {
if (ret != cudaSuccess) {
logger->error("Cannot retrieve device pointer for IO memory: ret={}", ret);
return false;
}
......@@ -216,7 +216,7 @@ Gpu::registerHostMemory(const MemoryBlock& mem)
bool Gpu::makeAccessibleToPCIeAndVA(const MemoryBlock& mem)
{
if(pImpl->gdr == nullptr) {
if (pImpl->gdr == nullptr) {
logger->warn("GDRcopy not available");
return false;
}
......@@ -226,7 +226,7 @@ bool Gpu::makeAccessibleToPCIeAndVA(const MemoryBlock& mem)
try {
auto path = mm.findPath(masterPciEAddrSpaceId, mem.getAddrSpaceId());
// if first hop is the PCIe bus, we know that memory is off-GPU
if(path.front() == mm.getPciAddressSpace()) {
if (path.front() == mm.getPciAddressSpace()) {
throw std::out_of_range("Memory block is outside of this GPU");
}
......@@ -246,7 +246,7 @@ bool Gpu::makeAccessibleToPCIeAndVA(const MemoryBlock& mem)
// required to set this flag before mapping
unsigned int enable = 1;
ret = cuPointerSetAttribute(&enable, CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, devptr);
if(ret != CUDA_SUCCESS) {
if (ret != CUDA_SUCCESS) {
logger->error("Cannot set pointer attributes on memory block {}: {}",
mem.getAddrSpaceId(), ret);
return false;
......@@ -254,7 +254,7 @@ bool Gpu::makeAccessibleToPCIeAndVA(const MemoryBlock& mem)
gdr_mh_t mh;
ret = gdr_pin_buffer(pImpl->gdr, devptr, mem.getSize(), 0, 0, &mh);
if(ret != 0) {
if (ret != 0) {
logger->error("Cannot pin memory block {} via gdrcopy: {}",
mem.getAddrSpaceId(), ret);
return false;
......@@ -262,7 +262,7 @@ bool Gpu::makeAccessibleToPCIeAndVA(const MemoryBlock& mem)
void* bar = nullptr;
ret = gdr_map(pImpl->gdr, mh, &bar, mem.getSize());
if(ret != 0) {
if (ret != 0) {
logger->error("Cannot map memory block {} via gdrcopy: {}",
mem.getAddrSpaceId(), ret);
return false;
......@@ -270,7 +270,7 @@ bool Gpu::makeAccessibleToPCIeAndVA(const MemoryBlock& mem)
gdr_info_t info;
ret = gdr_get_info(pImpl->gdr, mh, &info);
if(ret != 0) {
if (ret != 0) {
logger->error("Cannot get info for mapping of memory block {}: {}",
mem.getAddrSpaceId(), ret);
return false;
......@@ -294,11 +294,11 @@ bool Gpu::makeAccessibleToPCIeAndVA(const MemoryBlock& mem)
uint64_t addr[8];
ret = gdr_map_dma(pImpl->gdr, mh, 3, 0, 0, addr, 8);
for(int i = 0; i < ret; i++) {
for (int i = 0; i < ret; i++) {
logger->debug("DMA addr[{}]: {:#x}", i, addr[i]);
}
if(ret != 1) {
if (ret != 1) {
logger->error("Only one DMA address per block supported at the moment");
return false;
}
......@@ -328,7 +328,7 @@ Gpu::makeAccessibleFromPCIeOrHostRam(const MemoryBlock& mem)
// not reachable via PCI -> not IO memory
}
if(isIoMemory) {
if (isIoMemory) {
logger->debug("Memory block {} is assumed to be IO memory",
mem.getAddrSpaceId());
......@@ -396,7 +396,7 @@ GpuAllocator::allocateBlock(size_t size)
});
if(chunk != chunks.end()) {
if (chunk != chunks.end()) {
logger->debug("Found existing chunk that can host the requested block");
return (*chunk)->allocateBlock(size);
......@@ -408,7 +408,7 @@ GpuAllocator::allocateBlock(size_t size)
const size_t chunkSize = size - (size & (GpuPageSize - 1)) + GpuPageSize;
logger->debug("Allocate new chunk of {:#x} bytes", chunkSize);
if(cudaSuccess != cudaMalloc(&addr, chunkSize)) {
if (cudaSuccess != cudaMalloc(&addr, chunkSize)) {
logger->error("cudaMalloc(..., size={}) failed", chunkSize);
throw std::bad_alloc();
}
......@@ -445,7 +445,7 @@ Gpu::Gpu(int gpuId) :
logger = villas::logging.get(getName());
pImpl->gdr = gdr_open();
if(pImpl->gdr == nullptr) {
if (pImpl->gdr == nullptr) {
logger->warn("No GDRcopy support enabled, cannot open /dev/gdrdrv");
}
}
......@@ -470,7 +470,7 @@ bool Gpu::init()
struct pci_region* pci_regions = nullptr;
const size_t pci_num_regions = pci_get_regions(&pImpl->pdev, &pci_regions);
for(size_t i = 0; i < pci_num_regions; i++) {
for (size_t i = 0; i < pci_num_regions; i++) {
const size_t region_size = pci_regions[i].end - pci_regions[i].start + 1;
logger->info("BAR{}: bus addr={:#x} size={:#x}",
pci_regions[i].num, pci_regions[i].start, region_size);
......@@ -500,15 +500,15 @@ GpuFactory::make()
std::list<std::unique_ptr<Gpu>> gpuList;
for(int gpuId = 0; gpuId < deviceCount; gpuId++) {
if(cudaSetDevice(gpuId) != cudaSuccess) {
for (int gpuId = 0; gpuId < deviceCount; gpuId++) {
if (cudaSetDevice(gpuId) != cudaSuccess) {
logger->warn("Cannot activate GPU {}", gpuId);
continue;
}
auto gpu = std::make_unique<Gpu>(gpuId);
if(not gpu->init()) {
if (not gpu->init()) {
logger->warn("Cannot initialize GPU {}", gpuId);
continue;
}
......@@ -517,7 +517,7 @@ GpuFactory::make()
}
logger->info("Initialized {} GPUs", gpuList.size());
for(auto& gpu : gpuList) {
for (auto& gpu : gpuList) {
logger->debug(" - {}", gpu->getName());
}
......
......@@ -42,7 +42,7 @@ kernel_mailbox(volatile uint32_t *mailbox, volatile uint32_t* counter)
printf("[kernel] started\n");
while(1) {
while (1) {
if (*mailbox == 1) {
*mailbox = 0;
printf("[gpu] counter = %d\n", *counter);
......@@ -56,7 +56,7 @@ kernel_mailbox(volatile uint32_t *mailbox, volatile uint32_t* counter)
__global__ void
kernel_memcpy(volatile uint8_t* dst, volatile uint8_t* src, size_t length)
{
while(length > 0) {
while (length > 0) {
*dst++ = *src++;
length--;
}
......
......@@ -70,9 +70,9 @@ public:
const std::string& port,
bool isMaster)
{
for(auto& vertexEntry : vertices) {
for (auto& vertexEntry : vertices) {
auto& vertex = vertexEntry.second;
if(vertex->nodeName == node and vertex->portName == port and vertex->isMaster == isMaster)
if (vertex->nodeName == node and vertex->portName == port and vertex->isMaster == isMaster)
return vertex;
}
......
......@@ -79,7 +79,7 @@ public:
private:
void updateRunningStatus()
{
if(running and isIdleBit())
if (running and isIdleBit())
running = false;
}
......
......@@ -62,7 +62,7 @@ PCIeCardFactory::make(json_t *json, struct pci* pci, std::shared_ptr<VfioContain
"slot", &pci_slot,
"id", &pci_id);
if(ret != 0) {
if (ret != 0) {
logger->warn("Cannot parse JSON config");
continue;
}
......@@ -87,18 +87,18 @@ PCIeCardFactory::make(json_t *json, struct pci* pci, std::shared_ptr<VfioContain
}
if(not card->init()) {
if (not card->init()) {
logger->warn("Cannot start FPGA card {}", card_name);
continue;
}
card->ips = ip::IpCoreFactory::make(card.get(), json_ips);
if(card->ips.empty()) {
if (card->ips.empty()) {
logger->error("Cannot initialize IPs of FPGA card {}", card_name);
continue;
}
if(not card->check()) {
if (not card->check()) {
logger->warn("Checking of FPGA card {} failed", card_name);
continue;
}
......@@ -122,7 +122,7 @@ PCIeCard::~PCIeCard()
auto& mm = MemoryManager::get();
// unmap all memory blocks
for(auto& mappedMemoryBlock : memoryBlocksMapped) {
for (auto& mappedMemoryBlock : memoryBlocksMapped) {
auto translation = mm.getTranslation(addrSpaceIdDeviceToHost,
mappedMemoryBlock);
......@@ -139,8 +139,8 @@ PCIeCard::~PCIeCard()
ip::IpCore*
PCIeCard::lookupIp(const std::string& name) const
{
for(auto& ip : ips) {
if(*ip == name) {
for (auto& ip : ips) {
if (*ip == name) {
return ip.get();
}
}
......@@ -152,8 +152,8 @@ PCIeCard::lookupIp(const std::string& name) const
ip::IpCore*
PCIeCard::lookupIp(const Vlnv& vlnv) const
{
for(auto& ip : ips) {
if(*ip == vlnv) {
for (auto& ip : ips) {
if (*ip == vlnv) {
return ip.get();
}
}
......@@ -163,8 +163,8 @@ PCIeCard::lookupIp(const Vlnv& vlnv) const
ip::IpCore*PCIeCard::lookupIp(const ip::IpIdentifier& id) const
{
for(auto& ip : ips) {
if(*ip == id) {
for (auto& ip : ips) {
if (*ip == id) {
return ip.get();
}
}
......@@ -176,7 +176,7 @@ ip::IpCore*PCIeCard::lookupIp(const ip::IpIdentifier& id) const
bool
PCIeCard::mapMemoryBlock(const MemoryBlock& block)
{
if(not vfioContainer->isIommuEnabled()) {
if (not vfioContainer->isIommuEnabled()) {
logger->warn("VFIO mapping not supported without IOMMU");
return false;
}
......@@ -184,7 +184,7 @@ PCIeCard::mapMemoryBlock(const MemoryBlock& block)
auto& mm = MemoryManager::get();
const auto& addrSpaceId = block.getAddrSpaceId();
if(memoryBlocksMapped.find(addrSpaceId) != memoryBlocksMapped.end()) {
if (memoryBlocksMapped.find(addrSpaceId) != memoryBlocksMapped.end()) {
// block already mapped
return true;
} else {
......@@ -197,7 +197,7 @@ PCIeCard::mapMemoryBlock(const MemoryBlock& block)
UINTPTR_MAX,
block.getSize());
if(iovaAddr == UINTPTR_MAX) {
if (iovaAddr == UINTPTR_MAX) {
logger->error("Cannot map memory at {:#x} of size {:#x}",
processBaseAddr, block.getSize());
return false;
......@@ -242,12 +242,12 @@ PCIeCard::init()
/* Reset system? */
if (do_reset) {
/* Reset / detect PCI device */
if(not vfioDevice->pciHotReset()) {
if (not vfioDevice->pciHotReset()) {
logger->error("Failed to reset PCI device");
return false;
}
if(not reset()) {
if (not reset()) {
logger->error("Failed to reset FGPA card");
return false;
}
......
......@@ -70,7 +70,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
json_t* json_ip;
json_object_foreach(json_ips, ipName, json_ip) {
const char* vlnv;
if(json_unpack(json_ip, "{ s: s }", "vlnv", &vlnv) != 0) {
if (json_unpack(json_ip, "{ s: s }", "vlnv", &vlnv) != 0) {
loggerStatic->warn("IP {} has no VLNV", ipName);
continue;
}
......@@ -85,10 +85,10 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
// first to be initialized.
vlnvInitializationOrder.reverse();
for(auto& vlnvInitFirst : vlnvInitializationOrder) {
for (auto& vlnvInitFirst : vlnvInitializationOrder) {
// iterate over IPs, if VLNV matches, push to front and remove from list
for(auto it = allIps.begin(); it != allIps.end(); ++it) {
if(vlnvInitFirst == it->getVlnv()) {
for (auto it = allIps.begin(); it != allIps.end(); ++it) {
if (vlnvInitFirst == it->getVlnv()) {
orderedIps.push_front(*it);
it = allIps.erase(it);
}
......@@ -99,12 +99,12 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
orderedIps.splice(orderedIps.end(), allIps);
loggerStatic->debug("IP initialization order:");
for(auto& id : orderedIps) {
for (auto& id : orderedIps) {
loggerStatic->debug(" " CLR_BLD("{}"), id.getName());
}
// configure all IPs
for(auto& id : orderedIps) {
for (auto& id : orderedIps) {
loggerStatic->info("Configuring {}", id);
// find the appropriate factory that can create the specified VLNV
......@@ -114,7 +114,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
// candidates, the first suitable factory will be used.
IpCoreFactory* ipCoreFactory = lookup(id.getVlnv());
if(ipCoreFactory == nullptr) {
if (ipCoreFactory == nullptr) {
loggerStatic->warn("No plugin found to handle {}", id.getVlnv());
continue;
} else {
......@@ -132,7 +132,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
// the list and will run out of scope.
auto ip = std::unique_ptr<IpCore>(ipCoreFactory->create());
if(ip == nullptr) {
if (ip == nullptr) {
logger->warn("Cannot create an instance of {}",
ipCoreFactory->getName());
continue;
......@@ -146,7 +146,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
json_t* json_ip = json_object_get(json_ips, id.getName().c_str());
json_t* json_irqs = json_object_get(json_ip, "irqs");
if(json_is_object(json_irqs)) {
if (json_is_object(json_irqs)) {
logger->debug("Parse IRQs of {}", *ip);
const char* irqName;
......@@ -156,7 +156,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
auto tokens = utils::tokenize(irqEntry, ":");
if(tokens.size() != 2) {
if (tokens.size() != 2) {
logger->warn("Cannot parse IRQ '{}' of " CLR_BLD("{}"),
irqEntry, id.getName());
continue;
......@@ -165,14 +165,14 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
const std::string& irqControllerName = tokens[0];
InterruptController* intc = nullptr;
for(auto& configuredIp : configuredIps) {
if(*configuredIp == irqControllerName) {
for (auto& configuredIp : configuredIps) {
if (*configuredIp == irqControllerName) {
intc = dynamic_cast<InterruptController*>(configuredIp.get());
break;
}
}
if(intc == nullptr) {
if (intc == nullptr) {
logger->error("Interrupt Controller {} for IRQ {} not found",
irqControllerName, irqName);
continue;
......@@ -192,7 +192,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
json_t* json_memory_view = json_object_get(json_ip, "memory-view");
if(json_is_object(json_memory_view)) {
if (json_is_object(json_memory_view)) {
logger->debug("Parse memory view of {}", *ip);
......@@ -227,7 +227,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
"baseaddr", &base,
"highaddr", &high,
"size", &size);
if(ret != 0) {
if (ret != 0) {
logger->error("Cannot parse address block {}/{}/{}/{}",
ip->getInstanceName(),
bus_name, instance_name, block_name);
......@@ -255,7 +255,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
}
// IP-specific setup via JSON config
if(not ipCoreFactory->configureJson(*ip, json_ip)) {
if (not ipCoreFactory->configureJson(*ip, json_ip)) {
logger->warn("Cannot configure IP from JSON");
continue;
}
......@@ -265,12 +265,12 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
}
// Start and check IPs now
for(auto& ip : configuredIps) {
for (auto& ip : configuredIps) {
// Translate all memory blocks that the IP needs to be accessible from
// the process and cache in the instance, so this has not to be done at
// runtime.
for(auto& memoryBlock : ip->getMemoryBlocks()) {
for (auto& memoryBlock : ip->getMemoryBlocks()) {
// construct the global name of this address block
const auto addrSpaceName =
MemoryManager::getSlaveAddrSpaceName(ip->getInstanceName(),
......@@ -293,12 +293,12 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
loggerStatic->info("Initializing {}", *ip);
if(not ip->init()) {
if (not ip->init()) {
loggerStatic->error("Cannot start IP {}", *ip);
continue;
}
if(not ip->check()) {
if (not ip->check()) {
loggerStatic->error("Checking failed for IP {}", *ip);
continue;
}
......@@ -309,7 +309,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
loggerStatic->debug("Initialized IPs:");
for(auto& ip : initializedIps) {
for (auto& ip : initializedIps) {
loggerStatic->debug(" {}", *ip);
}
......@@ -321,12 +321,12 @@ void
IpCore::dump()
{
logger->info("IP: {}", *this);
for(auto& [num, irq] : irqs) {
for (auto& [num, irq] : irqs) {
logger->info(" IRQ {}: {}:{}",
num, irq.irqController->getInstanceName(), irq.num);
}
for(auto& [block, translation] : addressTranslations) {
for (auto& [block, translation] : addressTranslations) {
logger->info(" Memory {}: {}", block, translation);
}
}
......@@ -335,8 +335,8 @@ IpCore::dump()
IpCoreFactory*
IpCoreFactory::lookup(const Vlnv &vlnv)
{
for(auto& ip : plugin::Registry::lookup<IpCoreFactory>()) {
if(ip->getCompatibleVlnv() == vlnv)
for (auto& ip : plugin::Registry::lookup<IpCoreFactory>()) {
if (ip->getCompatibleVlnv() == vlnv)
return ip;
}
......
......@@ -45,7 +45,7 @@ IpNodeFactory::configureJson(IpCore& ip, json_t* json_ip)
auto logger = getLogger();
json_t* json_ports = json_object_get(json_ip, "ports");
if(not json_is_array(json_ports)) {
if (not json_is_array(json_ports)) {
logger->debug("IP has no ports");
return true;
}
......@@ -53,7 +53,7 @@ IpNodeFactory::configureJson(IpCore& ip, json_t* json_ip)
size_t index;
json_t* json_port;
json_array_foreach(json_ports, index, json_port) {
if(not json_is_object(json_port)) {
if (not json_is_object(json_port)) {
logger->error("Port {} is not an object", index);
return false;
}
......@@ -63,13 +63,13 @@ IpNodeFactory::configureJson(IpCore& ip, json_t* json_ip)
"role", &role_raw,
"target", &target_raw,
"name", &name_raw);
if(ret != 0) {
if (ret != 0) {
logger->error("Cannot parse port {}", index);
return false;
}
const auto tokens = utils::tokenize(target_raw, ":");
if(tokens.size() != 2) {
if (tokens.size() != 2) {
logger->error("Cannot parse 'target' of port {}", index);
return false;
}
......@@ -89,7 +89,7 @@ IpNodeFactory::configureJson(IpCore& ip, json_t* json_ip)
not isMaster);
if(isMaster) {
if (isMaster) {
IpNode::streamGraph.addDefaultEdge(thisVertex->getIdentifier(),
connectedVertex->getIdentifier());
ipNode.portsMaster[name_raw] = thisVertex;
......@@ -104,10 +104,10 @@ IpNodeFactory::configureJson(IpCore& ip, json_t* json_ip)
std::pair<std::string, std::string>
IpNode::getLoopbackPorts() const
{
for(auto& [masterName, masterTo] : portsMaster) {
for(auto& [slaveName, slaveTo] : portsSlave) {
for (auto& [masterName, masterTo] : portsMaster) {
for (auto& [slaveName, slaveTo] : portsSlave) {
// TODO: should we also check which IP both ports are connected to?
if(masterTo->nodeName == slaveTo->nodeName) {
if (masterTo->nodeName == slaveTo->nodeName) {
return { masterName, slaveName };
}
}
......@@ -118,18 +118,18 @@ IpNode::getLoopbackPorts() const
bool IpNode::connect(const StreamVertex& from, const StreamVertex& to)
{
if(from.nodeName != getInstanceName()) {
if (from.nodeName != getInstanceName()) {
logger->error("Cannot connect from a foreign StreamVertex: {}", from);
return false;
}
StreamGraph::Path path;
if(not streamGraph.getPath(from.getIdentifier(), to.getIdentifier(), path)) {
if (not streamGraph.getPath(from.getIdentifier(), to.getIdentifier(), path)) {
logger->error("No path from {} to {}", from, to);
return false;
}
if(path.size() == 0) {
if (path.size() == 0) {
return true;
}
......@@ -140,16 +140,16 @@ bool IpNode::connect(const StreamVertex& from, const StreamVertex& to)
auto nextHopNode = firstHopNode;
// check if next hop is an internal connection
if(firstHopNode->nodeName == getInstanceName()) {
if (firstHopNode->nodeName == getInstanceName()) {
if(not connectInternal(from.portName, firstHopNode->portName)) {