* [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-compatible driver step
@ 2021-03-31 5:13 Ling Wei
2021-03-31 5:16 ` Ling, WeiX
2021-04-07 1:22 ` Tu, Lijuan
0 siblings, 2 replies; 4+ messages in thread
From: Ling Wei @ 2021-03-31 5:13 UTC (permalink / raw)
To: dts; +Cc: Ling Wei
Add bind dut ports to DPDK-compatible driver method and
step in tear_down after test_check_threshold_value_with_cbdma
exectue over.
Signed-off-by: Ling Wei <weix.ling@intel.com>
---
tests/TestSuite_vhost_cbdma.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tests/TestSuite_vhost_cbdma.py b/tests/TestSuite_vhost_cbdma.py
index 260c534e..5699a7db 100644
--- a/tests/TestSuite_vhost_cbdma.py
+++ b/tests/TestSuite_vhost_cbdma.py
@@ -110,6 +110,22 @@ class TestVirTioVhostCbdma(TestCase):
self.dut.send_expect("rm -rf /tmp/s0", "#")
self.mode_list = []
+ def bind_nic_driver(self, ports, driver=""):
+ if driver == "igb_uio":
+ for port in ports:
+ netdev = self.dut.ports_info[port]['port']
+ driver = netdev.get_nic_driver()
+ if driver != 'igb_uio':
+ netdev.bind_driver(driver='igb_uio')
+ else:
+ for port in ports:
+ netdev = self.dut.ports_info[port]['port']
+ driver_now = netdev.get_nic_driver()
+ if driver == "":
+ driver = netdev.default_driver
+ if driver != driver_now:
+ netdev.bind_driver(driver=driver)
+
def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num):
"""
get all cbdma ports
@@ -533,6 +549,8 @@ class TestVirTioVhostCbdma(TestCase):
"""
self.dut.send_expect("killall -I %s" % self.testpmd_name, '#', 20)
self.bind_cbdma_device_to_kernel()
+ if self.running_case == 'test_check_threshold_value_with_cbdma':
+ self.bind_nic_driver(self.dut_ports, self.drivername)
def tear_down_all(self):
"""
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-compatible driver step
2021-03-31 5:13 [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-compatible driver step Ling Wei
@ 2021-03-31 5:16 ` Ling, WeiX
2021-04-02 7:47 ` Wang, Yinan
2021-04-07 1:22 ` Tu, Lijuan
1 sibling, 1 reply; 4+ messages in thread
From: Ling, WeiX @ 2021-03-31 5:16 UTC (permalink / raw)
To: dts
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
> -----Original Message-----
> From: Ling, WeiX <weix.ling@intel.com>
> Sent: Wednesday, March 31, 2021 01:13 PM
> To: dts@dpdk.org
> Cc: Ling, WeiX <weix.ling@intel.com>
> Subject: [dts][PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-
> compatible driver step
>
Tested-by: Wei Ling <weix.ling@intel.com>
[-- Attachment #2: TestVirTioVhostCbdma.log --]
[-- Type: application/octet-stream, Size: 5488 bytes --]
31/03/2021 11:53:40 dts:
TEST SUITE : TestVirTioVhostCbdma
31/03/2021 11:53:40 dts: NIC : fortville_spirit
31/03/2021 11:53:41 dut.10.240.183.220:
31/03/2021 11:53:41 tester:
31/03/2021 11:53:46 tester: ls -d /tmp/vhost_cbdma
31/03/2021 11:53:47 tester: /tmp/vhost_cbdma
31/03/2021 11:53:47 dut.10.240.183.220: cat /proc/meminfo |grep Hugepagesize|awk '{print($2)}'
31/03/2021 11:53:47 dut.10.240.183.220: 1048576
31/03/2021 11:53:47 TestVirTioVhostCbdma: Test Case test_check_threshold_value_with_cbdma Begin
31/03/2021 11:53:47 dut.10.240.183.220:
31/03/2021 11:53:47 tester:
31/03/2021 11:53:47 dut.10.240.183.220: killall -I dpdk-testpmd
31/03/2021 11:53:47 dut.10.240.183.220: dpdk-testpmd: no process found
31/03/2021 11:53:47 dut.10.240.183.220: rm -rf /root/dpdk/vhost-net*
31/03/2021 11:53:47 dut.10.240.183.220:
31/03/2021 11:53:47 dut.10.240.183.220: rm -rf /tmp/s0
31/03/2021 11:53:47 dut.10.240.183.220:
31/03/2021 11:53:47 dut.10.240.183.220: ./usertools/dpdk-devbind.py --status-dev misc
31/03/2021 11:53:47 dut.10.240.183.220:
Misc (rawdev) devices using kernel driver
=========================================
0000:00:04.0 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:00:04.1 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:00:04.2 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:00:04.3 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:00:04.4 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:00:04.5 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:00:04.6 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:00:04.7 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:80:04.0 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:80:04.1 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:80:04.2 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:80:04.3 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:80:04.4 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:80:04.5 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:80:04.6 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
0000:80:04.7 'Sky Lake-E CBDMA Registers 2021' drv=ioatdma unused=igb_uio,vfio-pci
31/03/2021 11:53:47 dut.10.240.183.220: ./usertools/dpdk-devbind.py --force --bind=igb_uio 0000:80:04.0 0000:80:04.1 0000:80:04.2 0000:80:04.3
31/03/2021 11:53:48 dut.10.240.183.220:
31/03/2021 11:53:48 dut.10.240.183.220: echo 0000:af:00.0 > /sys/bus/pci/devices/0000\:af\:00.0/driver/unbind
31/03/2021 11:53:48 dut.10.240.183.220:
31/03/2021 11:53:48 dut.10.240.183.220: modprobe i40e
31/03/2021 11:53:48 dut.10.240.183.220:
31/03/2021 11:53:48 dut.10.240.183.220: echo 0000:af:00.0 > /sys/bus/pci/drivers/i40e/bind
31/03/2021 11:53:48 dut.10.240.183.220:
31/03/2021 11:53:48 dut.10.240.183.220: ifconfig ens802f0 up
31/03/2021 11:53:49 dut.10.240.183.220:
31/03/2021 11:53:49 dut.10.240.183.220: echo 0000:af:00.1 > /sys/bus/pci/devices/0000\:af\:00.1/driver/unbind
31/03/2021 11:53:49 dut.10.240.183.220:
31/03/2021 11:53:49 dut.10.240.183.220: modprobe i40e
31/03/2021 11:53:49 dut.10.240.183.220:
31/03/2021 11:53:49 dut.10.240.183.220: echo 0000:af:00.1 > /sys/bus/pci/drivers/i40e/bind
31/03/2021 11:53:49 dut.10.240.183.220:
31/03/2021 11:53:49 dut.10.240.183.220: ifconfig ens802f1 up
31/03/2021 11:53:49 dut.10.240.183.220:
31/03/2021 11:54:00 dut.10.240.183.220: cat /proc/meminfo |grep Hugepagesize|awk '{print($2)}'
31/03/2021 11:54:00 dut.10.240.183.220: 1048576
31/03/2021 11:54:11 dut.10.240.183.220: cat /proc/meminfo |grep Hugepagesize|awk '{print($2)}'
31/03/2021 11:54:12 dut.10.240.183.220: 1048576
31/03/2021 11:54:27 TestVirTioVhostCbdma: Actual Info:[]
31/03/2021 11:54:27 TestVirTioVhostCbdma: Test Case test_check_threshold_value_with_cbdma Result FAILED: 'Check failed: Actual value:[]'
31/03/2021 11:54:27 dut.10.240.183.220: killall -I dpdk-testpmd
31/03/2021 11:54:27 dut.10.240.183.220: dpdk-testpmd: no process found
31/03/2021 11:54:27 dut.10.240.183.220: modprobe ioatdma
31/03/2021 11:54:27 dut.10.240.183.220:
31/03/2021 11:54:27 dut.10.240.183.220: ./usertools/dpdk-devbind.py -u 0000:80:04.0 0000:80:04.1 0000:80:04.2 0000:80:04.3
31/03/2021 11:54:28 dut.10.240.183.220:
31/03/2021 11:54:28 dut.10.240.183.220: ./usertools/dpdk-devbind.py --force --bind=ioatdma 0000:80:04.0 0000:80:04.1 0000:80:04.2 0000:80:04.3
31/03/2021 11:54:28 dut.10.240.183.220:
31/03/2021 11:54:35 dts:
TEST SUITE ENDED: TestVirTioVhostCbdma
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-compatible driver step
2021-03-31 5:16 ` Ling, WeiX
@ 2021-04-02 7:47 ` Wang, Yinan
0 siblings, 0 replies; 4+ messages in thread
From: Wang, Yinan @ 2021-04-02 7:47 UTC (permalink / raw)
To: Ling, WeiX, dts
Acked-by: Wang, Yinan <yinan.wang@intel.com>
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Ling, WeiX
> Sent: 2021?3?31? 13:17
> To: dts@dpdk.org
> Subject: Re: [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to
> DPDK-compatible driver step
>
> > -----Original Message-----
> > From: Ling, WeiX <weix.ling@intel.com>
> > Sent: Wednesday, March 31, 2021 01:13 PM
> > To: dts@dpdk.org
> > Cc: Ling, WeiX <weix.ling@intel.com>
> > Subject: [dts][PATCH V1] tests/vhost_cbdma: add bind dut ports to
> DPDK-
> > compatible driver step
> >
> Tested-by: Wei Ling <weix.ling@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-compatible driver step
2021-03-31 5:13 [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-compatible driver step Ling Wei
2021-03-31 5:16 ` Ling, WeiX
@ 2021-04-07 1:22 ` Tu, Lijuan
1 sibling, 0 replies; 4+ messages in thread
From: Tu, Lijuan @ 2021-04-07 1:22 UTC (permalink / raw)
To: Ling, WeiX, dts; +Cc: Ling, WeiX
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Ling Wei
> Sent: 2021年3月31日 13:13
> To: dts@dpdk.org
> Cc: Ling, WeiX <weix.ling@intel.com>
> Subject: [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-
> compatible driver step
>
> Add bind dut ports to DPDK-compatible driver method and step in tear_down
> after test_check_threshold_value_with_cbdma
> exectue over.
>
> Signed-off-by: Ling Wei <weix.ling@intel.com>
> ---
> tests/TestSuite_vhost_cbdma.py | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/tests/TestSuite_vhost_cbdma.py b/tests/TestSuite_vhost_cbdma.py
> index 260c534e..5699a7db 100644
> --- a/tests/TestSuite_vhost_cbdma.py
> +++ b/tests/TestSuite_vhost_cbdma.py
> @@ -110,6 +110,22 @@ class TestVirTioVhostCbdma(TestCase):
> self.dut.send_expect("rm -rf /tmp/s0", "#")
> self.mode_list = []
>
> + def bind_nic_driver(self, ports, driver=""):
> + if driver == "igb_uio":
> + for port in ports:
> + netdev = self.dut.ports_info[port]['port']
> + driver = netdev.get_nic_driver()
> + if driver != 'igb_uio':
> + netdev.bind_driver(driver='igb_uio')
> + else:
> + for port in ports:
> + netdev = self.dut.ports_info[port]['port']
> + driver_now = netdev.get_nic_driver()
> + if driver == "":
> + driver = netdev.default_driver
> + if driver != driver_now:
> + netdev.bind_driver(driver=driver)
Too many duplicated code, prefer to reduce them as following:
for port in ports:
netdev = self.dut.ports_info[port]['port']
driver_now = netdev.get_nic_driver()
if driver == "":
driver = netdev.default_driver
if driver != driver_now:
netdev.bind_driver(driver=driver)
> +
> def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num):
> """
> get all cbdma ports
> @@ -533,6 +549,8 @@ class TestVirTioVhostCbdma(TestCase):
> """
> self.dut.send_expect("killall -I %s" % self.testpmd_name, '#', 20)
> self.bind_cbdma_device_to_kernel()
> + if self.running_case == 'test_check_threshold_value_with_cbdma':
> + self.bind_nic_driver(self.dut_ports, self.drivername)
>
> def tear_down_all(self):
> """
> --
> 2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-07 1:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 5:13 [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-compatible driver step Ling Wei
2021-03-31 5:16 ` Ling, WeiX
2021-04-02 7:47 ` Wang, Yinan
2021-04-07 1:22 ` Tu, Lijuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).