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 A890B47CD for ; Mon, 13 Jun 2016 14:28:11 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 13 Jun 2016 05:28:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,466,1459839600"; d="scan'208";a="1000837154" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by fmsmga002.fm.intel.com with ESMTP; 13 Jun 2016 05:28:10 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by IRSMSX109.ger.corp.intel.com (163.33.3.23) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 13 Jun 2016 13:28:08 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.183]) by IRSMSX156.ger.corp.intel.com ([10.108.20.68]) with mapi id 14.03.0248.002; Mon, 13 Jun 2016 13:28:09 +0100 From: "Iremonger, Bernard" To: "Richardson, Bruce" CC: "dev@dpdk.org" , "Doherty, Declan" , "Ananyev, Konstantin" Thread-Topic: [dpdk-dev] [PATCH v3 3/4] bonding: take queue spinlock in rx/tx burst functions Thread-Index: AQHRxM18/A1UDGyp2k6AoPL2Wnlv+p/nDpiAgAAtvzA= Date: Mon, 13 Jun 2016 12:28:08 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C21A038B2E@IRSMSX108.ger.corp.intel.com> References: <1464280727-25752-2-git-send-email-bernard.iremonger@intel.com> <1465751489-10111-1-git-send-email-bernard.iremonger@intel.com> <1465751489-10111-4-git-send-email-bernard.iremonger@intel.com> <20160613091800.GA17996@bricha3-MOBL3> In-Reply-To: <20160613091800.GA17996@bricha3-MOBL3> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzQ0OTU1N2ItM2M2Zi00ZjdmLTllYWItYjQ5M2QwYWI2ZGM0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImJsenlpR0xONlN5ZTh3U1ZJWVFIZzNZbzJtS0kwNGRZb2FBXC9OZGJpOHpzPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 3/4] bonding: take queue spinlock in rx/tx burst functions 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: Mon, 13 Jun 2016 12:28:12 -0000 Hi Bruce, > Subject: Re: [dpdk-dev] [PATCH v3 3/4] bonding: take queue spinlock in rx= /tx > burst functions >=20 > On Sun, Jun 12, 2016 at 06:11:28PM +0100, Bernard Iremonger wrote: > > Use rte_spinlock_trylock() in the rx/tx burst functions to take the > > queue spinlock. > > > > Signed-off-by: Bernard Iremonger > > Acked-by: Konstantin Ananyev > > --- >=20 > Why does this particular PMD need spinlocks when doing RX and TX, while > other device types do not? How is adding/removing devices from a bonded > device different to other control operations that can be done on physical > PMDs? Is this not similar to say bringing down or hotplugging out a physi= cal > port just before an RX or TX operation takes place? > For all other PMDs we rely on the app to synchronise control and data pla= ne > operation - why not here? >=20 > /Bruce This issue arose during VM live migration testing.=20 For VM live migration it is necessary (while traffic is running) to be able= to remove a bonded slave device, stop it, close it and detach it. It a slave device is removed from a bonded device while traffic is running = a segmentation fault may occur in the rx/tx burst function. The spinlock ha= s been added to prevent this occurring. The bonding device already uses a spinlock to synchronise between the add a= nd remove functionality and the slave_link_status_change_monitor code.=20 Previously testpmd did not allow, stop, close or detach of PMD while traffi= c was running. Testpmd has been modified with the following patchset=20 http://dpdk.org/dev/patchwork/patch/13472/ It now allows stop, close and detach of a PMD provided in it is not forward= ing and is not a slave of bonded PMD. Regards, Bernard.