From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 162802583 for ; Tue, 29 May 2018 11:09:40 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2018 02:09:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,455,1520924400"; d="scan'208";a="43613478" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.12.58]) ([10.252.12.58]) by fmsmga008.fm.intel.com with ESMTP; 29 May 2018 02:09:36 -0700 To: Honnappa Nagarahalli , olivier.matz@6wind.com Cc: dev@dpdk.org References: <1527571694-121047-1-git-send-email-honnappa.nagarahalli@arm.com> From: "Burakov, Anatoly" Message-ID: <3b43c395-2ebd-228a-23be-cbe149e4c812@intel.com> Date: Tue, 29 May 2018 10:09:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1527571694-121047-1-git-send-email-honnappa.nagarahalli@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] rte_ring: clarify preemptible nature of ring algorithm X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2018 09:09:41 -0000 On 29-May-18 6:28 AM, Honnappa Nagarahalli wrote: > rte_ring implementation is not preemptible only under certain > circumstances. This clarification is helpful for data plane and > control plane communication using rte_ring. > > Signed-off-by: Honnappa Nagarahalli > Reviewed-by: Gavin Hu > Reviewed-by: Ola Liljedahl > --- > v2: > * Fixed checkpatch warnings > > lib/librte_ring/rte_ring.h | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h > index d3d3f7f..2f9c945 100644 > --- a/lib/librte_ring/rte_ring.h > +++ b/lib/librte_ring/rte_ring.h > @@ -26,8 +26,13 @@ > * - Bulk dequeue. > * - Bulk enqueue. > * > - * Note: the ring implementation is not preemptable. A lcore must not > - * be interrupted by another task that uses the same ring. > + * Note: the ring implementation can block threads from completing their > + * operation under the following circumstances. > + * A preempted thread can block other threads (operating on the same ring) > + * from completing their operations, only if those threads are performing > + * the same ring operation (enqueue/dequeue) as the preempted thread. > + * In other words, a preempted consumer thread will not block any producer > + * threads and vice versa. > * > */ > > Similar clarification is already present in Programmer's Guide for rte_ring section. Perhaps it would be good to reference it here? -- Thanks, Anatoly