On Fri, Sep 29, 2023 at 9:46 AM Amit Prakash Shukla
<amitpraka...@marvell.com> wrote:
>
> Added testsuite to test the dma adapter functionality.
> The testsuite detects event and DMA device capability
> and accordingly dma adapter is configured and modes are
> tested. Test command:
>
> <build dir>/app/test/dpdk-test event_dma_adapter_autotest

Use the below command with SW driver so that anyone can run it.

>
> Signed-off-by: Amit Prakash Shukla <amitpraka...@marvell.com>

sudo ./build/app/test/dpdk-test --vdev=dma_skeleton event_dma_adapter_autotest
There are failures with above as skelton dmadev does not support SG
and most of remaining drivers. So please change to following.

[for-main]dell[dpdk-next-eventdev] $ git diff
diff --git a/lib/eventdev/rte_event_dma_adapter.c
b/lib/eventdev/rte_event_dma_adapter.c
index 4899bc5d0f..bbdfd3daa6 100644
--- a/lib/eventdev/rte_event_dma_adapter.c
+++ b/lib/eventdev/rte_event_dma_adapter.c
@@ -256,8 +256,13 @@ edma_circular_buffer_flush_to_dma_dev(struct
event_dma_adapter *adapter,

        for (i = 0; i < n; i++) {
                op = bufp->op_buffer[*head];
-               ret = rte_dma_copy_sg(dma_dev_id, vchan, op->src_seg,
op->dst_seg,
-                                     op->nb_src, op->nb_dst, op->flags);
+               if (op->nb_src == 1 && op->nb_dst == 1)
+                       ret = rte_dma_copy(dma_dev_id, vchan,
op->src_seg->addr, op->dst_seg->addr,
+                               op->src_seg->length, op->flags);
+               else
+                       ret = rte_dma_copy_sg(dma_dev_id, vchan,
op->src_seg, op->dst_seg,
+                               op->nb_src, op->nb_dst, op->flags);
+

With above change all test cases are pasiing on skelton device.

[for-main]dell[dpdk-next-eventdev] $ sudo ./build/app/test/dpdk-test
--vdev=dma_skeleton event_dma_adapter_autotest
EAL: Detected CPU lcores: 56
EAL: Detected NUMA nodes: 2
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
skeldma_probe(): Create dma_skeleton dmadev with lcore-id -1
APP: HPET is not enabled, using TSC as default timer
RTE>>event_dma_adapter_autotest
 + ------------------------------------------------------- +
 + Test Suite : Event dma adapter test suite
 + ------------------------------------------------------- +
 + TestCase [ 0] : test_dma_adapter_create succeeded
 + TestCase [ 1] : test_dma_adapter_vchan_add_del succeeded
 +------------------------------------------------------+
 + DMA adapter stats for instance 0:
 + Event port poll count         0x0
 + Event dequeue count           0x0
 + DMA dev enqueue count         0x0
 + DMA dev enqueue failed count  0x0
 + DMA dev dequeue count         0x0
 + Event enqueue count           0x0
 + Event enqueue retry count     0x0
 + Event enqueue fail count      0x0
 +------------------------------------------------------+
 + TestCase [ 2] : test_dma_adapter_stats succeeded
 + TestCase [ 3] : test_dma_adapter_params succeeded
 +------------------------------------------------------+
 + DMA adapter stats for instance 0:
 + Event port poll count         0xc5df
 + Event dequeue count           0x20
 + DMA dev enqueue count         0x20
 + DMA dev enqueue failed count  0x0
 + DMA dev dequeue count         0x20
 + Event enqueue count           0x20
 + Event enqueue retry count     0x0
 + Event enqueue fail count      0x0
 +------------------------------------------------------+
 + TestCase [ 4] : test_with_op_forward_mode succeeded
EVENTDEV: rte_event_dev_stop() line 1427: Device with dev_id=0already stopped
 + ------------------------------------------------------- +
 + Test Suite Summary : Event dma adapter test suite
 + ------------------------------------------------------- +
 + Tests Total :        5
 + Tests Skipped :      0
 + Tests Executed :     5
 + Tests Unsupported:   0
 + Tests Passed :       5
 + Tests Failed :       0
 + ------------------------------------------------------- +
Test OK
RTE>>skeldma_remove(): Remove dma_skeleton dmadev



# Please fix the second warning  by using rte_strscpy

[for-main]dell[dpdk-next-eventdev] $ ./devtools/checkpatches.sh -n 12
&& ./devtools/check-git-log.sh -n 12

### [PATCH] eventdev/dma: support adapter create and free

WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements
should be avoided
#60: FILE: lib/eventdev/rte_event_dma_adapter.c:19:
+#define EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) \
+       do { \
+               if (!edma_adapter_valid_id(id)) { \
+                       RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d\n", id); \
+                       return retval; \
+               } \
+       } while (0)

WARNING:STRCPY: Prefer strscpy over strcpy - see:
https://github.com/KSPP/linux/issues/88
#302: FILE: lib/eventdev/rte_event_dma_adapter.c:261:
+       strcpy(adapter->mem_name, name);

total: 0 errors, 2 warnings, 349 lines checked

Rest of the chages looks good to me. Good to merge next version.

Reply via email to