Skip to content

Commit e4d6a58

Browse files
committed
[cru] SP FIFO empty counters should be per DMA channel
1 parent f8d923d commit e4d6a58

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Cru/CruDmaChannel.cxx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,16 +400,15 @@ bool CruDmaChannel::areSuperpageFifosHealthy()
400400
}
401401

402402
bool ok = true;
403-
static std::unordered_map<int, uint32_t> counters;
404403

405404
for (const auto& link : mLinks) {
406405
uint32_t emptyCounter = getBar()->getSuperpageFifoEmptyCounter(link.id);
407-
if (counters.count(link.id) && //only check after the counters map has been initialized
408-
counters[link.id] != emptyCounter) {
409-
log((format("Empty counter of Superpage FIFO of link %1% increased") % link.id).str(), LogWarningDevel_(4257));
406+
if (mEmptySPFifoCounters.count(link.id) && //only check after the counters map has been initialized
407+
mEmptySPFifoCounters[link.id] != emptyCounter) {
408+
log((format("Empty counter of Superpage FIFO of link %d increased from %x to %x") % link.id % mEmptySPFifoCounters[link.id] % emptyCounter).str(), LogWarningDevel_(4257));
410409
ok = false;
411410
}
412-
counters[link.id] = emptyCounter;
411+
mEmptySPFifoCounters[link.id] = emptyCounter;
413412
}
414413

415414
return ok;

src/Cru/CruDmaChannel.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ class CruDmaChannel final : public DmaChannelPdaBase
159159
const size_t mDmaPageSize;
160160

161161
bool mFirstSPPushed = false;
162+
163+
/// Empty Superpage FIFO counters per link
164+
std::unordered_map<int, uint32_t> mEmptySPFifoCounters;
162165
};
163166

164167
} // namespace roc

0 commit comments

Comments
 (0)