From patchwork Wed Oct 28 13:42:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 55692 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp129965lbr; Wed, 28 Oct 2015 06:46:58 -0700 (PDT) X-Received: by 10.140.168.11 with SMTP id o11mr3148076qho.28.1446040018662; Wed, 28 Oct 2015 06:46:58 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n10si42153922qki.73.2015.10.28.06.46.58; Wed, 28 Oct 2015 06:46:58 -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; 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 527E8619B2; Wed, 28 Oct 2015 13:46:58 +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 C38E7619C7; Wed, 28 Oct 2015 13:43:50 +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 E1E4561FBE; Wed, 28 Oct 2015 13:43:16 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by lists.linaro.org (Postfix) with ESMTPS id BF10861FB4 for ; Wed, 28 Oct 2015 13:43:01 +0000 (UTC) Received: by lbbwb3 with SMTP id wb3so5956178lbb.1 for ; Wed, 28 Oct 2015 06:43:00 -0700 (PDT) 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=PJLntlUM9KDgrK0Nt4gtCKrIeqZIV+56LfrT/65Q47cyGAbNb27aO/icJAM6bURhNx AfZv6yLClk3ikW2VHMrimsjxPZ+eFeB/GBtVlJ9A0t9KpJ2SQjN8WyoetCAwtpyqYjTs ZCSRCuU+9qTsET7WIH5LQ4B9Spaly9GJaey54+D5KAmUgPAXUBUrKoHpfUgNpEnlIlAn k9KvglHDqXSrlyvCHrRHdowe26f8OOvz6ik/9qoebTcgfHXdU++g+YHSJlMTNmKm1oXj xF720wXsoJBSti3BKqIMbniQbQjobXNOFvI4pI9HC1or0aEvp6yZoPbiT2GB79vPqITq fCTA== 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=G4nl12oBZAjPXN4HAnBia/BEYKYe+vuowxvQY+p0iZsbwSWJ62OJb8C6gRyrQhZlg+ t9dx8/WOWmASjTkeFbl/QwUEBiEJN12cDiS78mNb7B2vzajURTJfRbwg/P+EXTrG7A0x 9/MxS3BMhz5LhaNJAjpXtHz7vHaP3dZYq3Ztq11xzwbCtS0pE7HtJ+UqXsZgYxZBxQSJ DaufBgmoQ2L8l6r83hwKfc2407BzCHHW2iC5Yb07aWYm3DZSk0Be9+eyfEycIqnSrBe8 fhjJKkyvkFhyukLL5XRIQLKgyNNRvABqpKfqMMrZPTJiPCfpg8Zo+bYhYy+AvWX8jEWM 5oZg== X-Gm-Message-State: ALoCoQmRdhcYC0P2pKzqmif+uskmvbUM41wGncG0pHrJ2ouS5LaK2z5Apq/TYTSd7FjMbEGaGJLT X-Received: by 10.112.144.225 with SMTP id sp1mr9523220lbb.97.1446039780730; Wed, 28 Oct 2015 06:43:00 -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 b142sm4471309lfb.46.2015.10.28.06.42.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Oct 2015 06:43:00 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 28 Oct 2015 16:42:48 +0300 Message-Id: <1446039773-28325-4-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1446039773-28325-1-git-send-email-maxim.uvarov@linaro.org> References: <1446039773-28325-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv12 3/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: "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"); }