From patchwork Fri May 20 16:30:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 68271 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3857722qge; Fri, 20 May 2016 08:52:17 -0700 (PDT) X-Received: by 10.140.19.174 with SMTP id 43mr4017643qgh.44.1463759537038; Fri, 20 May 2016 08:52:17 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h123si18707465qkd.147.2016.05.20.08.52.16; Fri, 20 May 2016 08:52:17 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id AA4C5616FA; Fri, 20 May 2016 15:52:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id B6A60617EC; Fri, 20 May 2016 15:35:24 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E40B8618C3; Fri, 20 May 2016 15:35:22 +0000 (UTC) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by lists.linaro.org (Postfix) with ESMTPS id 850F26180B for ; Fri, 20 May 2016 15:32:23 +0000 (UTC) Received: by mail-lb0-f181.google.com with SMTP id n11so36622156lbh.1 for ; Fri, 20 May 2016 08:32:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Qx5LwkC0iFs8mfbNs+Pm0BiJ0O+g7gQoIlE2Y90Wpq4=; b=a2WHzfORXmSv7jFeCm6DvBzRl7kxnNjgQo+iYrgbJxPI1h5BPkv2cenfSaLgTpBiOh M+R7Gc6GzzADWYS0VDBhGXias4d5Tdz4mbvyY6Bex6g7vtQTBrd92ari9y8gvzp6nfYK rAETcSaV4jUrveMEN4aRRIbCFwqs6UJ+7C2mn5xXqiCYmcjeQiokUpcbdFYZbd8wX2s5 /scCeSr3N1K2Nr8X7Fv2Ow44fZPNQ8Qla4IMtn0p3ZTHuoabp1f1pyrKcVR8bBWP3r3A qJRm6m58+MMgnB6RjCU47i92WEJFKXx0zq2M5Fjke76vuxE4PrXUdTTWcxga6Y/SXc03 Igng== X-Gm-Message-State: AOPr4FVxy9jJI+gvdURmiQA1+yD7WfDCt2kAHaUhQPJcZ/m4GiRRvsl0T3jIiIAsVN3gdtLGFnQ= X-Received: by 10.112.149.137 with SMTP id ua9mr1343635lbb.54.1463758342436; Fri, 20 May 2016 08:32:22 -0700 (PDT) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id tg1sm3348847lbb.7.2016.05.20.08.32.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 May 2016 08:32:21 -0700 (PDT) From: Christophe Milard To: maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Fri, 20 May 2016 18:30:37 +0200 Message-Id: <1463761851-37121-22-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463761851-37121-1-git-send-email-christophe.milard@linaro.org> References: <1463761851-37121-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv9 21/35] example: ipsec: using agnostic function for ODP threads X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" odp_ipsec is changed to use the implementation agnostic ODP thread create and join functions, from helpers. odp_ipsec is hence no longer aware on how the odpthread is implemented. Signed-off-by: Christophe Milard --- example/ipsec/odp_ipsec.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index e75db61..4d08772 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1047,12 +1047,12 @@ pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt, * - Sequence number assignment queue * - Per packet crypto API completion queue * - * @param arg Required by "odph_linux_pthread_create", unused + * @param arg Required by "odph_odpthreads_create", unused * * @return NULL (should never return) */ static -void *pktio_thread(void *arg EXAMPLE_UNUSED) +int pktio_thread(void *arg EXAMPLE_UNUSED) { int thr; odp_packet_t pkt; @@ -1203,7 +1203,7 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) } /* unreachable */ - return NULL; + return 0; } /** @@ -1212,7 +1212,7 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) int main(int argc, char *argv[]) { - odph_linux_pthread_t thread_tbl[MAX_WORKERS]; + odph_odpthread_t thread_tbl[MAX_WORKERS]; int num_workers; int i; int stream_count; @@ -1221,7 +1221,7 @@ main(int argc, char *argv[]) char cpumaskstr[ODP_CPUMASK_STR_SIZE]; odp_pool_param_t params; odp_instance_t instance; - odph_linux_thr_params_t thr_params; + odph_odpthread_params_t thr_params; /* create by default scheduled queues */ queue_create = odp_queue_create; @@ -1341,8 +1341,7 @@ main(int argc, char *argv[]) thr_params.arg = NULL; thr_params.thr_type = ODP_THREAD_WORKER; thr_params.instance = instance; - - odph_linux_pthread_create(thread_tbl, &cpumask, &thr_params); + odph_odpthreads_create(thread_tbl, &cpumask, &thr_params); /* * If there are streams attempt to verify them else @@ -1356,7 +1355,7 @@ main(int argc, char *argv[]) } while (!done); printf("All received\n"); } else { - odph_linux_pthread_join(thread_tbl, num_workers); + odph_odpthreads_join(thread_tbl); } free(args->appl.if_names);