From patchwork Fri Mar 2 15:00:13 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: 130551 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1377272lja; Fri, 2 Mar 2018 07:09:50 -0800 (PST) X-Google-Smtp-Source: AG47ELsiBnsnQCYXSy2LDqotkaMR3EDLGy3bfSoKUEXaCV2Zqnaip53DkbF9/USGcTlXVLJgR7RN X-Received: by 10.55.22.24 with SMTP id g24mr8950328qkh.302.1520003390699; Fri, 02 Mar 2018 07:09:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520003390; cv=none; d=google.com; s=arc-20160816; b=RTOQkJ6sdtXyZms/N9mK3N2rVKTB+9xrJte3xG38UzBf/25MDm1J4tPq9B8MQ7RbaQ wdDapFbyQcyo3GNBCFBGXUgt0Md9aBNb8rblbcXpkJ3Dkty1pwT4ERyQmmJsyOMy0ULn Vle3X6/AB8yQ7e51tU/eriDmOhQu7SpjiogPzun4xZCOkI65qwwpcsoap6vbhKqb4Ljn O0VbdzGGkj98xLGwT2Shr5v0HVNsxGPgNLB9+UfV7bzqfmQoJqPcQp9WroBqTHTvF6Fd MK+Zg2Isx3ErfSbdsYGOh73bmdDbrNacsQe8xgCtk1kMTFfS180oJ8hzTTFPC79Bmta1 eO0Q== 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=YeHllEv3/aDSTppwrYu6J+kLSDNXbOZF99XejXI4r60=; b=G6XiC3sL3LygEdvdm7mbj2yCqB6Xj+8XNSIETeJZrrSJgD9hY0FRt/+f36EELSHvRV L6N/cUdYgkjW+N7yGaBa+X52h7D2NEfMvRltc9FCX6Xy6rbqvR6i/7anJqmbIfw8LjbX PJ+Ao8qqagnb7MRwoUiupWvtS3bikOmjYCyyNmdj39MYLAfPsT43jcryw7No8hR8JoYn XMhGJ+xIHGaRUNYiM2WaJN/oMu1CbtapfTgGIrl1CElXpQ3MINgwzrp4CTkVbHBZcStz Z3BfYae+grgGfQjzEwNw1PxQkOu09HWdB9E6xkLZd7OLnGd/NKSrQxqvIyPJEuto68k0 P+GQ== 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 g15si6988683qtk.283.2018.03.02.07.09.50; Fri, 02 Mar 2018 07:09:50 -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 5632B62791; Fri, 2 Mar 2018 15:09: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, 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 53A2861103; Fri, 2 Mar 2018 15:01:09 +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 7A0EF6178F; Fri, 2 Mar 2018 15:00:29 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id 6A2A061768 for ; Fri, 2 Mar 2018 15:00:21 +0000 (UTC) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 56B154514A for ; Fri, 2 Mar 2018 18:00:20 +0300 (MSK) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [2a02:6b8:0:801::ac]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id DXsEzutEFI-0Ksu2G2q; Fri, 02 Mar 2018 18:00:20 +0300 Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ChbgkO0UiZ-0J2K3euL; Fri, 02 Mar 2018 18:00:19 +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: Fri, 2 Mar 2018 18:00:13 +0300 Message-Id: <1520002815-30682-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520002815-30682-1-git-send-email-odpbot@yandex.ru> References: <1520002815-30682-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 504 Subject: [lng-odp] [PATCH v2 4/6] linux-gen: sched: optimize parallel packet input queue throughput 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 Extend direct packet input processing to parallel queues. Parallel queues do not quarantee ordering, so also those can pass packets directly to application and (potentially) stash some per thread. Signed-off-by: Petri Savolainen --- /** Email created from pull request 504 (psavol:master-sched-optim-2) ** https://github.com/Linaro/odp/pull/504 ** Patch: https://github.com/Linaro/odp/pull/504.patch ** Base sha: e1c0e4570a45d05dd9f2e8e052ce71164209d112 ** Merge commit sha: 964132736e0785222be184065d6ac73121cd46ac **/ platform/linux-generic/odp_schedule_basic.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 3ea261fae..d662bd6a4 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -846,19 +846,19 @@ static inline int do_schedule_grp(odp_queue_t *out_queue, odp_event_t out_ev[], * priorities. Stop scheduling queue when pktio * has been stopped. */ if (pktin) { - int atomic = queue_is_atomic(qi); - int num_pkt = poll_pktin(qi, atomic); + int stash = !ordered; + int num_pkt = poll_pktin(qi, stash); if (odp_unlikely(num_pkt < 0)) continue; - if (num_pkt == 0 || !atomic) { + if (num_pkt == 0 || !stash) { ring_enq(ring, RING_MASK, qi); break; } - /* Process packets from an atomic queue - * right away */ + /* Process packets from an atomic or + * parallel queue right away. */ num = num_pkt; } else { /* Remove empty queue from scheduling. @@ -868,12 +868,6 @@ static inline int do_schedule_grp(odp_queue_t *out_queue, odp_event_t out_ev[], } } - handle = queue_from_index(qi); - sched_local.num = num; - sched_local.index = 0; - sched_local.queue = handle; - ret = copy_events(out_ev, max_num); - if (ordered) { uint64_t ctx; odp_atomic_u64_t *next_ctx; @@ -895,6 +889,12 @@ static inline int do_schedule_grp(odp_queue_t *out_queue, odp_event_t out_ev[], ring_enq(ring, RING_MASK, qi); } + handle = queue_from_index(qi); + sched_local.num = num; + sched_local.index = 0; + sched_local.queue = handle; + ret = copy_events(out_ev, max_num); + /* Output the source queue handle */ if (out_queue) *out_queue = handle;