diff mbox series

[v1,8/11] test: l2fwd: use multi conversion functions

Message ID 1517328009-16379-9-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v1,1/11] linux-gen: packet: use inlined flow hash set | expand

Commit Message

Github ODP bot Jan. 30, 2018, 4 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


Use multi versions of packet / event conversion functions.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
/** Email created from pull request 437 (psavol:master-packet-optim)
 ** https://github.com/Linaro/odp/pull/437
 ** Patch: https://github.com/Linaro/odp/pull/437.patch
 ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd
 ** Merge commit sha: ab7875c186fe80cfe103c5be5634b0eda312aed4
 **/
 test/performance/odp_l2fwd.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c
index 09a12b050..a2b9a9ca0 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -270,12 +270,10 @@  static inline int event_queue_send(odp_queue_t queue, odp_packet_t *pkt_tbl,
 				   unsigned pkts)
 {
 	int ret;
-	unsigned i;
 	unsigned sent = 0;
 	odp_event_t ev_tbl[pkts];
 
-	for (i = 0; i < pkts; i++)
-		ev_tbl[i] = odp_packet_to_event(pkt_tbl[i]);
+	odp_packet_to_event_multi(pkt_tbl, ev_tbl, pkts);
 
 	while (sent < pkts) {
 		ret = odp_queue_enq_multi(queue, &ev_tbl[sent], pkts - sent);
@@ -373,8 +371,7 @@  static int run_worker_sched_mode(void *arg)
 		if (pkts <= 0)
 			continue;
 
-		for (i = 0; i < pkts; i++)
-			pkt_tbl[i] = odp_packet_from_event(ev_tbl[i]);
+		odp_packet_from_event_multi(pkt_tbl, ev_tbl, pkts);
 
 		if (odp_unlikely(gbl_args->appl.extra_check)) {
 			if (gbl_args->appl.chksum)
@@ -499,8 +496,7 @@  static int run_worker_plain_queue_mode(void *arg)
 		if (odp_unlikely(pkts <= 0))
 			continue;
 
-		for (i = 0; i < pkts; i++)
-			pkt_tbl[i] = odp_packet_from_event(event[i]);
+		odp_packet_from_event_multi(pkt_tbl, event, pkts);
 
 		if (odp_unlikely(gbl_args->appl.extra_check)) {
 			if (gbl_args->appl.chksum)