From patchwork Mon Oct 9 15:00:14 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: 115258 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2653489qgn; Mon, 9 Oct 2017 08:01:51 -0700 (PDT) X-Google-Smtp-Source: AOwi7QD+GiHrtEVLnSo703a8WaMdg3QJpMwv0mtbTj7bVyRzmLwUr6MPjfoOnrnzBon09ZsXUPJ5 X-Received: by 10.36.107.146 with SMTP id v140mr14863545itc.95.1507561311065; Mon, 09 Oct 2017 08:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507561311; cv=none; d=google.com; s=arc-20160816; b=pCU9zmc28qCAA1kSjZzhrXJzrktVwsk77DFFTUEsnB74an93ppa9asJbPWLBHl9rSV hnIJvt5qjiq6EorNLBeb5Wu1zr2fS0gHNudeJUnb/LY/YBjR6r1zOc8TgBCx3b0nx4L6 pIzSFZj+NeP4hFm+4X9EMEM4TFye4vsf7y2TRY6pUd4UnXsW2v8Ql8z4cM7bOcBJR7Bi V+/3L7tM70d6qXp1rEM79btcgJvqPffpHBndEG0inAqtfjpro15M1Ng/iPRVxDnUsbZQ J5JoFyP71VHmgDvAxb8AUCYMXer1tEdZFnGxyQ5T46jjV+qOGbvoF5gVlrtJY0jH11o8 eqbg== 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=+za6mB9H207FbisKEDo1liTZmOp9gQc/qtYWspwluos=; b=FR0X9nY5i2RNV5TTZdGttEPMocFaw6bitmUvhAF6zdEnMFKt+JVDnkO2APh06vwatG QyF7AqOTgsfBNCtTVE6wL3R5uOZ7MvvQjJyt4PbpH50CeGuWjDPVliVeoWEh50U1jMWo 0XmElgDvXRJNcTR23+3P2wVHIWxf3y2akVH7B/Orp/Deo4hITPQ8lLBJG0v55zAXsQK3 yXtVLGP8ObZrC90O20BHLcHUHyWjADvIq7RNX9E9bqaveoXJlufARdWBVo4HXZ612QIb Rv78/vkazBo1uYaMVsJ72Fjrz8ru+h8TcbycEHneikbAhHw/p+5Rd8WS/dyM6zaomsTo mtjQ== 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 c5si7077803itg.114.2017.10.09.08.01.50; Mon, 09 Oct 2017 08:01: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; 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 9A1DB60804; Mon, 9 Oct 2017 15:01:50 +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 6CB35607C8; Mon, 9 Oct 2017 15:00:47 +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 711AC607E1; Mon, 9 Oct 2017 15:00:42 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 67C15607D6 for ; Mon, 9 Oct 2017 15:00:40 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 6FD9A40824B5 for ; Mon, 9 Oct 2017 18:00:39 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VwmiR8aP3E-0dNW5RT5; Mon, 09 Oct 2017 18:00:39 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id w4HfFWI668-0cuu79Nu; Mon, 09 Oct 2017 18:00:38 +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 18:00:14 +0300 Message-Id: <1507561215-16021-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507561215-16021-1-git-send-email-odpbot@yandex.ru> References: <1507561215-16021-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 188 Subject: [lng-odp] [PATCH v5 1/2] test: disable packet parsing in odp_pktio_perf 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 Disable packet parsing as it is done in the driver where it affects scalability of the application. This especially problematic for e.g. the loopback pktio which has only one RX queue. Together with the improved sequence number allocation change, performance improves >2x on Hisilicon D02 (6 and 8 threads) and more of the scalability of the scheduler itself is exposed. Signed-off-by: Ola Liljedahl Reviewed-by: Brian Brooks Jira: ENTNET-488 Change-Id: I44035bf5b70af5b5bd9b7163ca55673043d2493b --- /** 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: 6b635f064676df1178d721f260827b7bc537a61c **/ test/common_plat/performance/odp_pktio_perf.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/test/common_plat/performance/odp_pktio_perf.c b/test/common_plat/performance/odp_pktio_perf.c index a170e1285..e13a850a3 100644 --- a/test/common_plat/performance/odp_pktio_perf.c +++ b/test/common_plat/performance/odp_pktio_perf.c @@ -241,18 +241,16 @@ static int pktio_pkt_has_magic(odp_packet_t pkt) size_t l4_off; pkt_head_t pkt_hdr; - l4_off = odp_packet_l4_offset(pkt); - if (l4_off) { - int ret = odp_packet_copy_to_mem(pkt, - l4_off + ODPH_UDPHDR_LEN, - sizeof(pkt_hdr), &pkt_hdr); + l4_off = ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN; + int ret = odp_packet_copy_to_mem(pkt, + l4_off + ODPH_UDPHDR_LEN, + sizeof(pkt_hdr), &pkt_hdr); - if (ret != 0) - return 0; + if (ret != 0) + return 0; - if (pkt_hdr.magic == TEST_HDR_MAGIC) - return 1; - } + if (pkt_hdr.magic == TEST_HDR_MAGIC) + return 1; return 0; } @@ -739,6 +737,7 @@ static int test_init(void) odp_pool_param_t params; const char *iface; int schedule; + odp_pktio_config_t cfg; odp_pool_param_init(¶ms); params.pkt.len = PKT_HDR_LEN + gbl_args->args.pkt_len; @@ -788,6 +787,13 @@ static int test_init(void) return -1; } + /* Disable packet parsing as this is done in the driver where it + * affects scalability. + */ + odp_pktio_config_init(&cfg); + cfg.parser.layer = ODP_PKTIO_PARSER_LAYER_NONE; + odp_pktio_config(gbl_args->pktio_rx, &cfg); + if (gbl_args->args.num_ifaces > 1) { if (odp_pktout_queue_config(gbl_args->pktio_rx, NULL)) { LOG_ERR("failed to configure pktio_rx queue\n"); From patchwork Mon Oct 9 15:00:15 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: 115259 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2654712qgn; Mon, 9 Oct 2017 08:02:46 -0700 (PDT) X-Google-Smtp-Source: AOwi7QC9h4/aNTD/9S3YVgG0wTYULPn1F4V/vwBgTz6nJIG0NWRkjk1CK++hkle1Kyt7vZg1Rc2Z X-Received: by 10.36.197.129 with SMTP id f123mr15803278itg.27.1507561366340; Mon, 09 Oct 2017 08:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507561366; cv=none; d=google.com; s=arc-20160816; b=rurG/OEH4o3Qe9HahH3XoR+2eGgHVaSUjaWE4uuO7C/K307M7+eBoNbVPnA5XbUFKI iAHABJHyCo7W3VH0wgHvVisn3nfDt+hfPWEhmchUFSlbML7CWiHNtlHIFuSSXMBnDiO5 GOUYs7ZnuPaUkM3lgr7/wsgcqoLOom6+xiqMMKpCU1OgHkRhSYHoOE1d0KD9WIBVRc8O FiKSnxI7v4dyT8BRKrUvVbm9NZIx4PwaHD9fz+2yzGd1sW/fvBu2tyyvtp6mWBC8SzG9 4PUR2px78zA+GfqxTvj1vqkr1xi+15Q5H4LRAFyOCPvDSf0OrAQ12PiZowKsjcji+265 R9MQ== 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=K9ghlHQMIRpsQErQfbt2mVoNmnpGligEhLDR3aHqPIU=; b=OkkicKDx0It4RV3m6xJRmcbQ89mgozM5NH2g3Nz+FKAvHfsgfYdOzA9iWCuqXKJhOL f33kqBcud7Ft2znFKLncBPO/dD8pMOs5uGnfACYG1A+oP8VsuJD5K8TTXKQ7s39P85Zj 4k+5wNo5WrRCABYgwWyeTywEd9MWiprZDLq3RtrJSt0WHNDuVCTL3ZzeFa847VklkUGk m0rLUeXu1/mra9NXsI2jRdbIyTjXoaaqo3ybLwVqF63/zgTCjwlDCLYrXy3AXcl2Ugls /ICVoFLmRrnzR+WGr6IJFxiEZ8BShe467pbTfJtuFBytnRZilkw31kWkZxk9SOCRvYF2 tjWQ== 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 h140si6938827ita.137.2017.10.09.08.02.46; Mon, 09 Oct 2017 08:02:46 -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 D9D4A60B15; Mon, 9 Oct 2017 15:02:45 +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=-4.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_SPAM, 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 54C0F60BF7; Mon, 9 Oct 2017 15:00:58 +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 00FF960AD0; Mon, 9 Oct 2017 15:00:44 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id D369E607C8 for ; Mon, 9 Oct 2017 15:00:41 +0000 (UTC) Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 5D4BE5A02FD6 for ; Mon, 9 Oct 2017 18:00:40 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback9o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id RnLFAfWs9B-0esqvUhc; Mon, 09 Oct 2017 18:00:40 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id w4HfFWI668-0du0mkAS; Mon, 09 Oct 2017 18:00:39 +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 18:00:15 +0300 Message-Id: <1507561215-16021-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507561215-16021-1-git-send-email-odpbot@yandex.ru> References: <1507561215-16021-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 188 Subject: [lng-odp] [PATCH v5 2/2] 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 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: 6b635f064676df1178d721f260827b7bc537a61c **/ 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 e13a850a3..b749ee9b9 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); @@ -261,9 +259,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; }