diff mbox

example_pktio: no need to provide pool to threads

Message ID 1396370395-1753-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Headers show

Commit Message

Maxim Uvarov April 1, 2014, 4:39 p.m. UTC
Packet pool can be found with odp_buffer_pool_lookup(),
no need to provide it to threads. Emphasize that in example.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 test/packet/odp_example_pktio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/test/packet/odp_example_pktio.c b/test/packet/odp_example_pktio.c
index 10190a0..8a13013 100644
--- a/test/packet/odp_example_pktio.c
+++ b/test/packet/odp_example_pktio.c
@@ -109,7 +109,7 @@  static void *pktio_queue_thread(void *arg)
 
 	/* Lookup the packet pool */
 	pkt_pool = odp_buffer_pool_lookup("packet_pool");
-	if (pkt_pool == ODP_BUFFER_POOL_INVALID) {
+	if (pkt_pool == ODP_BUFFER_POOL_INVALID || pkt_pool != thr_args->pool) {
 		ODP_ERR("  [%02i] Error: pkt_pool not found\n", thr);
 		return NULL;
 	}
@@ -117,7 +117,7 @@  static void *pktio_queue_thread(void *arg)
 	/* Open a packet IO instance for this thread */
 	sock_params->type = thr_args->type;
 	sock_params->fanout = thr_args->fanout;
-	pktio = odp_pktio_open(thr_args->pktio_dev, thr_args->pool, &params);
+	pktio = odp_pktio_open(thr_args->pktio_dev, pkt_pool, &params);
 	if (pktio == ODP_PKTIO_INVALID) {
 		ODP_ERR("  [%02i] Error: pktio create failed\n", thr);
 		return NULL;
@@ -222,7 +222,7 @@  static void *pktio_ifburst_thread(void *arg)
 
 	/* Lookup the packet pool */
 	pkt_pool = odp_buffer_pool_lookup("packet_pool");
-	if (pkt_pool == ODP_BUFFER_POOL_INVALID) {
+	if (pkt_pool == ODP_BUFFER_POOL_INVALID || pkt_pool != thr_args->pool) {
 		ODP_ERR("  [%02i] Error: pkt_pool not found\n", thr);
 		return NULL;
 	}
@@ -230,7 +230,7 @@  static void *pktio_ifburst_thread(void *arg)
 	/* Open a packet IO instance for this thread */
 	sock_params->type = thr_args->type;
 	sock_params->fanout = thr_args->fanout;
-	pktio = odp_pktio_open(thr_args->pktio_dev, thr_args->pool, &params);
+	pktio = odp_pktio_open(thr_args->pktio_dev, pkt_pool, &params);
 	if (pktio == ODP_PKTIO_INVALID) {
 		ODP_ERR("  [%02i] Error: pktio create failed.\n", thr);
 		return NULL;