* [dts] [PATCH V1 1/2] test_plans/cvl_iavf_rss_configure_test_plan:add iavf rss configure test plan
2021-02-25 11:05 [dts] [PATCH V1 0/2] add iavf rss configure case and plan Zhimin Huang
@ 2021-02-25 11:05 ` Zhimin Huang
2021-02-25 11:05 ` [dts] [PATCH V1 2/2] tests/cvl_iavf_rss_configure:add iavf rss configure test case Zhimin Huang
2021-03-02 4:39 ` [dts] [PATCH V1 0/2] add iavf rss configure case and plan Tu, Lijuan
2 siblings, 0 replies; 5+ messages in thread
From: Zhimin Huang @ 2021-02-25 11:05 UTC (permalink / raw)
To: dts; +Cc: lijuan.tu, Zhimin Huang
*.iavf support configure rss:
runtime func:port config all rss ip/udp/tcp/sctp/none/all
command-line:--rss-ip, --rss-udp, --disable-rss
---
| 328 ++++++++++++++++++++++++
1 file changed, 328 insertions(+)
create mode 100755 test_plans/cvl_iavf_rss_configure_test_plan.rst
--git a/test_plans/cvl_iavf_rss_configure_test_plan.rst b/test_plans/cvl_iavf_rss_configure_test_plan.rst
new file mode 100755
index 0000000..9766c76
--- /dev/null
+++ b/test_plans/cvl_iavf_rss_configure_test_plan.rst
@@ -0,0 +1,328 @@
+.. Copyright (c) <2021>, Intel Corporation
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ - Neither the name of Intel Corporation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+===============================
+IAVF: default RSS configuration
+===============================
+
+Description
+===========
+
+DPDK-21.02 improved iavf default RSS, major feature are:
+
+ - support IAVF to use port config to set ip/udp/tcp/sctp RSS, other rss_type like gtpu/l2tpv3/esp/ah will be
+ rejected, they should only be supported used in RTE_FLOW::
+
+ port config all rss ip/udp/tcp/sctp
+
+ - default RSS should be overwritten but not append, for example, set udp, then set tcp, it will be tcp at the end.
+ - any kernel PF enabled default RSS should be disabled, it requires ice base driver >= 1.3.0.
+ - only support Intel E810 series cards now, but not support Intel 700 series cards.
+
+Prerequisites
+=============
+
+1. NIC requires:
+
+ - Intel E810 series ethernet cards: columbiaville_25g, columbiaville_100g, etc.
+
+2. insmod ice.ko, and bind PF to ice.
+
+3. create a VF from a PF in DUT, set mac address for this VF::
+
+ echo 1 > /sys/bus/pci/devices/0000\:18\:00.0/sriov_numvfs
+ ip link set enp24s0f0 vf 0 mac 00:11:22:33:44:55
+
+4. bind VF to vfio-pci::
+
+ modprobe vfio-pci
+ usertools/dpdk-devbind.py --force --bind=vfio-pci 0000:18:01.0
+
+5. launch testpmd::
+
+ ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf -n 4 -- -i --rxq=16 --txq=16
+ testpmd>set fwd rxonly
+ testpmd>set verbose 1
+ testpmd> start
+
+Basic test steps
+----------------
+
+1. set rss function
+
+* testpmd command-line options::
+
+ --rss-ip: set ip RSS.
+ --rss-udp: set udp RSS.
+ --disable-rss: disable RSS.
+
+ RSS is on by default.
+
+* testpmd runtime functions::
+
+ port config all rss ip/udp/tcp/sctp/none/all
+
+ * The ``none`` option is equivalent to the ``--disable-rss`` command-line option.
+ * The `` ip`` option is equivalent to the ``--rss-ip`` command-line option.
+ * The `` udp`` option is equivalent to the ``--rss-udp`` command-line option.
+
+.. note::
+
+ - IP_RSS: ip/udp/tcp/sctp pkts use L3 ipv4()/ipv6() get hash values.
+ - UDP(TCP/SCTP)_RSS: only UDP(TCP/SCTP) pkts use L4 UDP()/TCP()/SCTP() get hash values, other pkts have no hash values.
+
+2. transmit different protocol packets, and check hash results based on following table. (take IP RSS for example)
+
+ a. transmit MAC_IPV4_PAY packet::
+
+ Ether(dst="00:11:22:33:44:55")/IP(src="192.168.0.2",dst="192.168.0.3")/("X"*40)
+
+ b. check hash results that `RSS hash=0x5bf8517c` in the output::
+
+ testpmd> port 0/queue 12: received 1 packets(have hash)
+ src=00:1E:67:56:C8:2B - dst=00:11:22:33:44:55 - type=0x0800 - length=74 - nb_segs=1 - RSS hash=0x5bf8517c - RSS
+ queue=0xc - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 -
+ l3_len=20 - Receive queue=0xc
+ ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+ c. transmit MAC_IPV4_UDP packet::
+
+ Ether(dst="00:11:22:33:44:55")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1024,dport=1025)/("X"*40)
+
+ d. check hash results that `RSS hash=0x5bf8517c` in the output, MAC_IPV4_UDP has same hash vaule with MAC_IPV4_PAY,
+ that's becuse they have same IP dst and src::
+
+ testpmd> port 0/queue 12: received 1 packets(have hash)
+ src=00:1E:67:56:C8:2B - dst=00:11:22:33:44:55 - type=0x0800 - length=82 - nb_segs=1 - RSS hash=0x5bf8517c - RSS
+ queue=0xc - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_UDP - sw ptype: L2_ETHER L3_IPV4 L4_UDP - l2_len=14 -
+ l3_len=20 - l4_len=8 - Receive queue=0xc
+ ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+.. note::
+
+ Some packets don't have string `RSS hash` in the output, as their hash function are disabled.
+
+
+.. table::
+
+ +-------------------------------+------------------------------+--------------------------+-----------------------------+-------------------------+
+ | Default hash function: Non Symmetric_toeplitz |
+ +-------------------------------+------------------------------+--------------------------+-----------------------------+-------------------------+
+ | RSS Configuration | Pattern | Default Input Set | Traffic packet type | hash action |
+ +===============================+==============================+==========================+=============================+=========================+
+ | | MAC_IPV4, MAC_IPV6 | ipv4, ipv6 | MAC_IPV4_PAY | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_UDP | same hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_TCP | same hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_SCTP | same hash value |
+ | IP +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_PAY | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_UDP | same hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_TCP | same hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_SCTP | same hash value |
+ +-------------------------------+------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | MAC_IPV4_UDP, MAC_IPV6_UDP | ipv4-udp, ipv6-udp | MAC_IPV4_UDP | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_PAY | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_TCP | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_SCTP | no hash value |
+ | UDP +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_UDP | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_PAY | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_TCP | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_SCTP | no hash value |
+ +-------------------------------+------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | MAC_IPV4_TCP, MAC_IPV6_TCP | ipv4-tcp, ipv6-tcp | MAC_IPV4_TCP | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_PAY | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_UDP | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_SCTP | no hash value |
+ | TCP +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_TCP | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_PAY | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_UDP | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_SCTP | no hash value |
+ +-------------------------------+------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | MAC_IPV4_SCTP, MAC_IPV6_SCTP | ipv4-sctp, ipv6-sctp | MAC_IPV4_SCTP | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_PAY | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_UDP | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_TCP | no hash value |
+ | SCTP +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_SCTP | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_PAY | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_UDP | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_TCP | no hash value |
+ +-------------------------------+------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | ALL | all | MAC_IPV4_PAY | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_UDP | different hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_TCP | different hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_SCTP | different hash value |
+ | all +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_PAY | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_UDP | different hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_TCP | different hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_SCTP | different hash value |
+ +-------------------------------+------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_PAY | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_SCTP | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_UDP | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_TCP | no hash value |
+ | none (disable) +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_PAY | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_SCTP | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_UDP | no hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_TCP | no hash value |
+ +-------------------------------+------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | MAC_IPV4, MAC_IPV6 | ipv4, ipv6 | MAC_IPV4_PAY | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_SCTP | same hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_UDP | same hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV4_TCP | same hash value |
+ | w/o setting +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_PAY | record hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_SCTP | same hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_UDP | same hash value |
+ | +------------------------------+--------------------------+-----------------------------+-------------------------+
+ | | | | MAC_IPV6_TCP | same hash value |
+ +-------------------------------+------------------------------+--------------------------+-----------------------------+-------------------------+
+
+Sending packets command line of scapy
+-------------------------------------
+
+.. table::
+
+ +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
+ | Traffic packet type | Scapy command line |
+ +=====================+===========================================================================================================================================================+
+ | MAC_IPV4_PAY | sendp([Ether(dst="00:11:22:33:44:55")/IP(src="192.168.0.2",dst="192.168.0.3")/("X" * 40)], iface="enp24s0f0") |
+ +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
+ | MAC_IPV4_UDP | sendp([Ether(dst="00:11:22:33:44:55")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1024,dport=1025)/("X" * 40)], iface="enp24s0f0") |
+ +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
+ | MAC_IPV4_TCP | sendp([Ether(dst="00:11:22:33:44:55")/IP(src="192.168.0.2",dst="192.168.0.3")/TCP(sport=1024,dport=1025)/("X" * 40)], iface="enp24s0f0") |
+ +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
+ | MAC_IPV4_SCTP | sendp([Ether(dst="00:11:22:33:44:55")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X" * 40)], iface="enp24s0f0") |
+ +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
+ | MAC_IPV6_PAY | sendp([Ether(dst="00:11:22:33:44:55")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/("X" * 40)], iface="enp24s0f0") |
+ +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
+ | MAC_IPV6_UDP | sendp([Ether(dst="00:11:22:33:44:55")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1024,dport=1025)/("X" * 40)], iface="enp24s0f0") |
+ +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
+ | MAC_IPV6_TCP | sendp([Ether(dst="00:11:22:33:44:55")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/TCP(sport=1024,dport=1025)/("X" * 40)], iface="enp24s0f0") |
+ +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
+ | MAC_IPV6_SCTP | sendp([Ether(dst="00:11:22:33:44:55")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X" * 40)], iface="enp24s0f0") |
+ +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
+
+Test Case: test_iavf_rss_configure_to_ip
+========================================
+
+Set rss to ip with testpmd runtime func, transmit different protocol packets, and check hash results.
+
+Test Case: test_iavf_rss_configure_to_udp
+=========================================
+
+Set rss to udp with testpmd runtime func, transmit different protocol packets, and check hash results.
+
+Test Case: test_iavf_rss_configure_to_tcp
+=========================================
+
+Set rss to tcp with testpmd runtime func, transmit different protocol packets, and check hash results.
+
+Test Case: test_iavf_rss_configure_to_sctp
+==========================================
+
+Set rss to sctp with testpmd runtime func, transmit different protocol packets, and check hash results.
+
+Test Case: test_iavf_rss_configure_to_all
+=========================================
+
+Set rss to all with testpmd runtime func, transmit different protocol packets, and check hash results.
+
+Test Case: test_iavf_rss_configure_to_none
+==========================================
+
+disable rss with testpmd runtime func, transmit different protocol packets, and check hash results.
+
+Test Case: test_iavf_rss_command_line_to_ip
+===========================================
+
+Set rss to ip with testpmd command line options, transmit different protocol packets, and check hash results.
+
+Test Case: test_iavf_rss_command_line_to_udp
+============================================
+
+Set rss to udp with testpmd command line options, transmit different protocol packets, and check hash results.
+
+Test Case: test_iavf_rss_command_line_to_none
+=============================================
+
+disable rss with testpmd command line options, transmit different protocol packets, and check hash results.
+
+Test Case: test_iavf_rss_command_line_to_default
+================================================
+
+don't set rss with either runtime func nor command line option, only use default configuration, transmit different protocol packets, and check hash results.
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dts] [PATCH V1 2/2] tests/cvl_iavf_rss_configure:add iavf rss configure test case
2021-02-25 11:05 [dts] [PATCH V1 0/2] add iavf rss configure case and plan Zhimin Huang
2021-02-25 11:05 ` [dts] [PATCH V1 1/2] test_plans/cvl_iavf_rss_configure_test_plan:add iavf rss configure test plan Zhimin Huang
@ 2021-02-25 11:05 ` Zhimin Huang
2021-02-25 11:19 ` Huang, ZhiminX
2021-03-02 4:39 ` [dts] [PATCH V1 0/2] add iavf rss configure case and plan Tu, Lijuan
2 siblings, 1 reply; 5+ messages in thread
From: Zhimin Huang @ 2021-02-25 11:05 UTC (permalink / raw)
To: dts; +Cc: lijuan.tu, Zhimin Huang
*.iavf support rss configure:
runtime func:port config all rss ip/udp/tcp/sctp/none/all
command-line:--rss-ip, --rss-udp, --disable-rss
---
| 392 ++++++++++++++++++++++++++++++
1 file changed, 392 insertions(+)
create mode 100755 tests/TestSuite_cvl_iavf_rss_configure.py
--git a/tests/TestSuite_cvl_iavf_rss_configure.py b/tests/TestSuite_cvl_iavf_rss_configure.py
new file mode 100755
index 0000000..86b2819
--- /dev/null
+++ b/tests/TestSuite_cvl_iavf_rss_configure.py
@@ -0,0 +1,392 @@
+# BSD LICENSE
+#
+# Copyright(c) 2021 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import json
+import time
+import re
+import packet
+import os
+from scapy.contrib.gtp import *
+from test_case import TestCase
+from pmd_output import PmdOutput
+from rte_flow_common import RssProcessing
+
+tv_packets_basic = {
+ 'tv_mac_ipv4': 'Ether(dst="00:11:22:33:44:55")/IP(src="192.168.0.2",dst="192.168.0.3")/("X"*40)',
+ 'tv_mac_ipv6': 'Ether(dst="00:11:22:33:44:55")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/("X"*40)',
+ 'tv_mac_ipv4_udp': 'Ether(dst="00:11:22:33:44:55")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1024,dport=1025)/("X"*40)',
+ 'tv_mac_ipv6_udp': 'Ether(dst="00:11:22:33:44:55")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1024,dport=1025)/("X"*40)',
+ 'tv_mac_ipv4_tcp': 'Ether(dst="00:11:22:33:44:55")/IP(src="192.168.0.2",dst="192.168.0.3")/TCP(sport=1024,dport=1025)/("X"*40)',
+ 'tv_mac_ipv6_tcp': 'Ether(dst="00:11:22:33:44:55")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/TCP(sport=1024,dport=1025)/("X"*40)',
+ 'tv_mac_ipv4_sctp': 'Ether(dst="00:11:22:33:44:55")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)',
+ 'tv_mac_ipv6_sctp': 'Ether(dst="00:11:22:33:44:55")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)',
+}
+
+tvs_mac_ip = {
+ 'sub_casename': 'tv_mac_ip',
+ 'port_id': 0,
+ 'test': [
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4'],
+ 'action': {'save_hash': 'ipv4'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6'],
+ 'action': {'save_hash': 'ipv6'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_udp'],
+ 'action': {'check_hash_same': 'ipv4'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_udp'],
+ 'action': {'check_hash_same': 'ipv6'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_tcp'],
+ 'action': {'check_hash_same': 'ipv4'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_tcp'],
+ 'action': {'check_hash_same': 'ipv6'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_sctp'],
+ 'action': {'check_hash_same': 'ipv4'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_sctp'],
+ 'action': {'check_hash_same': 'ipv6'},
+ },
+ ]
+}
+
+tvs_mac_udp = {
+ 'sub_casename': 'tv_mac_udp',
+ 'port_id': 0,
+ 'test': [
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_udp'],
+ 'action': {'save_hash', 'ipv4_udp'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_udp'],
+ 'action': {'save_hash', 'ipv6_udp'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_tcp'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_tcp'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_sctp'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_sctp'],
+ 'action': 'check_no_hash',
+ },
+ ]
+}
+
+tvs_mac_tcp = {
+ 'sub_casename': 'tv_mac_tcp',
+ 'port_id': 0,
+ 'test': [
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_tcp'],
+ 'action': {'save_hash', 'ipv4_tcp'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_tcp'],
+ 'action': {'save_hash', 'ipv6_tcp'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_udp'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_udp'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_sctp'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_sctp'],
+ 'action': 'check_no_hash',
+ },
+ ]
+}
+
+tvs_mac_sctp = {
+ 'sub_casename': 'tv_mac_sctp',
+ 'port_id': 0,
+ 'test': [
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_sctp'],
+ 'action': {'save_hash', 'ipv4_sctp'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_sctp'],
+ 'action': {'save_hash', 'ipv6_sctp'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_udp'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_udp'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_tcp'],
+ 'action': 'check_no_hash',
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_tcp'],
+ 'action': 'check_no_hash',
+ },
+ ]
+}
+
+tvs_mac_all = {
+ 'sub_casename': 'tvs_mac_all',
+ 'port_id': 0,
+ 'test': [
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4'],
+ 'action': {'save_hash', 'ipv4_all'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6'],
+ 'action': {'save_hash', 'ipv6_all'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_udp'],
+ 'action': {'check_hash_different', 'ipv4_all'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_udp'],
+ 'action': {'check_hash_different', 'ipv6_all'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_tcp'],
+ 'action': {'check_hash_different', 'ipv4_all'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_tcp'],
+ 'action': {'check_hash_different', 'ipv6_all'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv4_sctp'],
+ 'action': {'check_hash_different', 'ipv4_all'},
+ },
+ {
+ 'send_packet': tv_packets_basic['tv_mac_ipv6_sctp'],
+ 'action': {'check_hash_different', 'ipv6_all'},
+ },
+ ]
+}
+
+tvs_mac_disable_rss = eval(str(tvs_mac_all)
+ .replace('save_hash', 'check_no_hash')
+ .replace('check_hash_different', 'check_no_hash')
+ )
+
+class IAVFRSSConfigureTest(TestCase):
+
+ def set_up_all(self):
+ """
+ Run at the start of each test suite.
+ Generic filter Prerequistites
+ """
+ self.dut_ports = self.dut.get_ports(self.nic)
+ self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
+ # Verify that enough ports are available
+ self.verify(len(self.dut_ports) >= 1, "Insufficient ports")
+ self.tester_port0 = self.tester.get_local_port(self.dut_ports[0])
+ self.tester_iface0 = self.tester.get_interface(self.tester_port0)
+ self.cores = "1S/5C/1T"
+ # check core num
+ core_list = self.dut.get_core_list(self.cores)
+ self.verify(len(core_list) >= 5, "Insufficient cores for testing")
+
+ self.vf_driver = self.get_suite_cfg()['vf_driver']
+ if self.vf_driver is None:
+ self.vf_driver = 'vfio-pci'
+ self.pf0_intf = self.dut.ports_info[self.dut_ports[0]]['intf']
+ self.create_vf()
+
+ self.queue_num = 16
+ self.param = " --rxq={} --txq={} ".format(self.queue_num, self.queue_num)
+ self.pmdout = PmdOutput(self.dut)
+ self.launch_testpmd(param=self.param)
+ self.rssprocess = RssProcessing(self, self.pmdout, [self.tester_iface0], self.queue_num)
+ self.dut_session = self.dut.new_session()
+
+ def set_up(self):
+ """
+ Run before each test case.
+ """
+ # check testpmd process status
+ cmd = "ps -aux | grep testpmd | grep -v grep"
+ out = self.dut_session.send_expect(cmd, "#", 15)
+ if "testpmd" not in out:
+ self.restart_testpmd()
+
+ def tear_down(self):
+ """
+ Run after each test case.
+ """
+ self.pmdout.execute_cmd("stop")
+
+ def tear_down_all(self):
+ """
+ Run after each test suite.
+ """
+ self.dut.send_expect("quit", "#")
+ self.destroy_vf()
+ self.dut.kill_all()
+
+ def launch_testpmd(self, param=''):
+ """
+ start testpmd
+ """
+ #Prepare testpmd EAL and parameters
+ self.pmdout.start_testpmd(cores=self.cores, param=param,
+ eal_param=f"-w {self.vf0_pci}", socket=self.ports_socket)
+ # test link status
+ res = self.pmdout.wait_link_status_up('all', timeout=15)
+ self.verify(res is True, 'there have port link is down')
+ self.pmdout.execute_cmd("set fwd rxonly", "testpmd> ", 15)
+ self.pmdout.execute_cmd("set verbose 1", "testpmd> ", 15)
+
+ def restart_testpmd(self, cmd_line=''):
+ """
+ some case need to restart testpmd with param
+ """
+ self.pmdout.quit()
+ params = self.param + cmd_line
+ self.launch_testpmd(param=params)
+ self.pmdout.execute_cmd("start")
+
+ def create_vf(self):
+ self.dut.bind_interfaces_linux('ice')
+ self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], 1)
+ self.sriov_vfs_port = self.dut.ports_info[self.dut_ports[0]]['vfs_port']
+ self.dut.send_expect("ifconfig %s up" % self.pf0_intf, "# ")
+ self.dut.send_expect('ip link set %s vf 0 mac 00:11:22:33:44:55' % self.pf0_intf, '#')
+ self.vf0_pci = self.sriov_vfs_port[0].pci
+ try:
+ for port in self.sriov_vfs_port:
+ port.bind_driver(self.vf_driver)
+ except Exception as e:
+ self.destroy_vf()
+ raise Exception(e)
+
+ def destroy_vf(self):
+ self.dut.send_expect("quit", "# ", 60)
+ time.sleep(2)
+ self.dut.destroy_sriov_vfs_by_port(self.dut_ports[0])
+
+ def set_rss_configure(self, rss_type):
+ if rss_type != "":
+ self.pmdout.execute_cmd("port config all rss %s" % rss_type)
+ self.pmdout.execute_cmd("start")
+
+ def test_iavf_rss_configure_to_ip(self):
+ self.set_rss_configure(rss_type='ip')
+ self.rssprocess.handle_rss_distribute_cases(cases_info=tvs_mac_ip)
+
+ def test_iavf_rss_configure_to_udp(self):
+ self.set_rss_configure(rss_type='udp')
+ self.rssprocess.handle_rss_distribute_cases(cases_info=tvs_mac_udp)
+
+ def test_iavf_rss_configure_to_tcp(self):
+ self.set_rss_configure(rss_type='tcp')
+ self.rssprocess.handle_rss_distribute_cases(cases_info=tvs_mac_tcp)
+
+ def test_iavf_rss_configure_to_sctp(self):
+ self.set_rss_configure(rss_type='sctp')
+ self.rssprocess.handle_rss_distribute_cases(cases_info=tvs_mac_sctp)
+
+ def test_iavf_rss_configure_to_all(self):
+ self.set_rss_configure(rss_type='all')
+ self.rssprocess.handle_rss_distribute_cases(cases_info=tvs_mac_all)
+
+ def test_iavf_rss_configure_to_none(self):
+ self.set_rss_configure(rss_type='none')
+ self.rssprocess.handle_rss_distribute_cases(cases_info=tvs_mac_disable_rss)
+
+ def test_iavf_rss_command_line_to_ip(self):
+ self.restart_testpmd(cmd_line='--rss-ip')
+ self.rssprocess.handle_rss_distribute_cases(cases_info=tvs_mac_ip)
+
+ def test_iavf_rss_command_line_to_udp(self):
+ self.restart_testpmd(cmd_line='--rss-udp')
+ self.rssprocess.handle_rss_distribute_cases(cases_info=tvs_mac_udp)
+
+ def test_iavf_rss_command_line_to_none(self):
+ self.restart_testpmd(cmd_line='--disable-rss')
+ self.rssprocess.handle_rss_distribute_cases(cases_info=tvs_mac_disable_rss)
+
+ def test_iavf_rss_command_line_to_default(self):
+ self.restart_testpmd()
+ self.rssprocess.handle_rss_distribute_cases(cases_info=tvs_mac_ip)
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread