From 11621ca68dd4150dfbe042956921ede7cbb33ac8 Mon Sep 17 00:00:00 2001 From: Jeff Shaw Date: Fri, 21 Mar 2025 08:00:17 -0700 Subject: dma_intel: fix dsa software fallback 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 --- src/plugins/dma_intel/dsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/dma_intel/dsa.c b/src/plugins/dma_intel/dsa.c index 473f2efa93e..20a90e34b0e 100644 --- a/src/plugins/dma_intel/dsa.c +++ b/src/plugins/dma_intel/dsa.c @@ -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 { -- cgit