From patchwork Wed Apr 8 06:28:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Badicioiu X-Patchwork-Id: 46865 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5C8F120553 for ; Wed, 8 Apr 2015 06:30:06 +0000 (UTC) Received: by laat2 with SMTP id t2sf16131997laa.2 for ; Tue, 07 Apr 2015 23:30:05 -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=asv2AIQdasSANbiYPr9MWwmzj/TWmN1P0w5HKcAg/Gw=; b=QNEcdSlnnNcuFOal9Yfb/b275Le8ZpPW9jkeiKhMuJdEwoskJitbytWstgdeTXdnaH 4OIyKNhMDmai3s78JQuEWiEIvU591T7pz1/Nv5ciZrMMeXaDTX3n/le/TRsoS4Vgiv9V UIfAzi/M91Z7VHjDC6LfPAXY2mf7092/c/loytxzf79ytJ7Yaz8uexDjz1Q3PxGT6t7S ER6iFkNRmQ7HtRtHF79pcgb/fPfy+uPiqKL96tS2ojjM6G6AJmlRhqK6PX20OvHm72PD C+uXtYwj0G+KJJx2s2Rxvs+Ri3wK29tisohzi0LxA4vULSDArJrwic3r9YrVm7G4OXxX z2vA== X-Gm-Message-State: ALoCoQlVHA/5BVy2c5F/fU0Rj8nfFJaKlTYiHHyMdrnBlgMFxj4gHJy4p7zF8mNw8gsmreDqvywj X-Received: by 10.180.11.101 with SMTP id p5mr1041196wib.3.1428474605367; Tue, 07 Apr 2015 23:30:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.38 with SMTP id w6ls138306laa.13.gmail; Tue, 07 Apr 2015 23:30:05 -0700 (PDT) X-Received: by 10.152.36.227 with SMTP id t3mr10334010laj.12.1428474605198; Tue, 07 Apr 2015 23:30:05 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id uo6si7942679lbc.21.2015.04.07.23.30.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 23:30:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbcga7 with SMTP id ga7so9739022lbc.1 for ; Tue, 07 Apr 2015 23:30:04 -0700 (PDT) X-Received: by 10.112.184.70 with SMTP id es6mr21299644lbc.117.1428474604570; Tue, 07 Apr 2015 23:30:04 -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 l1csp861973lbt; Tue, 7 Apr 2015 23:30:03 -0700 (PDT) X-Received: by 10.55.23.162 with SMTP id 34mr45254939qkx.76.1428474603338; Tue, 07 Apr 2015 23:30:03 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f132si8591762qhc.118.2015.04.07.23.30.01; Tue, 07 Apr 2015 23:30:03 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id B85D764F6F; Wed, 8 Apr 2015 06:30:01 +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 629DB64E31; Wed, 8 Apr 2015 06:29:59 +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 EBE3964F69; Wed, 8 Apr 2015 06:29:56 +0000 (UTC) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0070.outbound.protection.outlook.com [65.55.169.70]) by lists.linaro.org (Postfix) with ESMTPS id 5141164E31 for ; Wed, 8 Apr 2015 06:29:11 +0000 (UTC) Received: from CY1PR0301MB0604.namprd03.prod.outlook.com (25.160.142.23) by CY1PR0301MB0700.namprd03.prod.outlook.com (25.160.159.142) with Microsoft SMTP Server (TLS) id 15.1.125.19; Wed, 8 Apr 2015 06:29:10 +0000 Received: from DM2PR03CA0036.namprd03.prod.outlook.com (10.141.96.35) by CY1PR0301MB0604.namprd03.prod.outlook.com (0.160.142.23) with Microsoft SMTP Server (TLS) id 15.1.130.23; Wed, 8 Apr 2015 06:29:09 +0000 Received: from BN1BFFO11FD036.protection.gbl (2a01:111:f400:7c10::1:105) by DM2PR03CA0036.outlook.office365.com (2a01:111:e400:2428::35) with Microsoft SMTP Server (TLS) id 15.1.130.23 via Frontend Transport; Wed, 8 Apr 2015 06:29:09 +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 BN1BFFO11FD036.mail.protection.outlook.com (10.58.144.99) with Microsoft SMTP Server (TLS) id 15.1.136.16 via Frontend Transport; Wed, 8 Apr 2015 06:29:08 +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 t386T6cM019565; Tue, 7 Apr 2015 23:29:07 -0700 From: To: Date: Wed, 8 Apr 2015 09:28:24 +0300 Message-ID: <1428474504-30468-1-git-send-email-alexandru.badicioiu@linaro.org> X-Mailer: git-send-email 1.7.3.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130729481489563555; (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)(199003)(189002)(36756003)(47776003)(77096005)(110136001)(33646002)(104016003)(15975445007)(6806004)(50986999)(86362001)(77156002)(46102003)(62966003)(19580405001)(92566002)(87936001)(105596002)(106466001)(229853001)(19580395003)(86152002)(50226001)(48376002)(2351001)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0604; H:az84smr01.freescale.net; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB0604; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB0700; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002010)(5005006); SRVR:CY1PR0301MB0604; BCL:0; PCL:0; RULEID:(400005)(401004); SRVR:CY1PR0301MB0604; X-Forefront-PRVS: 0540846A1D X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2015 06:29:08.7067 (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: CY1PR0301MB0604 X-Topics: patch Subject: [lng-odp] [PATCH 1/1 v1] 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.217.173 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..86cfb7e 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++) {