From patchwork Tue Feb 13 16: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: 128248 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4397337ljc; Tue, 13 Feb 2018 08:00:27 -0800 (PST) X-Google-Smtp-Source: AH8x2241IwuO3AUxx0Cvhk077RDOt00ymCC3wW3WoKhFFWGQohgmn6UVvYIxDmoJ1j7lqOFPY9yk X-Received: by 10.237.49.130 with SMTP id 2mr2511920qth.19.1518537627163; Tue, 13 Feb 2018 08:00:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518537627; cv=none; d=google.com; s=arc-20160816; b=CfBViF/guyZKkwaSCSycI6xAoSjY7Bh5oTuTCWvQOA/kOEGJhPrB/UWI9UH9QGh38I 4yfQ3a6QtPB/hXwCSMLoBJb9LzUC1agzCvWy/iW/h+qdoKpQvWkdZIJQyehvqzzYGk/A BNelIltmNaaL0N9EyG1N7m4VOVPABlysDwtAZm6FPsmxpE37nyfMGuhTSrjBTWcBnliY 4WE7lZLwV9Nt2mFpnmTVkEHrRDh5dERJ01KaZQ3Pb7cFkPqkZvOQKyA5QM1ubz1B4wBs pxUSGpTJ/OG9L8MVo+4X/DHPk7IiCO7zKP1ZKMOMGPRANvUW96G20nQXXwycLlNLDCSL 72Zw== 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=xW3lOwr4zhO0U36pFJzK+mj3M2hOtZg8cyeWI16ceEU=; b=huqA8WvkjLbLA6iiAlS2RT2FGN3g/S8X+KTudaQBrNWuu6LDCoobySH6P5Ymym+NMf iIyykbazqaaS9s3qU6YeBRT4d3tsIcZkVxSRB6mU6zaNpOz39E8qaGnfrGkc/h2Gq/g+ /xNyfqcEBnL9SGX1jjSeV2nquUEswBeKLOdsfGkyIZwQ/8E0Or09WmfI5gZbMr5iBZWI ZOGIhB4QpzOu8Dy9JzrN+mBGMBMs19n3+OgaedJ2iiliKflQNvfIJy4ZSXYvsj81EKHl 9PQJfgjoYMlvQI1hk1xw4ySlWKeYxc3hWionXMzvkVOS6LXyRRZli8xJZNSKPG4iTULv 0jpA== 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 c11si7719903qth.465.2018.02.13.08.00.26; Tue, 13 Feb 2018 08:00:27 -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 1BEBD609E9; Tue, 13 Feb 2018 16:00:26 +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 CD5CF616F5; Tue, 13 Feb 2018 16:00:18 +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 E98D76170B; Tue, 13 Feb 2018 16:00:15 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 0047E616F5 for ; Tue, 13 Feb 2018 16:00:13 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward104o.mail.yandex.net (Yandex) with ESMTP id A20A87022C0 for ; Tue, 13 Feb 2018 19:00:11 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id pUe4T5FVxp-0BEGjTGA; Tue, 13 Feb 2018 19:00:11 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 9l1Lelxs2A-0BdC2ieM; Tue, 13 Feb 2018 19:00:11 +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, 13 Feb 2018 19:00:08 +0300 Message-Id: <1518537609-25649-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518537609-25649-1-git-send-email-odpbot@yandex.ru> References: <1518537609-25649-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 475 Subject: [lng-odp] [PATCH v1 1/2] example: generator: remove busy wait for direct mode receive 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: Bogdan Pricope Add timeout to avoid unnecessary loops on low traffic. Signed-off-by: Bogdan Pricope --- /** Email created from pull request 475 (bogdanPricope:master_generator_rx_pr) ** https://github.com/Linaro/odp/pull/475 ** Patch: https://github.com/Linaro/odp/pull/475.patch ** Base sha: 41b3fa2cd994a7ef68290a07dcde5564e4640847 ** Merge commit sha: 1e80eb73f8a105ac227aa7be2b861e2c12491802 **/ example/generator/odp_generator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index f8c787e44..440b6b287 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -939,6 +939,7 @@ static int gen_recv_direct_thread(void *arg) odp_packet_t pkts[MAX_RX_BURST]; int pkt_cnt, burst_size; odp_pktin_queue_t pktin; + uint64_t wait = odp_pktin_wait_time(ODP_TIME_SEC_IN_NS); thr = odp_thread_id(); thr_args = (thread_args_t *)arg; @@ -952,8 +953,7 @@ static int gen_recv_direct_thread(void *arg) if (thr_args->stop) break; - pkt_cnt = odp_pktin_recv_tmo(pktin, pkts, burst_size, - ODP_PKTIN_NO_WAIT); + pkt_cnt = odp_pktin_recv_tmo(pktin, pkts, burst_size, wait); if (pkt_cnt > 0) { process_pkts(thr, thr_args, pkts, pkt_cnt);