vlib: pre-alloc dma backend batches

Allocate and initialize dma batch structure when adding dma config.
The number of required dma batches is set by max_batches parameter.
Thus dma batches are not allocated dynamically in worker thread.
Application need to check the return value of vlib_dma_batch_new.

Type: improvement

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Change-Id: I5d05a67b59634cf2862a377d5ab77cb1040343ce
This commit is contained in:
Marvin Liu
2023-03-14 23:43:28 +08:00
committed by Florin Coras
parent 0d712c1a96
commit 738aba7b51
2 changed files with 28 additions and 0 deletions

View File

@ -38,6 +38,7 @@ typedef struct
};
u32 features;
};
u16 max_batches;
u16 max_transfers;
u32 max_transfer_size;
vlib_dma_batch_callback_fn *callback_fn;