dma_intel: fix dsa software fallback 36/42536/3
authorJeff Shaw <[email protected]>
Fri, 21 Mar 2025 15:00:17 +0000 (08:00 -0700)
committerFlorin Coras <[email protected]>
Fri, 28 Mar 2025 01:09:03 +0000 (01:09 +0000)
When a page fault occurs, and the "block on fault" flag is not set, the
DSA device reports the error in the completion descriptor and software
should complete the operation in software. This behavior works properly,
except the batch was not added to the list of pending batches, so the
DSA node failed to completely process the batch. The side effect is the
application callback is not called, so buffers are not freed, and the
batch is never added back to the freelist, leading to eventual buffer
exhaustion, and traffic stopping.

The fix is to make sure the batch is added to the list of pending
batches so the DSA node completes the batch. This change also removes
the line that increments the "submitted" counter as that is only used
to count batches that are submitted to hardware. A separate counter,
sw_fallback, is used to count batches that are handled in software.

Type: fix
Change-Id: Ib54e8d77ac02e5dca237bb9348440c3ddaad993b
Signed-off-by: Jeff Shaw <[email protected]>
src/plugins/dma_intel/dsa.c

index 473f2ef..20a90e3 100644 (file)
@@ -103,7 +103,6 @@ intel_dsa_batch_fallback (vlib_main_t *vm, intel_dsa_batch_t *b,
       clib_memcpy_fast (desc->dst, desc->src, desc->size);
     }
   b->status = INTEL_DSA_STATUS_CPU_SUCCESS;
-  ch->submitted++;
   return;
 }
 
@@ -407,6 +406,7 @@ intel_dsa_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node,
          /* fallback to software if exception happened */
          intel_dsa_batch_fallback (vm, b, ch);
          glitch = 1 & b->barrier_before_last;
+         t->pending_batches[n++] = b;
        }
       else
        {