From patchwork Thu Oct 22 09:50:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 55426 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 7255B2304B for ; Thu, 22 Oct 2015 09:52:36 +0000 (UTC) Received: by wiclg3 with SMTP id lg3sf31321777wic.3 for ; Thu, 22 Oct 2015 02:52:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=+6lsO/0fRCbNIJxwzuyjb4ARW21AOtWbssI3W9/9k+o=; b=I1x7oZZ9vhALLJNWGCFd75muMpEky7VkdsAYfbJtHSfV3LRhqOxauVdc1BkgkKOt6r 1HKA+UuwG/sDPTGMrES5g0TT62eGPQZR6vwyf9z3ls1L3by7L1FjMrTGzokvyZKZr98k fBkGNedxpoJI36nXktwIzJeoc4pJsoTum67hotIrR3vQIv6Z4Rf5sLC43iksFBJiIE+5 laDnxZhnAYqRG505qy2TauLHTIgn9M2j0lTPUxbsrBM1PoJ3sfixGRG39SS8Nr9lNmKn H05u8pSOrrdUMOupvNpWOINwJLQqBCrP5H9l8Qepf651plQVm0hr9DCsj6sRDfy8YMSe FHkQ== X-Gm-Message-State: ALoCoQn4h7SRKAtJH95byaWHvgFxonl88VCdsoxG1rLNO6Y6noETmvFDA6ZwkNsPLZevpejXfPzN X-Received: by 10.112.14.4 with SMTP id l4mr3437863lbc.20.1445507555765; Thu, 22 Oct 2015 02:52:35 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.211.137 with SMTP id k131ls329220lfg.53.gmail; Thu, 22 Oct 2015 02:52:35 -0700 (PDT) X-Received: by 10.25.143.72 with SMTP id r69mr5107598lfd.65.1445507555628; Thu, 22 Oct 2015 02:52:35 -0700 (PDT) Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com. [2a00:1450:4010:c07::229]) by mx.google.com with ESMTPS id rb7si9090242lbb.4.2015.10.22.02.52.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2015 02:52:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c07::229 as permitted sender) client-ip=2a00:1450:4010:c07::229; Received: by lffz202 with SMTP id z202so41577658lff.3 for ; Thu, 22 Oct 2015 02:52:35 -0700 (PDT) X-Received: by 10.112.139.201 with SMTP id ra9mr7950061lbb.29.1445507555494; Thu, 22 Oct 2015 02:52:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp490522lbq; Thu, 22 Oct 2015 02:52:34 -0700 (PDT) X-Received: by 10.107.170.220 with SMTP id g89mr14243304ioj.178.1445507554344; Thu, 22 Oct 2015 02:52:34 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k92si10460261iod.64.2015.10.22.02.52.33; Thu, 22 Oct 2015 02:52:34 -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; Received: by lists.linaro.org (Postfix, from userid 109) id CB41F62C08; Thu, 22 Oct 2015 09:52:33 +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 6449C62BFF; Thu, 22 Oct 2015 09:50:30 +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 ACFF262BF6; Thu, 22 Oct 2015 09:50:26 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by lists.linaro.org (Postfix) with ESMTPS id 40C1D61D5A for ; Thu, 22 Oct 2015 09:50:23 +0000 (UTC) Received: by lfaz124 with SMTP id z124so41426063lfa.1 for ; Thu, 22 Oct 2015 02:50:22 -0700 (PDT) X-Received: by 10.25.37.196 with SMTP id l187mr5220027lfl.101.1445507422217; Thu, 22 Oct 2015 02:50:22 -0700 (PDT) Received: from localhost.localdomain (ppp91-76-161-180.pppoe.mtu-net.ru. [91.76.161.180]) by smtp.gmail.com with ESMTPSA id nb1sm2207849lbb.9.2015.10.22.02.50.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Oct 2015 02:50:21 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 22 Oct 2015 12:50:07 +0300 Message-Id: <1445507411-20556-4-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445507411-20556-1-git-send-email-maxim.uvarov@linaro.org> References: <1445507411-20556-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv11 3/7] 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: 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" X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c07::229 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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"); }