From patchwork Thu Nov 19 09:43:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 56970 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3072170lbb; Thu, 19 Nov 2015 01:45:54 -0800 (PST) X-Received: by 10.140.89.113 with SMTP id u104mr758261qgd.98.1447926354182; Thu, 19 Nov 2015 01:45:54 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y142si6017710qhy.129.2015.11.19.01.45.53; Thu, 19 Nov 2015 01:45:54 -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 B8AAF61FF5; Thu, 19 Nov 2015 09:45:53 +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 6C71C61FCF; Thu, 19 Nov 2015 09:43:52 +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 2183961FC9; Thu, 19 Nov 2015 09:43:44 +0000 (UTC) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) by lists.linaro.org (Postfix) with ESMTPS id 4A75361D7D for ; Thu, 19 Nov 2015 09:43:42 +0000 (UTC) Received: by lfaz4 with SMTP id z4so44266583lfa.0 for ; Thu, 19 Nov 2015 01:43:41 -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=SnfDCe9doHnfRR1wAk6nneTQP3igbe7itfvpYQbK+P0=; b=N8Zomp8FK7FRBhpp0xavM/GkIXQNJLVTmowaXRuCPF8ZeSi07v+s73lr0LUX4dt81j jmwfNRn8UMQaaeb1EHsSXDMYSKWZ2oUIKBwnyYhUz5uQn9y/CJG0gitxfF3Y4ZHMZsPg vM0a2oNHuLhUuwiiz6ryLqQHR/tFLrLcyB7YNkLVM6hK+FhYuDzcdsLo5qTCCnOXErNJ 5UbUrMPCr7lAOw1u4aJKcmO+FhaFWoPtaJ2wxmJ2+OZAAoILbEyPw9O8uaN00D6dHeRd ComsO1RUw2WUD5yd/GG7BzNlvChoAY1SvWSc8QaspoiIDWYLX5u8D0EUsxaq+XpgWiWR eMVA== 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=SnfDCe9doHnfRR1wAk6nneTQP3igbe7itfvpYQbK+P0=; b=Idd0CcLrOU9CMxD9Y2Oi9EjzflaSWer6rY937qKm2FlJbkyOOG/AnvJSita6ZqWTae 7HJEkne1oX8ZOfi13re7Lrq8z3N4H96Nz1H0GUCLkxraYeVVsdja6DMcq8U1UbFF8B2f v/z6nbQpR5fvvl7SJVrtRS97MkNf+b0p96+0XJNkOcr5DZdl36yduXGFRHs7C3RoIC0i +aTTG1H9GiT46pge0tKBmo13NW5WU5iN9jQyJ6RSz7dE7V3D6Lk1v3hzsUIT/DL/2n8T 4TBGfbGQMsepmxvNYhb31bW6clTe8XasFNbjMXkN3+MA5bsvQQ0UjGAOUcHu35Zjdb41 8FEg== X-Gm-Message-State: ALoCoQlQIhq9Fc8Q9ntNKMycGzt9hPaqIOZTJy9mnV03sWkiSq7MFDnvraKCofhrSyFn2DEXFiKb X-Received: by 10.25.158.211 with SMTP id h202mr2417441lfe.29.1447926221135; Thu, 19 Nov 2015 01:43:41 -0800 (PST) Received: from localhost.localdomain (ppp91-76-161-180.pppoe.mtu-net.ru. [91.76.161.180]) by smtp.gmail.com with ESMTPSA id 194sm1081186lfd.4.2015.11.19.01.43.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 01:43:40 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 19 Nov 2015 12:43:26 +0300 Message-Id: <1447926212-15365-4-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447926212-15365-1-git-send-email-maxim.uvarov@linaro.org> References: <1447926212-15365-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv14 3/9] 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 | 7 ++++--- helper/ring.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/helper/include/odp/helper/ring.h b/helper/include/odp/helper/ring.h index 5e640a7..c3c2f6a 100644 --- a/helper/include/odp/helper/ring.h +++ b/helper/include/odp/helper/ring.h @@ -156,10 +156,11 @@ typedef struct odph_ring { } 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 +#define ODPH_RING_F_SP_ENQ (1 << 0) /* The default enqueue is "single-producer".*/ +#define ODPH_RING_F_SC_DEQ (1 << 1) /* The default dequeue is "single-consumer".*/ +#define ODPH_RING_SHM_PROC (1 << 2) /* If set - ring is visible from different processes. Default is thread visible. */ +#define ODPH_RING_NO_LIST (1 << 3) /* Do not link ring to linked list. */ #define ODPH_RING_QUOT_EXCEED (1 << 31) /* Quota exceed for burst ops */ #define ODPH_RING_SZ_MASK (unsigned)(0x0fffffff) /* Ring size mask */ 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"); }