From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id AA53AADED for ; Wed, 15 Jun 2016 10:37:57 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 15 Jun 2016 01:37:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,475,1459839600"; d="scan'208";a="828410724" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga003.jf.intel.com with ESMTP; 15 Jun 2016 01:37:54 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 15 Jun 2016 09:37:53 +0100 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.51]) by irsmsx111.ger.corp.intel.com ([169.254.2.182]) with mapi id 14.03.0248.002; Wed, 15 Jun 2016 09:37:53 +0100 From: "Ananyev, Konstantin" To: Thomas Monjalon , "Pattan, Reshma" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v9 1/8] ethdev: use locks to protect Rx/Tx callback lists Thread-Index: AQHRxsb8c+QpcxnBPE2qkSBe1aWjuJ/qHtqAgAAUOJA= Date: Wed, 15 Jun 2016 08:37:52 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B714ED@irsmsx105.ger.corp.intel.com> References: <1465575534-23605-1-git-send-email-reshma.pattan@intel.com> <12886124.K2biJ8F8kE@xps13> <3AEA2BF9852C6F48A459DA490692831F0104E1EE@IRSMSX109.ger.corp.intel.com> <10886152.VH5xYhdqG2@xps13> In-Reply-To: <10886152.VH5xYhdqG2@xps13> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 v9 1/8] ethdev: use locks to protect Rx/Tx callback lists X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 08:37:58 -0000 Hi Thomas, > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, June 15, 2016 9:19 AM > To: Pattan, Reshma > Cc: dev@dpdk.org; Ananyev, Konstantin > Subject: Re: [dpdk-dev] [PATCH v9 1/8] ethdev: use locks to protect Rx/Tx= callback lists >=20 > 2016-06-15 05:30, Pattan, Reshma: > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > > 2016-06-14 10:38, Reshma Pattan: > > > > Added spinlocks around add/remove logic of Rx and Tx callbacks to > > > > avoid corruption of callback lists in multithreaded context. > > > > > > > > Signed-off-by: Reshma Pattan > > > > > > Why cb->next is not locked in burst functions? > > It is safe to do "read access" here and doesn't require any locking as = rx/tx burst is initiated by only local user(control plane) thread. > > > > > Just protecting add/remove but not its usage seems useless. > > Here locks were required around add/remove to protect "write access" = because write to callback list is now done from 2 threads > > i.e. one from local user thread(control plane) and another from pdump c= ontrol thread(initiated by remote pdump request). >=20 > So read and write can be done by different threads. Yes, and this is possible even in current DPDK version (16.04). What is added by Reshma's patch - now it is possible to have concurrent wri= te from 2 different thread to that list. =20 > I think the read access would need locking but we do not want it > in fast path. I don't think it would be needed. As I said - read/write interaction didn't change from what we have right no= w. But if you have some particular scenario in mind that you believe would cau= se a race condition - please speak up. =20 Konstantin > Are you sure there is no issue in this design?