From patchwork Wed Jan 11 07:50:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi He X-Patchwork-Id: 90822 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1003244qgi; Tue, 10 Jan 2017 23:52:24 -0800 (PST) X-Received: by 10.237.49.225 with SMTP id 88mr6482943qth.120.1484121144557; Tue, 10 Jan 2017 23:52:24 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d140si3220079qkc.241.2017.01.10.23.52.24; Tue, 10 Jan 2017 23:52:24 -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 sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id EC9EF609A5; Wed, 11 Jan 2017 07:52:23 +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, 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 7E8B960D25; Wed, 11 Jan 2017 07:51: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 3BF6360987; Wed, 11 Jan 2017 07:50:57 +0000 (UTC) Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) by lists.linaro.org (Postfix) with ESMTPS id C99B060508 for ; Wed, 11 Jan 2017 07:50:55 +0000 (UTC) Received: by mail-pf0-f173.google.com with SMTP id y143so39575248pfb.0 for ; Tue, 10 Jan 2017 23:50:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=53bXOSFif5S05091niPLgBiNkLeMHBIwZX+6p2eFX+A=; b=OIpZY5vmwE1OeRWxYLI8SNSaLiflGLSeRWBMP5fWnNfktIvNokqCwhSL+hfDuHw2nL fPSvhcY7q/zYruchKTfAvO1T1v2rd3uYL/MjfO0oiOAEHgEzNSQgaNky8CMeCFzAATM+ Dv8sQoEtxO0+wYgDoiQ/QEtuB4ScrG4L5HVSBG+EVlTMu9wq8jw2M9Y9zdOL+KOt0k7R 373W7E+ZIkLzT9RPcxzRRhELnA3P1Sq/2MSK17W6/10e/+vzOUg6NFrhfhjR9LTwjmfQ PWQp9oHxMi6lEOVRCc067HNFvayY9Kbyff7FbzzPrP+rWNg3MZfyVMqNdnvRJ2fPx0ST +sKg== X-Gm-Message-State: AIkVDXL75HrQDvf9KTcDN+ZQlCS9di2+SBh2FiHQjV0uXJC8UzuPmh3EO4nowSCqRhqQqTRehi8= X-Received: by 10.98.16.7 with SMTP id y7mr8702815pfi.55.1484121055175; Tue, 10 Jan 2017 23:50:55 -0800 (PST) Received: from ubuntu.heyii.co (ubuntu.heyii.co. [45.32.66.203]) by smtp.googlemail.com with ESMTPSA id l12sm3543001pfj.37.2017.01.10.23.50.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Jan 2017 23:50:54 -0800 (PST) From: Yi He To: bill.fischofer@linaro.org, maxim.uvarov@linaro.org, lng-odp@lists.linaro.org Date: Wed, 11 Jan 2017 07:50:31 +0000 Message-Id: <1484121033-15354-3-git-send-email-yi.he@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484121033-15354-1-git-send-email-yi.he@linaro.org> References: <1484121033-15354-1-git-send-email-yi.he@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv3 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 1406312..1bc33eb 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -390,6 +390,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) { @@ -816,6 +821,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,