From: "Xiao, QimaiX" <qimaix.xiao@intel.com>
To: "Tu, Lijuan" <lijuan.tu@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Subject: Re: [dts] [PATCH V1] optimize tests/TestSuite_rss_to_rte_flow to run more effectively
Date: Fri, 12 Apr 2019 07:15:15 +0000 [thread overview]
Message-ID: <5C5FA1EBCC0D164EAD0302E258A5234B6EE2FF@SHSMSX103.ccr.corp.intel.com> (raw)
Thanks for your review.
Never mind, I just found run this case will take almost about 2 hours, it's not reasonable and I only have one test ENV.
During this case runtime, I have no more ENV to run other case and the wait is too long.
that's why I submit this patch.
So I removed some unnecessary sleep time and optimized two or three functions in it to make it run far more faster, and I reformat the code to comply with PEP8 of python.
After rechecked the code this morning, thanks for your reminding, at your last comment, I realized I'd modified the old version of this case, my mistake.
This case has been modified by Peng, Yuan at 3/19/2019 1:25 PM, and I forgot to update it. So just ignore this path.
If it's necessary to reduce the run time of this case, I'll submit a new patch to fix it , or I just keep it and not submit.
Thanks again.
BR,
Xiao,qimai
-----Original Message-----
From: Tu, Lijuan
Sent: Friday, April 12, 2019 1:54 AM
To: Xiao, QimaiX <qimaix.xiao@intel.com>; dts@dpdk.org
Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
Subject: RE: [dts] [PATCH V1] optimize tests/TestSuite_rss_to_rte_flow to run more effectively
A bunch of useless changes. More comments inline.
Could you please give me a reason why I should merge this patch next time when you file patches?
Thanks
Lijuan
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xiao,qimai
> Sent: Wednesday, April 10, 2019 2:53 AM
> To: dts@dpdk.org
> Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
> Subject: [dts] [PATCH V1] optimize tests/TestSuite_rss_to_rte_flow to
> run more effectively
>
> Signed-off-by: xiao,qimai <qimaix.xiao@intel.com>
> ---
> tests/TestSuite_rss_to_rte_flow.py | 103
> ++++++++++++-----------------
> 1 file changed, 42 insertions(+), 61 deletions(-)
>
> diff --git a/tests/TestSuite_rss_to_rte_flow.py
> b/tests/TestSuite_rss_to_rte_flow.py
> index 12c13e7..244e2c4 100644
> --- a/tests/TestSuite_rss_to_rte_flow.py
> +++ b/tests/TestSuite_rss_to_rte_flow.py
> @@ -36,18 +36,11 @@ Test moving RSS to rte_flow.
>
> """
>
> -import utils
> -import time
> import re
> +import time
[Lijuan] what does it mean that move "import time" to another line.
>
> -from test_case import TestCase
> -from settings import HEADER_SIZE
> from pmd_output import PmdOutput
> -from settings import DRIVERS
> -
> -from project_dpdk import DPDKdut
> -from dut import Dut
> -from packet import Packet
> +from test_case import TestCase
>
>
> class TestRSS_to_Rteflow(TestCase):
> @@ -99,14 +92,13 @@ class TestRSS_to_Rteflow(TestCase):
> """
> get the queue which packet enter.
> """
> - outstring = self.dut.send_expect("stop", "testpmd> ")
> - time.sleep(2)
> - result_scanner = r"Forward Stats for RX Port= %s/Queue=\s?([0-9]+)" %
> self.dut_ports[0]
> + outstring = self.pmdout.get_output()
> + result_scanner = r'port\s?%s/queue\s?(\d+):\s?received \d+
> + packets' % self.dut_ports[0]
> scanner = re.compile(result_scanner, re.DOTALL)
> m = scanner.search(outstring)
> queue_id = m.group(1)
> - print "queue is %s" % queue_id
> - self.dut.send_expect("start", "testpmd> ")
> + print("queue is %s" % queue_id)
[Lijuan] the original statement is python style, do not try to change it to a C style.
> + self.pmdout.execute_cmd("clear port stats all")
> return queue_id
>
> def send_and_check(self, pkt, rss_queue):
> @@ -115,7 +107,6 @@ class TestRSS_to_Rteflow(TestCase):
> """
> self.tester.scapy_append('sendp(%s, iface="%s")' % (pkt, self.tester_itf))
> self.tester.scapy_execute()
> - time.sleep(2)
[Lijuan] you'd better to keep it, I do not like to get another patch that says time is not enough.
> queue = self.get_queue_number()
> self.verify(queue in rss_queue, "the packet doesn't enter the
> expected RSS queue.")
> return queue
> @@ -134,8 +125,8 @@ class TestRSS_to_Rteflow(TestCase):
> packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d")],
> iface="%s")' % (
> self.pf_mac, itf, i + 1, i + 2, itf)
> self.tester.scapy_append(packet)
> - self.tester.scapy_execute()
> - time.sleep(2)
> + self.tester.scapy_execute()
> + time.sleep(2)
>
> def check_packet_queue(self, queue, out):
> """
> @@ -212,10 +203,12 @@ class TestRSS_to_Rteflow(TestCase):
> if (self.nic in ["fortville_eagle", "fortville_spirit",
> "fortville_spirit_single", "fortpark_TLV", "fortville_25g"]):
> self.dut.send_expect(
> - "show port 0 rss-hash", "all ipv4-frag ipv4-tcp ipv4-udp ipv4-sctp
> ipv4-other ipv6-frag ipv6-tcp ipv6-udp ipv6-sctp ipv6-other l2-payload
> ip udp tcp sctp")
> + "show port 0 rss-hash",
> + "all ipv4-frag ipv4-tcp ipv4-udp ipv4-sctp ipv4-other
> + ipv6-frag ipv6-tcp ipv6-udp ipv6-sctp ipv6-other l2-payload ip udp
> + tcp
> + sctp")
[Lijuan] what's the difference?
> else:
> self.dut.send_expect(
> - "show port 0 rss-hash", "all ipv4 ipv4-tcp ipv4-udp ipv6 ipv6-tcp
> ipv6-udp ipv6-ex ipv6-tcp-ex ipv6-udp-ex ip udp tcp")
> + "show port 0 rss-hash",
> + "all ipv4 ipv4-tcp ipv4-udp ipv6 ipv6-tcp ipv6-udp
> + ipv6-ex ipv6-tcp-ex ipv6-udp-ex ip udp tcp")
[Lijuan] what's the difference?
> # send the packets and verify the results
> self.send_packet("ipv4-other", self.tester_itf)
> out = self.dut.send_expect("stop", "testpmd> ", 120) @@
> -360,7 +353,8 @@ class TestRSS_to_Rteflow(TestCase):
>
> # Create a rss queue rule
> self.dut.send_expect(
> - "flow create 0 ingress pattern end actions rss types udp ipv4-tcp
> ipv6-sctp ipv4-other end queues 1 4 7 end / end", "created")
> + "flow create 0 ingress pattern end actions rss types udp
> + ipv4-tcp
> ipv6-sctp ipv4-other end queues 1 4 7 end / end",
> + "created")
[Lijuan] what's the difference?
> # send the packets and verify the results
> if (self.nic in ["fortville_eagle", "fortville_spirit",
> "fortville_spirit_single", "fortpark_TLV", "fortville_25g"]):
> @@ -396,7 +390,8 @@ class TestRSS_to_Rteflow(TestCase):
> """
> # Only supported by i40e
> self.verify(self.nic in ["fortville_eagle", "fortville_spirit",
> - "fortville_spirit_single", "fortpark_TLV", "fortville_25g"],
> "NIC Unsupported: " + str(self.nic))
> + "fortville_spirit_single", "fortpark_TLV", "fortville_25g"],
> + "NIC Unsupported: " + str(self.nic))
[Lijuan] what's the difference?
> pkt1 =
> "Ether(dst='%s')/IP(src='0.0.0.0',dst='4.0.0.0')/UDP(sport=100,
> dport=200)/('X'*48)" % self.pf_mac
> pkt2 =
> "Ether(dst='%s')/IP(src='0.0.0.0',dst='4.0.0.0')/UDP(sport=100,
> dport=201)/('X'*48)" % self.pf_mac
> pkt3 =
> "Ether(dst='%s')/IP(src='0.0.0.0',dst='4.0.0.0')/UDP(sport=101,
> dport=201)/('X'*48)" % self.pf_mac @@ -422,10 +417,10 @@ class
> TestRSS_to_Rteflow(TestCase):
> list1 = [queue1, queue2, queue3, queue4, queue5]
>
> # Create a rss key rule
> - self.dut.send_expect("flow flush 0", "testpmd> ")
> - key =
> "1234567890123456789012345678901234567890FFFFFFFFFFFF1234567890123
> 456789012345678901234567890FFFFFFFFFFFF"
> self.dut.send_expect(
> - "flow create 0 ingress pattern end actions rss types ipv4-udp end
> key %s / end" % key, "created")
> + "flow flush 0", "testpmd> ")
> + self.dut.send_expect(
> + "flow create 0 ingress pattern end actions rss types
> + ipv4-udp end key 67108863 / end", "created")
[Lijuan] Could you explain why change key, more short?
> out2 = self.dut.send_expect("show port 0 rss-hash key",
> "testpmd> ",
> 120)
> key_queue1 = self.send_and_check(pkt1, rss_queue)
> key_queue2 = self.send_and_check(pkt2, rss_queue) @@ -434,39
> +429,18 @@ class TestRSS_to_Rteflow(TestCase):
> key_queue5 = self.send_and_check(pkt5, rss_queue)
> list2 = [key_queue1, key_queue2, key_queue3, key_queue4,
> key_queue5]
>
> - self.verify((key in out2) and (out1 != out2) and (list1 != list2), "the key
> setting doesn't take effect.")
> + self.verify((out1 != out2) and (list1 != list2), "the key
> + setting doesn't take effect.")
[Lijuan] what's the difference?
>
> - # Create a rss rult with truncating key_len
> - self.dut.send_expect("flow flush 0", "testpmd> ")
> - key =
> "1234567890123456789012345678901234567890FFFFFFFFFFFF1234567890123
> 456789012345678901234567890FFFFFFFFFFFF"
> - key_len = "50"
> + # Create a rss key_len rule
> self.dut.send_expect(
> - "flow create 0 ingress pattern end actions rss types ipv4-udp end
> key %s key_len %s / end" % (key, key_len), "created")
> - out3 = self.dut.send_expect("show port 0 rss-hash key", "testpmd> ",
> 120)
> - key_queue1 = self.send_and_check(pkt1, rss_queue)
> - key_queue2 = self.send_and_check(pkt2, rss_queue)
> - key_queue3 = self.send_and_check(pkt3, rss_queue)
> - key_queue4 = self.send_and_check(pkt4, rss_queue)
> - key_queue5 = self.send_and_check(pkt5, rss_queue)
[Lijuan] why remove these tests?
> - list3 = [key_queue1, key_queue2, key_queue3, key_queue4,
> key_queue5]
> -
> - self.verify((key not in out3) and (out3 != out1 != out2) and (list3 !=
> list1 != list2), "the key setting doesn't take effect.")
> -
> - # Create a rss rule with padding key_len
> - self.dut.send_expect("flow flush 0", "testpmd> ")
> - key =
> "1234567890123456789012345678901234567890FFFFFFFFFFFF1234567890123
> 456789012345678901234567890FFFFFF"
> - key_len = "52"
> + "flow flush 0", "testpmd> ")
> self.dut.send_expect(
> - "flow create 0 ingress pattern end actions rss types ipv4-udp end
> key %s key_len %s / end" % (key, key_len), "created")
> - out4 = self.dut.send_expect("show port 0 rss-hash key", "testpmd> ",
> 120)
> - key_queue1 = self.send_and_check(pkt1, rss_queue)
> - key_queue2 = self.send_and_check(pkt2, rss_queue)
> - key_queue3 = self.send_and_check(pkt3, rss_queue)
> - key_queue4 = self.send_and_check(pkt4, rss_queue)
> - key_queue5 = self.send_and_check(pkt5, rss_queue)
> - list4 = [key_queue1, key_queue2, key_queue3, key_queue4,
> key_queue5]
> -
> - self.verify((key in out4) and (out4 != out1 != out2 != out3) and (list4 !=
> list1 != list2), "the key setting doesn't take effect.")
> + "flow create 0 ingress pattern end actions rss types
> + ipv4-udp end
> key_len 3 / end", "created")
> + # Create a rss key rule
> + self.dut.send_expect(
> + "flow flush 0", "testpmd> ")
> + self.dut.send_expect(
> + "flow create 0 ingress pattern end actions rss types
> + ipv4-udp end key 67108863 key_len 3 / end", "created")
>
> def test_disable_rss_in_commandline(self):
> """
> @@ -493,7 +467,8 @@ class TestRSS_to_Rteflow(TestCase):
> time.sleep(2)
> # Create a rss queue rule
> self.dut.send_expect(
> - "flow create 0 ingress pattern end actions rss types ipv6-tcp ipv4-udp
> sctp ipv6-other end queues 5 6 7 end / end", "created")
> + "flow create 0 ingress pattern end actions rss types
> + ipv6-tcp ipv4-
> udp sctp ipv6-other end queues 5 6 7 end / end",
> + "created")
> # send the packets and verify the results
> if (self.nic in ["fortville_eagle", "fortville_spirit",
> "fortville_spirit_single", "fortpark_TLV", "fortville_25g"]):
> @@ -551,14 +526,16 @@ class TestRSS_to_Rteflow(TestCase):
> if (self.nic in ["bartonhills", "powerville"]):
> # Create a flow director rule
> self.dut.send_expect(
> - "flow create 0 ingress pattern eth / ipv4 proto is 6 / udp dst is 50 /
> end actions queue index 1 / end", "created")
> + "flow create 0 ingress pattern eth / ipv4 proto is 6
> + / udp dst is 50 /
> end actions queue index 1 / end",
> + "created")
> rss_queue = ["1"]
> pkt =
> "Ether(dst='%s')/IP(src='10.0.0.1',dst='192.168.0.2',proto=6)/UDP(dpor
> t=50,
> sport=50)/('X'*48)" % self.pf_mac
> self.send_and_check(pkt, rss_queue)
> else:
> # Create a flow director rule
> self.dut.send_expect(
> - "flow create 0 ingress pattern eth / ipv4 src is 10.0.0.1 dst is
> 192.168.0.2 / udp src is 50 dst is 50 / end actions queue index 1 /
> end",
> "created")
> + "flow create 0 ingress pattern eth / ipv4 src is
> + 10.0.0.1 dst is
> 192.168.0.2 / udp src is 50 dst is 50 / end actions queue index 1 /
> end",
> + "created")
> # send the packets and verify the results
> rss_queue = ["1"]
> self.send_and_check(self.pkt2, rss_queue) @@ -572,7
> +549,8 @@ class TestRSS_to_Rteflow(TestCase):
> Set RSS queue rule with queue region API.
> """
> self.verify(self.nic in ["fortville_eagle", "fortville_spirit",
> - "fortville_spirit_single", "fortpark_TLV", "fortville_25g"],
> "NIC Unsupported: " + str(self.nic))
> + "fortville_spirit_single", "fortpark_TLV", "fortville_25g"],
> + "NIC Unsupported: " + str(self.nic))
> self.pmdout.start_testpmd("%s" % self.cores, "--rxq=16
> --txq=16 --port-
> topology=chained")
> self.dut.send_expect("set fwd rxonly", "testpmd> ", 120)
> self.dut.send_expect("set verbose 1", "testpmd> ", 120) @@
> -581,7
> +559,8 @@ class TestRSS_to_Rteflow(TestCase):
>
> # Create a rss queue rule.
> self.dut.send_expect(
> - "flow create 0 ingress pattern end actions rss types tcp end queues 7
> 8 10 11 12 14 15 end / end", "created")
> + "flow create 0 ingress pattern end actions rss types tcp
> + end queues 7
> 8 10 11 12 14 15 end / end",
> + "created")
> # send the packets and verify the results
> rss_queue = ["7", "8", "10", "11", "12", "14", "15"]
> queue1 = self.send_and_check(self.prio_pkt1, rss_queue) @@
> -616,7
> +595,8 @@ class TestRSS_to_Rteflow(TestCase):
> Set RSS queue rule with invalid parameter in queue region API.
> """
> self.verify(self.nic in ["fortville_eagle", "fortville_spirit",
> - "fortville_spirit_single", "fortpark_TLV", "fortville_25g"],
> "NIC Unsupported: " + str(self.nic))
> + "fortville_spirit_single", "fortpark_TLV", "fortville_25g"],
> + "NIC Unsupported: " + str(self.nic))
> self.pmdout.start_testpmd("%s" % self.cores, "--rxq=16
> --txq=16 --port-
> topology=chained")
> self.dut.send_expect("set fwd rxonly", "testpmd> ", 120)
> self.dut.send_expect("set verbose 1", "testpmd> ", 120) @@
> -642,7
> +622,8 @@ class TestRSS_to_Rteflow(TestCase):
> The queue region is priority to RSS queue rule.
> """
> self.verify(self.nic in ["fortville_eagle", "fortville_spirit",
> - "fortville_spirit_single", "fortpark_TLV", "fortville_25g"],
> "NIC Unsupported: " + str(self.nic))
> + "fortville_spirit_single", "fortpark_TLV", "fortville_25g"],
> + "NIC Unsupported: " + str(self.nic))
> self.pmdout.start_testpmd("%s" % self.cores, "--rxq=16
> --txq=16 --port-
> topology=chained")
> self.dut.send_expect("port config all rss all", "testpmd> ", 120)
> self.dut.send_expect("set fwd rxonly", "testpmd> ", 120)
> --
> 2.19.1
next reply other threads:[~2019-04-12 7:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-12 7:15 Xiao, QimaiX [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-04-10 9:53 xiao,qimai
2019-04-11 17:53 ` Tu, Lijuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5C5FA1EBCC0D164EAD0302E258A5234B6EE2FF@SHSMSX103.ccr.corp.intel.com \
--to=qimaix.xiao@intel.com \
--cc=dts@dpdk.org \
--cc=lijuan.tu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).