@@ -164,22 +164,15 @@ void CruDmaChannel::deviceStopDma()
164164 int moved = 0 ;
165165 for (auto & link : mLinks ) {
166166 int32_t superpageCount = getBar ()->getSuperpageCount (link.id );
167- if (superpageCount == 0 ) { // Do not pop superpages if the link has been inactive
168- continue ;
169- }
170167 uint32_t amountAvailable = superpageCount - link.superpageCounter ;
171168 // log((format("superpageCount %1% amountAvailable %2%") % superpageCount % amountAvailable).str());
172- for (uint32_t i = 0 ; i < ( amountAvailable + 1 ) ; ++i) { // get an extra, possibly partly filled superpage
169+ for (uint32_t i = 0 ; i < amountAvailable; ++i) {
173170 if (mReadyQueue .size () >= READY_QUEUE_CAPACITY) {
174171 break ;
175172 }
176173
177174 if (!link.queue .empty ()) { // care for the extra filled superpage
178- if (i == amountAvailable) { // Propagate that it is the last popped to set the size only to the RDH (eox)
179- transferSuperpageFromLinkToReady (link, true );
180- } else {
181- transferSuperpageFromLinkToReady (link);
182- }
175+ transferSuperpageFromLinkToReady (link);
183176 moved++;
184177 }
185178 }
@@ -276,23 +269,19 @@ void CruDmaChannel::pushSuperpageToLink(Link& link, const Superpage& superpage)
276269 link.queue .push_back (superpage);
277270}
278271
279- void CruDmaChannel::transferSuperpageFromLinkToReady (Link& link, bool isPopped )
272+ void CruDmaChannel::transferSuperpageFromLinkToReady (Link& link)
280273{
281274 if (link.queue .empty ()) {
282275 BOOST_THROW_EXCEPTION (Exception () << ErrorInfo::Message (" Could not transfer Superpage from link to ready queue, link queue is empty" ));
283276 }
284277
285278 link.queue .front ().setReady (true );
286279
287- if (isPopped) {
288- link.queue .front ().setReceived (0x40 ); // Only RDH in case it's popped
280+ uint32_t superpageSize = getBar ()->getSuperpageSize (link.id );
281+ if (superpageSize == 0 ) {
282+ link.queue .front ().setReceived (link.queue .front ().getSize ()); // force the full superpage size for backwards compatibility
289283 } else {
290- uint32_t superpageSize = getBar ()->getSuperpageSize (link.id );
291- if (superpageSize == 0 ) {
292- link.queue .front ().setReceived (link.queue .front ().getSize ()); // force the full superpage size for backwards compatibility
293- } else {
294- link.queue .front ().setReceived (superpageSize);
295- }
284+ link.queue .front ().setReceived (superpageSize);
296285 }
297286
298287 mReadyQueue .push_back (link.queue .front ());
0 commit comments