* [dts][PATCH V4 2/2] tests/loopback_virtio_user_server_mode_cbdma: modify dmas parameter by DPDK changed
@ 2022-12-15 6:29 Wei Ling
2022-12-26 4:55 ` lijuan.tu
0 siblings, 1 reply; 2+ messages in thread
From: Wei Ling @ 2022-12-15 6:29 UTC (permalink / raw)
To: dts; +Cc: Wei Ling
The dmas parameter have been changed by the local patch, so modify the
dmas parameter in the testsuite.
Signed-off-by: Wei Ling <weix.ling@intel.com>
---
..._loopback_virtio_user_server_mode_cbdma.py | 913 ++++++++++++------
1 file changed, 616 insertions(+), 297 deletions(-)
diff --git a/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py b/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py
index 81fae50c..22727049 100644
--- a/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py
+++ b/tests/TestSuite_loopback_virtio_user_server_mode_cbdma.py
@@ -2,12 +2,7 @@
# Copyright(c) 2022 Intel Corporation
#
-"""
-DPDK Test suite.
-Test loopback virtio-user server mode
-"""
import re
-import time
from framework.packet import Packet
from framework.pmd_output import PmdOutput
@@ -27,8 +22,9 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
self.path = self.dut.apps_name["test-pmd"]
self.testpmd_name = self.path.split("/")[-1]
self.app_pdump = self.dut.apps_name["pdump"]
- self.dump_pcap_q0 = "/root/pdump-rx-q0.pcap"
- self.dump_pcap_q1 = "/root/pdump-rx-q1.pcap"
+ self.base_dir = self.dut.base_dir.replace("~", "/root")
+ self.dump_pcap_q0 = "%s/pdump-rx-q0.pcap" % self.base_dir
+ self.dump_pcap_q1 = "%s/pdump-rx-q1.pcap" % self.base_dir
self.device_str = None
self.cbdma_dev_infos = []
self.vhost_user = self.dut.new_session(suite="vhost_user")
@@ -42,7 +38,7 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
Run before each test case.
"""
self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#")
- self.dut.send_expect("rm -rf ./vhost-net*", "#")
+ self.dut.send_expect("rm -rf %s/vhost-net*" % self.base_dir, "#")
self.table_header = [
"Mode",
"Pkt_size",
@@ -60,45 +56,59 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
return True if out == "2048" else False
def send_6192_packets_from_vhost(self):
- """
- start the testpmd of vhost-user, start to send 8k packets
- """
- time.sleep(3)
- self.vhost_user_pmd.execute_cmd("set fwd csum")
self.vhost_user_pmd.execute_cmd("set txpkts 64,64,64,2000,2000,2000")
self.vhost_user_pmd.execute_cmd("set burst 1")
self.vhost_user_pmd.execute_cmd("start tx_first 1")
- self.vhost_user_pmd.execute_cmd("stop")
def send_960_packets_from_vhost(self):
- """
- start the testpmd of vhost-user, start to send 8k packets
- """
- time.sleep(3)
- self.vhost_user_pmd.execute_cmd("set fwd csum")
self.vhost_user_pmd.execute_cmd("set txpkts 64,128,256,512")
self.vhost_user_pmd.execute_cmd("set burst 1")
self.vhost_user_pmd.execute_cmd("start tx_first 1")
- self.vhost_user_pmd.execute_cmd("stop")
def send_chain_packets_from_vhost(self):
- time.sleep(3)
- self.vhost_user_pmd.execute_cmd("set txpkts 65535,65535,65535,65535,65535")
+ self.vhost_user_pmd.execute_cmd("set txpkts 65535,65535")
self.vhost_user_pmd.execute_cmd("start tx_first 32", timeout=30)
def verify_virtio_user_receive_packets(self):
results = 0.0
- time.sleep(3)
- for _ in range(10):
- out = self.virtio_user_pmd.execute_cmd("show port stats all")
+ for _ in range(5):
+ out = self.virtio_user_pmd.execute_cmd("show port stats 0")
lines = re.search("Rx-pps:\s*(\d*)", out)
result = lines.group(1)
results += float(result)
- Mpps = results / (1000000 * 10)
+ Mpps = results / (1000000 * 5)
self.logger.info(Mpps)
self.verify(Mpps > 0, "virtio-user can not receive packets")
- def launch_pdump_to_capture_pkt(self, capture_all_queue=True):
+ def check_each_queue_has_packets_info_on_virtio_user(
+ self, queues, check_rx=True, check_tx=True
+ ):
+ """
+ check each queue has receive packets on virtio-user0 side
+ """
+ out = self.virtio_user_pmd.execute_cmd("stop")
+ for queue_index in range(0, queues):
+ queue = re.search("Port= 0/Queue=\s*%d" % queue_index, out)
+ queue = queue.group()
+ index = out.find(queue)
+ if check_rx:
+ rx = re.search("RX-packets:\s*(\d*)", out[index:])
+ rx_packets = int(rx.group(1))
+ self.verify(
+ rx_packets > 0,
+ "The queue %d rx-packets is 0 about " % queue_index
+ + "rx-packets:%d" % rx_packets,
+ )
+ if check_tx:
+ tx = re.search("TX-packets:\s*(\d*)", out[index:])
+ tx_packets = int(tx.group(1))
+ self.verify(
+ tx_packets > 0,
+ "The queue %d tx-packets is 0 about " % queue_index
+ + "tx-packets:%d" % tx_packets,
+ )
+
+ def launch_pdump_to_capture_pkt(self):
command = (
self.app_pdump
+ " "
@@ -110,24 +120,26 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
command % (self.dump_pcap_q0, self.dump_pcap_q1), "Port"
)
- def check_packet_payload_valid(self, pkt_len):
+ def check_packet_payload_valid(self, pkt_len, check_payload=True):
self.pdump_session.send_expect("^c", "# ", 60)
dump_file_list = [self.dump_pcap_q0, self.dump_pcap_q1]
for pcap in dump_file_list:
- self.dut.session.copy_file_from(src="%s" % pcap, dst="%s" % pcap)
pkt = Packet()
- pkts = pkt.read_pcapfile(pcap)
+ self.logger.info("Check capture file: %s payload " % pcap)
+ pkts = pkt.read_pcapfile(pcap, crb=self.dut)
expect_data = str(pkts[0]["Raw"])
for i in range(len(pkts)):
self.verify(
len(pkts[i]) == pkt_len,
- "virtio-user0 receive packet's length not equal %s Byte" % pkt_len,
- )
- check_data = str(pkts[i]["Raw"])
- self.verify(
- check_data == expect_data,
- "the payload in receive packets has been changed from %s" % i,
+ "virtio-user0 receive packet's length %s not equal %s Byte"
+ % (len(pkts[i]), pkt_len),
)
+ if check_payload:
+ check_data = str(pkts[i]["Raw"])
+ self.verify(
+ check_data == expect_data,
+ "the payload in receive packets has been changed from %s" % i,
+ )
def start_vhost_testpmd(self, cores, eal_param, param, ports, iova_mode="va"):
eal_param += " --iova=" + iova_mode
@@ -141,7 +153,12 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
)
def start_virtio_testpmd_with_vhost_net0(
- self, cores, eal_param, param, set_fwd_csum=True
+ self,
+ cores,
+ eal_param,
+ param,
+ set_fwd_csum=True,
+ set_fwd_rxonly=False,
):
"""
launch the testpmd as virtio with vhost_net0
@@ -158,16 +175,10 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
)
if set_fwd_csum:
self.virtio_user_pmd.execute_cmd("set fwd csum")
+ if set_fwd_rxonly:
+ self.virtio_user_pmd.execute_cmd("set fwd rxonly")
self.virtio_user_pmd.execute_cmd("start")
- @staticmethod
- def generate_dms_param(queues):
- das_list = []
- for i in range(queues):
- das_list.append("txq{}".format(i))
- das_param = "[{}]".format(";".join(das_list))
- return das_param
-
def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num, allow_diff_socket=False):
"""
get and bind cbdma ports into DPDK driver
@@ -224,47 +235,45 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
self.dut.close_session(self.vhost_user)
self.dut.close_session(self.virtio_user)
- def test_loopback_packed_ring_all_path_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ def test_loopback_packed_ring_inorder_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
self,
):
"""
- Test Case 1: Loopback packed ring all path multi-queues payload check with server mode and cbdma enable
+ Test Case 1: Loopback packed ring inorder mergeable path multi-queues payload check with server mode and cbdma enable
"""
- self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=8)
- vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]'"
- lcore_dma = (
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s"
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=1)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
% (
- self.vhost_core_list[1],
self.cbdma_list[0],
- self.vhost_core_list[1],
- self.cbdma_list[1],
- self.vhost_core_list[2],
- self.cbdma_list[2],
- self.vhost_core_list[2],
- self.cbdma_list[3],
- self.vhost_core_list[3],
- self.cbdma_list[4],
- self.vhost_core_list[3],
- self.cbdma_list[5],
- self.vhost_core_list[4],
- self.cbdma_list[6],
- self.vhost_core_list[4],
- self.cbdma_list[7],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
)
)
- vhost_param = (
- " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 --lcore-dma=[%s]"
- % lcore_dma
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
)
-
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -272,18 +281,58 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
-
virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,packed_vq=1,server=1"
virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_virtio_testpmd_with_vhost_net0(
cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
)
-
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_6192_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=6192)
- self.vhost_user_pmd.quit()
+ def test_loopback_packed_ring_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ self,
+ ):
+ """
+ Test Case 2: Loopback packed ring mergeable path multi-queues payload check with server mode and cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
+ % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ )
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
+ )
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -291,21 +340,58 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
- self.launch_pdump_to_capture_pkt()
- self.send_6192_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=6192)
-
- self.virtio_user_pmd.quit()
virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=0,packed_vq=1,server=1"
virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_virtio_testpmd_with_vhost_net0(
cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
)
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_6192_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=6192)
- self.vhost_user_pmd.quit()
+ def test_loopback_packed_ring_inorder_non_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ self,
+ ):
+ """
+ Test Case 3: Loopback packed ring inorder non-mergeable path multi-queues payload check with server mode and cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=4)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
+ % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[2],
+ self.cbdma_list[2],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[2],
+ self.cbdma_list[2],
+ self.cbdma_list[3],
+ self.cbdma_list[3],
+ )
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
+ )
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -313,21 +399,58 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
- self.launch_pdump_to_capture_pkt()
- self.send_6192_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=6192)
-
- self.virtio_user_pmd.quit()
- virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,packed_vq=1,server=1"
+ virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,server=1"
virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_virtio_testpmd_with_vhost_net0(
cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
)
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_960_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=960)
- self.vhost_user_pmd.quit()
+ def test_loopback_packed_ring_non_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ self,
+ ):
+ """
+ Test Case 4: Loopback packed ring non-mergeable path multi-queues payload check with server mode and cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=8)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
+ % (
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[2],
+ self.cbdma_list[3],
+ self.cbdma_list[4],
+ self.cbdma_list[5],
+ self.cbdma_list[2],
+ self.cbdma_list[3],
+ self.cbdma_list[4],
+ self.cbdma_list[5],
+ self.cbdma_list[6],
+ self.cbdma_list[7],
+ )
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
+ )
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -335,21 +458,58 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
- self.launch_pdump_to_capture_pkt()
- self.send_960_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=960)
-
- self.virtio_user_pmd.quit()
- virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,server=1"
+ virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,packed_vq=1,server=1"
virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_virtio_testpmd_with_vhost_net0(
cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
)
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_960_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=960)
- self.vhost_user_pmd.quit()
+ def test_loopback_packed_ring_vectorized_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ self,
+ ):
+ """
+ Test Case 5: Loopback packed ring vectorized path multi-queues payload check with server mode and cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
+ % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ )
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
+ )
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -357,21 +517,58 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
- self.launch_pdump_to_capture_pkt()
- self.send_960_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=960)
-
- self.virtio_user_pmd.quit()
- virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,server=1"
+ virtio_eal_param = "--force-max-simd-bitwidth=512 --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,server=1"
virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_virtio_testpmd_with_vhost_net0(
cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
)
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_960_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=960)
- self.vhost_user_pmd.quit()
+ def test_loopback_packed_ring_vectorized_not_power_of_2_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ self,
+ ):
+ """
+ Test Case 6: Loopback packed ring vectorized path and ring size is not power of 2 multi-queues payload check with server mode and cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
+ % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ )
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
+ )
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -379,102 +576,58 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
- self.launch_pdump_to_capture_pkt()
- self.send_960_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=960)
-
- self.virtio_user_pmd.quit()
- virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,queue_size=1025,server=1"
+ virtio_eal_param = "--force-max-simd-bitwidth=512 --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,packed_vq=1,vectorized=1,queue_size=1025,server=1"
virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1025 --rxd=1025"
self.start_virtio_testpmd_with_vhost_net0(
cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
)
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_960_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=960)
- self.vhost_user_pmd.quit()
- self.start_vhost_testpmd(
- cores=self.vhost_core_list,
- eal_param=vhost_eal_param,
- param=vhost_param,
- ports=self.cbdma_list,
- iova_mode="va",
- )
- self.launch_pdump_to_capture_pkt()
- self.send_960_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=960)
-
- if not self.check_2M_env:
- self.virtio_user_pmd.quit()
- self.vhost_user_pmd.quit()
- vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq6;txq7;rxq0;rxq1;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]'"
- vhost_param = (
- " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024 --lcore-dma=[%s]"
- % lcore_dma
- )
- self.start_vhost_testpmd(
- cores=self.vhost_core_list,
- eal_param=vhost_eal_param,
- param=vhost_param,
- ports=self.cbdma_list,
- iova_mode="pa",
- )
-
- virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,packed_vq=1,server=1"
- virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
- self.logger.info("Launch virtio with packed ring mergeable inorder path")
- self.start_virtio_testpmd_with_vhost_net0(
- cores=self.virtio0_core_list,
- eal_param=virtio_eal_param,
- param=virtio_param,
- )
-
- self.launch_pdump_to_capture_pkt()
- self.send_6192_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=6192)
-
- def test_loopback_split_ring_all_path_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ def test_loopback_split_ring_inorder_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
self,
):
"""
- Test Case 2: Loopback split ring all path multi-queues payload check with server mode and cbdma enable
- """
- self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=3)
- vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]'"
- lcore_dma = (
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s,"
- "lcore%s@%s"
+ Test Case 7: Loopback split ring inorder mergeable path multi-queues payload check with server mode and cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=1)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
% (
- self.vhost_core_list[1],
self.cbdma_list[0],
- self.vhost_core_list[2],
self.cbdma_list[0],
- self.vhost_core_list[3],
- self.cbdma_list[1],
- self.vhost_core_list[3],
- self.cbdma_list[2],
- self.vhost_core_list[4],
- self.cbdma_list[1],
- self.vhost_core_list[4],
- self.cbdma_list[2],
- self.vhost_core_list[5],
- self.cbdma_list[1],
- self.vhost_core_list[5],
- self.cbdma_list[2],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
)
)
- vhost_param = (
- " --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024 --lcore-dma=[%s]"
- % lcore_dma
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
)
-
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -482,18 +635,58 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
-
virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1"
- virtio_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
+ virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_virtio_testpmd_with_vhost_net0(
cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
)
-
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_6192_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=6192)
- self.vhost_user_pmd.quit()
+ def test_loopback_split_ring_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ self,
+ ):
+ """
+ Test Case 8: Loopback split ring mergeable path multi-queues payload check with server mode and cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
+ % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ )
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
+ )
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -501,45 +694,58 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
- self.launch_pdump_to_capture_pkt()
- self.send_6192_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=6192)
-
- self.virtio_user_pmd.quit()
virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=0,server=1"
- virtio_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
+ virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_virtio_testpmd_with_vhost_net0(
cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
)
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_6192_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=6192)
- self.vhost_user_pmd.quit()
- self.start_vhost_testpmd(
- cores=self.vhost_core_list,
- eal_param=vhost_eal_param,
- param=vhost_param,
- ports=self.cbdma_list,
- iova_mode="va",
- )
- self.launch_pdump_to_capture_pkt()
- self.send_6192_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=6192)
-
- self.virtio_user_pmd.quit()
- virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,server=1"
- virtio_param = (
- "--enable-hw-vlan-strip --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
+ def test_loopback_split_ring_inorder_non_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ self,
+ ):
+ """
+ Test Case 9: Loopback split ring inorder non-mergeable path multi-queues payload check with server mode and cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=4)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
+ % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[2],
+ self.cbdma_list[2],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[2],
+ self.cbdma_list[2],
+ self.cbdma_list[3],
+ self.cbdma_list[3],
+ )
)
- self.start_virtio_testpmd_with_vhost_net0(
- cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
)
- self.launch_pdump_to_capture_pkt()
- self.send_960_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=960)
-
- self.vhost_user_pmd.quit()
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -547,21 +753,58 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
- self.launch_pdump_to_capture_pkt()
- self.send_960_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=960)
-
- self.virtio_user_pmd.quit()
virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,server=1"
- virtio_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
+ virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_virtio_testpmd_with_vhost_net0(
cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
)
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_960_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=960)
- self.vhost_user_pmd.quit()
+ def test_loopback_split_ring_non_mergeable_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ self,
+ ):
+ """
+ Test Case 10: Loopback split ring non-mergeable path multi-queues payload check with server mode and cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
+ % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ )
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
+ )
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -569,21 +812,57 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
- self.launch_pdump_to_capture_pkt()
- self.send_960_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=960)
-
- self.virtio_user_pmd.quit()
- virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,vectorized=1,server=1"
- virtio_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
+ virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,server=1"
+ virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_virtio_testpmd_with_vhost_net0(
cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
)
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_960_packets_from_vhost()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=960)
- self.vhost_user_pmd.quit()
+ def test_loopback_split_ring_vectorized_multi_queues_payload_check_with_server_mode_and_cbdma_enable(
+ self,
+ ):
+ """
+ Test Case 11: Loopback split ring vectorized path multi-queues payload check with server mode and cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "rxq2@%s;"
+ "rxq3@%s;"
+ "rxq4@%s;"
+ "rxq5@%s;"
+ "rxq6@%s;"
+ "rxq7@%s"
+ % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ )
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
+ )
+ vhost_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -591,51 +870,36 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
+ virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=1,vectorized=1,server=1"
+ virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
+ self.start_virtio_testpmd_with_vhost_net0(
+ cores=self.virtio0_core_list, eal_param=virtio_eal_param, param=virtio_param
+ )
self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd mac")
self.send_960_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.vhost_user_pmd.execute_cmd("show port stats all")
+ self.vhost_user_pmd.execute_cmd("stop")
self.check_packet_payload_valid(pkt_len=960)
- if not self.check_2M_env:
- self.virtio_user_pmd.quit()
- self.vhost_user_pmd.quit()
- vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[txq0;txq1;txq2;txq3;txq4;txq5;rxq2;rxq3;rxq4;rxq5;rxq6;rxq7]'"
- vhost_param = (
- " --nb-cores=5 --rxq=8 --txq=8 --txd=1024 --rxd=1024 --lcore-dma=[%s]"
- % lcore_dma
- )
- self.start_vhost_testpmd(
- cores=self.vhost_core_list,
- eal_param=vhost_eal_param,
- param=vhost_param,
- ports=self.cbdma_list,
- iova_mode="pa",
- )
-
- virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1"
- virtio_param = " --nb-cores=4 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
- self.logger.info("Launch virtio with packed ring mergeable inorder path")
- self.start_virtio_testpmd_with_vhost_net0(
- cores=self.virtio0_core_list,
- eal_param=virtio_eal_param,
- param=virtio_param,
- )
-
- self.launch_pdump_to_capture_pkt()
- self.send_6192_packets_from_vhost()
- self.check_packet_payload_valid(pkt_len=6192)
-
def test_loopback_split_ring_large_chain_packets_stress_test_with_server_mode_and_cbdma_enable(
self,
):
"""
- Test Case 3: Loopback split ring large chain packets stress test with server mode and cbdma enable
+ Test Case 12: Loopback split ring large chain packets stress test with server mode and cbdma enable
"""
if not self.check_2M_env:
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=1)
- vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[txq0;rxq0]'"
- lcore_dma = "lcore%s@%s" % (self.vhost_core_list[1], self.cbdma_list[0])
-
- vhost_param = " --nb-cores=1 --mbuf-size=65535 --lcore-dma=[%s]" % lcore_dma
+ dmas = "txq0@%s;" "rxq0@%s" % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[%s]'"
+ % dmas
+ )
+ vhost_param = "--nb-cores=1 --mbuf-size=65535"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -643,7 +907,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
-
virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=1,server=1,mrg_rxbuf=1,in_order=0,vectorized=1,queue_size=2048"
virtio_param = " --nb-cores=1 --rxq=1 --txq=1 --txd=2048 --rxd=2048"
self.start_virtio_testpmd_with_vhost_net0(
@@ -652,18 +915,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
param=virtio_param,
set_fwd_csum=False,
)
-
- self.send_chain_packets_from_vhost()
- self.verify_virtio_user_receive_packets()
-
- self.vhost_user_pmd.quit()
- self.start_vhost_testpmd(
- cores=self.vhost_core_list,
- eal_param=vhost_eal_param,
- param=vhost_param,
- ports=self.cbdma_list,
- iova_mode="pa",
- )
self.send_chain_packets_from_vhost()
self.verify_virtio_user_receive_packets()
@@ -671,14 +922,19 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
self,
):
"""
- Test Case 4: Loopback packed ring large chain packets stress test with server mode and cbdma enable
+ Test Case 13: Loopback packed ring large chain packets stress test with server mode and cbdma enable
"""
if not self.check_2M_env:
self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=1)
- vhost_eal_param = "--vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[txq0;rxq0]'"
- lcore_dma = "lcore%s@%s" % (self.vhost_core_list[1], self.cbdma_list[0])
-
- vhost_param = " --nb-cores=1 --mbuf-size=65535 --lcore-dma=[%s]" % lcore_dma
+ dmas = "txq0@%s;" "rxq0@%s" % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=1,client=1,dmas=[%s]'"
+ % dmas
+ )
+ vhost_param = "--nb-cores=1 --mbuf-size=65535"
self.start_vhost_testpmd(
cores=self.vhost_core_list,
eal_param=vhost_eal_param,
@@ -686,7 +942,6 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
ports=self.cbdma_list,
iova_mode="va",
)
-
virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=1,server=1,mrg_rxbuf=1,in_order=0,vectorized=1,packed_vq=1,queue_size=2048"
virtio_param = " --nb-cores=1 --rxq=1 --txq=1 --txd=2048 --rxd=2048"
self.start_virtio_testpmd_with_vhost_net0(
@@ -695,20 +950,84 @@ class TestLoopbackVirtioUserServerModeCbama(TestCase):
param=virtio_param,
set_fwd_csum=False,
)
-
self.send_chain_packets_from_vhost()
self.verify_virtio_user_receive_packets()
- self.vhost_user_pmd.quit()
- self.start_vhost_testpmd(
- cores=self.vhost_core_list,
- eal_param=vhost_eal_param,
- param=vhost_param,
- ports=self.cbdma_list,
- iova_mode="pa",
+ def test_pv_split_and_packed_test_txonly_mode_with_cbdma_enable(self):
+ """
+ Test Case 14: PV split and packed ring test txonly mode with cbdma enable
+ """
+ self.get_cbdma_ports_info_and_bind_to_dpdk(cbdma_num=2)
+ dmas = (
+ "txq0@%s;"
+ "txq1@%s;"
+ "txq2@%s;"
+ "txq3@%s;"
+ "txq4@%s;"
+ "txq5@%s;"
+ "txq6@%s;"
+ "txq7@%s"
+ % (
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[0],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
+ self.cbdma_list[1],
)
- self.send_chain_packets_from_vhost()
- self.verify_virtio_user_receive_packets()
+ )
+ vhost_eal_param = (
+ "--vdev 'eth_vhost0,iface=vhost-net0,queues=8,client=1,dmas=[%s]'" % dmas
+ )
+ vhost_param = " --nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
+ self.start_vhost_testpmd(
+ cores=self.vhost_core_list,
+ eal_param=vhost_eal_param,
+ param=vhost_param,
+ ports=self.cbdma_list,
+ iova_mode="va",
+ )
+ virtio_eal_param = "--vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=1,in_order=1,server=1"
+ virtio_param = "--nb-cores=1 --rxq=8 --txq=8 --txd=1024 --rxd=1024"
+ self.start_virtio_testpmd_with_vhost_net0(
+ cores=self.virtio0_core_list,
+ eal_param=virtio_eal_param,
+ param=virtio_param,
+ set_fwd_csum=False,
+ set_fwd_rxonly=True,
+ )
+ self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd txonly")
+ self.vhost_user_pmd.execute_cmd("async_vhost tx poll completed on")
+ self.send_6192_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.check_each_queue_has_packets_info_on_virtio_user(
+ queues=8, check_rx=True, check_tx=False
+ )
+ self.check_packet_payload_valid(pkt_len=6192, check_payload=False)
+
+ self.vhost_user_pmd.execute_cmd("stop")
+ self.virtio_user_pmd.quit()
+ virtio_eal_param = "--force-max-simd-bitwidth=512 --vdev=net_virtio_user0,mac=00:11:22:33:44:10,path=./vhost-net0,queues=8,mrg_rxbuf=0,in_order=0,vectorized=1,packed_vq=1,server=1,queue_size=1025"
+ virtio_param = "--nb-cores=1 --rxq=8 --txq=8 --txd=1025 --rxd=1025"
+ self.start_virtio_testpmd_with_vhost_net0(
+ cores=self.virtio0_core_list,
+ eal_param=virtio_eal_param,
+ param=virtio_param,
+ set_fwd_csum=False,
+ set_fwd_rxonly=True,
+ )
+ self.launch_pdump_to_capture_pkt()
+ self.vhost_user_pmd.execute_cmd("set fwd txonly")
+ self.vhost_user_pmd.execute_cmd("async_vhost tx poll completed on")
+ self.send_960_packets_from_vhost()
+ self.verify_virtio_user_receive_packets()
+ self.check_each_queue_has_packets_info_on_virtio_user(
+ queues=8, check_rx=True, check_tx=False
+ )
+ self.check_packet_payload_valid(pkt_len=960, check_payload=False)
def tear_down(self):
"""
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-26 4:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15 6:29 [dts][PATCH V4 2/2] tests/loopback_virtio_user_server_mode_cbdma: modify dmas parameter by DPDK changed Wei Ling
2022-12-26 4:55 ` lijuan.tu
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).