From patchwork Tue Apr 1 16:39:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 27553 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7614B20553 for ; Tue, 1 Apr 2014 16:40:02 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id b57sf17587201eek.2 for ; Tue, 01 Apr 2014 09:40:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:to:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe:content-type; bh=6nf68CbKkiAyCpm9nfzR/5KOCiy/CRGLObV91F4CiA4=; b=ggVI4jtu80YAveLYgoQHPWA35uzMSFGa66OrOGU6a7F/yMy7azritGXsxkdj7Gw/pJ Yy4z1ExboS4TfDx8lefmPw22WyD2ga90TK/YgwBRM0rlJF/fRj8xcIzEgIk/KGlR4w5J Xhvr1F017vvvnz93d045n3GfSipXnquTHQXOcpNDP4de3DySif8cScgBt7X3HfYi3/Xb 9aurPSzjB3h48pZAfADehkxLZ8GGt+SrA5MsHc/zq6H/i6XiIkS3BcW9RksHHCwehkVt M6RFPifpx30BhzfBqmZqlgGS0nwrU0RhxGnZCIBjrQNTLkNSj0MT0YZ8l+mt80PoCqPP pLAg== X-Gm-Message-State: ALoCoQn0QedN2ZMaXaS/JSPaTyrcQejddKEQuK/VixZR7gTtzbx4ma0tbKVBNyRpfzMC2Rfwrk6+ X-Received: by 10.204.171.76 with SMTP id g12mr7268573bkz.2.1396370401368; Tue, 01 Apr 2014 09:40:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: lng-odp@linaro.org Received: by 10.152.3.201 with SMTP id e9ls20921lae.86.gmail; Tue, 01 Apr 2014 09:40:01 -0700 (PDT) X-Received: by 10.112.13.101 with SMTP id g5mr1862084lbc.39.1396370400958; Tue, 01 Apr 2014 09:40:00 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id c10si11179501lbv.63.2014.04.01.09.40.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 09:40:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.45 is neither permitted nor denied by best guess record for domain of maxim.uvarov@linaro.org) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id hr17so7294121lab.32 for ; Tue, 01 Apr 2014 09:40:00 -0700 (PDT) X-Received: by 10.112.171.67 with SMTP id as3mr22486508lbc.10.1396370400750; Tue, 01 Apr 2014 09:40:00 -0700 (PDT) Received: from maxim-lap.localhost.onion ([92.39.133.154]) by mx.google.com with ESMTPSA id fa8sm12457479lbc.18.2014.04.01.09.39.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 09:39:59 -0700 (PDT) From: Maxim Uvarov To: lng-odp@linaro.org Subject: [lng-odp] [PATCH] example_pktio: no need to provide pool to threads Date: Tue, 1 Apr 2014 20:39:55 +0400 Message-Id: <1396370395-1753-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.45 is neither permitted nor denied by best guess record for domain of maxim.uvarov@linaro.org) smtp.mail=maxim.uvarov@linaro.org Precedence: list Mailing-list: list lng-odp@linaro.org; contact lng-odp+owners@linaro.org List-ID: X-Google-Group-Id: 474323889996 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- test/packet/odp_example_pktio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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, ¶ms); + pktio = odp_pktio_open(thr_args->pktio_dev, pkt_pool, ¶ms); 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, ¶ms); + pktio = odp_pktio_open(thr_args->pktio_dev, pkt_pool, ¶ms); if (pktio == ODP_PKTIO_INVALID) { ODP_ERR(" [%02i] Error: pktio create failed.\n", thr); return NULL;