From patchwork Fri Apr 7 04:07:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 97009 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp111663qgd; Thu, 6 Apr 2017 21:07:37 -0700 (PDT) X-Received: by 10.200.57.71 with SMTP id t7mr36538233qtb.99.1491538057133; Thu, 06 Apr 2017 21:07:37 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r48si3568786qte.38.2017.04.06.21.07.36; Thu, 06 Apr 2017 21:07:37 -0700 (PDT) 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 4E53E62DA5; Fri, 7 Apr 2017 04:07:36 +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_H3, RCVD_IN_MSPIKE_WL, 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 B3B6162D79; Fri, 7 Apr 2017 04:07:32 +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 0C18E62D85; Fri, 7 Apr 2017 04:07:30 +0000 (UTC) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by lists.linaro.org (Postfix) with ESMTPS id 4C3F662D68 for ; Fri, 7 Apr 2017 04:07:28 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id b187so73886517oif.0 for ; Thu, 06 Apr 2017 21:07:28 -0700 (PDT) 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; bh=NbWNbWADQ6bv892do4G3yuyHPm1Zkrb+omjTGrmIu0U=; b=EzYBrc5fJBASv/0xL0SpktfHl209QTTsA5wPrjoXpsGHzbmu8bUE3S+8x6EAk+M8Me kZj2NdsjMAo7my0MouJKSGUuA8HEXrRtat+6LcPcUTs0G/ntGq3NxWRVprguL8sCLmeO 2LaTU45tGXq2MuEC94S0TIlt0xzgNHOyQDIB2niu8NoogS7Xt6NZpdPi7NtEu4Mr38to 4vvHfCEeXudltUAqQBd8tAux8YoDBVNpZxqYRpv2cAfBMqkYe6fJngKvAj7T3xFSv+xs GLJ3WXtIt0gi/kKBb6CXq2Wm5d+GWWAQnFYNpdukiSCcAjI2tFR5mRsI/CQ7wJlPei4T cuog== X-Gm-Message-State: AFeK/H0NWcS0lfw6pr1wf3Te82QRRRsDrRmijTI+mYgTIRKQ9V5giG4HPq4FTrhDKyF7TssDFdk= X-Received: by 10.202.6.129 with SMTP id 123mr18344297oig.198.1491538047708; Thu, 06 Apr 2017 21:07:27 -0700 (PDT) Received: from localhost.localdomain (cpe-70-113-26-109.austin.res.rr.com. [70.113.26.109]) by smtp.gmail.com with ESMTPSA id v49sm1638587otb.13.2017.04.06.21.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 21:07:27 -0700 (PDT) From: Honnappa Nagarahalli To: lng-odp@lists.linaro.org Date: Thu, 6 Apr 2017 23:07:03 -0500 Message-Id: <1491538024-112904-1-git-send-email-honnappa.nagarahalli@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [lng-odp] [PATCH 1/2] add queue size param and related capability 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" Added size parameter indicating the maximum number of events in the queue and the corresponding queue capability changes. Signed-off-by: Honnappa Nagarahalli --- include/odp/api/spec/queue.h | 12 ++++++++++++ platform/linux-generic/odp_queue.c | 1 + 2 files changed, 13 insertions(+) -- 2.7.4 diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index 7972fea..ccb6fb8 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.h @@ -112,6 +112,12 @@ typedef struct odp_queue_capability_t { /** Number of scheduling priorities */ unsigned sched_prios; + /** Maximum number of events in the queue. + * + * Value of zero indicates the size is limited only by the available + * memory in the system. */ + unsigned max_size; + } odp_queue_capability_t; /** @@ -124,6 +130,12 @@ typedef struct odp_queue_param_t { * the queue type. */ odp_queue_type_t type; + /** Queue size + * + * Maximum number of events in the queue. Value of 0 chooses the + * default configuration of the implementation. */ + uint32_t size; + /** Enqueue mode * * Default value for both queue types is ODP_QUEUE_OP_MT. Application diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index fcf4bf5..5a50a57 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -175,6 +175,7 @@ int odp_queue_capability(odp_queue_capability_t *capa) capa->max_ordered_locks = sched_fn->max_ordered_locks(); capa->max_sched_groups = sched_fn->num_grps(); capa->sched_prios = odp_schedule_num_prio(); + capa->max_size = 0; return 0; }