From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3E41EA057B; Thu, 2 Apr 2020 10:42:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 350881BEDC; Thu, 2 Apr 2020 10:42:11 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 448221BED9 for ; Thu, 2 Apr 2020 10:42:09 +0200 (CEST) IronPort-SDR: 3ue6FxaN9rUDKLRhc5qs5hCU18XsdFDVpAm1BDO6pAS+IG0ngnq79tKl2Z8G0d8PT+FgPWISEi mR+kMt+9iidA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2020 01:42:08 -0700 IronPort-SDR: vPVKc3scs0clMsRxRsv9xhOz7HuNSPnOF9svgI509Pe2CbEaqChH0VGgR+g0Exr54zso5OCK+C UHkm5TVRsKtQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,335,1580803200"; d="scan'208";a="243002218" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga008.jf.intel.com with ESMTP; 02 Apr 2020 01:42:07 -0700 Received: from shsmsx604.ccr.corp.intel.com (10.109.6.214) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Apr 2020 01:41:47 -0700 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by SHSMSX604.ccr.corp.intel.com (10.109.6.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 2 Apr 2020 16:41:45 +0800 Received: from shsmsx603.ccr.corp.intel.com ([10.109.6.143]) by SHSMSX603.ccr.corp.intel.com ([10.109.6.143]) with mapi id 15.01.1713.004; Thu, 2 Apr 2020 16:41:45 +0800 From: "Wang, Yinan" To: "Xiao, QimaiX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1]tests/TestSuite_hotplug_mp: add two virtio cases in hutplug_mp Thread-Index: AQHWCAx34oMMRr9pfE+WDz7tAnpLWqhlhOFg Date: Thu, 2 Apr 2020 08:41:45 +0000 Message-ID: References: <1585732002-328121-1-git-send-email-qimaix.xiao@intel.com> <1585732002-328121-2-git-send-email-qimaix.xiao@intel.com> <4d07c3b944bd4cd68e29149e3e0601c7@intel.com> In-Reply-To: <4d07c3b944bd4cd68e29149e3e0601c7@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1]tests/TestSuite_hotplug_mp: add two virtio cases in hutplug_mp X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Acked-by: Wang, Yinan > -----Original Message----- > From: dts On Behalf Of Xiao, QimaiX > Sent: 2020=1B$BG/=1B(B4=1B$B7n=1B(B1=1B$BF|=1B(B 18:00 > To: dts@dpdk.org > Subject: Re: [dts] [PATCH V1]tests/TestSuite_hotplug_mp: add two virtio > cases in hutplug_mp >=20 > Tested-by: : Xiao, QimaiX >=20 > Regards, > Xiao Qimai >=20 >=20 > > -----Original Message----- > > From: Xiao, QimaiX > > Sent: Wednesday, April 1, 2020 5:07 PM > > To: dts@dpdk.org > > Cc: Xiao, QimaiX > > Subject: [dts][PATCH V1]tests/TestSuite_hotplug_mp: add two virtio > > cases in hutplug_mp > > > > *. add 2 virtio cases > > > > Signed-off-by: Xiao Qimai > > --- > > tests/TestSuite_hotplug_mp.py | 78 > > ++++++++++++++++++++++++++++++++++--------- > > 1 file changed, 62 insertions(+), 16 deletions(-) > > > > diff --git a/tests/TestSuite_hotplug_mp.py > > b/tests/TestSuite_hotplug_mp.py index c756ca8..4cb5ce5 100644 > > --- a/tests/TestSuite_hotplug_mp.py > > +++ b/tests/TestSuite_hotplug_mp.py > > @@ -8,6 +8,7 @@ Hotplug Multi-process Test. > > import utils > > import time > > from test_case import TestCase > > +import itertools > > > > test_loop =3D 2 > > > > @@ -29,6 +30,7 @@ class TestHotplugMp(TestCase): > > # Start two new sessions to run secondary process > > self.session_sec_1 =3D self.dut.new_session() > > self.session_sec_2 =3D self.dut.new_session() > > + self.session_vhost =3D self.dut.new_session() > > if self.drivername !=3D "": > > self.dut.bind_interfaces_linux(self.kdriver) > > > > @@ -81,7 +83,7 @@ class TestHotplugMp(TestCase): > > if flg_exist =3D=3D 0: > > self.verify(dev not in out, "Fail that have the > > device!") > > > > - def attach_detach(self, process=3D"pri", is_dev=3D1, opt_plug=3D"p= lugin", > > flg_loop=3D0, dev=3D"0000:00:00.0"): > > + def attach_detach(self, process=3D"pri", is_dev=3D1, > > + opt_plug=3D"plugin", > > flg_loop=3D0, dev=3D"0000:00:00.0", iface=3DNone): > > """ > > Attach or detach physical/virtual device from primary/secondar= y > > process. > > @@ -99,23 +101,33 @@ class TestHotplugMp(TestCase): > > dev: define physical device PCI "0000:00:00.0" or virtual devi= ce > > "net_af_packet" > > """ > > - > > + iface =3D self.intf0 if not iface else iface > > if opt_plug =3D=3D "plugin": > > self.verify_devlist(dev, flg_exist=3D0) > > for i in range(test_loop): > > if process =3D=3D "pri": > > if is_dev =3D=3D 0: > > - self.session_pri.send_expect( > > - "attach %s,iface=3D%s" > > - % (dev, self.intf0), "example>", 100) > > + if not 'virtio' in dev: > > + self.session_pri.send_expect( > > + "attach %s,iface=3D%s" > > + % (dev, iface), "example>", 100) > > + else: > > + self.session_pri.send_expect( > > + "attach %s,%s" > > + % (dev, iface), "example>", 100) > > else: > > self.session_pri.send_expect( > > "attach %s" % dev, "example>", 100) > > if process =3D=3D "sec": > > if is_dev =3D=3D 0: > > - self.session_sec_1.send_expect( > > - "attach %s,iface=3D%s" > > - % (dev, self.intf0), "example>", 100) > > + if not 'virtio' in dev: > > + self.session_sec_1.send_expect( > > + "attach %s,iface=3D%s" > > + % (dev, iface), "example>", 100) > > + else: > > + self.session_sec_1.send_expect( > > + "attach %s,%s" > > + % (dev, iface), "example>", 100) > > else: > > self.session_sec_1.send_expect( > > "attach %s" % dev, "example>", 100) @@ > > -168,7 +180,7 @@ class TestHotplugMp(TestCase): > > self.multi_process_quit() > > self.dut.bind_interfaces_linux(self.kdriver) > > > > - def attach_detach_vdev(self, process=3D"pri", opt_plug=3D"plugin", > > flg_loop=3D0, dev=3D"net_af_packet"): > > + def attach_detach_vdev(self, process=3D"pri", opt_plug=3D"plugin", > > flg_loop=3D0, dev=3D"net_af_packet", iface=3DNone): > > """ > > Attach or detach virtual device from primary/secondary process= . > > Check port interface is at link up status before hotplug test. > > @@ -176,23 +188,24 @@ class TestHotplugMp(TestCase): > > rte_pmd_init_internals(): net_af_packet: ioctl failed (SIOCGIF= INDEX) > > EAL: Driver cannot attach the device (net_af_packet) > > """ > > - self.dut.send_expect("ifconfig %s up" % self.intf0, "#") > > - time.sleep(5) > > - out =3D self.dut.send_expect("ethtool %s" % self.intf0, "#") > > - self.verify("Link detected: yes" in out, "Wrong link status") > > + if not iface: > > + self.dut.send_expect("ifconfig %s up" % self.intf0, "#") > > + time.sleep(5) > > + out =3D self.dut.send_expect("ethtool %s" % self.intf0, "#= ") > > + self.verify("Link detected: yes" in out, "Wrong link > > + status") > > > > self.multi_process_setup() > > for i in range(test_loop): > > - self.attach_detach(process, 0, "plugin", flg_loop, dev) > > + self.attach_detach(process, 0, "plugin", flg_loop, dev, > > + iface=3Diface) > > if opt_plug in ["plugout", "hotplug", "crossplug"]: > > if opt_plug =3D=3D "crossplug": > > if process =3D=3D "pri": > > cross_proc =3D "sec" > > elif process =3D=3D "sec": > > cross_proc =3D "pri" > > - self.attach_detach(cross_proc, 0, "plugout", flg_l= oop, dev) > > + self.attach_detach(cross_proc, 0, "plugout", > > + flg_loop, dev, iface=3Diface) > > else: > > - self.attach_detach(process, 0, "plugout", flg_loop= , dev) > > + self.attach_detach(process, 0, "plugout", > > + flg_loop, dev, iface=3Diface) > > > > if opt_plug =3D=3D "plugin" or opt_plug =3D=3D "plugout": > > break > > @@ -299,6 +312,39 @@ class TestHotplugMp(TestCase): > > """ > > self.attach_detach_vdev("sec", "crossplug", 1, > > "net_af_packet") > > > > + def test_attach_detach_vhost_user(self): > > + """ > > + Repeat to attach and detach vhost-user device > > + """ > > + vdev =3D "net_vhost0" > > + self.attach_detach_vdev("pri", "hotplug", 1, vdev, > > + iface=3D"vhost- > > net,queues=3D1,client=3D0") > > + self.attach_detach_vdev("sec", "hotplug", 1, vdev, > > + iface=3D"vhost- > > net,queues=3D1,client=3D0") > > + self.attach_detach_vdev("pri", "crossplug", 1, vdev, > > + iface=3D"vhost- > > net,queues=3D1,client=3D0") > > + self.attach_detach_vdev("sec", "crossplug", 1, vdev, > > + iface=3D"vhost-net,queues=3D1,client=3D0") > > + > > + def test_attach_detach_virtio_user(self): > > + """ > > + Repeat to attach and detach virtio-user device > > + """ > > + vdev =3D "net_virtio_user0" > > + self.path =3D "/home/vhost-net" > > + self.session_vhost.send_expect("rm -rf %s" % self.path, "#") > > + eal_param =3D self.dut.create_eal_parameters(no_pci=3DTrue, > > prefix=3D'vhost',vdevs=3D["eth_vhost0,iface=3D%s" % self.path]) > > + param =3D ' -- -i' > > + testpmd_cmd =3D "./%s/app/testpmd " % self.target + eal_param = + > > param > > + self.session_vhost.send_expect(testpmd_cmd, 'testpmd> ', > > timeout=3D60) > > + try: > > + self.attach_detach_vdev("pri", "hotplug", 1, vdev, > > > iface=3D"mac=3D00:01:02:03:04:05,path=3D%s,packed_vq=3D1,mrg_rxbuf=3D1,in= _order > > =3D0" % self.path) > > + self.attach_detach_vdev("sec", "hotplug", 1, vdev, > > > iface=3D"mac=3D00:01:02:03:04:05,path=3D%s,packed_vq=3D1,mrg_rxbuf=3D1,in= _order > > =3D0" % self.path) > > + self.attach_detach_vdev("pri", "crossplug", 1, vdev, > > > iface=3D"mac=3D00:01:02:03:04:05,path=3D%s,packed_vq=3D1,mrg_rxbuf=3D1,in= _order > > =3D0" % self.path) > > + self.attach_detach_vdev("sec", "crossplug", 1, vdev, > > > iface=3D"mac=3D00:01:02:03:04:05,path=3D%s,packed_vq=3D1,mrg_rxbuf=3D1,in= _order > > =3D0" % self.path) > > + except Exception as e: > > + self.logger.info(e) > > + raise Exception(e) > > + finally: > > + self.dut.send_expect("rm -rf %s" % self.path, "#") > > + self.dut.kill_all() > > + > > def tear_down(self): > > """ > > Run after each test case. > > -- > > 1.8.3.1