File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ CruDmaChannel::CruDmaChannel(const Parameters& parameters)
8282 }
8383 stream << id << " " ;
8484 // Implicit constructors are deleted for the folly Queue. Workaround to keep the Link struct with a queue * field.
85- std::shared_ptr<SuperpageQueue> linkQueue = std::make_shared<SuperpageQueue>(LINK_QUEUE_CAPACITY );
85+ std::shared_ptr<SuperpageQueue> linkQueue = std::make_shared<SuperpageQueue>(LINK_QUEUE_CAPACITY_ALLOCATIONS );
8686 Link newLink = { static_cast <LinkId>(id), 0 , linkQueue };
8787 mLinks .push_back (newLink);
8888 }
Original file line number Diff line number Diff line change @@ -69,10 +69,12 @@ class CruDmaChannel final : public DmaChannelPdaBase
6969 // / Max amount of superpages per link.
7070 // / This may not exceed the limit determined by the firmware capabilities.
7171 static constexpr size_t LINK_QUEUE_CAPACITY = Cru::MAX_SUPERPAGE_DESCRIPTORS;
72+ static constexpr size_t LINK_QUEUE_CAPACITY_ALLOCATIONS = LINK_QUEUE_CAPACITY + 1 ; // folly Queue needs + 1
7273
7374 // / Max amount of superpages in the ready queue.
7475 // / This is an arbitrary size, can easily be increased if more headroom is needed.
7576 static constexpr size_t READY_QUEUE_CAPACITY = Cru::MAX_SUPERPAGE_DESCRIPTORS * Cru::MAX_LINKS;
77+ static constexpr size_t READY_QUEUE_CAPACITY_ALLOCATIONS = READY_QUEUE_CAPACITY + 1 ; // folly Queue needs + 1
7678
7779 // / Queue for one link
7880 using SuperpageQueue = folly::ProducerConsumerQueue<Superpage>;
@@ -143,7 +145,7 @@ class CruDmaChannel final : public DmaChannelPdaBase
143145 size_t mLinkQueuesTotalAvailable ;
144146
145147 // / Queue for superpages that have been transferred and are waiting for popping by the user
146- SuperpageQueue mReadyQueue { READY_QUEUE_CAPACITY };
148+ SuperpageQueue mReadyQueue { READY_QUEUE_CAPACITY_ALLOCATIONS };
147149
148150 // These variables are configuration parameters
149151
You can’t perform that action at this time.
0 commit comments