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 93BA4A05DC for ; Mon, 10 Jun 2019 07:07:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACDC11BDE7; Mon, 10 Jun 2019 07:07:55 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4B4BD1BDDF for ; Mon, 10 Jun 2019 07:07:54 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jun 2019 22:07:53 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 09 Jun 2019 22:07:53 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 9 Jun 2019 22:07:52 -0700 Received: from BGSMSX107.gar.corp.intel.com (10.223.4.191) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 9 Jun 2019 22:07:52 -0700 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.109]) by BGSMSX107.gar.corp.intel.com ([169.254.9.94]) with mapi id 14.03.0415.000; Mon, 10 Jun 2019 10:37:46 +0530 From: "Varghese, Vipin" To: Stephen Hemminger 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: AQHVHJZTSox6wG22SEqA+y7b3zcuwKaOrIWAgAWuNlA= Date: Mon, 10 Jun 2019 05:07:45 +0000 Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D36601D@BGSMSX101.gar.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-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDNjOTI5MjctZTljZC00NTI4LWJkZGUtZTcwYWZiNTFkN2MzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQWlJaVNVaVlxR1lYbmJtek56SXdLbkJodHRHUFRiNXNselNTRWRka0hiUDdpSmI0aEZWcGx5ZnFtSnY4MnppRyJ9 dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.223.10.10] 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" Hi Stephen, snipped > NAK > What is the use case for this?=20 Use cases: - allow user to investigate the contents pre-enqueue. - allow user to investigate the contents post-dequeue. - modify pre-enqueue and post-dequeue stage content. - investigate PMD meta data. Rings are one of the most used elements of DPDK > and anything like this will have performance impact. Based on the current testing with 10G, the impact with callback handlers en= abled with no or one has less than 0.1% with SP-SC. I will test for more ca= ses like SP-MC, MP-SC, and MP-MC. >=20 > And as DPDK goes to more of distribution model, all features have to be e= nabled. >=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 ordering. Yes, thanks you for pointing this out, Let me correct the same.