From patchwork Fri Dec 9 10:51:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi He X-Patchwork-Id: 87423 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp239911qgi; Fri, 9 Dec 2016 02:52:57 -0800 (PST) X-Received: by 10.55.27.226 with SMTP id m95mr76785108qkh.143.1481280777226; Fri, 09 Dec 2016 02:52:57 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 62si19698507qta.326.2016.12.09.02.52.57; Fri, 09 Dec 2016 02:52:57 -0800 (PST) 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=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E212360E3E; Fri, 9 Dec 2016 10:52:56 +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, RCVD_IN_DNSWL_NONE, 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 A5FF060E1F; Fri, 9 Dec 2016 10:52:22 +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 1923360E39; Fri, 9 Dec 2016 10:52:11 +0000 (UTC) Received: from mail-pg0-f43.google.com (mail-pg0-f43.google.com [74.125.83.43]) by lists.linaro.org (Postfix) with ESMTPS id 40C8560E39 for ; Fri, 9 Dec 2016 10:51:44 +0000 (UTC) Received: by mail-pg0-f43.google.com with SMTP id x23so6818914pgx.1 for ; Fri, 09 Dec 2016 02:51:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kHBW/aT3JGbjMUujqfZ8h4+FJ7eRwYzE+MLwyHwpoGI=; b=KGWzHTOWT5U0o4BPbAwjxS7Fkl0Tg6rY1wivLj+r8SxaD3lmmGk+BBbqD+MKB2zczz /6q2DCDXOehdT+Cn0rSn1UweaAO69wvKhO/Qm1MJ8p0PzUIb/UHdzXs9FOgeqoeiuqyB PYaavoEr4nX7wAWwIbPOeLnAw3IJfmXQue+0C9ml3USrUNr7wdTxYsY/qWMjlVf5l18k dp4kec+CXuEZpbbIK4v8IugD8Fs28TRzTx4+/oGP44ViJbk4QUFYu/yB3XV79r54c+m2 EZlymKf6sGSVkKCqPsRjz3QA1Ii4hNw94Ja7zdgTkw2mpTSLzEcvsXpM6xjgLvMiC0eR YXKw== X-Gm-Message-State: AKaTC03jcuqHZYcF2r27RQWGY8HAEXPXOR3R/vThuoSTuKMA47Rko7934FGaV563sKkmX4aoHT8= X-Received: by 10.99.37.195 with SMTP id l186mr141210446pgl.91.1481280703366; Fri, 09 Dec 2016 02:51:43 -0800 (PST) Received: from ubuntu.heyii.co (ubuntu.heyii.co. [45.32.66.203]) by smtp.googlemail.com with ESMTPSA id p67sm56750457pfb.2.2016.12.09.02.51.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Dec 2016 02:51:42 -0800 (PST) From: Yi He To: lng-odp@lists.linaro.org Date: Fri, 9 Dec 2016 10:51:27 +0000 Message-Id: <1481280689-14223-3-git-send-email-yi.he@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481280689-14223-1-git-send-email-yi.he@linaro.org> References: <1481280689-14223-1-git-send-email-yi.he@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv2 2/4] linux-gen: sched: add unsched_queue callback 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" Add this unsched_queue callback to indicate queue's ineligible for scheduling. Signed-off-by: Yi He --- platform/linux-generic/include/odp_schedule_if.h | 2 ++ platform/linux-generic/odp_queue.c | 4 +++- platform/linux-generic/odp_schedule.c | 6 ++++++ platform/linux-generic/odp_schedule_sp.c | 6 ++++++ 4 files changed, 17 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index c0aee42..530d157 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -25,6 +25,7 @@ typedef int (*schedule_init_queue_fn_t)(uint32_t queue_index, ); typedef void (*schedule_destroy_queue_fn_t)(uint32_t queue_index); typedef int (*schedule_sched_queue_fn_t)(uint32_t queue_index); +typedef int (*schedule_unsched_queue_fn_t)(uint32_t queue_index); typedef int (*schedule_ord_enq_multi_fn_t)(uint32_t queue_index, void *buf_hdr[], int num, int *ret); typedef int (*schedule_init_global_fn_t)(void); @@ -44,6 +45,7 @@ typedef struct schedule_fn_t { schedule_init_queue_fn_t init_queue; schedule_destroy_queue_fn_t destroy_queue; schedule_sched_queue_fn_t sched_queue; + schedule_unsched_queue_fn_t unsched_queue; schedule_ord_enq_multi_fn_t ord_enq_multi; schedule_init_global_fn_t init_global; schedule_term_global_fn_t term_global; diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index 3b6a68b..67b5e85 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -525,8 +525,10 @@ static inline int deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], if (hdr == NULL) { /* Already empty queue */ - if (queue->s.status == QUEUE_STATUS_SCHED) + if (queue->s.status == QUEUE_STATUS_SCHED) { queue->s.status = QUEUE_STATUS_NOTSCHED; + sched_fn->unsched_queue(queue->s.index); + } UNLOCK(&queue->s.lock); return 0; diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 264c58f..704dbd8 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -1200,6 +1200,11 @@ static int schedule_sched_queue(uint32_t queue_index) return 0; } +static int schedule_unsched_queue(uint32_t queue_index ODP_UNUSED) +{ + return 0; +} + static int schedule_num_grps(void) { return NUM_SCHED_GRPS; @@ -1218,6 +1223,7 @@ const schedule_fn_t schedule_default_fn = { .init_queue = schedule_init_queue, .destroy_queue = schedule_destroy_queue, .sched_queue = schedule_sched_queue, + .unsched_queue = schedule_unsched_queue, .ord_enq_multi = schedule_ord_enq_multi, .init_global = schedule_init_global, .term_global = schedule_term_global, diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index 8481f29..5c0b503 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -307,6 +307,11 @@ static int sched_queue(uint32_t qi) return 0; } +static int unsched_queue(uint32_t qi ODP_UNUSED) +{ + return 0; +} + static int ord_enq_multi(uint32_t queue_index, void *buf_hdr[], int num, int *ret) { @@ -689,6 +694,7 @@ const schedule_fn_t schedule_sp_fn = { .init_queue = init_queue, .destroy_queue = destroy_queue, .sched_queue = sched_queue, + .unsched_queue = unsched_queue, .ord_enq_multi = ord_enq_multi, .init_global = init_global, .term_global = term_global,