test suite reviews and discussions
 help / color / mirror / Atom feed
* [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 --]

^ 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

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git