From patchwork Mon Oct 19 16:07:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 55241 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id D1F4222F11 for ; Mon, 19 Oct 2015 16:11:19 +0000 (UTC) Received: by wiclg3 with SMTP id lg3sf2939053wic.3 for ; Mon, 19 Oct 2015 09:11:19 -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=rydkzPb+LvClyU8pcjRAHuTwU0cIFJn8NG06mWtEf+g=; b=OBLpCb7FiXOFGaUsdZEUk735m4khPgNCOHHHpwyU9bZdzzUDdzdiO+7rPXBp4jXfR9 7SmoJqfD27XP5+6+Ltnbt34uyHB40yZtM2K9YaGJs1dgjXlYtb8H+LY/6gSYaOEBBzrK /p/UDpHbtMXpBWotkLZX2VHK2CzP6DhJ9KwZJX4YTlJUHhaZmCxAc0iYF+v3d0kCFAgJ ubDoFUoLGQ4Qd6DqSb1hQiTmEKYEDutJU3ogMH6Wu0HOBGnIR09ogVkZtBtegAwydMdr yke9WiDljVEianbK8OTR7Tqpc8zAbKAjeaPKjSuxFdn7GT8iPg5ZqDpFayF1L46MAOS+ 3/mw== X-Gm-Message-State: ALoCoQnQigxwsTl6CpC+X5JO5K2FHG34QPxnsesvTfVFEAMuYNhH4r3JJ3xH0QGO4D+1w4lYC7gm X-Received: by 10.180.87.164 with SMTP id az4mr4394926wib.1.1445271079116; Mon, 19 Oct 2015 09:11:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.89.207 with SMTP id n198ls574790lfb.54.gmail; Mon, 19 Oct 2015 09:11:18 -0700 (PDT) X-Received: by 10.112.130.39 with SMTP id ob7mr15507568lbb.66.1445271078827; Mon, 19 Oct 2015 09:11:18 -0700 (PDT) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com. [2a00:1450:4010:c07::231]) by mx.google.com with ESMTPS id t17si2504525lfd.41.2015.10.19.09.11.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2015 09:11:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c07::231 as permitted sender) client-ip=2a00:1450:4010:c07::231; Received: by lffz202 with SMTP id z202so32143874lff.3 for ; Mon, 19 Oct 2015 09:11:18 -0700 (PDT) X-Received: by 10.25.210.206 with SMTP id j197mr10010273lfg.86.1445271078616; Mon, 19 Oct 2015 09:11:18 -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 w3csp1561659lbq; Mon, 19 Oct 2015 09:11:17 -0700 (PDT) X-Received: by 10.107.38.210 with SMTP id m201mr31882160iom.98.1445271076857; Mon, 19 Oct 2015 09:11:16 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p130si27027886iop.126.2015.10.19.09.11.16; Mon, 19 Oct 2015 09:11:16 -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 2B4CA619B9; Mon, 19 Oct 2015 16:11:16 +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 7B67F6196E; Mon, 19 Oct 2015 16:08:24 +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 B5B5061C8B; Mon, 19 Oct 2015 16:08:20 +0000 (UTC) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) by lists.linaro.org (Postfix) with ESMTPS id C903A61941 for ; Mon, 19 Oct 2015 16:08:13 +0000 (UTC) Received: by lffv3 with SMTP id v3so114734655lff.0 for ; Mon, 19 Oct 2015 09:08:12 -0700 (PDT) X-Received: by 10.25.18.71 with SMTP id h68mr10016140lfi.94.1445270892611; Mon, 19 Oct 2015 09:08:12 -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 k186sm1732158lfg.8.2015.10.19.09.08.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Oct 2015 09:08:11 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 19 Oct 2015 19:07:59 +0300 Message-Id: <1445270883-8069-5-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445270883-8069-1-git-send-email-maxim.uvarov@linaro.org> References: <1445270883-8069-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv10 4/8] 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::231 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 6bb2bda..fe01c5d 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"); }