From patchwork Fri Oct 9 11:59:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 54694 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 3F40622DB6 for ; Fri, 9 Oct 2015 12:02:18 +0000 (UTC) Received: by wisv5 with SMTP id v5sf27733209wis.0 for ; Fri, 09 Oct 2015 05:02:17 -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=JQ6MXzyWeVrq/HC4CU6ZSimHdik9rDMfQ5wsXaBz03YLxi8BwPxh9L2SC8v6wdwcg8 tohwJUpVZHQ+ezi8FKB+W7pd74MGsjZVb62eyzTH0XusN2eD9t3HZHAz+RYyPpY647fQ pk8XB8E+oVL4K6k9M8im9bc88qCY6G7doWf3YxX+ThMEFz2x2vZo4PMg8FPtsoYNOetZ jefz6/wNUhL8Ea+LZtQ1lDsSs7pyqqzEQ5YI3Cp2w5/hprxKjluRQZjhKq5c68pLvqFl km/8fcULqWdNY6c1I3viIXtFtVdBHQQARM+0NSe/KFIJZZXFmbsEIMrNB9VtiPUmRk+x ofhw== X-Gm-Message-State: ALoCoQlFbIcX6O5SdGwfWIZ9sRzzxJVwMiH5cJSbCT0nuij/9L6PlELuCTUaViQfxU2gNyDDsY2m X-Received: by 10.195.18.100 with SMTP id gl4mr2546942wjd.4.1444392137577; Fri, 09 Oct 2015 05:02:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.151.203 with SMTP id z194ls270850lfd.57.gmail; Fri, 09 Oct 2015 05:02:17 -0700 (PDT) X-Received: by 10.25.143.72 with SMTP id r69mr4166448lfd.65.1444392137247; Fri, 09 Oct 2015 05:02:17 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id e76si947908lfe.27.2015.10.09.05.02.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Oct 2015 05:02:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbwr8 with SMTP id r8so77662062lbw.2 for ; Fri, 09 Oct 2015 05:02:17 -0700 (PDT) X-Received: by 10.25.205.198 with SMTP id d189mr4196156lfg.72.1444392137108; Fri, 09 Oct 2015 05:02:17 -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 w3csp1158065lbq; Fri, 9 Oct 2015 05:02:16 -0700 (PDT) X-Received: by 10.107.130.217 with SMTP id m86mr16683670ioi.22.1444392136087; Fri, 09 Oct 2015 05:02:16 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o85si2257915ioi.24.2015.10.09.05.02.13; Fri, 09 Oct 2015 05:02: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 B51A961A50; Fri, 9 Oct 2015 12:02:13 +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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 B7E7761B1A; Fri, 9 Oct 2015 11:59:20 +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 EC5E561A41; Fri, 9 Oct 2015 11:59:11 +0000 (UTC) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by lists.linaro.org (Postfix) with ESMTPS id BACAE61815 for ; Fri, 9 Oct 2015 11:59:08 +0000 (UTC) Received: by lbos8 with SMTP id s8so77426676lbo.0 for ; Fri, 09 Oct 2015 04:59:07 -0700 (PDT) X-Received: by 10.112.14.9 with SMTP id l9mr6351044lbc.91.1444391947704; Fri, 09 Oct 2015 04:59:07 -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 v19sm235052lfd.7.2015.10.09.04.59.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Oct 2015 04:59:07 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Fri, 9 Oct 2015 14:59:00 +0300 Message-Id: <1444391944-20772-5-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444391944-20772-1-git-send-email-maxim.uvarov@linaro.org> References: <1444391944-20772-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv9 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-Removed-Original-Auth: Dkim didn't pass. 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 209.85.217.171 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org 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"); }