]> git.droids-corp.org - dpdk.git/commitdiff
app/eventdev: use port quiescing
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Fri, 13 May 2022 17:58:40 +0000 (23:28 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 17 May 2022 14:43:30 +0000 (16:43 +0200)
Quiesce event ports used by the workers core on exit to free up
any outstanding resources.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
app/test-eventdev/test_perf_common.c
app/test-eventdev/test_pipeline_common.c

index b51a1004256b6b45d4b8326541515aabec0d1b12..8e3836280dea8767f3e659194dffbbf58a78179e 100644 (file)
@@ -985,6 +985,13 @@ perf_opt_dump(struct evt_options *opt, uint8_t nb_queues)
        evt_dump("prod_enq_burst_sz", "%d", opt->prod_enq_burst_sz);
 }
 
+static void
+perf_event_port_flush(uint8_t dev_id __rte_unused, struct rte_event ev,
+                     void *args)
+{
+       rte_mempool_put(args, ev.event_ptr);
+}
+
 void
 perf_worker_cleanup(struct rte_mempool *const pool, uint8_t dev_id,
                    uint8_t port_id, struct rte_event events[], uint16_t nb_enq,
@@ -1000,6 +1007,7 @@ perf_worker_cleanup(struct rte_mempool *const pool, uint8_t dev_id,
                        events[i].op = RTE_EVENT_OP_RELEASE;
                rte_event_enqueue_burst(dev_id, port_id, events, nb_deq);
        }
+       rte_event_port_quiesce(dev_id, port_id, perf_event_port_flush, pool);
 }
 
 void
index d8e80903b2152305950ce04c1e8fb884fe117e8e..c66656cd3997a1ff22fb05dd42f2fda021fbc8b4 100644 (file)
@@ -518,6 +518,16 @@ pipeline_vector_array_free(struct rte_event events[], uint16_t num)
        }
 }
 
+static void
+pipeline_event_port_flush(uint8_t dev_id __rte_unused, struct rte_event ev,
+                         void *args __rte_unused)
+{
+       if (ev.event_type & RTE_EVENT_TYPE_VECTOR)
+               pipeline_vector_array_free(&ev, 1);
+       else
+               rte_pktmbuf_free(ev.mbuf);
+}
+
 void
 pipeline_worker_cleanup(uint8_t dev, uint8_t port, struct rte_event ev[],
                        uint16_t enq, uint16_t deq)
@@ -542,6 +552,8 @@ pipeline_worker_cleanup(uint8_t dev, uint8_t port, struct rte_event ev[],
 
                rte_event_enqueue_burst(dev, port, ev, deq);
        }
+
+       rte_event_port_quiesce(dev, port, pipeline_event_port_flush, NULL);
 }
 
 void