* [dts][PATCH V1 1/2] test_plans/vf_queue_start_stop: add new vf test_plan
@ 2023-04-13 6:17 Lingli Chen
2023-04-13 6:17 ` [dts][PATCH V1 2/2] tests/vf_queue_start_stop: add a new vf case Lingli Chen
2023-04-26 2:58 ` [dts][PATCH V1 1/2] test_plans/vf_queue_start_stop: add new vf test_plan Tu, Lijuan
0 siblings, 2 replies; 5+ messages in thread
From: Lingli Chen @ 2023-04-13 6:17 UTC (permalink / raw)
To: dts; +Cc: yuan.peng, Lingli Chen
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 5049 bytes --]
add vf_queue_start_stop_test_plan
Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
test_plans/index.rst | 1 +
test_plans/vf_queue_start_stop_test_plan.rst | 94 ++++++++++++++++++++
2 files changed, 95 insertions(+)
create mode 100644 test_plans/vf_queue_start_stop_test_plan.rst
diff --git a/test_plans/index.rst b/test_plans/index.rst
index 2008f50b..7c72d6eb 100644
--- a/test_plans/index.rst
+++ b/test_plans/index.rst
@@ -192,6 +192,7 @@ The following are the test plans for the DPDK DTS automated test system.
vf_packet_rxtx_test_plan
vf_pf_reset_test_plan
vf_port_start_stop_test_plan
+ vf_queue_start_stop_test_plan
vf_rss_test_plan
vf_single_core_perf_test_plan
vf_smoke_test_plan
diff --git a/test_plans/vf_queue_start_stop_test_plan.rst b/test_plans/vf_queue_start_stop_test_plan.rst
new file mode 100644
index 00000000..a1a83450
--- /dev/null
+++ b/test_plans/vf_queue_start_stop_test_plan.rst
@@ -0,0 +1,94 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+ Copyright(c) 2023 Intel Corporation
+
+===========================
+VF Shutdown API Queue Tests
+===========================
+
+This tests for Shutdown API feature can be run on linux userspace. It
+will check if NIC vf port can be stopped and restarted without exiting the
+application process. Furthermore, it will check if it can reconfigure
+new configurations for a port after the port is stopped, and if it is
+able to restart with those new configurations. It is based on testpmd
+application.
+
+The test is performed by running the testpmd application and using a
+traffic generator. Port/queue configurations can be set interactively,
+and still be set at the command line when launching the application in
+order to be compatible with previous test framework.
+
+Prerequisites
+-------------
+
+Assume port A and B are connected to the remote ports, e.g. packet generator.
+Get the pci device id of DUT, for example::
+
+ ./usertools/dpdk-devbind.py -s
+
+ 0000:af:00.0 'Ethernet Controller XXV710 for 25GbE SFP28 158b' if=enp175s0f0 drv=i40e unused=vfio-pci
+
+Generate 1 VF on PF::
+
+ echo 1 > /sys/bus/pci/devices/0000:af:00.0/sriov_numvfs
+
+Bind VFs to dpdk driver::
+
+ modprobe vfio-pci
+ ./usertools/dpdk-devbind.py -b vfio-pci 0000:af:01.0
+
+Test Case: vf queue start/stop
+------------------------------
+
+This case support VF (Intel® Ethernet 700 Series/Intel® Ethernet 800 Series)
+
+#. Launch testpmd::
+ x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 1-2 -n 4 -a 0000:af:01.0 -- -i --portmask=0x1 --port-topology=loop
+
+#. Run "set verbose 1" to set verbose
+#. Run "set fwd mac" to set fwd type
+#. Run "start" to start fwd package
+
+#. Start a packet capture on the tester in the background::
+ tcpdump -i ens7 'ether[12:2] != 0x88cc' -Q in -w /tmp/tester/sniff_ens7.pcap
+
+#. Start packet generator to transmit packets::
+ sendp([Ether(dst='3c:fd:fe:c1:0f:4c', src='00:00:20:00:00:00')/IP()/UDP()/Raw(load=b'XXXXXXXXXXXXXXXXXX')],iface="ens7",count=4,inter=0,verbose=False)
+
+#. Stop testpmd::
+
+ --------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 4 RX-dropped: 0 RX-total: 4
+ TX-packets: 4 TX-dropped: 0 TX-total: 4
+ ----------------------------------------------------------------------------
+
+#. Quit tcpdump and check tester port receive 4 packets
+
+#. Run "port 0 rxq 0 stop" to stop rxq 0 in port 0
+#. Start packet generator to transmit and check tester port not receive packets
+#. Stop testpmd::
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 0 RX-dropped: 4 RX-total: 4
+ TX-packets: 0 TX-dropped: 0 TX-total: 0
+ ----------------------------------------------------------------------------
+
+#. Run "port 0 rxq 0 start" to start rxq 0 in port 0
+#. Run "port 0 txq 0 stop" to stop txq 0 in port 0
+#. Start packet generator to transmit and check tester port not receive packets
+ and in testpmd it not has "port 0/queue 0: received 1 packets" print
+#. Stop testpmd::
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 4 RX-dropped: 0 RX-total: 4
+ TX-packets: 0 TX-dropped: 0 TX-total: 0
+ ----------------------------------------------------------------------------
+
+#. Run "port 0 txq 0 start" to start txq 0 in port 0
+#. Start packet generator to transmit and check tester port receive 4 packets
+ and in testpmd it has "port 0/queue 0: received 1 packets" print
+#. Stop testpmd::
+
+ ---------------------- Forward statistics for port 0 ----------------------
+ RX-packets: 4 RX-dropped: 0 RX-total: 4
+ TX-packets: 4 TX-dropped: 0 TX-total: 4
+ ----------------------------------------------------------------------------
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dts][PATCH V1 2/2] tests/vf_queue_start_stop: add a new vf case
2023-04-13 6:17 [dts][PATCH V1 1/2] test_plans/vf_queue_start_stop: add new vf test_plan Lingli Chen
@ 2023-04-13 6:17 ` Lingli Chen
2023-04-17 1:57 ` Huang, ChenyuX
2023-04-18 3:29 ` Peng, Yuan
2023-04-26 2:58 ` [dts][PATCH V1 1/2] test_plans/vf_queue_start_stop: add new vf test_plan Tu, Lijuan
1 sibling, 2 replies; 5+ messages in thread
From: Lingli Chen @ 2023-04-13 6:17 UTC (permalink / raw)
To: dts; +Cc: yuan.peng, Lingli Chen
add vf_queue_start_stop test script
Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
tests/TestSuite_vf_queue_start_stop.py | 174 +++++++++++++++++++++++++
1 file changed, 174 insertions(+)
create mode 100644 tests/TestSuite_vf_queue_start_stop.py
diff --git a/tests/TestSuite_vf_queue_start_stop.py b/tests/TestSuite_vf_queue_start_stop.py
new file mode 100644
index 00000000..80c6a83b
--- /dev/null
+++ b/tests/TestSuite_vf_queue_start_stop.py
@@ -0,0 +1,174 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2023 Intel Corporation
+#
+
+"""
+DPDK Test suite.
+
+Test queue start stop Feature
+
+"""
+
+import time
+
+from framework.packet import Packet, strip_pktload
+from framework.pmd_output import PmdOutput
+from framework.test_case import TestCase
+
+#
+#
+# Test class.
+#
+
+
+class TestQueueStartStop(TestCase):
+ #
+ #
+ #
+ # Test cases.
+ #
+
+ def set_up_all(self):
+ """
+ Run at the start of each test suite.
+ """
+ self.ports = self.dut.get_ports(self.nic)
+ self.verify(len(self.ports) >= 1, "Insufficient number of ports.")
+
+ self.core_config = "1S/2C/1T"
+ self.ports_socket = self.dut.get_numa_id(self.ports[0])
+
+ def set_up(self):
+ """
+ Run before each test case.
+ """
+ # generate vf
+ self.dut.bind_interfaces_linux(self.kdriver)
+ self.dut.generate_sriov_vfs_by_port(self.ports[0], 1)
+ self.vf_port = self.dut.ports_info[self.ports[0]]["vfs_port"][0]
+
+ self.vf_port.bind_driver(driver="vfio-pci")
+ self.vf_port_pci = self.dut.ports_info[self.ports[0]]["sriov_vfs_pci"][0]
+
+ def check_forwarding(self, dmac, rx_received=True, received=True):
+ self.send_packet(0, 0, dmac, rx_received, received)
+
+ def send_packet(self, txPort, rxPort, dmac, rx_received, received=True):
+ """
+ Send packages according to parameters.
+ """
+ rxitf = self.tester.get_interface(self.tester.get_local_port(rxPort))
+ txitf = self.tester.get_interface(self.tester.get_local_port(txPort))
+
+ pkt = Packet(pkt_type="UDP", pkt_len=64)
+ inst = self.tester.tcpdump_sniff_packets(rxitf)
+ pkt.config_layer("ether", {"dst": dmac})
+ pkt.send_pkt(self.tester, tx_port=txitf, count=4)
+ sniff_pkts = self.tester.load_tcpdump_sniff_packets(inst)
+ out = self.dut.get_session_output()
+ if rx_received:
+ self.verify(
+ "port 0/queue 0: received 1 packets" in out,
+ "start queue revice package failed, out = %s" % out,
+ )
+ else:
+ self.verify(
+ "port 0/queue 0: received 1 packets" not in out,
+ "start queue revice package failed, out = %s" % out,
+ )
+
+ if received:
+ res = strip_pktload(sniff_pkts, layer="L4")
+ self.verify(
+ "58 58 58 58 58 58 58 58" in res, "receive queue not work as expected"
+ )
+ else:
+ self.verify(len(sniff_pkts) == 0, "stop queue not work as expected")
+
+ def test_vf_queue_start_stop(self):
+ """
+ vf queue start/stop test
+ """
+ self.pmd_out = PmdOutput(self.dut)
+ cores = self.dut.get_core_list(self.core_config, socket=self.ports_socket)
+ # dpdk start
+ try:
+ self.pmd_out.start_testpmd(
+ cores=cores,
+ eal_param="-a %s --file-prefix=vf" % self.vf_port_pci,
+ param="--portmask=0x1 --port-topology=loop",
+ )
+ self.dut.send_expect("set fwd mac", "testpmd>")
+ self.dut.send_expect("set verbose 1", "testpmd>")
+ self.dut.send_expect("start", "testpmd>")
+ self.pmd_out.wait_link_status_up("all")
+ dmac = self.pmd_out.get_port_mac(0)
+ self.check_forwarding(dmac)
+ out = self.dut.send_expect("stop", "testpmd>")
+ self.verify(
+ "RX-packets: 4" in out, "Forward statistics for RX-packets is error"
+ )
+ self.verify(
+ "TX-packets: 4" in out, "Forward statistics for TX-packets is error"
+ )
+ except Exception as e:
+ raise IOError("dpdk start and first forward failure: %s" % e)
+
+ try:
+ # stop rx queue test
+ print("test stop rx queue")
+ self.dut.send_expect("port 0 rxq 0 stop", "testpmd>")
+ self.dut.send_expect("start", "testpmd>")
+ self.check_forwarding(dmac, rx_received=False, received=False)
+
+ out = self.dut.send_expect("stop", "testpmd>")
+ self.verify(
+ "RX-packets: 0" in out, "Forward statistics for RX-packets is error"
+ )
+
+ # stop tx queue test
+ print("test start rx queue stop tx queue")
+ self.dut.send_expect("port 0 rxq 0 start", "testpmd>")
+ self.dut.send_expect("port 0 txq 0 stop", "testpmd>")
+ self.dut.send_expect("start", "testpmd>")
+ self.check_forwarding(dmac, rx_received=False, received=False)
+ out = self.dut.send_expect("stop", "testpmd>")
+ self.verify(
+ "TX-packets: 0" in out, "Forward statistics for TX-packets is error"
+ )
+ except Exception as e:
+ raise IOError("queue stop forward failure: %s" % e)
+
+ try:
+ # start tx queue test
+ print("test start rx and tx queue")
+ self.dut.send_expect("port 0 txq 0 start", "testpmd>")
+ self.dut.send_expect("start", "testpmd>")
+ self.check_forwarding(dmac)
+ out = self.dut.send_expect("stop", "testpmd>")
+ self.verify(
+ "RX-packets: 4" in out,
+ "restart txq Forward statistics for RX-packets is error",
+ )
+ self.verify(
+ "TX-packets: 4" in out,
+ "restart txq Forward statistics for TX-packets is error",
+ )
+ except Exception as e:
+ raise IOError("queue start forward failure: %s" % e)
+
+ def tear_down(self):
+ """
+ Run after each test case.
+ """
+ try:
+ self.dut.send_expect("quit", "#")
+ except:
+ print("Failed to quit testpmd")
+
+ def tear_down_all(self):
+ """
+ Run after each test suite.
+ """
+ self.dut.kill_all()
+ self.dut.bind_interfaces_linux(self.drivername)
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [dts][PATCH V1 2/2] tests/vf_queue_start_stop: add a new vf case
2023-04-13 6:17 ` [dts][PATCH V1 2/2] tests/vf_queue_start_stop: add a new vf case Lingli Chen
@ 2023-04-17 1:57 ` Huang, ChenyuX
2023-04-18 3:29 ` Peng, Yuan
1 sibling, 0 replies; 5+ messages in thread
From: Huang, ChenyuX @ 2023-04-17 1:57 UTC (permalink / raw)
To: Chen, LingliX, dts; +Cc: Peng, Yuan, Chen, LingliX
> -----Original Message-----
> From: Lingli Chen <linglix.chen@intel.com>
> Sent: Thursday, April 13, 2023 2:18 PM
> To: dts@dpdk.org
> Cc: Peng, Yuan <yuan.peng@intel.com>; Chen, LingliX <linglix.chen@intel.com>
> Subject: [dts][PATCH V1 2/2] tests/vf_queue_start_stop: add a new vf case
>
> add vf_queue_start_stop test script
>
> Signed-off-by: Lingli Chen <linglix.chen@intel.com>
> ---
i40e:failed by bug: DPDK-37084 stop rxq, Forward statistics for RX-packets is error
ice: failed by bug: DPDK-36737
Tested-by: Chenyu Huang <chenyux.huang@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [dts][PATCH V1 2/2] tests/vf_queue_start_stop: add a new vf case
2023-04-13 6:17 ` [dts][PATCH V1 2/2] tests/vf_queue_start_stop: add a new vf case Lingli Chen
2023-04-17 1:57 ` Huang, ChenyuX
@ 2023-04-18 3:29 ` Peng, Yuan
1 sibling, 0 replies; 5+ messages in thread
From: Peng, Yuan @ 2023-04-18 3:29 UTC (permalink / raw)
To: Chen, LingliX, dts
> -----Original Message-----
> From: Chen, LingliX <linglix.chen@intel.com>
> Sent: Thursday, April 13, 2023 2:18 PM
> To: dts@dpdk.org
> Cc: Peng, Yuan <yuan.peng@intel.com>; Chen, LingliX
> <linglix.chen@intel.com>
> Subject: [dts][PATCH V1 2/2] tests/vf_queue_start_stop: add a new vf case
>
> add vf_queue_start_stop test script
>
> Signed-off-by: Lingli Chen <linglix.chen@intel.com>
> ---
Acked-by: Yuan Peng <yuan.peng@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [dts][PATCH V1 1/2] test_plans/vf_queue_start_stop: add new vf test_plan
2023-04-13 6:17 [dts][PATCH V1 1/2] test_plans/vf_queue_start_stop: add new vf test_plan Lingli Chen
2023-04-13 6:17 ` [dts][PATCH V1 2/2] tests/vf_queue_start_stop: add a new vf case Lingli Chen
@ 2023-04-26 2:58 ` Tu, Lijuan
1 sibling, 0 replies; 5+ messages in thread
From: Tu, Lijuan @ 2023-04-26 2:58 UTC (permalink / raw)
To: Chen, LingliX, dts; +Cc: Peng, Yuan, Chen, LingliX
I thinks this is a generic test case, it's not necessary to create a new test suite, add it to iavf test plan is more make sense.
By the way, the title and description of test plan are not align with content.
> -----Original Message-----
> From: Lingli Chen <linglix.chen@intel.com>
> Sent: Thursday, April 13, 2023 2:17 PM
> To: dts@dpdk.org
> Cc: Peng, Yuan <yuan.peng@intel.com>; Chen, LingliX <linglix.chen@intel.com>
> Subject: [dts][PATCH V1 1/2] test_plans/vf_queue_start_stop: add new vf
> test_plan
>
> add vf_queue_start_stop_test_plan
>
> Signed-off-by: Lingli Chen <linglix.chen@intel.com>
> ---
> test_plans/index.rst | 1 +
> test_plans/vf_queue_start_stop_test_plan.rst | 94 ++++++++++++++++++++
> 2 files changed, 95 insertions(+)
> create mode 100644 test_plans/vf_queue_start_stop_test_plan.rst
>
> diff --git a/test_plans/index.rst b/test_plans/index.rst index 2008f50b..7c72d6eb
> 100644
> --- a/test_plans/index.rst
> +++ b/test_plans/index.rst
> @@ -192,6 +192,7 @@ The following are the test plans for the DPDK DTS
> automated test system.
> vf_packet_rxtx_test_plan
> vf_pf_reset_test_plan
> vf_port_start_stop_test_plan
> + vf_queue_start_stop_test_plan
> vf_rss_test_plan
> vf_single_core_perf_test_plan
> vf_smoke_test_plan
> diff --git a/test_plans/vf_queue_start_stop_test_plan.rst
> b/test_plans/vf_queue_start_stop_test_plan.rst
> new file mode 100644
> index 00000000..a1a83450
> --- /dev/null
> +++ b/test_plans/vf_queue_start_stop_test_plan.rst
> @@ -0,0 +1,94 @@
> +.. SPDX-License-Identifier: BSD-3-Clause
> + Copyright(c) 2023 Intel Corporation
> +
> +===========================
> +VF Shutdown API Queue Tests
> +===========================
> +
> +This tests for Shutdown API feature can be run on linux userspace. It
> +will check if NIC vf port can be stopped and restarted without exiting
> +the application process. Furthermore, it will check if it can
> +reconfigure new configurations for a port after the port is stopped,
> +and if it is able to restart with those new configurations. It is based
> +on testpmd application.
> +
> +The test is performed by running the testpmd application and using a
> +traffic generator. Port/queue configurations can be set interactively,
> +and still be set at the command line when launching the application in
> +order to be compatible with previous test framework.
> +
> +Prerequisites
> +-------------
> +
> +Assume port A and B are connected to the remote ports, e.g. packet generator.
> +Get the pci device id of DUT, for example::
> +
> + ./usertools/dpdk-devbind.py -s
> +
> + 0000:af:00.0 'Ethernet Controller XXV710 for 25GbE SFP28 158b'
> + if=enp175s0f0 drv=i40e unused=vfio-pci
> +
> +Generate 1 VF on PF::
> +
> + echo 1 > /sys/bus/pci/devices/0000:af:00.0/sriov_numvfs
> +
> +Bind VFs to dpdk driver::
> +
> + modprobe vfio-pci
> + ./usertools/dpdk-devbind.py -b vfio-pci 0000:af:01.0
> +
> +Test Case: vf queue start/stop
> +------------------------------
> +
> +This case support VF (Intel® Ethernet 700 Series/Intel® Ethernet 800
> +Series)
> +
> +#. Launch testpmd::
> + x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 1-2 -n 4 -a
> +0000:af:01.0 -- -i --portmask=0x1 --port-topology=loop
> +
> +#. Run "set verbose 1" to set verbose
> +#. Run "set fwd mac" to set fwd type
> +#. Run "start" to start fwd package
> +
> +#. Start a packet capture on the tester in the background::
> + tcpdump -i ens7 'ether[12:2] != 0x88cc' -Q in -w
> +/tmp/tester/sniff_ens7.pcap
> +
> +#. Start packet generator to transmit packets::
> + sendp([Ether(dst='3c:fd:fe:c1:0f:4c',
> +src='00:00:20:00:00:00')/IP()/UDP()/Raw(load=b'XXXXXXXXXXXXXXXXXX')],if
> +ace="ens7",count=4,inter=0,verbose=False)
> +
> +#. Stop testpmd::
> +
> + --------------------- Forward statistics for port 0 ----------------------
> + RX-packets: 4 RX-dropped: 0 RX-total: 4
> + TX-packets: 4 TX-dropped: 0 TX-total: 4
> +
> + ----------------------------------------------------------------------
> + ------
> +
> +#. Quit tcpdump and check tester port receive 4 packets
> +
> +#. Run "port 0 rxq 0 stop" to stop rxq 0 in port 0 #. Start packet
> +generator to transmit and check tester port not receive packets #. Stop
> +testpmd::
> +
> + ---------------------- Forward statistics for port 0 ----------------------
> + RX-packets: 0 RX-dropped: 4 RX-total: 4
> + TX-packets: 0 TX-dropped: 0 TX-total: 0
> +
> + ----------------------------------------------------------------------
> + ------
> +
> +#. Run "port 0 rxq 0 start" to start rxq 0 in port 0 #. Run "port 0 txq
> +0 stop" to stop txq 0 in port 0 #. Start packet generator to transmit
> +and check tester port not receive packets
> + and in testpmd it not has "port 0/queue 0: received 1 packets" print
> +#. Stop testpmd::
> +
> + ---------------------- Forward statistics for port 0 ----------------------
> + RX-packets: 4 RX-dropped: 0 RX-total: 4
> + TX-packets: 0 TX-dropped: 0 TX-total: 0
> +
> + ----------------------------------------------------------------------
> + ------
> +
> +#. Run "port 0 txq 0 start" to start txq 0 in port 0 #. Start packet
> +generator to transmit and check tester port receive 4 packets
> + and in testpmd it has "port 0/queue 0: received 1 packets" print #.
> +Stop testpmd::
> +
> + ---------------------- Forward statistics for port 0 ----------------------
> + RX-packets: 4 RX-dropped: 0 RX-total: 4
> + TX-packets: 4 TX-dropped: 0 TX-total: 4
> +
> + ----------------------------------------------------------------------
> + ------
> --
> 2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-04-26 2:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 6:17 [dts][PATCH V1 1/2] test_plans/vf_queue_start_stop: add new vf test_plan Lingli Chen
2023-04-13 6:17 ` [dts][PATCH V1 2/2] tests/vf_queue_start_stop: add a new vf case Lingli Chen
2023-04-17 1:57 ` Huang, ChenyuX
2023-04-18 3:29 ` Peng, Yuan
2023-04-26 2:58 ` [dts][PATCH V1 1/2] test_plans/vf_queue_start_stop: add new vf test_plan Tu, Lijuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).