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 588DA56A1 for ; Fri, 30 Sep 2016 17:03:09 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 30 Sep 2016 08:03:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,273,1473145200"; d="scan'208";a="1064494341" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga002.fm.intel.com with ESMTP; 30 Sep 2016 08:03:07 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.6]) by IRSMSX152.ger.corp.intel.com ([169.254.6.13]) with mapi id 14.03.0248.002; Fri, 30 Sep 2016 16:03:06 +0100 From: "Pattan, Reshma" To: "Kerlin, MarcinX" , "dev@dpdk.org" CC: "De Lara Guarch, Pablo" , "thomas.monjalon@6wind.com" , "Kerlin, MarcinX" Thread-Topic: [dpdk-dev] [PATCH v5 0/2] app/testpmd: improve multiprocess support Thread-Index: AQHSGyP8SgPoxoEBI06fBkT1DW7N+KCSIQVQ Date: Fri, 30 Sep 2016 15:03:05 +0000 Message-ID: <3AEA2BF9852C6F48A459DA490692831F010AA109@IRSMSX109.ger.corp.intel.com> References: <1474974783-4861-2-git-send-email-marcinx.kerlin@intel.com> <1475244055-6309-1-git-send-email-marcinx.kerlin@intel.com> In-Reply-To: <1475244055-6309-1-git-send-email-marcinx.kerlin@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDQ2ZGIzNDItYTc3MC00YzVmLWFlOGMtYzZhNzRmZDY0YzIzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlZTRmllNDJhYVZMU2h6aG5NdUtzZTB5aHJzbWpjV1Y2dTdoRzN1eTF5NU09In0= x-ctpclassification: CTP_IC 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 v5 0/2] app/testpmd: improve multiprocess support 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: Fri, 30 Sep 2016 15:03:09 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marcin Kerlin > Sent: Friday, September 30, 2016 3:01 PM > To: dev@dpdk.org > Cc: De Lara Guarch, Pablo ; > thomas.monjalon@6wind.com; Kerlin, MarcinX > Subject: [dpdk-dev] [PATCH v5 0/2] app/testpmd: improve multiprocess supp= ort >=20 > This patch ensure not overwrite device data in the multiprocess applicati= on. >=20 > 1)Changes in the library introduces continuity in array rte_eth_dev_data[= ] shared > between all processes. Secondary process adds new entries in free space i= nstead > of overwriting existing entries. >=20 > 2)Changes in application testpmd allow secondary process to attach the > mempool created by primary process rather than create new and in the case= of > quit or force quit to free devices data from shared array rte_eth_dev_dat= a[]. >=20 > ------------------------- > How to reproduce the bug: >=20 > 1) Run primary process: > ./testpmd -c 0xf -n 4 --socket-mem=3D'512,0' -w 03:00.1 -w 03:00.0 --proc= - > type=3Dprimary --file-prefix=3Dxz1 -- -i >=20 > (gdb) print rte_eth_devices[0].data.name > $52 =3D "3:0.1" > (gdb) print rte_eth_devices[1].data.name > $53 =3D "3:0.0" >=20 > 2) Run secondary process: > ./testpmd -c 0xf0 --socket-mem=3D'512,0' -n 4 -v -b 03:00.1 -b 03:00.0 --= vdev > 'eth_pcap0,rx_pcap=3D/var/log/device1.pcap, tx_pcap=3D/var/log/device2.pc= ap' > --proc-type=3Dsecondary --file-prefix=3Dxz1 -- -i >=20 > (gdb) print rte_eth_devices[0].data.name > $52 =3D "eth_pcap0" > (gdb) print rte_eth_devices[1].data.name > $53 =3D "eth_pcap1" >=20 > 3) Go back to the primary and re-check: > (gdb) print rte_eth_devices[0].data.name > $54 =3D "eth_pcap0" > (gdb) print rte_eth_devices[1].data.name > $55 =3D "eth_pcap1" >=20 > It means that secondary process overwrite data of primary process. >=20 > This patch fix it and now if we go back to the primary and re-check then > everything is fine: > (gdb) print rte_eth_devices[0].data.name > $56 =3D "3:0.1" > (gdb) print rte_eth_devices[1].data.name > $57 =3D "3:0.0" >=20 > So after this fix structure rte_eth_dev_data[] will keep all data one aft= er the > other instead of overwriting: > (gdb) print rte_eth_dev_data[0].name > $52 =3D "3:0.1" > (gdb) print rte_eth_dev_data[1].name > $53 =3D "3:0.0" > (gdb) print rte_eth_dev_data[2].name > $54 =3D "eth_pcap0" > (gdb) print rte_eth_dev_data[3].name > $55 =3D "eth_pcap1" > and so on will be append in the next indexes >=20 > If secondary process will be turned off then also will be deleted from ar= ray: > (gdb) print rte_eth_dev_data[0].name > $52 =3D "3:0.1" > (gdb) print rte_eth_dev_data[1].name > $53 =3D "3:0.0" > (gdb) print rte_eth_dev_data[2].name > $54 =3D "" > (gdb) print rte_eth_dev_data[3].name > $55 =3D "" > this also allows re-use index 2 and 3 for next another process > ------------------------- >=20 > Breaking ABI: > Changes in the library librte_ether causes extending existing structure > rte_eth_dev_data with a new field lock. The reason is that this structure= is > sharing between all the processes so it should be protected against attem= pting > to write from two different processes. >=20 > Tomasz Kulasek sent announce ABI change in librte_ether on 21 July 2016. > I would like to join to this breaking ABI, if it is possible. >=20 > v2: > * fix syntax error in version script > v3: > * changed scope of function > * improved description > v4: > * fix syntax error in version script > v5: > * fix header file >=20 > Marcin Kerlin (2): > librte_ether: add protection against overwrite device data > app/testpmd: improve handling of multiprocess >=20 > app/test-pmd/testpmd.c | 37 +++++++++++++- > app/test-pmd/testpmd.h | 1 + > lib/librte_ether/rte_ethdev.c | 90 ++++++++++++++++++++++++++++= +++--- > lib/librte_ether/rte_ethdev.h | 12 +++++ > lib/librte_ether/rte_ether_version.map | 6 +++ > 5 files changed, 136 insertions(+), 10 deletions(-) >=20 > -- > 1.9.1 Acked-by: Reshma Pattan