* [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
@ 2021-07-29 10:11 Lingli Chen
0 siblings, 0 replies; 8+ messages in thread
From: Lingli Chen @ 2021-07-29 10:11 UTC (permalink / raw)
To: dts; +Cc: Lingli Chen
1.Launch virtio-pmd on VM with_mergeable_path add
--rx-offloads=0x00002000, according to dpdk commit 4e8169eb0d2d(net/virtio: fix Rx scatter offload).
2.start_vms() use qemu_path instead mode and mergeable parameters.
3.fix script issues:influence between cases.
Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
tests/TestSuite_vm2vm_virtio_pmd.py | 97 ++++++++++++++---------------
1 file changed, 48 insertions(+), 49 deletions(-)
diff --git a/tests/TestSuite_vm2vm_virtio_pmd.py b/tests/TestSuite_vm2vm_virtio_pmd.py
index 44f17a36..99a4602b 100644
--- a/tests/TestSuite_vm2vm_virtio_pmd.py
+++ b/tests/TestSuite_vm2vm_virtio_pmd.py
@@ -66,6 +66,7 @@ class TestVM2VMVirtioPMD(TestCase):
self.pmd_vhost = PmdOutput(self.dut, self.vhost_user)
self.cbdma_dev_infos = []
self.vm_config = 'vhost_sample'
+ self.device_str = ' '
def set_up(self):
"""
@@ -155,20 +156,20 @@ class TestVM2VMVirtioPMD(TestCase):
w_pci_str = ' '.join(w_pci_list)
if path_mode == "mergeable":
command = self.app_testpmd_path + " -c 0x3 -n 4 " + \
- "--file-prefix=virtio -- -i --tx-offloads=0x00 " + \
- "--enable-hw-vlan-strip " + "--txq={0} --rxq={0} ".format(queues) if queues else ""
+ "--file-prefix=virtio -- -i --tx-offloads=0x00 --rx-offloads=0x00002000 " + \
+ "--enable-hw-vlan-strip " + ("--txq={0} --rxq={0} ".format(queues) if queues else "")
command = command + "--txd=1024 --rxd=1024 %s"
vm_client.send_expect(command % extern_param, "testpmd> ", 20)
elif path_mode == "normal":
command = self.app_testpmd_path + " -c 0x3 -n 4 " + \
"--file-prefix=virtio -- -i --tx-offloads=0x00 " + \
- "--enable-hw-vlan-strip " + "--txq={0} --rxq={0} ".format(queues) if queues else ""
+ "--enable-hw-vlan-strip " + ("--txq={0} --rxq={0} ".format(queues) if queues else "")
command = command + "--txd=1024 --rxd=1024 %s"
vm_client.send_expect(command % extern_param, "testpmd> ", 20)
elif path_mode == "vector_rx":
command = self.app_testpmd_path + " -c 0x3 -n 4 " + \
- "--file-prefix=virtio %s -- -i" + "--txq={0} --rxq={0} ".format(queues) if queues else ""
+ "--file-prefix=virtio %s -- -i " + ("--txq={0} --rxq={0} ".format(queues) if queues else "")
command = command + "--txd=1024 --rxd=1024 %s"
vm_client.send_expect(command % (w_pci_str, extern_param), "testpmd> ", 20)
@@ -188,29 +189,16 @@ class TestVM2VMVirtioPMD(TestCase):
"--pdump '%s,queue=*,rx-dev=%s,mbuf-size=8000'"
self.pdump_session.send_expect(command_line % (self.dut.prefix_subfix, dump_port, self.dump_pcap), 'Port')
- def start_vms(self, mode=0, mergeable=True, server_mode=False, opt_queue=None, vm_config=''):
+ def start_vms(self, qemu_path='', server_mode=False, opt_queue=None, vm_config='vhost_sample'):
"""
start two VM, each VM has one virtio device
"""
# for virtio 0.95, start vm with "disable-modern=true"
# for virito 1.0, start vm with "disable-modern=false"
- if mode == 0:
- setting_args = "disable-modern=true"
- elif mode == 1:
- setting_args = "disable-modern=false"
- elif mode == 2:
- setting_args = "disable-modern=false,packed=on"
- if mergeable is True:
- setting_args += "," + "mrg_rxbuf=on"
- else:
- setting_args += "," + "mrg_rxbuf=off"
vm_params = {}
- if opt_queue > 1:
- setting_args += ",csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on"
+
+ if opt_queue is not None:
vm_params['opt_queue'] = opt_queue
- setting_args = setting_args + ",mq=on,vectors=40"
- else:
- setting_args += ",csum=on,gso=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
for i in range(self.vm_num):
vm_dut = None
@@ -222,7 +210,7 @@ class TestVM2VMVirtioPMD(TestCase):
else:
vm_params['opt_path'] = self.base_dir + '/vhost-net%d' % i + ',server'
vm_params['opt_mac'] = "52:54:00:00:00:0%d" % (i+1)
- vm_params['opt_settings'] = setting_args
+ vm_params['opt_settings'] = qemu_path
vm_info.set_vm_device(**vm_params)
time.sleep(3)
try:
@@ -304,62 +292,67 @@ class TestVM2VMVirtioPMD(TestCase):
def test_vhost_vm2vm_virtio_pmd_with_normal_path(self):
"""
- vhost-user + virtio-pmd with normal path
+ Test Case 2: vhost-user + virtio-pmd with normal path
"""
+ qemu_path = "disable-modern=true,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
path_mode = "normal"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=0, mergeable=False)
+ self.start_vms(qemu_path=qemu_path)
self.start_vm_testpmd(self.vm_dut[0], path_mode)
self.start_vm_testpmd(self.vm_dut[1], path_mode)
self.send_and_verify(mode="virtio 0.95 normal path", path=path_mode)
def test_vhost_vm2vm_virito_10_pmd_with_normal_path(self):
"""
- vhost-user + virtio1.0-pmd with normal path
+ Test Case 4: vhost-user + virtio1.0-pmd with normal path
"""
path_mode = "normal"
+ qemu_path = "disable-modern=false,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=1, mergeable=False)
+ self.start_vms(qemu_path=qemu_path)
self.start_vm_testpmd(self.vm_dut[0], path_mode)
self.start_vm_testpmd(self.vm_dut[1], path_mode)
self.send_and_verify(mode="virtio 1.0 normal path", path=path_mode)
def test_vhost_vm2vm_virtio_pmd_with_vector_rx_path(self):
"""
- vhost-user + virtio-pmd with vector_rx path
+ Test Case 1: vhost-user + virtio-pmd with vector_rx path
"""
path_mode = "vector_rx"
+ qemu_path = "disable-modern=true,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=0, mergeable=False)
+ self.start_vms(qemu_path=qemu_path)
self.start_vm_testpmd(self.vm_dut[0], path_mode, virtio_net_pci = self.vm_dut[0].ports_info[0]['pci'])
self.start_vm_testpmd(self.vm_dut[1], path_mode, virtio_net_pci = self.vm_dut[1].ports_info[0]['pci'])
self.send_and_verify(mode="virtio 0.95 vector_rx", path=path_mode)
def test_vhost_vm2vm_virtio_10_pmd_with_vector_rx_path(self):
"""
- vhost-user + virtio1.0-pmd with vector_rx path
+ Test Case 3: vhost-user + virtio1.0-pmd with vector_rx path
"""
path_mode = "vector_rx"
+ qemu_path = "disable-modern=false,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=1, mergeable=False)
+ self.start_vms(qemu_path=qemu_path)
self.start_vm_testpmd(self.vm_dut[0], path_mode, virtio_net_pci = self.vm_dut[0].ports_info[0]['pci'])
self.start_vm_testpmd(self.vm_dut[1], path_mode, virtio_net_pci = self.vm_dut[1].ports_info[0]['pci'])
self.send_and_verify(mode="virtio 1.0 vector_rx", path=path_mode)
def test_vhost_vm2vm_virito_pmd_with_mergeable_path(self):
"""
- vhost-user + virtio-pmd with mergeable path test with payload check
+ Test Case 5: vhost-user + virtio-pmd with mergeable path test with payload check
"""
path_mode = "mergeable"
+ qemu_path = "disable-modern=true,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
extern_param = '--max-pkt-len=9600'
dump_port = 'port=0'
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=0, mergeable=True)
+ self.start_vms(qemu_path=qemu_path)
# git the vm enough huge to run pdump
self.vm_dut[0].set_huge_pages(2048)
# start testpmd and pdump in VM0
@@ -377,14 +370,15 @@ class TestVM2VMVirtioPMD(TestCase):
def test_vhost_vm2vm_virito_10_pmd_with_mergeable_path(self):
"""
- vhost-user + virtio1.0-pmd with mergeable path test with payload check
+ Test Case 6: vhost-user + virtio1.0-pmd with mergeable path test with payload check
"""
path_mode = "mergeable"
+ qemu_path = "disable-modern=false,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
extern_param = '--max-pkt-len=9600'
dump_port = 'port=0'
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=1, mergeable=True)
+ self.start_vms(qemu_path=qemu_path)
# git the vm enough huge to run pdump
self.vm_dut[0].set_huge_pages(2048)
# start testpmd and pdump in VM0
@@ -402,26 +396,28 @@ class TestVM2VMVirtioPMD(TestCase):
def test_vhost_vm2vm_virito_11_pmd_with_normal_path(self):
"""
- vhost-user + virtio1.0-pmd with normal path
+ Test Case 8: vhost-user + virtio1.0-pmd with normal path
"""
path_mode = "normal"
+ qemu_path = "disable-modern=false,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,packed=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=2, mergeable=False)
+ self.start_vms(qemu_path=qemu_path)
self.start_vm_testpmd(self.vm_dut[0], path_mode)
self.start_vm_testpmd(self.vm_dut[1], path_mode)
self.send_and_verify(mode="virtio 1.0 normal path", path=path_mode)
def test_vhost_vm2vm_virito_11_pmd_with_mergeable_path(self):
"""
- vhost-user + virtio1.0-pmd with mergeable path test with payload check
+ Test Case 7: vhost-user + virtio1.0-pmd with mergeable path test with payload check
"""
path_mode = "mergeable"
+ qemu_path = "disable-modern=false,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,packed=on"
extern_param = '--max-pkt-len=9600'
dump_port = 'port=0'
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=2, mergeable=True)
+ self.start_vms(qemu_path=qemu_path)
# git the vm enough huge to run pdump
self.vm_dut[0].set_huge_pages(2048)
# start testpmd and pdump in VM0
@@ -437,7 +433,7 @@ class TestVM2VMVirtioPMD(TestCase):
# check the packet in vm0
self.check_packet_payload_valid(self.vm_dut[0])
- def test_vhost_vm2vm_virtio_split_ring_with_mergeable_path_cbdma_enabled(self):
+ def test_vhost_vm2vm_virtio_split_ring_with_mergeable_path_cbdma_enable(self):
"""
Test Case 9: VM2VM virtio-pmd split ring mergeable path 8 queues CBDMA enable with server mode stable test
"""
@@ -445,8 +441,9 @@ class TestVM2VMVirtioPMD(TestCase):
self.get_core_list(self.nb_cores + 1)
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True)
self.logger.info("Launch vhost-testpmd with CBDMA and used 8 queue")
- self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4,
- server_mode=True, opt_queue=8, combined=True, rxq_txq=8)
+ qemu_path = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on"
+ self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, qemu_path=qemu_path,
+ server_mode=True, opt_queue=8, rxq_txq=8)
self.logger.info("Launch testpmd in VM1")
self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
self.vm_dut[0].send_expect('set fwd mac', 'testpmd> ', 30)
@@ -469,7 +466,7 @@ class TestVM2VMVirtioPMD(TestCase):
self.check_port_stats_result(self.vm_dut[0], queue_num=8)
self.check_port_stats_result(self.vm_dut[1], queue_num=8)
- def test_vhost_vm2vm_split_ring_with_mergeable_path_and_server_mode_cbdma_enabled(self):
+ def test_vhost_vm2vm_split_ring_with_mergeable_path_and_server_mode_cbdma_enable(self):
"""
Test Case 10: VM2VM virtio-pmd split ring mergeable path dynamic queue size CBDMA enable with server mode test
"""
@@ -477,8 +474,9 @@ class TestVM2VMVirtioPMD(TestCase):
self.get_core_list(self.nb_cores + 1)
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True)
self.logger.info("Launch vhost-testpmd with CBDMA and used 8 queue")
- self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4,
- server_mode=True, opt_queue=8, combined=True, rxq_txq=8)
+ qemu_path = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on"
+ self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, qemu_path=qemu_path,
+ server_mode=True, opt_queue=8, rxq_txq=8)
self.logger.info("Launch testpmd in VM1")
self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
self.vm_dut[0].send_expect('set fwd mac', 'testpmd> ', 30)
@@ -500,15 +498,16 @@ class TestVM2VMVirtioPMD(TestCase):
self.check_port_stats_result(self.vm_dut[0], queue_num=8)
self.check_port_stats_result(self.vm_dut[1], queue_num=8)
- def test_vhost_vm2vm_packed_ring_with_mergeable_path_and_8queues_cbdma_enabled(self):
+ def test_vhost_vm2vm_packed_ring_with_mergeable_path_and_8queues_cbdma_enable(self):
"""
Test Case 11: VM2VM virtio-pmd packed ring mergeable path 8 queues CBDMA enable test
"""
self.nb_cores = 4
self.get_core_list(self.nb_cores + 1)
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True)
- self.prepare_test_env(cbdma=True, no_pci=False, client_mode=False, enable_queues=8, nb_cores=4,
- server_mode=False, opt_queue=8, combined=True, rxq_txq=8, mode=2)
+ qemu_path = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on,packed=on"
+ self.prepare_test_env(cbdma=True, no_pci=False, client_mode=False, enable_queues=8, nb_cores=4, qemu_path=qemu_path,
+ server_mode=False, opt_queue=8, rxq_txq=8)
self.logger.info("Launch testpmd in VM1")
self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
self.logger.info("Launch testpmd in VM2 and send imix pkts")
@@ -616,14 +615,14 @@ class TestVM2VMVirtioPMD(TestCase):
vm_dut.send_expect("clear port stats all", "testpmd> ", 30)
vm_dut.send_expect("start", "testpmd> ", 30)
- def prepare_test_env(self, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2,
- server_mode=False, opt_queue=None, combined=False, rxq_txq=None, iova_mode=False, vm_config='vhost_sample', mode=1):
+ def prepare_test_env(self, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, qemu_path='',
+ server_mode=False, opt_queue=None, rxq_txq=None, iova_mode=False, vm_config='vhost_sample'):
"""
start vhost testpmd and qemu, and config the vm env
"""
self.start_vhost_testpmd_cbdma(cbdma=cbdma, no_pci=no_pci, client_mode=client_mode, enable_queues=enable_queues,
nb_cores=nb_cores, rxq_txq=rxq_txq, iova_mode=iova_mode)
- self.start_vms(server_mode=server_mode, opt_queue=opt_queue, mode=mode, vm_config=vm_config)
+ self.start_vms(qemu_path=qemu_path, server_mode=server_mode, opt_queue=opt_queue, vm_config=vm_config)
def start_vhost_testpmd_cbdma(self, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, rxq_txq=None, iova_mode=False):
"""
--
2.32.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
2021-09-29 10:17 ` Wang, Yinan
@ 2021-10-25 8:05 ` Tu, Lijuan
0 siblings, 0 replies; 8+ messages in thread
From: Tu, Lijuan @ 2021-10-25 8:05 UTC (permalink / raw)
To: Wang, Yinan, Chen, LingliX, dts
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Wang, Yinan
> Sent: 2021年9月29日 18:18
> To: Chen, LingliX <linglix.chen@intel.com>; dts@dpdk.org
> Subject: Re: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
>
> Acked-by: Yinan Wang <yinan.wang@intel.com>
>
> > -----Original Message-----
> > From: dts <dts-bounces@dpdk.org> On Behalf Of Chen, LingliX
> > Sent: 2021?8?27? 11:40
> > To: dts@dpdk.org
> > Subject: Re: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
> >
> >
> > > -----Original Message-----
> > > From: Chen, LingliX <linglix.chen@intel.com>
> > > Sent: Friday, August 27, 2021 7:10 PM
> > > To: dts@dpdk.org
> > > Cc: Chen, LingliX <linglix.chen@intel.com>
> > > Subject: [dts][PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
> >
> > Tested-by: Lingli Chen <linglix.chen@intel.com>
Applied
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
2021-08-27 3:40 ` Chen, LingliX
2021-08-27 9:07 ` Wang, Yinan
@ 2021-09-29 10:17 ` Wang, Yinan
2021-10-25 8:05 ` Tu, Lijuan
1 sibling, 1 reply; 8+ messages in thread
From: Wang, Yinan @ 2021-09-29 10:17 UTC (permalink / raw)
To: Chen, LingliX, dts
Acked-by: Yinan Wang <yinan.wang@intel.com>
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Chen, LingliX
> Sent: 2021?8?27? 11:40
> To: dts@dpdk.org
> Subject: Re: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
>
>
> > -----Original Message-----
> > From: Chen, LingliX <linglix.chen@intel.com>
> > Sent: Friday, August 27, 2021 7:10 PM
> > To: dts@dpdk.org
> > Cc: Chen, LingliX <linglix.chen@intel.com>
> > Subject: [dts][PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
>
> Tested-by: Lingli Chen <linglix.chen@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
2021-09-22 16:41 Lingli Chen
@ 2021-09-23 2:01 ` Chen, LingliX
0 siblings, 0 replies; 8+ messages in thread
From: Chen, LingliX @ 2021-09-23 2:01 UTC (permalink / raw)
To: dts
> -----Original Message-----
> From: Chen, LingliX <linglix.chen@intel.com>
> Sent: Thursday, September 23, 2021 12:42 AM
> To: dts@dpdk.org
> Cc: Chen, LingliX <linglix.chen@intel.com>
> Subject: [dts][PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
>
Tested-by: Lingli Chen <linglix.chen@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
@ 2021-09-22 16:41 Lingli Chen
2021-09-23 2:01 ` Chen, LingliX
0 siblings, 1 reply; 8+ messages in thread
From: Lingli Chen @ 2021-09-22 16:41 UTC (permalink / raw)
To: dts; +Cc: Lingli Chen
1.Launch virtio-pmd on VM with_mergeable_path add --rx-offloads=0x00002000, due to dpdk code change from 21.08-rc2.
2.start_vms() use setting_args instead mode and mergeable parameters.
3.fix case 10 sync with testplan.
Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
tests/TestSuite_vm2vm_virtio_pmd.py | 141 ++++++++++++++--------------
1 file changed, 73 insertions(+), 68 deletions(-)
diff --git a/tests/TestSuite_vm2vm_virtio_pmd.py b/tests/TestSuite_vm2vm_virtio_pmd.py
index 44f17a36..e0dab2c7 100644
--- a/tests/TestSuite_vm2vm_virtio_pmd.py
+++ b/tests/TestSuite_vm2vm_virtio_pmd.py
@@ -66,6 +66,7 @@ class TestVM2VMVirtioPMD(TestCase):
self.pmd_vhost = PmdOutput(self.dut, self.vhost_user)
self.cbdma_dev_infos = []
self.vm_config = 'vhost_sample'
+ self.device_str = ' '
def set_up(self):
"""
@@ -145,30 +146,29 @@ class TestVM2VMVirtioPMD(TestCase):
self.virtio_user0.send_expect('set burst 1', 'testpmd> ', 30)
self.virtio_user0.send_expect('start tx_first 10', 'testpmd> ', 30)
- def start_vm_testpmd(self, vm_client, path_mode, extern_param="", virtio_net_pci="", queues=""):
+ def start_vm_testpmd(self, vm_client, path_mode, extern_param="", virtio_net_pci=""):
"""
launch the testpmd in vm
"""
# deal with ports
w_pci_list = []
- w_pci_list.append('-w %s,%s' % (virtio_net_pci, 'vectorized=1'))
+ w_pci_list.append('-a %s,%s' % (virtio_net_pci, 'vectorized=1'))
w_pci_str = ' '.join(w_pci_list)
if path_mode == "mergeable":
command = self.app_testpmd_path + " -c 0x3 -n 4 " + \
- "--file-prefix=virtio -- -i --tx-offloads=0x00 " + \
- "--enable-hw-vlan-strip " + "--txq={0} --rxq={0} ".format(queues) if queues else ""
-
+ "--file-prefix=virtio -- -i --tx-offloads=0x00 --rx-offloads=0x00002000 " + \
+ "--enable-hw-vlan-strip "
command = command + "--txd=1024 --rxd=1024 %s"
vm_client.send_expect(command % extern_param, "testpmd> ", 20)
elif path_mode == "normal":
command = self.app_testpmd_path + " -c 0x3 -n 4 " + \
"--file-prefix=virtio -- -i --tx-offloads=0x00 " + \
- "--enable-hw-vlan-strip " + "--txq={0} --rxq={0} ".format(queues) if queues else ""
+ "--enable-hw-vlan-strip "
command = command + "--txd=1024 --rxd=1024 %s"
vm_client.send_expect(command % extern_param, "testpmd> ", 20)
elif path_mode == "vector_rx":
command = self.app_testpmd_path + " -c 0x3 -n 4 " + \
- "--file-prefix=virtio %s -- -i" + "--txq={0} --rxq={0} ".format(queues) if queues else ""
+ "--file-prefix=virtio %s -- -i "
command = command + "--txd=1024 --rxd=1024 %s"
vm_client.send_expect(command % (w_pci_str, extern_param), "testpmd> ", 20)
@@ -188,29 +188,16 @@ class TestVM2VMVirtioPMD(TestCase):
"--pdump '%s,queue=*,rx-dev=%s,mbuf-size=8000'"
self.pdump_session.send_expect(command_line % (self.dut.prefix_subfix, dump_port, self.dump_pcap), 'Port')
- def start_vms(self, mode=0, mergeable=True, server_mode=False, opt_queue=None, vm_config=''):
+ def start_vms(self, setting_args='', server_mode=False, opt_queue=None, vm_config='vhost_sample'):
"""
start two VM, each VM has one virtio device
"""
# for virtio 0.95, start vm with "disable-modern=true"
# for virito 1.0, start vm with "disable-modern=false"
- if mode == 0:
- setting_args = "disable-modern=true"
- elif mode == 1:
- setting_args = "disable-modern=false"
- elif mode == 2:
- setting_args = "disable-modern=false,packed=on"
- if mergeable is True:
- setting_args += "," + "mrg_rxbuf=on"
- else:
- setting_args += "," + "mrg_rxbuf=off"
vm_params = {}
- if opt_queue > 1:
- setting_args += ",csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on"
+
+ if opt_queue is not None:
vm_params['opt_queue'] = opt_queue
- setting_args = setting_args + ",mq=on,vectors=40"
- else:
- setting_args += ",csum=on,gso=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
for i in range(self.vm_num):
vm_dut = None
@@ -304,62 +291,67 @@ class TestVM2VMVirtioPMD(TestCase):
def test_vhost_vm2vm_virtio_pmd_with_normal_path(self):
"""
- vhost-user + virtio-pmd with normal path
+ Test Case 2: vhost-user + virtio-pmd with normal path
"""
+ setting_args = "disable-modern=true,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
path_mode = "normal"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=0, mergeable=False)
+ self.start_vms(setting_args=setting_args)
self.start_vm_testpmd(self.vm_dut[0], path_mode)
self.start_vm_testpmd(self.vm_dut[1], path_mode)
self.send_and_verify(mode="virtio 0.95 normal path", path=path_mode)
def test_vhost_vm2vm_virito_10_pmd_with_normal_path(self):
"""
- vhost-user + virtio1.0-pmd with normal path
+ Test Case 4: vhost-user + virtio1.0-pmd with normal path
"""
path_mode = "normal"
+ setting_args = "disable-modern=false,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=1, mergeable=False)
+ self.start_vms(setting_args=setting_args)
self.start_vm_testpmd(self.vm_dut[0], path_mode)
self.start_vm_testpmd(self.vm_dut[1], path_mode)
self.send_and_verify(mode="virtio 1.0 normal path", path=path_mode)
def test_vhost_vm2vm_virtio_pmd_with_vector_rx_path(self):
"""
- vhost-user + virtio-pmd with vector_rx path
+ Test Case 1: vhost-user + virtio-pmd with vector_rx path
"""
path_mode = "vector_rx"
+ setting_args = "disable-modern=true,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=0, mergeable=False)
+ self.start_vms(setting_args=setting_args)
self.start_vm_testpmd(self.vm_dut[0], path_mode, virtio_net_pci = self.vm_dut[0].ports_info[0]['pci'])
self.start_vm_testpmd(self.vm_dut[1], path_mode, virtio_net_pci = self.vm_dut[1].ports_info[0]['pci'])
self.send_and_verify(mode="virtio 0.95 vector_rx", path=path_mode)
def test_vhost_vm2vm_virtio_10_pmd_with_vector_rx_path(self):
"""
- vhost-user + virtio1.0-pmd with vector_rx path
+ Test Case 3: vhost-user + virtio1.0-pmd with vector_rx path
"""
path_mode = "vector_rx"
+ setting_args = "disable-modern=false,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=1, mergeable=False)
+ self.start_vms(setting_args=setting_args)
self.start_vm_testpmd(self.vm_dut[0], path_mode, virtio_net_pci = self.vm_dut[0].ports_info[0]['pci'])
self.start_vm_testpmd(self.vm_dut[1], path_mode, virtio_net_pci = self.vm_dut[1].ports_info[0]['pci'])
self.send_and_verify(mode="virtio 1.0 vector_rx", path=path_mode)
def test_vhost_vm2vm_virito_pmd_with_mergeable_path(self):
"""
- vhost-user + virtio-pmd with mergeable path test with payload check
+ Test Case 5: vhost-user + virtio-pmd with mergeable path test with payload check
"""
path_mode = "mergeable"
+ setting_args = "disable-modern=true,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
extern_param = '--max-pkt-len=9600'
dump_port = 'port=0'
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=0, mergeable=True)
+ self.start_vms(setting_args=setting_args)
# git the vm enough huge to run pdump
self.vm_dut[0].set_huge_pages(2048)
# start testpmd and pdump in VM0
@@ -377,14 +369,15 @@ class TestVM2VMVirtioPMD(TestCase):
def test_vhost_vm2vm_virito_10_pmd_with_mergeable_path(self):
"""
- vhost-user + virtio1.0-pmd with mergeable path test with payload check
+ Test Case 6: vhost-user + virtio1.0-pmd with mergeable path test with payload check
"""
path_mode = "mergeable"
+ setting_args = "disable-modern=false,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
extern_param = '--max-pkt-len=9600'
dump_port = 'port=0'
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=1, mergeable=True)
+ self.start_vms(setting_args=setting_args)
# git the vm enough huge to run pdump
self.vm_dut[0].set_huge_pages(2048)
# start testpmd and pdump in VM0
@@ -402,26 +395,28 @@ class TestVM2VMVirtioPMD(TestCase):
def test_vhost_vm2vm_virito_11_pmd_with_normal_path(self):
"""
- vhost-user + virtio1.0-pmd with normal path
+ Test Case 8: vhost-user + virtio1.0-pmd with normal path
"""
path_mode = "normal"
+ setting_args = "disable-modern=false,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,packed=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=2, mergeable=False)
+ self.start_vms(setting_args=setting_args)
self.start_vm_testpmd(self.vm_dut[0], path_mode)
self.start_vm_testpmd(self.vm_dut[1], path_mode)
self.send_and_verify(mode="virtio 1.0 normal path", path=path_mode)
def test_vhost_vm2vm_virito_11_pmd_with_mergeable_path(self):
"""
- vhost-user + virtio1.0-pmd with mergeable path test with payload check
+ Test Case 7: vhost-user + virtio1.0-pmd with mergeable path test with payload check
"""
path_mode = "mergeable"
+ setting_args = "disable-modern=false,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,packed=on"
extern_param = '--max-pkt-len=9600'
dump_port = 'port=0'
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=2, mergeable=True)
+ self.start_vms(setting_args=setting_args)
# git the vm enough huge to run pdump
self.vm_dut[0].set_huge_pages(2048)
# start testpmd and pdump in VM0
@@ -437,22 +432,25 @@ class TestVM2VMVirtioPMD(TestCase):
# check the packet in vm0
self.check_packet_payload_valid(self.vm_dut[0])
- def test_vhost_vm2vm_virtio_split_ring_with_mergeable_path_cbdma_enabled(self):
+ def test_vhost_vm2vm_virtio_split_ring_with_mergeable_path_cbdma_enable(self):
"""
Test Case 9: VM2VM virtio-pmd split ring mergeable path 8 queues CBDMA enable with server mode stable test
"""
self.nb_cores = 4
+ path_mode = "mergeable"
+ extern_param = '--max-pkt-len=9600 --txq=8 --rxq=8'
self.get_core_list(self.nb_cores + 1)
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True)
self.logger.info("Launch vhost-testpmd with CBDMA and used 8 queue")
- self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4,
- server_mode=True, opt_queue=8, combined=True, rxq_txq=8)
+ setting_args = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on"
+ self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, setting_args=setting_args,
+ server_mode=True, opt_queue=8, rxq_txq=8)
self.logger.info("Launch testpmd in VM1")
- self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[0], path_mode, extern_param)
self.vm_dut[0].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[0].send_expect('start', 'testpmd> ', 30)
self.logger.info("Launch testpmd in VM2, sent imix pkts from VM2")
- self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[1], path_mode, extern_param)
self.vm_dut[1].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[1].send_expect('set txpkts 64,256,512,1024,2000,64,256,512,1024,2000', 'testpmd> ', 30)
self.vm_dut[1].send_expect('start tx_first 1', 'testpmd> ', 30)
@@ -469,50 +467,57 @@ class TestVM2VMVirtioPMD(TestCase):
self.check_port_stats_result(self.vm_dut[0], queue_num=8)
self.check_port_stats_result(self.vm_dut[1], queue_num=8)
- def test_vhost_vm2vm_split_ring_with_mergeable_path_and_server_mode_cbdma_enabled(self):
+ def test_vhost_vm2vm_split_ring_with_mergeable_path_and_server_mode_cbdma_enable(self):
"""
Test Case 10: VM2VM virtio-pmd split ring mergeable path dynamic queue size CBDMA enable with server mode test
"""
self.nb_cores = 4
+ path_mode = "mergeable"
+ extern_param = '--max-pkt-len=9600 --txq=8 --rxq=8'
self.get_core_list(self.nb_cores + 1)
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True)
- self.logger.info("Launch vhost-testpmd with CBDMA and used 8 queue")
- self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4,
- server_mode=True, opt_queue=8, combined=True, rxq_txq=8)
+ self.logger.info("Launch vhost-testpmd with CBDMA and used 4 queue")
+ setting_args = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on"
+ self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, setting_args=setting_args,
+ server_mode=True, opt_queue=8, rxq_txq=4)
self.logger.info("Launch testpmd in VM1")
- self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[0], path_mode, extern_param)
self.vm_dut[0].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[0].send_expect('start', 'testpmd> ', 30)
self.logger.info("Launch testpmd in VM2 and send imix pkts")
- self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[1], path_mode, extern_param)
self.vm_dut[1].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[1].send_expect('set txpkts 64,256,512,1024,2000,64,256,512,1024,2000', 'testpmd> ', 30)
self.vm_dut[1].send_expect('start tx_first 32', 'testpmd> ', 30)
self.logger.info("Check imix packets")
- self.check_port_stats_result(self.vm_dut[0], queue_num=8)
- self.check_port_stats_result(self.vm_dut[1], queue_num=8)
+ self.check_port_stats_result(self.vm_dut[0], queue_num=4)
+ self.check_port_stats_result(self.vm_dut[1], queue_num=4)
self.logger.info("Relaunch vhost side testpmd and Check imix packets 10 times")
- self.pmd_vhost.execute_cmd('quit', '#')
- self.start_vhost_testpmd_cbdma(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4,
- rxq_txq=8)
- self.vm_dut[1].send_expect('stop', 'testpmd> ', 30)
- self.vm_dut[1].send_expect('start tx_first 32', 'testpmd> ', 30)
- self.check_port_stats_result(self.vm_dut[0], queue_num=8)
- self.check_port_stats_result(self.vm_dut[1], queue_num=8)
+ for _ in range(10):
+ self.pmd_vhost.execute_cmd('quit', '#')
+ self.start_vhost_testpmd_cbdma(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4,
+ rxq_txq=8)
+ self.vm_dut[1].send_expect('stop', 'testpmd> ', 30)
+ self.vm_dut[1].send_expect('start tx_first 32', 'testpmd> ', 30)
+ self.check_port_stats_result(self.vm_dut[0], queue_num=8)
+ self.check_port_stats_result(self.vm_dut[1], queue_num=8)
- def test_vhost_vm2vm_packed_ring_with_mergeable_path_and_8queues_cbdma_enabled(self):
+ def test_vhost_vm2vm_packed_ring_with_mergeable_path_and_8queues_cbdma_enable(self):
"""
Test Case 11: VM2VM virtio-pmd packed ring mergeable path 8 queues CBDMA enable test
"""
self.nb_cores = 4
+ path_mode = "mergeable"
+ extern_param = '--max-pkt-len=9600 --txq=8 --rxq=8'
self.get_core_list(self.nb_cores + 1)
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True)
- self.prepare_test_env(cbdma=True, no_pci=False, client_mode=False, enable_queues=8, nb_cores=4,
- server_mode=False, opt_queue=8, combined=True, rxq_txq=8, mode=2)
+ setting_args = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on,packed=on"
+ self.prepare_test_env(cbdma=True, no_pci=False, client_mode=False, enable_queues=8, nb_cores=4, setting_args=setting_args,
+ server_mode=False, opt_queue=8, rxq_txq=8)
self.logger.info("Launch testpmd in VM1")
- self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[0], path_mode, extern_param)
self.logger.info("Launch testpmd in VM2 and send imix pkts")
- self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[1], path_mode, extern_param)
self.vm_dut[0].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[0].send_expect('start', 'testpmd> ', 30)
self.vm_dut[1].send_expect('set fwd mac', 'testpmd> ', 30)
@@ -531,7 +536,7 @@ class TestVM2VMVirtioPMD(TestCase):
self.logger.info(e)
time.sleep(10)
self.start_one_vms(mode=1, server_mode=False, opt_queue=8, vm_config=self.vm_config)
- self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[1], path_mode, extern_param)
self.vm_dut[0].send_expect('start', 'testpmd> ', 30)
self.vm_dut[1].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[1].send_expect('set txpkts 64,256,512,1024,20000,64,256,512,1024,20000', 'testpmd> ', 30)
@@ -616,14 +621,14 @@ class TestVM2VMVirtioPMD(TestCase):
vm_dut.send_expect("clear port stats all", "testpmd> ", 30)
vm_dut.send_expect("start", "testpmd> ", 30)
- def prepare_test_env(self, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2,
- server_mode=False, opt_queue=None, combined=False, rxq_txq=None, iova_mode=False, vm_config='vhost_sample', mode=1):
+ def prepare_test_env(self, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, setting_args='',
+ server_mode=False, opt_queue=None, rxq_txq=None, iova_mode=False, vm_config='vhost_sample'):
"""
start vhost testpmd and qemu, and config the vm env
"""
self.start_vhost_testpmd_cbdma(cbdma=cbdma, no_pci=no_pci, client_mode=client_mode, enable_queues=enable_queues,
nb_cores=nb_cores, rxq_txq=rxq_txq, iova_mode=iova_mode)
- self.start_vms(server_mode=server_mode, opt_queue=opt_queue, mode=mode, vm_config=vm_config)
+ self.start_vms(setting_args=setting_args, server_mode=server_mode, opt_queue=opt_queue, vm_config=vm_config)
def start_vhost_testpmd_cbdma(self, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, rxq_txq=None, iova_mode=False):
"""
--
2.32.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
@ 2021-08-27 11:10 Lingli Chen
2021-08-27 3:40 ` Chen, LingliX
0 siblings, 1 reply; 8+ messages in thread
From: Lingli Chen @ 2021-08-27 11:10 UTC (permalink / raw)
To: dts; +Cc: Lingli Chen
1.Launch virtio-pmd on VM with_mergeable_path add --rx-offloads=0x00002000, due to dpdk code change from 21.08-rc2.
2.start_vms() use setting_args instead mode and mergeable parameters.
3.fix case 10 sync with testplan.
Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
tests/TestSuite_vm2vm_virtio_pmd.py | 139 ++++++++++++++--------------
1 file changed, 72 insertions(+), 67 deletions(-)
diff --git a/tests/TestSuite_vm2vm_virtio_pmd.py b/tests/TestSuite_vm2vm_virtio_pmd.py
index 44f17a36..54942b3e 100644
--- a/tests/TestSuite_vm2vm_virtio_pmd.py
+++ b/tests/TestSuite_vm2vm_virtio_pmd.py
@@ -66,6 +66,7 @@ class TestVM2VMVirtioPMD(TestCase):
self.pmd_vhost = PmdOutput(self.dut, self.vhost_user)
self.cbdma_dev_infos = []
self.vm_config = 'vhost_sample'
+ self.device_str = ' '
def set_up(self):
"""
@@ -145,7 +146,7 @@ class TestVM2VMVirtioPMD(TestCase):
self.virtio_user0.send_expect('set burst 1', 'testpmd> ', 30)
self.virtio_user0.send_expect('start tx_first 10', 'testpmd> ', 30)
- def start_vm_testpmd(self, vm_client, path_mode, extern_param="", virtio_net_pci="", queues=""):
+ def start_vm_testpmd(self, vm_client, path_mode, extern_param="", virtio_net_pci=""):
"""
launch the testpmd in vm
"""
@@ -155,20 +156,19 @@ class TestVM2VMVirtioPMD(TestCase):
w_pci_str = ' '.join(w_pci_list)
if path_mode == "mergeable":
command = self.app_testpmd_path + " -c 0x3 -n 4 " + \
- "--file-prefix=virtio -- -i --tx-offloads=0x00 " + \
- "--enable-hw-vlan-strip " + "--txq={0} --rxq={0} ".format(queues) if queues else ""
-
+ "--file-prefix=virtio -- -i --tx-offloads=0x00 --rx-offloads=0x00002000 " + \
+ "--enable-hw-vlan-strip "
command = command + "--txd=1024 --rxd=1024 %s"
vm_client.send_expect(command % extern_param, "testpmd> ", 20)
elif path_mode == "normal":
command = self.app_testpmd_path + " -c 0x3 -n 4 " + \
"--file-prefix=virtio -- -i --tx-offloads=0x00 " + \
- "--enable-hw-vlan-strip " + "--txq={0} --rxq={0} ".format(queues) if queues else ""
+ "--enable-hw-vlan-strip "
command = command + "--txd=1024 --rxd=1024 %s"
vm_client.send_expect(command % extern_param, "testpmd> ", 20)
elif path_mode == "vector_rx":
command = self.app_testpmd_path + " -c 0x3 -n 4 " + \
- "--file-prefix=virtio %s -- -i" + "--txq={0} --rxq={0} ".format(queues) if queues else ""
+ "--file-prefix=virtio %s -- -i "
command = command + "--txd=1024 --rxd=1024 %s"
vm_client.send_expect(command % (w_pci_str, extern_param), "testpmd> ", 20)
@@ -188,29 +188,16 @@ class TestVM2VMVirtioPMD(TestCase):
"--pdump '%s,queue=*,rx-dev=%s,mbuf-size=8000'"
self.pdump_session.send_expect(command_line % (self.dut.prefix_subfix, dump_port, self.dump_pcap), 'Port')
- def start_vms(self, mode=0, mergeable=True, server_mode=False, opt_queue=None, vm_config=''):
+ def start_vms(self, setting_args='', server_mode=False, opt_queue=None, vm_config='vhost_sample'):
"""
start two VM, each VM has one virtio device
"""
# for virtio 0.95, start vm with "disable-modern=true"
# for virito 1.0, start vm with "disable-modern=false"
- if mode == 0:
- setting_args = "disable-modern=true"
- elif mode == 1:
- setting_args = "disable-modern=false"
- elif mode == 2:
- setting_args = "disable-modern=false,packed=on"
- if mergeable is True:
- setting_args += "," + "mrg_rxbuf=on"
- else:
- setting_args += "," + "mrg_rxbuf=off"
vm_params = {}
- if opt_queue > 1:
- setting_args += ",csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on"
+
+ if opt_queue is not None:
vm_params['opt_queue'] = opt_queue
- setting_args = setting_args + ",mq=on,vectors=40"
- else:
- setting_args += ",csum=on,gso=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
for i in range(self.vm_num):
vm_dut = None
@@ -304,62 +291,67 @@ class TestVM2VMVirtioPMD(TestCase):
def test_vhost_vm2vm_virtio_pmd_with_normal_path(self):
"""
- vhost-user + virtio-pmd with normal path
+ Test Case 2: vhost-user + virtio-pmd with normal path
"""
+ setting_args = "disable-modern=true,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
path_mode = "normal"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=0, mergeable=False)
+ self.start_vms(setting_args=setting_args)
self.start_vm_testpmd(self.vm_dut[0], path_mode)
self.start_vm_testpmd(self.vm_dut[1], path_mode)
self.send_and_verify(mode="virtio 0.95 normal path", path=path_mode)
def test_vhost_vm2vm_virito_10_pmd_with_normal_path(self):
"""
- vhost-user + virtio1.0-pmd with normal path
+ Test Case 4: vhost-user + virtio1.0-pmd with normal path
"""
path_mode = "normal"
+ setting_args = "disable-modern=false,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=1, mergeable=False)
+ self.start_vms(setting_args=setting_args)
self.start_vm_testpmd(self.vm_dut[0], path_mode)
self.start_vm_testpmd(self.vm_dut[1], path_mode)
self.send_and_verify(mode="virtio 1.0 normal path", path=path_mode)
def test_vhost_vm2vm_virtio_pmd_with_vector_rx_path(self):
"""
- vhost-user + virtio-pmd with vector_rx path
+ Test Case 1: vhost-user + virtio-pmd with vector_rx path
"""
path_mode = "vector_rx"
+ setting_args = "disable-modern=true,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=0, mergeable=False)
+ self.start_vms(setting_args=setting_args)
self.start_vm_testpmd(self.vm_dut[0], path_mode, virtio_net_pci = self.vm_dut[0].ports_info[0]['pci'])
self.start_vm_testpmd(self.vm_dut[1], path_mode, virtio_net_pci = self.vm_dut[1].ports_info[0]['pci'])
self.send_and_verify(mode="virtio 0.95 vector_rx", path=path_mode)
def test_vhost_vm2vm_virtio_10_pmd_with_vector_rx_path(self):
"""
- vhost-user + virtio1.0-pmd with vector_rx path
+ Test Case 3: vhost-user + virtio1.0-pmd with vector_rx path
"""
path_mode = "vector_rx"
+ setting_args = "disable-modern=false,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=1, mergeable=False)
+ self.start_vms(setting_args=setting_args)
self.start_vm_testpmd(self.vm_dut[0], path_mode, virtio_net_pci = self.vm_dut[0].ports_info[0]['pci'])
self.start_vm_testpmd(self.vm_dut[1], path_mode, virtio_net_pci = self.vm_dut[1].ports_info[0]['pci'])
self.send_and_verify(mode="virtio 1.0 vector_rx", path=path_mode)
def test_vhost_vm2vm_virito_pmd_with_mergeable_path(self):
"""
- vhost-user + virtio-pmd with mergeable path test with payload check
+ Test Case 5: vhost-user + virtio-pmd with mergeable path test with payload check
"""
path_mode = "mergeable"
+ setting_args = "disable-modern=true,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
extern_param = '--max-pkt-len=9600'
dump_port = 'port=0'
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=0, mergeable=True)
+ self.start_vms(setting_args=setting_args)
# git the vm enough huge to run pdump
self.vm_dut[0].set_huge_pages(2048)
# start testpmd and pdump in VM0
@@ -377,14 +369,15 @@ class TestVM2VMVirtioPMD(TestCase):
def test_vhost_vm2vm_virito_10_pmd_with_mergeable_path(self):
"""
- vhost-user + virtio1.0-pmd with mergeable path test with payload check
+ Test Case 6: vhost-user + virtio1.0-pmd with mergeable path test with payload check
"""
path_mode = "mergeable"
+ setting_args = "disable-modern=false,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on"
extern_param = '--max-pkt-len=9600'
dump_port = 'port=0'
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=1, mergeable=True)
+ self.start_vms(setting_args=setting_args)
# git the vm enough huge to run pdump
self.vm_dut[0].set_huge_pages(2048)
# start testpmd and pdump in VM0
@@ -402,26 +395,28 @@ class TestVM2VMVirtioPMD(TestCase):
def test_vhost_vm2vm_virito_11_pmd_with_normal_path(self):
"""
- vhost-user + virtio1.0-pmd with normal path
+ Test Case 8: vhost-user + virtio1.0-pmd with normal path
"""
path_mode = "normal"
+ setting_args = "disable-modern=false,mrg_rxbuf=off,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,packed=on"
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=2, mergeable=False)
+ self.start_vms(setting_args=setting_args)
self.start_vm_testpmd(self.vm_dut[0], path_mode)
self.start_vm_testpmd(self.vm_dut[1], path_mode)
self.send_and_verify(mode="virtio 1.0 normal path", path=path_mode)
def test_vhost_vm2vm_virito_11_pmd_with_mergeable_path(self):
"""
- vhost-user + virtio1.0-pmd with mergeable path test with payload check
+ Test Case 7: vhost-user + virtio1.0-pmd with mergeable path test with payload check
"""
path_mode = "mergeable"
+ setting_args = "disable-modern=false,mrg_rxbuf=on,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,packed=on"
extern_param = '--max-pkt-len=9600'
dump_port = 'port=0'
self.get_core_list(2)
self.start_vhost_testpmd()
- self.start_vms(mode=2, mergeable=True)
+ self.start_vms(setting_args=setting_args)
# git the vm enough huge to run pdump
self.vm_dut[0].set_huge_pages(2048)
# start testpmd and pdump in VM0
@@ -437,22 +432,25 @@ class TestVM2VMVirtioPMD(TestCase):
# check the packet in vm0
self.check_packet_payload_valid(self.vm_dut[0])
- def test_vhost_vm2vm_virtio_split_ring_with_mergeable_path_cbdma_enabled(self):
+ def test_vhost_vm2vm_virtio_split_ring_with_mergeable_path_cbdma_enable(self):
"""
Test Case 9: VM2VM virtio-pmd split ring mergeable path 8 queues CBDMA enable with server mode stable test
"""
self.nb_cores = 4
+ path_mode = "mergeable"
+ extern_param = '--max-pkt-len=9600 --txq=8 --rxq=8'
self.get_core_list(self.nb_cores + 1)
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True)
self.logger.info("Launch vhost-testpmd with CBDMA and used 8 queue")
- self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4,
- server_mode=True, opt_queue=8, combined=True, rxq_txq=8)
+ setting_args = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on"
+ self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, setting_args=setting_args,
+ server_mode=True, opt_queue=8, rxq_txq=8)
self.logger.info("Launch testpmd in VM1")
- self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[0], path_mode, extern_param)
self.vm_dut[0].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[0].send_expect('start', 'testpmd> ', 30)
self.logger.info("Launch testpmd in VM2, sent imix pkts from VM2")
- self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[1], path_mode, extern_param)
self.vm_dut[1].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[1].send_expect('set txpkts 64,256,512,1024,2000,64,256,512,1024,2000', 'testpmd> ', 30)
self.vm_dut[1].send_expect('start tx_first 1', 'testpmd> ', 30)
@@ -469,50 +467,57 @@ class TestVM2VMVirtioPMD(TestCase):
self.check_port_stats_result(self.vm_dut[0], queue_num=8)
self.check_port_stats_result(self.vm_dut[1], queue_num=8)
- def test_vhost_vm2vm_split_ring_with_mergeable_path_and_server_mode_cbdma_enabled(self):
+ def test_vhost_vm2vm_split_ring_with_mergeable_path_and_server_mode_cbdma_enable(self):
"""
Test Case 10: VM2VM virtio-pmd split ring mergeable path dynamic queue size CBDMA enable with server mode test
"""
self.nb_cores = 4
+ path_mode = "mergeable"
+ extern_param = '--max-pkt-len=9600 --txq=8 --rxq=8'
self.get_core_list(self.nb_cores + 1)
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True)
- self.logger.info("Launch vhost-testpmd with CBDMA and used 8 queue")
- self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4,
- server_mode=True, opt_queue=8, combined=True, rxq_txq=8)
+ self.logger.info("Launch vhost-testpmd with CBDMA and used 4 queue")
+ setting_args = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on"
+ self.prepare_test_env(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4, setting_args=setting_args,
+ server_mode=True, opt_queue=8, rxq_txq=4)
self.logger.info("Launch testpmd in VM1")
- self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[0], path_mode, extern_param)
self.vm_dut[0].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[0].send_expect('start', 'testpmd> ', 30)
self.logger.info("Launch testpmd in VM2 and send imix pkts")
- self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[1], path_mode, extern_param)
self.vm_dut[1].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[1].send_expect('set txpkts 64,256,512,1024,2000,64,256,512,1024,2000', 'testpmd> ', 30)
self.vm_dut[1].send_expect('start tx_first 32', 'testpmd> ', 30)
self.logger.info("Check imix packets")
- self.check_port_stats_result(self.vm_dut[0], queue_num=8)
- self.check_port_stats_result(self.vm_dut[1], queue_num=8)
+ self.check_port_stats_result(self.vm_dut[0], queue_num=4)
+ self.check_port_stats_result(self.vm_dut[1], queue_num=4)
self.logger.info("Relaunch vhost side testpmd and Check imix packets 10 times")
- self.pmd_vhost.execute_cmd('quit', '#')
- self.start_vhost_testpmd_cbdma(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4,
- rxq_txq=8)
- self.vm_dut[1].send_expect('stop', 'testpmd> ', 30)
- self.vm_dut[1].send_expect('start tx_first 32', 'testpmd> ', 30)
- self.check_port_stats_result(self.vm_dut[0], queue_num=8)
- self.check_port_stats_result(self.vm_dut[1], queue_num=8)
+ for _ in range(10):
+ self.pmd_vhost.execute_cmd('quit', '#')
+ self.start_vhost_testpmd_cbdma(cbdma=True, no_pci=False, client_mode=True, enable_queues=8, nb_cores=4,
+ rxq_txq=8)
+ self.vm_dut[1].send_expect('stop', 'testpmd> ', 30)
+ self.vm_dut[1].send_expect('start tx_first 32', 'testpmd> ', 30)
+ self.check_port_stats_result(self.vm_dut[0], queue_num=8)
+ self.check_port_stats_result(self.vm_dut[1], queue_num=8)
- def test_vhost_vm2vm_packed_ring_with_mergeable_path_and_8queues_cbdma_enabled(self):
+ def test_vhost_vm2vm_packed_ring_with_mergeable_path_and_8queues_cbdma_enable(self):
"""
Test Case 11: VM2VM virtio-pmd packed ring mergeable path 8 queues CBDMA enable test
"""
self.nb_cores = 4
+ path_mode = "mergeable"
+ extern_param = '--max-pkt-len=9600 --txq=8 --rxq=8'
self.get_core_list(self.nb_cores + 1)
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=16, queue_num=8, allow_diff_socket=True)
- self.prepare_test_env(cbdma=True, no_pci=False, client_mode=False, enable_queues=8, nb_cores=4,
- server_mode=False, opt_queue=8, combined=True, rxq_txq=8, mode=2)
+ setting_args = "disable-modern=false,mrg_rxbuf=on,mq=on,vectors=40,csum=on,guest_csum=on,host_tso4=on,guest_tso4=on,guest_ecn=on,guest_ufo=on,host_ufo=on,packed=on"
+ self.prepare_test_env(cbdma=True, no_pci=False, client_mode=False, enable_queues=8, nb_cores=4, setting_args=setting_args,
+ server_mode=False, opt_queue=8, rxq_txq=8)
self.logger.info("Launch testpmd in VM1")
- self.start_vm_testpmd(self.vm_dut[0], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[0], path_mode, extern_param)
self.logger.info("Launch testpmd in VM2 and send imix pkts")
- self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[1], path_mode, extern_param)
self.vm_dut[0].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[0].send_expect('start', 'testpmd> ', 30)
self.vm_dut[1].send_expect('set fwd mac', 'testpmd> ', 30)
@@ -531,7 +536,7 @@ class TestVM2VMVirtioPMD(TestCase):
self.logger.info(e)
time.sleep(10)
self.start_one_vms(mode=1, server_mode=False, opt_queue=8, vm_config=self.vm_config)
- self.start_vm_testpmd(self.vm_dut[1], "mergeable", extern_param="--max-pkt-len=9600", queues="8")
+ self.start_vm_testpmd(self.vm_dut[1], path_mode, extern_param)
self.vm_dut[0].send_expect('start', 'testpmd> ', 30)
self.vm_dut[1].send_expect('set fwd mac', 'testpmd> ', 30)
self.vm_dut[1].send_expect('set txpkts 64,256,512,1024,20000,64,256,512,1024,20000', 'testpmd> ', 30)
@@ -616,14 +621,14 @@ class TestVM2VMVirtioPMD(TestCase):
vm_dut.send_expect("clear port stats all", "testpmd> ", 30)
vm_dut.send_expect("start", "testpmd> ", 30)
- def prepare_test_env(self, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2,
- server_mode=False, opt_queue=None, combined=False, rxq_txq=None, iova_mode=False, vm_config='vhost_sample', mode=1):
+ def prepare_test_env(self, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, setting_args='',
+ server_mode=False, opt_queue=None, rxq_txq=None, iova_mode=False, vm_config='vhost_sample'):
"""
start vhost testpmd and qemu, and config the vm env
"""
self.start_vhost_testpmd_cbdma(cbdma=cbdma, no_pci=no_pci, client_mode=client_mode, enable_queues=enable_queues,
nb_cores=nb_cores, rxq_txq=rxq_txq, iova_mode=iova_mode)
- self.start_vms(server_mode=server_mode, opt_queue=opt_queue, mode=mode, vm_config=vm_config)
+ self.start_vms(setting_args=setting_args, server_mode=server_mode, opt_queue=opt_queue, vm_config=vm_config)
def start_vhost_testpmd_cbdma(self, cbdma=False, no_pci=True, client_mode=False, enable_queues=1, nb_cores=2, rxq_txq=None, iova_mode=False):
"""
--
2.32.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
2021-08-27 3:40 ` Chen, LingliX
@ 2021-08-27 9:07 ` Wang, Yinan
2021-09-29 10:17 ` Wang, Yinan
1 sibling, 0 replies; 8+ messages in thread
From: Wang, Yinan @ 2021-08-27 9:07 UTC (permalink / raw)
To: Chen, LingliX, dts
Acked-by: Yinan Wang <yinan.wang@intel.com>
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Chen, LingliX
> Sent: 2021?8?27? 11:40
> To: dts@dpdk.org
> Subject: Re: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
>
>
> > -----Original Message-----
> > From: Chen, LingliX <linglix.chen@intel.com>
> > Sent: Friday, August 27, 2021 7:10 PM
> > To: dts@dpdk.org
> > Cc: Chen, LingliX <linglix.chen@intel.com>
> > Subject: [dts][PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
>
> Tested-by: Lingli Chen <linglix.chen@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
2021-08-27 11:10 Lingli Chen
@ 2021-08-27 3:40 ` Chen, LingliX
2021-08-27 9:07 ` Wang, Yinan
2021-09-29 10:17 ` Wang, Yinan
0 siblings, 2 replies; 8+ messages in thread
From: Chen, LingliX @ 2021-08-27 3:40 UTC (permalink / raw)
To: dts
[-- Attachment #1: Type: text/plain, Size: 308 bytes --]
> -----Original Message-----
> From: Chen, LingliX <linglix.chen@intel.com>
> Sent: Friday, August 27, 2021 7:10 PM
> To: dts@dpdk.org
> Cc: Chen, LingliX <linglix.chen@intel.com>
> Subject: [dts][PATCH V1] tests/vm2vm_virtio_pmd: fix script issues
Tested-by: Lingli Chen <linglix.chen@intel.com>
[-- Attachment #2: TestVM2VMVirtioPMD.log --]
[-- Type: application/octet-stream, Size: 777416 bytes --]
[-- Attachment #3: TestVM2VMVirtioPMD-cbdma.log --]
[-- Type: application/octet-stream, Size: 885879 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-10-25 8:05 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 10:11 [dts] [PATCH V1] tests/vm2vm_virtio_pmd: fix script issues Lingli Chen
2021-08-27 11:10 Lingli Chen
2021-08-27 3:40 ` Chen, LingliX
2021-08-27 9:07 ` Wang, Yinan
2021-09-29 10:17 ` Wang, Yinan
2021-10-25 8:05 ` Tu, Lijuan
2021-09-22 16:41 Lingli Chen
2021-09-23 2:01 ` Chen, LingliX
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).