From patchwork Thu Dec 10 14:24:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 58213 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp525615lbb; Thu, 10 Dec 2015 06:27:11 -0800 (PST) X-Received: by 10.140.93.52 with SMTP id c49mr15418745qge.101.1449757631271; Thu, 10 Dec 2015 06:27:11 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o9si15043083qko.36.2015.12.10.06.27.09; Thu, 10 Dec 2015 06:27:11 -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; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id 774CF61A47; Thu, 10 Dec 2015 14:27:09 +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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 2541061A52; Thu, 10 Dec 2015 14:24:51 +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 994BC6198B; Thu, 10 Dec 2015 14:24:40 +0000 (UTC) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by lists.linaro.org (Postfix) with ESMTPS id E6EAA618D1 for ; Thu, 10 Dec 2015 14:24:37 +0000 (UTC) Received: by lbbcs9 with SMTP id cs9so51850696lbb.1 for ; Thu, 10 Dec 2015 06:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hmmYyNOCNYPM914mzY2/GuMtSXhLlaFbQBTozSSgffI=; b=D1j5YrM5+kk2rIy2BvxEm4JiN2/3SU1uQ9uJAN+YLMfwgmCTdupHmzyb7UA4C/StDL r9lRisF3wNHYwc01P1Ct8vTFaqyRcNvsayHXpYKv27hNNKPXgQOEevYTPvMXFfu1J1PG 17UiXOH5HHPA3BEWEezTOzvu08kUpaWefaOyJadOYlHkaF/Ns1UTjBIDFd9d328dWXYZ SO3emFZrMMfvSm1cMWW+KCZmk/G4RjgTZvfEVeQWD+3eg/b2GmfuPcl5ja/5nAv5cM0e HEe1IuM/n0ZzNZ1oYp0dizJEqMlFWaLK4yvm/6C1C+0xM2X/bu4a2i//O4KtFHwaOp8I s+4A== 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=hmmYyNOCNYPM914mzY2/GuMtSXhLlaFbQBTozSSgffI=; b=S++JTKifunhahfxb7Sm2KuE4gJeRf0WpquGCP/jd//ZYxLVjaYiuLP9Nfl0RKMvxH3 nf0X7lfhocey6JtzlbZe4Fb/wFNsOalSaDOVpJvEZsfPQ2P8kQPzD5IikayjpoXFPmWU l9ohnHdAC8eawk7ufr7/ticdQbXzZbeZ4Ndr0Rz+jgBTW7FUfla2kgTIW+Ks5V7WFkIk 5QZwUFn7TlBdFIvqQBoqpSBxGxpmn/vhj8QY/9upcS6+axOJhBpoM/n1vLKYYRXPsT8W 3GVijKeTfrPPC4DIni5jBWU1EXlYAlEFP5caX/rWxbv6UXq9ruuKZCBO2kDATpOvVYMB QS0w== X-Gm-Message-State: ALoCoQnVDSkWz2X4BtZTNqJPAjTLUxjPdN7rLMBvNZZ6Z0IVRRmC1TZNC7DLsoTSFhjQVAToCdEaw9KUqxUZNnsIfsZMOxHidw== X-Received: by 10.112.54.193 with SMTP id l1mr5379232lbp.58.1449757476774; Thu, 10 Dec 2015 06:24:36 -0800 (PST) Received: from localhost.localdomain (ppp91-76-173-134.pppoe.mtu-net.ru. [91.76.173.134]) by smtp.gmail.com with ESMTPSA id xn8sm2364938lbb.41.2015.12.10.06.24.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Dec 2015 06:24:36 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 10 Dec 2015 17:24:19 +0300 Message-Id: <1449757466-6287-4-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449757466-6287-1-git-send-email-maxim.uvarov@linaro.org> References: <1449757466-6287-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv17 03/10] helper: flag to not link ring to linked list 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Add flag ODPH_RING_NO_LIST to ring to not link it to linked list. Signed-off-by: Maxim Uvarov --- helper/include/odp/helper/ring.h | 21 +++++++++++++-------- helper/ring.c | 3 ++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/helper/include/odp/helper/ring.h b/helper/include/odp/helper/ring.h index 5e640a7..541a466 100644 --- a/helper/include/odp/helper/ring.h +++ b/helper/include/odp/helper/ring.h @@ -155,14 +155,19 @@ typedef struct odph_ring { void *ring[0] ODP_ALIGNED_CACHE; } odph_ring_t; - -#define ODPH_RING_F_SP_ENQ 0x0001 /* The default enqueue is "single-producer".*/ -#define ODPH_RING_F_SC_DEQ 0x0002 /* The default dequeue is "single-consumer".*/ -#define ODPH_RING_SHM_PROC 0x0004 /* If set - ring is visible from different - processes. Default is thread visible. */ -#define ODPH_RING_QUOT_EXCEED (1 << 31) /* Quota exceed for burst ops */ -#define ODPH_RING_SZ_MASK (unsigned)(0x0fffffff) /* Ring size mask */ - +/* The default enqueue is "single-producer".*/ +#define ODPH_RING_F_SP_ENQ (1 << 0) +/* The default dequeue is "single-consumer".*/ +#define ODPH_RING_F_SC_DEQ (1 << 1) +/* If set - ring is visible from different processes. + * Default is thread visible.*/ +#define ODPH_RING_SHM_PROC (1 << 2) + /* Do not link ring to linked list. */ +#define ODPH_RING_NO_LIST (1 << 3) +/* Quota exceed for burst ops */ +#define ODPH_RING_QUOT_EXCEED (1 << 31) +/* Ring size mask */ +#define ODPH_RING_SZ_MASK (unsigned)(0x0fffffff) /** * Create a new ring named *name* in memory. diff --git a/helper/ring.c b/helper/ring.c index 844abf7..e113606 100644 --- a/helper/ring.c +++ b/helper/ring.c @@ -199,7 +199,8 @@ odph_ring_create(const char *name, unsigned count, unsigned flags) r->prod.tail = 0; r->cons.tail = 0; - TAILQ_INSERT_TAIL(&odp_ring_list, r, next); + if (!(flags & ODPH_RING_NO_LIST)) + TAILQ_INSERT_TAIL(&odp_ring_list, r, next); } else { ODPH_ERR("Cannot reserve memory\n"); }