From: Pavan Nikhilesh <pbhagavat...@marvell.com> When in OP_FWD mode the DMA completion response should use the `rte_event_dma_adapter_op::event_meta` to inject the completion event.
Bugzilla ID: 1469 Fixes: 588dcac23610 ("eventdev/dma: reorganize event DMA ops") Signed-off-by: Pavan Nikhilesh <pbhagavat...@marvell.com> --- app/test/test_event_dma_adapter.c | 10 +++++++--- lib/eventdev/rte_event_dma_adapter.c | 1 + lib/eventdev/rte_event_dma_adapter.h | 11 ++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/test/test_event_dma_adapter.c b/app/test/test_event_dma_adapter.c index d9dff4ff7d..3b39521153 100644 --- a/app/test/test_event_dma_adapter.c +++ b/app/test/test_event_dma_adapter.c @@ -61,7 +61,8 @@ struct rte_event dma_response_info = { .queue_id = TEST_APP_EV_QUEUE_ID, .sched_type = RTE_SCHED_TYPE_ATOMIC, .flow_id = TEST_APP_EV_FLOWID, - .priority = TEST_APP_EV_PRIORITY + .priority = TEST_APP_EV_PRIORITY, + .op = RTE_EVENT_OP_NEW, }; static struct event_dma_adapter_test_params params; @@ -263,10 +264,12 @@ test_op_forward_mode(void) op->op_mp = params.op_mpool; op->dma_dev_id = TEST_DMA_DEV_ID; op->vchan = TEST_DMA_VCHAN_ID; + op->event_meta = dma_response_info.event; /* Fill in event info and update event_ptr with rte_event_dma_adapter_op */ memset(&ev[i], 0, sizeof(struct rte_event)); ev[i].event = 0; + ev[i].op = RTE_EVENT_OP_NEW; ev[i].event_type = RTE_EVENT_TYPE_DMADEV; ev[i].queue_id = TEST_DMA_EV_QUEUE_ID; ev[i].sched_type = RTE_SCHED_TYPE_ATOMIC; @@ -574,10 +577,11 @@ configure_event_dma_adapter(enum rte_event_dma_adapter_mode mode) ret = rte_event_dma_adapter_create(TEST_ADAPTER_ID, evdev, &conf, mode); TEST_ASSERT_SUCCESS(ret, "Failed to create event dma adapter\n"); - if (cap & RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_VCHAN_EV_BIND) { + event.event = dma_response_info.event; + if (cap & RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_VCHAN_EV_BIND) ret = rte_event_dma_adapter_vchan_add(TEST_ADAPTER_ID, TEST_DMA_DEV_ID, TEST_DMA_VCHAN_ID, &event); - } else + else ret = rte_event_dma_adapter_vchan_add(TEST_ADAPTER_ID, TEST_DMA_DEV_ID, TEST_DMA_VCHAN_ID, NULL); diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c index e52ef46a1b..ff2bc408c1 100644 --- a/lib/eventdev/rte_event_dma_adapter.c +++ b/lib/eventdev/rte_event_dma_adapter.c @@ -666,6 +666,7 @@ edma_ops_enqueue_burst(struct event_dma_adapter *adapter, struct rte_event_dma_a ev->op = RTE_EVENT_OP_FORWARD; else ev->op = RTE_EVENT_OP_NEW; + ev->event = ops[i]->event_meta; } do { diff --git a/lib/eventdev/rte_event_dma_adapter.h b/lib/eventdev/rte_event_dma_adapter.h index 048ddba3f3..768390cd30 100644 --- a/lib/eventdev/rte_event_dma_adapter.h +++ b/lib/eventdev/rte_event_dma_adapter.h @@ -179,8 +179,17 @@ struct rte_event_dma_adapter_op { * The dma device implementation should not modify this area. */ uint64_t event_meta; - /**< Event metadata that defines event attributes when used in OP_NEW mode. + /**< Event metadata of DMA completion event. + * Used when RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_VCHAN_EV_BIND is not + * supported in OP_NEW mode. * @see rte_event_dma_adapter_mode::RTE_EVENT_DMA_ADAPTER_OP_NEW + * @see RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_VCHAN_EV_BIND + * + * Used when RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_OP_FWD is not + * supported in OP_FWD mode. + * @see rte_event_dma_adapter_mode::RTE_EVENT_DMA_ADAPTER_OP_FORWARD + * @see RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_OP_FWD + * * @see struct rte_event::event */ int16_t dma_dev_id; -- 2.25.1