From patchwork Thu Apr 2 08:37:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Badicioiu X-Patchwork-Id: 46707 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 42F16215A9 for ; Thu, 2 Apr 2015 08:37:40 +0000 (UTC) Received: by labtp8 with SMTP id tp8sf16555769lab.2 for ; Thu, 02 Apr 2015 01:37:39 -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=QzaYWhqM1BkbJ1DHAxas9grSMn/MTjl6KQFEMTSoJ8Wmad6gtQ9tUQhcXU/dMtPoxh kARM+DAZotsVXiqcina2CmxZcdgb/isoahwvufdQJL9wyRoOOfip20xOd2+mOUXekviD 6K3E3rTsKBsNF7Ggjyft4U03NyXsQ9yxDzVccKr+IWQiSDnmecuDu+mCMDTMC/ey4YJe 2837ijHROz5r2e+Cq4F8pyQc8/+hg5OmTqi9oPP3GKlQZZ9eD7V8woNvn+Vo3DTBwvLf tV1D8kyYmav9zfcc3E8rEN8ibIZdGWaF/am3f7amXxIMSuAtDDctwNnn+mlHFXXqdKWR UMmA== X-Gm-Message-State: ALoCoQkHcjI5xKpAFxqjgfVeL4h3pvPShKphMdELeSUiLDGgpK5yeOEMwgRIevHof5wW07kCwkO4 X-Received: by 10.112.235.70 with SMTP id uk6mr7723060lbc.24.1427963859228; Thu, 02 Apr 2015 01:37:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.133 with SMTP id w5ls182346lad.22.gmail; Thu, 02 Apr 2015 01:37:39 -0700 (PDT) X-Received: by 10.112.190.69 with SMTP id go5mr17821131lbc.74.1427963859075; Thu, 02 Apr 2015 01:37:39 -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 q8si3687027laq.28.2015.04.02.01.37.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Apr 2015 01:37:38 -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 lagg8 with SMTP id g8so55044230lag.1 for ; Thu, 02 Apr 2015 01:37:38 -0700 (PDT) X-Received: by 10.152.36.169 with SMTP id r9mr16438354laj.29.1427963858526; Thu, 02 Apr 2015 01:37:38 -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.57.201 with SMTP id k9csp1186855lbq; Thu, 2 Apr 2015 01:37:37 -0700 (PDT) X-Received: by 10.140.144.139 with SMTP id 133mr62811726qhq.1.1427963857296; Thu, 02 Apr 2015 01:37:37 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q31si4350427qkq.104.2015.04.02.01.37.36; Thu, 02 Apr 2015 01:37:37 -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 8D65F6507A; Thu, 2 Apr 2015 08:37:36 +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 684B26505B; Thu, 2 Apr 2015 08:37:33 +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 BCCA865060; Thu, 2 Apr 2015 08:37:32 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0093.outbound.protection.outlook.com [157.56.110.93]) by lists.linaro.org (Postfix) with ESMTPS id 33FB16505B for ; Thu, 2 Apr 2015 08:37:32 +0000 (UTC) Received: from BN3PR0301CA0032.namprd03.prod.outlook.com (25.160.180.170) by BY1PR0301MB1192.namprd03.prod.outlook.com (25.160.195.150) with Microsoft SMTP Server (TLS) id 15.1.118.21; Thu, 2 Apr 2015 08:37:29 +0000 Received: from BL2FFO11FD046.protection.gbl (2a01:111:f400:7c09::101) by BN3PR0301CA0032.outlook.office365.com (2a01:111:e400:4000::42) with Microsoft SMTP Server (TLS) id 15.1.125.19 via Frontend Transport; Thu, 2 Apr 2015 08:37:29 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD046.mail.protection.outlook.com (10.173.161.208) with Microsoft SMTP Server (TLS) id 15.1.130.10 via Frontend Transport; Thu, 2 Apr 2015 08:37:28 +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 t328bQlC028298; Thu, 2 Apr 2015 01:37:27 -0700 From: To: Date: Thu, 2 Apr 2015 11:37:00 +0300 Message-ID: <1427963820-11856-1-git-send-email-alexandru.badicioiu@linaro.org> X-Mailer: git-send-email 1.7.3.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130724374490174781; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 192.88.158.2 as permitted sender) X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(86152002)(47776003)(48376002)(104016003)(77096005)(50226001)(105596002)(229853001)(62966003)(77156002)(15975445007)(2351001)(106466001)(86362001)(50466002)(6806004)(110136001)(87936001)(19580395003)(50986999)(19580405001)(33646002)(46102003)(92566002)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0301MB1192; 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:BY1PR0301MB1192; 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:BY1PR0301MB1192; BCL:0; PCL:0; RULEID:(401004)(400005); SRVR:BY1PR0301MB1192; X-Forefront-PRVS: 0534947130 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2015 08:37:28.7990 (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: BY1PR0301MB1192 X-Topics: patch Subject: [lng-odp] [PATCH 1/1 v1] 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..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++) {