From patchwork Mon Oct 9 14:00:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 115252 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp2425951edb; Mon, 9 Oct 2017 07:13:34 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCR0o3Y9LdfqfEMJxYfm9OAsxIphmHn2qgJqhuMbSQAV81YT/wXRDvr3EGllBd4dSr6l/vU X-Received: by 10.36.51.212 with SMTP id k203mr14618479itk.74.1507558413888; Mon, 09 Oct 2017 07:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507558413; cv=none; d=google.com; s=arc-20160816; b=G46N0AZ6zcTCZvjdxKTrT0IzNIVYXsszEVxj+wmegzJdzYxBhei1qXsPo1c0k9d3AX ilCBGziEbEKa4HmtBtA6JmqmveEnZ/jCI2dlDGtOhNmc3yOM1X0YTAaN0bbnBlmJQMDQ ZcYA//jaO75QpL85I0ai/OH+6Elik39uyKM/xAmh/iShdH32BdKLnHO/SPDBztEr4Lj6 s4G+N5HQkng9JWr9s8hgf+v4lV7r30D9HL2h6nMn3AqRuQC90l6lvhvHB1lruVHfUjbT x4qji/GRqWg+B2pcDhgamz2dANVFcax7owt/w3NOBQh3wSmeYc05u05p0szDk9ONYo6q pgdA== 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=7qoJUSAyB3hdYBVTyGQUdmi4hgof8rnWNm+G5JxwW5U=; b=fnd5gbDQDt+E8EHBrDXP9Uthmvkp6zqPPbvXwotyOjgkkjyuOWdg3dPYlbEAW/D/YA ixdmVVdilaOjKWG/eh19LdjAhltXkxDcwqVrOFRyRbwVied8ImM4My/Zw1aG4EkcrvwK YGD+YNJre96ymwCIGStAODcFJDSKqJ7ePbt6ggDsMapvqIL6nE0tHnYZq1YBnkLqB1Pc 28cpWsW7ABRMyw0HpcTaHV6NVo2XhYiE7THbAsHOaBZQVH36gPgbFscdb9/7Fe4CHAm5 5B12DpN07mNLbRM/+8i9L/hqlUjzxJMsfONWjvIWA1a3oxGi9jcHYtKZAXeo2oa2PENa p2Hw== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b186si266291ioa.28.2017.10.09.07.13.33; Mon, 09 Oct 2017 07:13:33 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 5DE4A60C29; Mon, 9 Oct 2017 14:13:33 +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,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 A269860BFB; Mon, 9 Oct 2017 14:03:26 +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 4AF9B60B4E; Mon, 9 Oct 2017 14:03:00 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id F1AF860AF4 for ; Mon, 9 Oct 2017 14:00:59 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 8C95F218439D for ; Mon, 9 Oct 2017 17:00:58 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 1nxWGZzInK-0woaA37g; Mon, 09 Oct 2017 17:00:58 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id wSTIYzb9Br-0vdKSmGb; Mon, 09 Oct 2017 17:00:57 +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: Mon, 9 Oct 2017 17:00:16 +0300 Message-Id: <1507557617-32018-13-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507557617-32018-1-git-send-email-odpbot@yandex.ru> References: <1507557617-32018-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 188 Subject: [lng-odp] [PATCH v3 12/13] test: make odp_pktio_perf more scalable 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: Ola Liljedahl Amortise overhead of atomic increment over multiple packets so to minimise this scalability bottleneck. Signed-off-by: Ola Liljedahl Reviewed-by: Brian Brooks Reviewed-by: Bill Fischofer Signed-off-by: Maxim Uvarov Jira: ENTNET-487 Change-Id: Idefb23da5d9b9b9c2c82eb46533cdf82dc19442e --- /** Email created from pull request 188 (WonderfulVoid:master) ** https://github.com/Linaro/odp/pull/188 ** Patch: https://github.com/Linaro/odp/pull/188.patch ** Base sha: c16af6486eea240609f334b1bdc81a11404275de ** Merge commit sha: 4ad1d0615a4dcd74d4e9703090149eec1a58d7d2 **/ test/common_plat/performance/odp_pktio_perf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/common_plat/performance/odp_pktio_perf.c b/test/common_plat/performance/odp_pktio_perf.c index a170e1285..210a833fe 100644 --- a/test/common_plat/performance/odp_pktio_perf.c +++ b/test/common_plat/performance/odp_pktio_perf.c @@ -167,14 +167,13 @@ static test_globals_t *gbl_args; /* * Generate a single test packet for transmission. */ -static odp_packet_t pktio_create_packet(void) +static odp_packet_t pktio_create_packet(uint32_t seq) { odp_packet_t pkt; odph_ethhdr_t *eth; odph_ipv4hdr_t *ip; odph_udphdr_t *udp; char *buf; - uint16_t seq; uint32_t offset; pkt_head_t pkt_hdr; size_t payload_len; @@ -209,7 +208,6 @@ static odp_packet_t pktio_create_packet(void) ODPH_IPV4HDR_LEN); ip->ttl = 128; ip->proto = ODPH_IPPROTO_UDP; - seq = odp_atomic_fetch_inc_u32(&ip_seq); ip->id = odp_cpu_to_be_16(seq); ip->chksum = 0; odph_ipv4_csum_update(pkt); @@ -263,9 +261,11 @@ static int pktio_pkt_has_magic(odp_packet_t pkt) static int alloc_packets(odp_packet_t *pkt_tbl, int num_pkts) { int n; + uint16_t seq; + seq = odp_atomic_fetch_add_u32(&ip_seq, num_pkts); for (n = 0; n < num_pkts; ++n) { - pkt_tbl[n] = pktio_create_packet(); + pkt_tbl[n] = pktio_create_packet(seq + n); if (pkt_tbl[n] == ODP_PACKET_INVALID) break; }