X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fdmadev%2Frte_dmadev.c;h=d4b32b2971b0019ff937ba0ad4dcc67fc959d34e;hb=6e858b4d9244cf53505589673755ab18ac2a4a83;hp=3f9154e61902a223d33edf17fa3700fdfc7505d1;hpb=5e0f85912754bf0d50c940165c40cac68e7c762f;p=dpdk.git diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 3f9154e619..d4b32b2971 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -18,7 +18,7 @@ static int16_t dma_devices_max; struct rte_dma_fp_object *rte_dma_fp_objs; -struct rte_dma_dev *rte_dma_devices; +static struct rte_dma_dev *rte_dma_devices; static struct { /* Hold the dev_max information of the primary process. This field is * set by the primary process and is read by the secondary process. @@ -49,6 +49,19 @@ rte_dma_dev_max(size_t dev_max) return 0; } +int16_t +rte_dma_next_dev(int16_t start_dev_id) +{ + int16_t dev_id = start_dev_id; + while (dev_id < dma_devices_max && rte_dma_devices[dev_id].state == RTE_DMA_DEV_UNUSED) + dev_id++; + + if (dev_id < dma_devices_max) + return dev_id; + + return -1; +} + static int dma_check_name(const char *name) { @@ -709,6 +722,7 @@ dma_capability_name(uint64_t capability) { RTE_DMA_CAPA_DEV_TO_DEV, "dev2dev" }, { RTE_DMA_CAPA_SVA, "sva" }, { RTE_DMA_CAPA_SILENT, "silent" }, + { RTE_DMA_CAPA_HANDLES_ERRORS, "handles_errors" }, { RTE_DMA_CAPA_OPS_COPY, "copy" }, { RTE_DMA_CAPA_OPS_COPY_SG, "copy_sg" }, { RTE_DMA_CAPA_OPS_FILL, "fill" }, @@ -830,6 +844,14 @@ dummy_completed_status(__rte_unused void *dev_private, return 0; } +static uint16_t +dummy_burst_capacity(__rte_unused const void *dev_private, + __rte_unused uint16_t vchan) +{ + RTE_DMA_LOG(ERR, "burst_capacity is not configured or not supported."); + return 0; +} + static void dma_fp_object_dummy(struct rte_dma_fp_object *obj) { @@ -840,4 +862,5 @@ dma_fp_object_dummy(struct rte_dma_fp_object *obj) obj->submit = dummy_submit; obj->completed = dummy_completed; obj->completed_status = dummy_completed_status; + obj->burst_capacity = dummy_burst_capacity; }