From patchwork Fri Apr 10 06:33:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Badicioiu X-Patchwork-Id: 46992 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CC9DD218D9 for ; Fri, 10 Apr 2015 06:34:54 +0000 (UTC) Received: by wiaa2 with SMTP id a2sf2499863wia.1 for ; Thu, 09 Apr 2015 23:34:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:mime-version:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=4LqM9WDLO1hUZrNZb3lTu5ep/toNS5jVumHBokvaNsM=; b=PVdGcdmytm1/QfxjAysaNo3qI4RhIEUMuGUWn7XRy7o+1TAq/jLX0X7xKgLOPvq4oP RoIoezgBJWBxFSXWgCEjs3YQNpdqpmgKCygKjg9VOyGgKgkumpVXY4kv+QcWwcO17rPG j8Gsgo2hqTgQYpWASmOvq9JDMMGO5qIgfTHTre8/1Tl6gAzqzJRPtYoAv6SZoHCLZi9e bhCaQqY1ivlBRRnl0bpCG1Ap5o9bA6SLQpii/ngS7abOgIKuJJ26LlZ9y/qVBIjQrQO9 JXsoh7J9vCHrWNiMVdkb/2hpBZBsz/zSGCMexAKVVmyr1r88V5Wz+b390BasH1kndkk2 367A== X-Gm-Message-State: ALoCoQmcctUKpMKheQmNuJVv/Z1NZNmnlJt2yT2q3J4XBPvdo+c7Y1ZBdVWOJoPs3dAj5t2LvsWg X-Received: by 10.180.105.226 with SMTP id gp2mr1190052wib.1.1428647693735; Thu, 09 Apr 2015 23:34:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.2 with SMTP id ci2ls375653lad.38.gmail; Thu, 09 Apr 2015 23:34:53 -0700 (PDT) X-Received: by 10.152.5.134 with SMTP id s6mr71530las.6.1428647693434; Thu, 09 Apr 2015 23:34:53 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id hh3si741640lbb.16.2015.04.09.23.34.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Apr 2015 23:34:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by layy10 with SMTP id y10so6402298lay.0 for ; Thu, 09 Apr 2015 23:34:53 -0700 (PDT) X-Received: by 10.112.162.232 with SMTP id yd8mr30085lbb.41.1428647693021; Thu, 09 Apr 2015 23:34:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp900114lbt; Thu, 9 Apr 2015 23:34:52 -0700 (PDT) X-Received: by 10.140.238.79 with SMTP id j76mr24876qhc.83.1428647691573; Thu, 09 Apr 2015 23:34:51 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id fb7si994808qcb.28.2015.04.09.23.34.50; Thu, 09 Apr 2015 23:34:51 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 803E8650CE; Fri, 10 Apr 2015 06:34:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id ED830650BE; Fri, 10 Apr 2015 06:34:46 +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 6EFED650CC; Fri, 10 Apr 2015 06:34:45 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0086.outbound.protection.outlook.com [157.56.110.86]) by lists.linaro.org (Postfix) with ESMTPS id D6F6A650BE for ; Fri, 10 Apr 2015 06:34:44 +0000 (UTC) Received: from BY2PR03MB255.namprd03.prod.outlook.com (10.242.37.22) by BY2PR03MB554.namprd03.prod.outlook.com (10.141.141.156) with Microsoft SMTP Server (TLS) id 15.1.118.21; Fri, 10 Apr 2015 06:34:40 +0000 Received: from BY2PR03CA051.namprd03.prod.outlook.com (10.141.249.24) by BY2PR03MB255.namprd03.prod.outlook.com (10.242.37.22) with Microsoft SMTP Server (TLS) id 15.1.136.17; Fri, 10 Apr 2015 06:34:39 +0000 Received: from BN1AFFO11FD005.protection.gbl (2a01:111:f400:7c10::100) by BY2PR03CA051.outlook.office365.com (2a01:111:e400:2c5d::24) with Microsoft SMTP Server (TLS) id 15.1.136.25 via Frontend Transport; Fri, 10 Apr 2015 06:34:39 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 192.88.158.2 as permitted sender) Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD005.mail.protection.outlook.com (10.58.52.65) with Microsoft SMTP Server (TLS) id 15.1.142.12 via Frontend Transport; Fri, 10 Apr 2015 06:34:38 +0000 Received: from fsr-fed1364-15.ea.freescale.net (fsr-fed1364-15.ea.freescale.net [10.171.81.144]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t3A6YaM1017701; Thu, 9 Apr 2015 23:34:37 -0700 From: To: Date: Fri, 10 Apr 2015 09:33:46 +0300 Message-ID: <1428647626-3335-1-git-send-email-alexandru.badicioiu@linaro.org> X-Mailer: git-send-email 1.7.3.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130731212787595206; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(189002)(199003)(110136001)(15975445007)(86362001)(46102003)(106466001)(77096005)(229853001)(50986999)(36756003)(77156002)(104016003)(62966003)(50226001)(87936001)(33646002)(48376002)(2351001)(47776003)(50466002)(19580405001)(19580395003)(92566002)(6806004)(105596002)(86152002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB255; H:az84smr01.freescale.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB255; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB554; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:BY2PR03MB255; BCL:0; PCL:0; RULEID:(401004)(400005); SRVR:BY2PR03MB255; X-Forefront-PRVS: 054231DC40 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2015 06:34:38.5255 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB255 X-Topics: patch Subject: [lng-odp] [PATCH 1/1 v2] examples: odp_ipsec: runtime select multiple vs single deq X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alexandru.badicioiu@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Alexandru Badicioiu Signed-off-by: Alexandru Badicioiu --- example/ipsec/odp_ipsec.c | 3 +++ example/ipsec/odp_ipsec_stream.c | 27 +++++++++++---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 9fb048a..cb8f535 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1498,6 +1498,9 @@ static void usage(char *progname) " can be used to advanced pkt I/O selection for linux-generic\n" " ODP_IPSEC_USE_POLL_QUEUES\n" " to enable use of poll queues instead of scheduled (default)\n" + " ODP_IPSEC_STREAM_VERIFY_MDEQ\n" + " to enable use of multiple dequeue for queue draining during\n" + " stream verification instead of single dequeue (default)\n" "\n", NO_PATH(progname), NO_PATH(progname) ); } diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index ed07355..35042f5 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -28,14 +28,6 @@ #define STREAM_MAGIC 0xBABE01234567CAFE -/** - * Control use of odp_queue_deq versus odp_queue_deq_multi - * when draining stream output queues - * - * @todo Make this command line driven versus compile time - * (see https://bugs.linaro.org/show_bug.cgi?id=626) - */ -#define LOOP_DEQ_MULTIPLE 0 /**< enable multi packet dequeue */ #define LOOP_DEQ_COUNT 32 /**< packets to dequeue at once */ /** @@ -517,7 +509,9 @@ odp_bool_t verify_stream_db_outputs(void) { odp_bool_t done = TRUE; stream_db_entry_t *stream = NULL; + const char *env; + env = getenv("ODP_IPSEC_STREAM_VERIFY_MDEQ"); /* For each stream look for output packets */ for (stream = stream_db->list; NULL != stream; stream = stream->next) { int idx; @@ -531,14 +525,15 @@ odp_bool_t verify_stream_db_outputs(void) continue; for (;;) { -#if LOOP_DEQ_MULTIPLE - count = odp_queue_deq_multi(queue, - ev_tbl, - LOOP_DEQ_COUNT); -#else - ev_tbl[0] = odp_queue_deq(queue); - count = (ev_tbl[0] != ODP_EVENT_INVALID) ? 1 : 0; -#endif + if (env) { + count = odp_queue_deq_multi(queue, + ev_tbl, + LOOP_DEQ_COUNT); + } else { + ev_tbl[0] = odp_queue_deq(queue); + count = (ev_tbl[0] != ODP_EVENT_INVALID) ? + 1 : 0; + } if (!count) break; for (idx = 0; idx < count; idx++) {