From patchwork Wed Jan 31 14:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126354 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp780227ljc; Wed, 31 Jan 2018 06:27:17 -0800 (PST) X-Google-Smtp-Source: AH8x226SjG9xBLCvTLAHFZ2NinsFnaMD92C1hyEOzSyusCvWK70+gwRFQh+nGW7LDQvYWMiK5Uca X-Received: by 10.200.26.69 with SMTP id q5mr49621865qtk.174.1517408837469; Wed, 31 Jan 2018 06:27:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517408837; cv=none; d=google.com; s=arc-20160816; b=tOHhtyX5abFdqh3gOXXEtUQhk1g3Tu/JX1ybMNESs2dz16OdjFpmKtDEo/gwU6/+Zr 1uShRPewtSynMQKA+DZ+qz8LhWzs9c9lq1AXnIuOj5BRWZXRLvQV3N7TVl8MOVertDLV a4x/BzP83E8xhYwAMyOpqWlkw/NZpO0E3jM7xOJsb3o2IpHQy5Vhk4+sQbU3/avFe5mX 4jLUZGPGpv1TlfnubtQQdBm9ZJ4aQdaGXWmzT1j4JneRaseBpbZUk59Bx/LnSE3iVhED 8HecgfHyxruUM8r5+6SF2vVNBJhblNXgcexaan8p+woTuF4rj2LCYrsxUTMEYnWNkKRi 45+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=hfVKnvR/qstaioUOd0AJazfR2OW0781/h4x6Soy1fPs=; b=bCiQ95siPmjYLv5uHYcazf8wRVIxPYjFx/ZQ0hTBKF4C6yHUl+5RRY7p+KuIZeC0hl QauW5Dp+UHZLnPrrIRFQCcjRj+4eX3MucdxI12BqkGQ3qi/u/ZmlbtZymoGEyvKgSCIv B6J0zvOgbN3GlLHgX3i0JV+VCLItr4SQXM0aDS6Xp8OkGkXxCOM4WGyxDtjUr4NoXWXr SaNCqNG5M9u7bxoGugVWIXqX0+dnHduqUHASjBGcI6VYeR9BhY6FeNbu5DanS63/Slwu PuWUSRt1gvfBX5XJbQGLHLHCLDeCCcXbXK7+nm5IirQUW+GpDAZ1tlI/2/43a5IEBMKM SO6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id v33si2614119qtc.225.2018.01.31.06.27.17; Wed, 31 Jan 2018 06:27:17 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 2C6B7617E2; Wed, 31 Jan 2018 14:27:17 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 960B5617A1; Wed, 31 Jan 2018 14:07:39 +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 EB248617A5; Wed, 31 Jan 2018 14:07:34 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 97C18616E5 for ; Wed, 31 Jan 2018 14:01:53 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 6689144459FB for ; Wed, 31 Jan 2018 17:00:18 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id dur8H5Zslc-0IwuhjJb; Wed, 31 Jan 2018 17:00:18 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nmVaH0g7bK-0HVioZFm; Wed, 31 Jan 2018 17:00:18 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 17:00:08 +0300 Message-Id: <1517407211-19105-9-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517407211-19105-1-git-send-email-odpbot@yandex.ru> References: <1517407211-19105-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 437 Subject: [lng-odp] [PATCH v2 8/11] test: l2fwd: use multi conversion functions 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Use multi versions of packet / event conversion functions. Signed-off-by: Petri Savolainen --- /** Email created from pull request 437 (psavol:master-packet-optim) ** https://github.com/Linaro/odp/pull/437 ** Patch: https://github.com/Linaro/odp/pull/437.patch ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd ** Merge commit sha: 3c2134ecc18e4fd52cd526b5c067815ca73864cc **/ test/performance/odp_l2fwd.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 09a12b050..a2b9a9ca0 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -270,12 +270,10 @@ static inline int event_queue_send(odp_queue_t queue, odp_packet_t *pkt_tbl, unsigned pkts) { int ret; - unsigned i; unsigned sent = 0; odp_event_t ev_tbl[pkts]; - for (i = 0; i < pkts; i++) - ev_tbl[i] = odp_packet_to_event(pkt_tbl[i]); + odp_packet_to_event_multi(pkt_tbl, ev_tbl, pkts); while (sent < pkts) { ret = odp_queue_enq_multi(queue, &ev_tbl[sent], pkts - sent); @@ -373,8 +371,7 @@ static int run_worker_sched_mode(void *arg) if (pkts <= 0) continue; - for (i = 0; i < pkts; i++) - pkt_tbl[i] = odp_packet_from_event(ev_tbl[i]); + odp_packet_from_event_multi(pkt_tbl, ev_tbl, pkts); if (odp_unlikely(gbl_args->appl.extra_check)) { if (gbl_args->appl.chksum) @@ -499,8 +496,7 @@ static int run_worker_plain_queue_mode(void *arg) if (odp_unlikely(pkts <= 0)) continue; - for (i = 0; i < pkts; i++) - pkt_tbl[i] = odp_packet_from_event(event[i]); + odp_packet_from_event_multi(pkt_tbl, event, pkts); if (odp_unlikely(gbl_args->appl.extra_check)) { if (gbl_args->appl.chksum)