test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Liu, Yong" <yong.liu@intel.com>
To: "Peng, Yuan" <yuan.peng@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Peng, Yuan" <yuan.peng@intel.com>
Subject: Re: [dts] [PATCH] tests: Add verification after flush rule to	TestSuite_queue_region.py
Date: Mon, 20 Aug 2018 05:32:37 +0000	[thread overview]
Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E63129A4A@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1534416487-122625-1-git-send-email-yuan.peng@intel.com>

Yuan, 
Some comments below.

Thanks,
Marvin

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Yuan
> Sent: Thursday, August 16, 2018 6:48 PM
> To: dts@dpdk.org
> Cc: Peng, Yuan <yuan.peng@intel.com>
> Subject: [dts] [PATCH] tests: Add verification after flush rule to
> TestSuite_queue_region.py
> 
> Add some verification after flush rule,
> Change some actions for fortpark card.
> The packet not match any queue region rule will go to queue region 0.
> 
> Signed-off-by: Peng Yuan <yuan.peng@intel.com>
> 
> diff --git a/tests/TestSuite_queue_region.py
> b/tests/TestSuite_queue_region.py
> index 9615388..2e4348a 100644
> --- a/tests/TestSuite_queue_region.py
> +++ b/tests/TestSuite_queue_region.py
> @@ -196,20 +196,19 @@ class TestQueue_region(TestCase):
> 
>      def test_pctype_map_queue_region(self):
>          # set queue region on a port
> -        self.dut.send_expect("set port 0 queue-region region_id 0
> queue_start_index 1 queue_num 1", "testpmd> ")
> +        self.dut.send_expect("set port 0 queue-region region_id 0
> queue_start_index 1 queue_num 2", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 1
> queue_start_index 3 queue_num 2", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 2
> queue_start_index 6 queue_num 2", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 3
> queue_start_index 8 queue_num 2", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 4
> queue_start_index 11 queue_num 4", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 5
> queue_start_index 15 queue_num 1", "testpmd> ")
> -        self.dut.send_expect("set port 0 queue-region region_id 6
> queue_start_index 2 queue_num 1", "testpmd> ")
> +        self.dut.send_expect("set port 0 queue-region region_id 6
> queue_start_index 5 queue_num 1", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 7
> queue_start_index 10 queue_num 1", "testpmd> ")
> 
>          # Set the mapping of flowtype to region index on a port
>          self.dut.send_expect("set port 0 queue-region region_id 0 flowtype
> 31", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 1 flowtype
> 32", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 2 flowtype
> 33", "testpmd> ")
> -        self.dut.send_expect("set port 0 queue-region region_id 3 flowtype
> 34", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 4 flowtype
> 35", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 6 flowtype
> 36", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 2 flowtype
> 41", "testpmd> ")
> @@ -217,22 +216,16 @@ class TestQueue_region(TestCase):
>          self.dut.send_expect("set port 0 queue-region region_id 4 flowtype
> 44", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 5 flowtype
> 45", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 7 flowtype
> 46", "testpmd> ")
> -        self.dut.send_expect("set port 0 queue-region region_id 1 flowtype
> 63", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region flush on", "testpmd> ")
> 

I found it's hard for me to link the flowtype and real packets. 
Maybe one dictionary which tracking the queue region/flowtype/packet type will make this case more clear.

>          # send the packets and verify the results
> -        queue_region = ["1"]
> +        queue_region = ["1", "2"]

Not sure why enlarge this region, look like not match the test plan.

>          self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="udp")
> 
>          # fortville can't parse the TCP SYN type packet, fortpark can parse
> it.
> -        # but you need to update hardware defined pctype to software defined
> -        # flow type mapping table manully.
>          if(self.nic in ["fortpark_TLV"]):
> -            self.dut.send_expect("port config 0 pctype mapping update 32 1",
> "testpmd> ")
> -            self.dut.send_expect("port config all rss 1", "testpmd> ")
>              queue_region = ["3", "4"]
>              self.send_and_check(queue_region, mac=self.pf_mac,
> pkt_type="tcp", flags="S")
> -            self.dut.send_expect("port config all rss all", "testpmd> ")
>          else:
>              queue_region = ["6", "7"]
>              self.send_and_check(queue_region, mac=self.pf_mac,
> pkt_type="tcp", flags="S")
> @@ -240,17 +233,25 @@ class TestQueue_region(TestCase):
>          queue_region = ["6", "7"]
>          self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="tcp",
> flags="PA")
> 
> -        queue_region = ["8", "9"]
> +        # not assign ipv4-sctp packet to any queue region, the packet to
> queue region 0.
> +        queue_region = ["1", "2"]
>          self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="sctp",
> tag=1)
> 
>          queue_region = ["11", "12", "13", "14"]
>          self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv4")
> 
> -        queue_region = ["2"]
> +        queue_region = ["5"]
>          self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv4",
> frag=1)
> 
> -        queue_region = ["8", "9"]
> -        self.send_and_check(queue_region, mac=self.pf_mac,
> pkt_type="ipv6_tcp")
> +        # fortville can't parse the TCP SYN type packet, fortpark can parse
> it.
> +        # default is SYN mode.
> +        # not assign ipv4-tcp SYN packet to any queue region, the packet to
> queue region 0.
> +        if(self.nic in ["fortpark_TLV"]):
> +            queue_region = ["1", "2"]
> +            self.send_and_check(queue_region, mac=self.pf_mac,
> pkt_type="ipv6_tcp")
> +        else:
> +            queue_region = ["8", "9"]
> +            self.send_and_check(queue_region, mac=self.pf_mac,
> pkt_type="ipv6_tcp")
> 
>          queue_region = ["11", "12", "13", "14"]
>          self.send_and_check(queue_region, mac=self.pf_mac,
> pkt_type="ipv6_sctp", tag=2)
> @@ -261,7 +262,8 @@ class TestQueue_region(TestCase):
>          queue_region = ["15"]
>          self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv6")
> 
> -        queue_region = ["3", "4"]
> +        # not assign L2 packet to any queue region, the packet to queue
> region 0.
> +        queue_region = ["1", "2"]
>          self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="L2",
> ethertype=0x88bb)
> 
>          queue_region = ["11", "12", "13", "14"]
> @@ -270,14 +272,28 @@ class TestQueue_region(TestCase):
>          # clear all the queue region configuration
>          # check if there is 1 flow rule have been created
>          out = self.dut.send_expect("show port 0 queue-region", "testpmd> ")
> -        self.get_and_compare_rules(out, 8, 12, 0)
> +        self.get_and_compare_rules(out, 8, 10, 0)
>          self.dut.send_expect("set port 0 queue-region flush off", "testpmd>
> ")
>          out = self.dut.send_expect("show port 0 queue-region", "testpmd> ")
>          self.get_and_compare_rules(out, 0, 0, 0)
> 
> +        # confirm packet not to the same queue after flush all the queue
> region rull.
> +        self.send_packet_pctype(mac=self.pf_mac, pkt_type="udp")
> +        queue = self.get_queue_number()
> +        self.verify(queue not in ["1", "2"], "the queue regions have not
> been flushed clearly.")
> +        self.send_packet_pctype(mac=self.pf_mac, pkt_type="sctp")
> +        queue = self.get_queue_number()
> +        self.verify(queue not in ["1", "2"], "the queue regions have not
> been flushed clearly.")
> +        self.send_packet_pctype(mac=self.pf_mac, pkt_type="ipv4")
> +        queue = self.get_queue_number()
> +        self.verify(queue not in ["10", "11", "12", "13"], "the queue
> regions have not been flushed clearly.")
> +        self.send_packet_pctype(mac=self.pf_mac, pkt_type="ipv6_tcp")
> +        queue = self.get_queue_number()
> +        self.verify(queue not in ["8", "9"], "the queue regions have not
> been flushed clearly.")
> +
>      def test_up_map_queue_region(self):
>          # set queue region on a port
> -        self.dut.send_expect("set port 0 queue-region region_id 0
> queue_start_index 0 queue_num 1", "testpmd> ")
> +        self.dut.send_expect("set port 0 queue-region region_id 0
> queue_start_index 14 queue_num 2", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 6
> queue_start_index 1 queue_num 8", "testpmd> ")
>          self.dut.send_expect("set port 0 queue-region region_id 2
> queue_start_index 10 queue_num 4", "testpmd> ")
> 
> @@ -289,10 +305,10 @@ class TestQueue_region(TestCase):
>          self.dut.send_expect("set port 0 queue-region flush on", "testpmd> ")
> 
>          # send the packets and verify the results
> -        queue_region = ["0"]
> +        queue_region = ["14", "15"]
>          self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="udp",
> prio=4)
> 
> -        queue_region = ["0"]
> +        queue_region = ["14", "15"]
>          self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="udp",
> prio=3)
> 
>          queue_region = ["1", "2", "3", "4", "5", "6", "7", "8"]
> @@ -309,7 +325,7 @@ class TestQueue_region(TestCase):
> 
>          self.send_packet_pctype(mac=self.pf_mac, pkt_type="udp")
>          queue = self.get_queue_number()
> -        self.verify(queue not in ["10", "11", "12", "13"], "the packet
> doesn't enter the expected queue.")
> +        self.verify(queue in ["14", "15"], "the packet doesn't enter the
> expected queue.")
> 
>          # clear all the queue region configuration
>          out = self.dut.send_expect("show port 0 queue-region", "testpmd> ")
> @@ -318,10 +334,13 @@ class TestQueue_region(TestCase):
>          out = self.dut.send_expect("show port 0 queue-region", "testpmd> ")
>          self.get_and_compare_rules(out, 0, 0, 0)
> 
> -        # confirm packet can't into the previous queue_region
> +        # confirm packet not to the same queue after flush all the queue
> region rull.
>          self.send_packet_up(mac=self.pf_mac, pkt_type="udp", prio=7)
>          queue = self.get_queue_number()
>          self.verify(queue not in ["10", "11", "12", "13"], "the queue
> regions have not been flushed clearly.")
> +        self.send_packet_up(mac=self.pf_mac, pkt_type="tcp", prio=2)
> +        queue = self.get_queue_number()
> +        self.verify(queue not in ["10", "11", "12", "13"], "the queue
> regions have not been flushed clearly.")
> 
>      def test_boundary_values(self):
>          # boundary value testing of "Set a queue region on a port"
> --
> 2.7.4

      reply	other threads:[~2018-08-20  5:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-16 10:48 Peng Yuan
2018-08-20  5:32 ` Liu, Yong [this message]

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=86228AFD5BCD8E4EBFD2B90117B5E81E63129A4A@SHSMSX103.ccr.corp.intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    --cc=yuan.peng@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).