From patchwork Tue Oct 10 14:00:13 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: 115403 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3791915qgn; Tue, 10 Oct 2017 07:02:54 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBTGtjnXTopUkZwuFdboIkPZETSMqlDqF6pcZST7is5ZAly5fMr2ZA8p+XHZdWvsfrw9tJs X-Received: by 10.36.14.200 with SMTP id 191mr18738076ite.133.1507644173966; Tue, 10 Oct 2017 07:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507644173; cv=none; d=google.com; s=arc-20160816; b=SL/qz/fVClgGKpDSuOvi4Rcp13wIODxfRXykUym3Bnqml6QFuxWIUN2RXj79BVNV6w H5blHijKCPJa+ZRe77EoXELVJnxF1lzRfAorqp7BTA08YMzviF5qPNVB97NaDWNL9LRL XW+HRlkeXLNSnsTzCXfe+kApXNcV9JWDjHBx32tFjttowogVivvUHs+fkKojdqRSOADm HGusH2decZUVg8Ic/5qOT9FJq7TWZ/FFeDfMyGt42Kuus2qxxWeqxjBdK86SOY/+cTEE 8Hx2O8tdUoHy3Q7hZs2fia3Z9z8bZRbYrHUrQijUYC026ePhIpxK0wD4b1igyzzq7MUJ e2og== 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=KAdJEdFH1b/11bXr3FN5/xQsq8ZsYq338QnsyKiNzuI=; b=aW5aolfc6uldivL/DgMgOV9FucCN5bCozMdFQdaig7FwPDdjTQW2YvZon2j23zRuS6 qp0ytUvUOuxc3HGc/18APvbzQkgQm6+6E+d3w6uuLVTHOUSMz/suFi303N4GjWtPAYDf VwfeX+E08wffVNTLoeQYCNzemqcCZa1tq1xbQxfDkMCFJzTJWEBvMrkS/Upzd2y/1U5E FMn/1SXIqln64hSpBgOsR91EKAA8Sdh3r3W/9p+YcoC/y3COAwoWeI7xOHrEa9TVXZMr BhDHhH8C+S2WO1pczxxRPZ6ImRgR6032nj85vSz0CX7aA03PjWdM2vCnktqCRMIdvYEq JUWg== 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 i1si9123170itf.72.2017.10.10.07.02.50; Tue, 10 Oct 2017 07:02:53 -0700 (PDT) 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 4FCEE60CC1; Tue, 10 Oct 2017 14:02: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 35BB160C63; Tue, 10 Oct 2017 14:00:56 +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 65EB860C9A; Tue, 10 Oct 2017 14:00:47 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id A98DF60C35 for ; Tue, 10 Oct 2017 14:00:44 +0000 (UTC) Received: from mxback4o.mail.yandex.net (mxback4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1e]) by forward103p.mail.yandex.net (Yandex) with ESMTP id D1B8321845C8 for ; Tue, 10 Oct 2017 17:00:42 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback4o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id XoTSigmrnr-0gj0MfDF; Tue, 10 Oct 2017 17:00:42 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id VhNutoZVyT-0guO5SWj; Tue, 10 Oct 2017 17:00:42 +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: Tue, 10 Oct 2017 17:00:13 +0300 Message-Id: <1507644014-13917-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507644014-13917-1-git-send-email-odpbot@yandex.ru> References: <1507644014-13917-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 188 Subject: [lng-odp] [PATCH v6 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: 3bacbfd55edf76b897a4b2e5c62b59ca6fa95331 ** Merge commit sha: 63cba8b410fd2e58a1d373bea42a956639022782 **/ 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 Tue Oct 10 14: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: 115404 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3793292qgn; Tue, 10 Oct 2017 07:03:53 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCHPwyYBXljtpXI24kmNz/rVZItHFMg9Hpizb2y7ZZtQLrGC0my5bRf7mKmxnaTi+7+OStY X-Received: by 10.36.204.137 with SMTP id x131mr10254038itf.94.1507644232954; Tue, 10 Oct 2017 07:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507644232; cv=none; d=google.com; s=arc-20160816; b=hstLTAPv8Qvp/ewtwP7oyOFDUhvAtnJNRbyi4QLBVc1E+kmIzBM1pr54k2e+HTOtcc 7SC66KbXJb1h6Q44LFx86obI1HBSurWPPKQaBMT5yywal/rVZ8qktS4hDaH8vxq5Q/KB 5trtFwnjl9gemrRl8UJ+5FrS7QzmP7egtLs37kL8pn1Cia7e7XVXtJRmCW8dNuObeinV ABMlspdPjt3rAjJ66UMqakUsaeMPHZ30fSb/7nTICdlS5K7V/l4Iv7XjZgaAttE2P3Je nO2XbQtlrfbLSTxhoVVMgciKKal1wUPSteGXFDu6XlQvvourR7FvH54C9JniN2gL8M7v GAmQ== 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=nqu+oy6Ym/zUjGWyLGNRGJE4RXeiER5Lo5Y41CBvy98=; b=yNcwSO8Dvuj5XnvDaUbM/dg5mORa8ZYU1E93H2/KV2RUF8jdw29gqggF3yT0Sa/YO3 L55zQ3dQBZfqnN0DISvotmhRRUnZsDlLxqPH24IH8sG4O0nbZX4mtJ8YOAvBX+/suB8v 793HpEqH492/1uC96STU6jY0vPc3XdORBxmO0vaMpCsq0cbJHi7NVHle5Y8v6JEiPup/ aFD3kPuEDxDEQfNDNNBRRQkW6TtQzkaPH2bldhMM4Wy7XwPG5veliQ6uNV7u3/cprVVU hIHEjPj2l5wtFv0wh98A+NHXY6UUytzR4Add7ttUbudwLdv0iUi/xksxbYMsX9ZoNfN4 T1WA== 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 u2si8378392ioe.239.2017.10.10.07.03.50; Tue, 10 Oct 2017 07:03:52 -0700 (PDT) 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 276E162875; Tue, 10 Oct 2017 14:03: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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 C2D4E60D44; Tue, 10 Oct 2017 14:01:07 +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 374F360D2C; Tue, 10 Oct 2017 14:00:55 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 60F11606B4 for ; Tue, 10 Oct 2017 14:00:46 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 815895604032 for ; Tue, 10 Oct 2017 17:00:43 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id riBPwnUf3n-0h9Cnrfi; Tue, 10 Oct 2017 17:00:43 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id VhNutoZVyT-0guOYAFe; Tue, 10 Oct 2017 17:00:42 +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: Tue, 10 Oct 2017 17:00:14 +0300 Message-Id: <1507644014-13917-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507644014-13917-1-git-send-email-odpbot@yandex.ru> References: <1507644014-13917-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 188 Subject: [lng-odp] [PATCH v6 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: 3bacbfd55edf76b897a4b2e5c62b59ca6fa95331 ** Merge commit sha: 63cba8b410fd2e58a1d373bea42a956639022782 **/ 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; }