From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 8B248A0096 for ; Fri, 7 Jun 2019 12:45:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A9B281BACB; Fri, 7 Jun 2019 12:45:15 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 06BDE3DC for ; Fri, 7 Jun 2019 12:45:13 +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 orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2019 03:45:09 -0700 X-ExtLoop1: 1 Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by fmsmga008.fm.intel.com with ESMTP; 07 Jun 2019 03:45:08 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.227]) by irsmsx110.ger.corp.intel.com ([169.254.15.167]) with mapi id 14.03.0415.000; Fri, 7 Jun 2019 11:45:07 +0100 From: "Ananyev, Konstantin" To: Stephen Hemminger , "Varghese, Vipin" CC: "olivier.matz@6wind.com" , "Pattan, Reshma" , "Wiles, Keith" , "dev@dpdk.org" , "Padubidri, Sanjay A" Thread-Topic: [dpdk-dev] [PATCH v1 1/2] lib/ring: add enqueue-dequeue callabck Thread-Index: AQHVHJZohHjcYMVHBEWdywoG8G6RPKaO9/WAgAEJiEA= Date: Fri, 7 Jun 2019 10:45:06 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725801688E19BF@IRSMSX104.ger.corp.intel.com> References: <20190606183355.56734-1-vipin.varghese@intel.com> <20190606124927.1a369d5b@hermes.lan> In-Reply-To: <20190606124927.1a369d5b@hermes.lan> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzgxNTQxYTUtNThkZi00ZGZlLWE1NDUtNDJiMmZiNDUyNzY1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicDAxblMzYk1rOCtYcHJjK1FraWs0N010UWhcL3pMc1VqUTlLc0J1b2MySXhEajN3NFZOajlFZ2NHMEZrMUxQYU0ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1 1/2] lib/ring: add enqueue-dequeue callabck 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger > Sent: Thursday, June 6, 2019 8:49 PM > To: Varghese, Vipin > Cc: olivier.matz@6wind.com; Pattan, Reshma ; Wil= es, Keith ; dev@dpdk.org; > Padubidri, Sanjay A > Subject: Re: [dpdk-dev] [PATCH v1 1/2] lib/ring: add enqueue-dequeue call= abck >=20 > On Fri, 7 Jun 2019 00:03:54 +0530 > Vipin Varghese wrote: >=20 > > Add callback event handler for enqueue dequeue operation on ring. > > The pre-enqueue and post-dequeue operation on ring is selected to > > invoke user callback handler. > > > > Signed-off-by: Vipin Varghese > > --- >=20 > NAK > What is the use case for this? Rings are one of the most used elements > of DPDK and anything like this will have performance impact. >=20 > And as DPDK goes to more of distribution model, all features have to be > enabled. +1 here. Approach in general looks quite expensive, most users wouldn't need it. For those who want such functionality, it is not big deal to create a wrapp= er on top of current rte_ring (drivers/net/ring could be one example). Konstantin >=20 >=20 > Also, this looks like a problem: > +struct rte_ring_callback { > + TAILQ_ENTRY(rte_ring_callback) next; /* Callbacks list */ > + rte_ring_cb_fn cb_fn; /* Callback address */ > + void *cb_arg; /* Parameter for callback */ > + uint32_t active; /* Callback is executing */ >=20 > The active element is likely updated in one thread and queried in another > it needs to be volatile, or better yet an atomic to ensure memory orderin= g.