summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Liu <yong.liu@intel.com>2023-03-14 23:56:31 +0800
committerFlorin Coras <florin.coras@gmail.com>2023-03-14 16:40:41 +0000
commit48d2e15e3d5afa34ab75112a949dacc2759d472c (patch)
tree5702147fe271861e6e123b09fa8d637747c75257
parent738aba7b5150b1c78953a5cd59791fed2ab539ab (diff)
session: pre-alloc required dma batches
Specify the number of max_batches when applying for dma config. Skip this round when no batch available from vlib_dma_batch_new. Type: improvement Signed-off-by: Marvin Liu <yong.liu@intel.com> Change-Id: Ic6e0acf81ba4fc3ed33aea6ac6990ef841021c59
-rw-r--r--src/vnet/session/session.c1
-rw-r--r--src/vnet/session/session_node.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 3747c8719ed..fe05dd21f68 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -2023,6 +2023,7 @@ session_dma_completion_cb (vlib_main_t *vm, struct vlib_dma_batch *batch)
static void
session_prepare_dma_args (vlib_dma_config_t *args)
{
+ args->max_batches = 16;
args->max_transfers = DMA_TRANS_SIZE;
args->max_transfer_size = 65536;
args->features = 0;
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index c67d63fea80..f1a006722fe 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -1936,6 +1936,8 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
if (wrk->trans_head == ((wrk->trans_tail + 1) & (wrk->trans_size - 1)))
return 0;
wrk->batch = vlib_dma_batch_new (vm, wrk->config_index);
+ if (!wrk->batch)
+ return 0;
}
/*