test suite reviews and discussions
 help / color / mirror / Atom feed
* Re: [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy
  2021-05-06 15:10 [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy Bo Chen
@ 2021-05-06  7:14 ` Chen, BoX C
  2021-05-26  6:13 ` Tu, Lijuan
  2021-05-26 11:17 ` David Marchand
  2 siblings, 0 replies; 5+ messages in thread
From: Chen, BoX C @ 2021-05-06  7:14 UTC (permalink / raw)
  To: dts

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

Tested-by: Bo Chen <box.c.chen@intel.com>

> -----Original Message-----
> From: Chen, BoX C <box.c.chen@intel.com>
> Sent: May 6, 2021 23:10
> To: dts@dpdk.org
> Cc: Chen, BoX C <box.c.chen@intel.com>
> Subject: [dts][PATCH V1] tests/generic_filter: use flow api replace legancy
> 
> use flow api replace legancy filter command
> 
> Signed-off-by: Bo Chen <BoX.C.Chen@intel.com>


[-- Attachment #2: TestGeneric_filter.log --]
[-- Type: application/octet-stream, Size: 604740 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy
@ 2021-05-06 15:10 Bo Chen
  2021-05-06  7:14 ` Chen, BoX C
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bo Chen @ 2021-05-06 15:10 UTC (permalink / raw)
  To: dts; +Cc: Bo Chen

use flow api replace legancy filter command

Signed-off-by: Bo Chen <BoX.C.Chen@intel.com>
---
 tests/TestSuite_generic_filter.py | 41 ++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/tests/TestSuite_generic_filter.py b/tests/TestSuite_generic_filter.py
index d4ea8926..f3ea9774 100644
--- a/tests/TestSuite_generic_filter.py
+++ b/tests/TestSuite_generic_filter.py
@@ -119,6 +119,12 @@ class TestGeneric_filter(TestCase):
         """
         Run before each test case.
         """
+        if self._suite_result.test_case == "test_128_queues":
+            print('will rebuild dpdk')
+            self.dut.send_expect(
+                "sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES 64$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128/' drivers/net/ixgbe/ixgbe_ethdev.h",
+                "# ", 30)
+            self.dut.build_install_dpdk(self.target)
         pass
 
     def filter_send_packet(self, type):
@@ -711,8 +717,6 @@ class TestGeneric_filter(TestCase):
         set_filter_flag = 1
         packet_flag = 1
         if self.kdriver == "ixgbe":
-            self.dut.send_expect("sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES 64$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128/' drivers/net/ixgbe/ixgbe_ethdev.h", "# ",30)
-            self.dut.build_install_dpdk(self.target)
             global valports
             total_mbufs = self.request_mbufs(128) * len(valports)
             self.pmdout.start_testpmd(
@@ -729,7 +733,6 @@ class TestGeneric_filter(TestCase):
                 "vlan set filter off %s" % valports[0], "testpmd> ")
             self.dut.send_expect(
                 "vlan set filter off %s" % valports[1], "testpmd> ")
-            frames_to_send = 1
             queue = ['64', '127', '128']
 
             for i in [0, 1, 2]:
@@ -739,35 +742,34 @@ class TestGeneric_filter(TestCase):
                     if 'Invalid RX queue %s' % (queue[i]) not in out:
                         set_filter_flag = 0
                         break
-                    out = self.dut.send_expect(
-                        "5tuple_filter %s add dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port %s src_port 1 protocol 0x06 mask 0x1f tcp_flags 0x0 priority 3 queue %s " % (valports[0], (i + 1), queue[i]), "testpmd> ")
-                    if 'error' not in out:
+                    cmd = "flow create {} ingress pattern eth / ".format(
+                        valports[0]) + "ipv4 dst is 2.2.2.5 src is 2.2.2.4 / tcp dst is {} src is 1 / ".format(
+                        i + 1) + "end actions queue index {} / end".format(queue[i])
+                    out = self.dut.send_expect(cmd, "testpmd> ")
+                    if 'Invalid argument' not in out:
                         set_filter_flag = 0
                         break
                     continue
                 else:
                     self.dut.send_expect("set stat_qmap rx %s %s %s" %
                                          (valports[0], queue[i], (i + 1)), "testpmd> ")
-                    out = self.dut.send_expect("5tuple_filter %s add dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port %s src_port 1 protocol 0x06 mask 0x1f tcp_flags 0x0 priority %d queue %s " % (
-                        valports[0], (i + 1), (3 - i), queue[i]), "testpmd> ")
+                    cmd = "flow create {} ingress pattern eth / ".format(
+                        valports[0]) + "ipv4 dst is 2.2.2.5 src is 2.2.2.4 / tcp dst is {} src is 1 / ".format(
+                        i + 1) + "end actions queue index {} / end".format(queue[i])
+                    self.dut.send_expect(cmd, "testpmd> ")
                     self.dut.send_expect("start", "testpmd> ", 120)
                 global filters_index
                 filters_index = i
                 self.filter_send_packet("packet")
                 time.sleep(1)
                 out = self.dut.send_expect("stop", "testpmd> ")
-                cmd = "Stats reg  %s RX-packets:             ([0-9]+)" % (
-                    i + 1)
-                result_scanner = r"%s" % cmd
-                scanner = re.compile(result_scanner, re.DOTALL)
-                m = scanner.search(out)
-                cur_pkt = m.group(1)
-                if int(cur_pkt) != frames_to_send:
+                p = re.compile(r"Forward Stats for RX Port= \d+/Queue=(\s?\d+)")
+                res = p.findall(out)
+                queues = [int(i) for i in res]
+                if queues[0] != int(queue[i]):
                     packet_flag = 0
                     break
             self.dut.send_expect("quit", "#", timeout=30)
-            self.dut.send_expect("sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 64/' drivers/net/ixgbe/ixgbe_ethdev.h", "# ",30)
-            self.dut.build_install_dpdk(self.target)
             self.verify(set_filter_flag == 1, "set filters error")
             self.verify(packet_flag == 1, "packet pass assert error")
         else:
@@ -853,6 +855,11 @@ class TestGeneric_filter(TestCase):
         Run after each test case.
         """
         self.dut.kill_all()
+        if self._suite_result.test_case == "test_128_queues":
+            self.dut.send_expect(
+                "sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 64/' drivers/net/ixgbe/ixgbe_ethdev.h",
+                "# ", 30)
+            self.dut.build_install_dpdk(self.target)
 
     def tear_down_all(self):
         pass
-- 
2.31.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy
  2021-05-06 15:10 [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy Bo Chen
  2021-05-06  7:14 ` Chen, BoX C
@ 2021-05-26  6:13 ` Tu, Lijuan
  2021-05-26 11:17 ` David Marchand
  2 siblings, 0 replies; 5+ messages in thread
From: Tu, Lijuan @ 2021-05-26  6:13 UTC (permalink / raw)
  To: Chen, BoX C, dts; +Cc: Chen, BoX C



> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Bo Chen
> Sent: 2021年5月6日 23:10
> To: dts@dpdk.org
> Cc: Chen, BoX C <box.c.chen@intel.com>
> Subject: [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy
> 
> use flow api replace legancy filter command
> 
> Signed-off-by: Bo Chen <BoX.C.Chen@intel.com>
> ---
>  tests/TestSuite_generic_filter.py | 41 ++++++++++++++++++-------------
>  1 file changed, 24 insertions(+), 17 deletions(-)
> 
> diff --git a/tests/TestSuite_generic_filter.py b/tests/TestSuite_generic_filter.py
> index d4ea8926..f3ea9774 100644
> --- a/tests/TestSuite_generic_filter.py
> +++ b/tests/TestSuite_generic_filter.py
> @@ -119,6 +119,12 @@ class TestGeneric_filter(TestCase):
>          """
>          Run before each test case.
>          """
> +        if self._suite_result.test_case == "test_128_queues":
> +            print('will rebuild dpdk')

Should use self.logger.info

> +            self.dut.send_expect(
> +                "sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES
> 64$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128/'
> drivers/net/ixgbe/ixgbe_ethdev.h",
> +                "# ", 30)
> +            self.dut.build_install_dpdk(self.target)
>          pass
> 
>      def filter_send_packet(self, type):
> @@ -711,8 +717,6 @@ class TestGeneric_filter(TestCase):
>          set_filter_flag = 1
>          packet_flag = 1
>          if self.kdriver == "ixgbe":
> -            self.dut.send_expect("sed -i -e 's/#define
> IXGBE_NONE_MODE_TX_NB_QUEUES 64$/#define
> IXGBE_NONE_MODE_TX_NB_QUEUES 128/' drivers/net/ixgbe/ixgbe_ethdev.h",
> "# ",30)
> -            self.dut.build_install_dpdk(self.target)
>              global valports
>              total_mbufs = self.request_mbufs(128) * len(valports)
>              self.pmdout.start_testpmd(
> @@ -729,7 +733,6 @@ class TestGeneric_filter(TestCase):
>                  "vlan set filter off %s" % valports[0], "testpmd> ")
>              self.dut.send_expect(
>                  "vlan set filter off %s" % valports[1], "testpmd> ")
> -            frames_to_send = 1
>              queue = ['64', '127', '128']
> 
>              for i in [0, 1, 2]:
> @@ -739,35 +742,34 @@ class TestGeneric_filter(TestCase):
>                      if 'Invalid RX queue %s' % (queue[i]) not in out:
>                          set_filter_flag = 0
>                          break
> -                    out = self.dut.send_expect(
> -                        "5tuple_filter %s add dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port %s
> src_port 1 protocol 0x06 mask 0x1f tcp_flags 0x0 priority 3 queue %s " %
> (valports[0], (i + 1), queue[i]), "testpmd> ")
> -                    if 'error' not in out:
> +                    cmd = "flow create {} ingress pattern eth / ".format(
> +                        valports[0]) + "ipv4 dst is 2.2.2.5 src is 2.2.2.4 / tcp dst is {} src is 1
> / ".format(
> +                        i + 1) + "end actions queue index {} / end".format(queue[i])
> +                    out = self.dut.send_expect(cmd, "testpmd> ")
> +                    if 'Invalid argument' not in out:
>                          set_filter_flag = 0
>                          break
>                      continue
>                  else:
>                      self.dut.send_expect("set stat_qmap rx %s %s %s" %
>                                           (valports[0], queue[i], (i + 1)), "testpmd> ")
> -                    out = self.dut.send_expect("5tuple_filter %s add dst_ip 2.2.2.5 src_ip
> 2.2.2.4 dst_port %s src_port 1 protocol 0x06 mask 0x1f tcp_flags 0x0 priority %d
> queue %s " % (
> -                        valports[0], (i + 1), (3 - i), queue[i]), "testpmd> ")
> +                    cmd = "flow create {} ingress pattern eth / ".format(
> +                        valports[0]) + "ipv4 dst is 2.2.2.5 src is 2.2.2.4 / tcp dst is {} src is 1
> / ".format(
> +                        i + 1) + "end actions queue index {} / end".format(queue[i])
> +                    self.dut.send_expect(cmd, "testpmd> ")
>                      self.dut.send_expect("start", "testpmd> ", 120)
>                  global filters_index
>                  filters_index = i
>                  self.filter_send_packet("packet")
>                  time.sleep(1)
>                  out = self.dut.send_expect("stop", "testpmd> ")
> -                cmd = "Stats reg  %s RX-packets:             ([0-9]+)" % (
> -                    i + 1)
> -                result_scanner = r"%s" % cmd
> -                scanner = re.compile(result_scanner, re.DOTALL)
> -                m = scanner.search(out)
> -                cur_pkt = m.group(1)
> -                if int(cur_pkt) != frames_to_send:
> +                p = re.compile(r"Forward Stats for RX Port= \d+/Queue=(\s?\d+)")
> +                res = p.findall(out)
> +                queues = [int(i) for i in res]
> +                if queues[0] != int(queue[i]):
>                      packet_flag = 0
>                      break
>              self.dut.send_expect("quit", "#", timeout=30)
> -            self.dut.send_expect("sed -i -e 's/#define
> IXGBE_NONE_MODE_TX_NB_QUEUES 128$/#define
> IXGBE_NONE_MODE_TX_NB_QUEUES 64/' drivers/net/ixgbe/ixgbe_ethdev.h",
> "# ",30)
> -            self.dut.build_install_dpdk(self.target)
>              self.verify(set_filter_flag == 1, "set filters error")
>              self.verify(packet_flag == 1, "packet pass assert error")
>          else:
> @@ -853,6 +855,11 @@ class TestGeneric_filter(TestCase):
>          Run after each test case.
>          """
>          self.dut.kill_all()
> +        if self._suite_result.test_case == "test_128_queues":
> +            self.dut.send_expect(
> +                "sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES
> 128$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 64/'
> drivers/net/ixgbe/ixgbe_ethdev.h",
> +                "# ", 30)
> +            self.dut.build_install_dpdk(self.target)
> 
>      def tear_down_all(self):
>          pass
> --
> 2.31.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy
  2021-05-06 15:10 [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy Bo Chen
  2021-05-06  7:14 ` Chen, BoX C
  2021-05-26  6:13 ` Tu, Lijuan
@ 2021-05-26 11:17 ` David Marchand
  2021-05-27  2:14   ` Honnappa Nagarahalli
  2 siblings, 1 reply; 5+ messages in thread
From: David Marchand @ 2021-05-26 11:17 UTC (permalink / raw)
  To: Bo Chen
  Cc: dts, techboard, dev, Qi Zhang, Juraj Linkeš,
	Honnappa Nagarahalli, Aaron Conole

On Thu, May 6, 2021 at 9:08 AM Bo Chen <BoX.C.Chen@intel.com> wrote:
>
> use flow api replace legancy filter command
>
> Signed-off-by: Bo Chen <BoX.C.Chen@intel.com>
> ---
>  tests/TestSuite_generic_filter.py | 41 ++++++++++++++++++-------------
>  1 file changed, 24 insertions(+), 17 deletions(-)
>
> diff --git a/tests/TestSuite_generic_filter.py b/tests/TestSuite_generic_filter.py
> index d4ea8926..f3ea9774 100644
> --- a/tests/TestSuite_generic_filter.py
> +++ b/tests/TestSuite_generic_filter.py
> @@ -119,6 +119,12 @@ class TestGeneric_filter(TestCase):
>          """
>          Run before each test case.
>          """
> +        if self._suite_result.test_case == "test_128_queues":
> +            print('will rebuild dpdk')
> +            self.dut.send_expect(
> +                "sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES 64$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128/' drivers/net/ixgbe/ixgbe_ethdev.h",

Patching dpdk to pass a test means there is something wrong either in
dpdk or in the test.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy
  2021-05-26 11:17 ` David Marchand
@ 2021-05-27  2:14   ` Honnappa Nagarahalli
  0 siblings, 0 replies; 5+ messages in thread
From: Honnappa Nagarahalli @ 2021-05-27  2:14 UTC (permalink / raw)
  To: David Marchand, Bo Chen
  Cc: dts, techboard, dev, Qi Zhang, Juraj Linkeš,
	Aaron Conole, Tu, Lijuan, Honnappa Nagarahalli, nd, Richardson,
	Bruce, nd

<snip>

> 
> On Thu, May 6, 2021 at 9:08 AM Bo Chen <BoX.C.Chen@intel.com> wrote:
> >
> > use flow api replace legancy filter command
> >
> > Signed-off-by: Bo Chen <BoX.C.Chen@intel.com>
> > ---
> >  tests/TestSuite_generic_filter.py | 41
> > ++++++++++++++++++-------------
> >  1 file changed, 24 insertions(+), 17 deletions(-)
> >
> > diff --git a/tests/TestSuite_generic_filter.py
> > b/tests/TestSuite_generic_filter.py
> > index d4ea8926..f3ea9774 100644
> > --- a/tests/TestSuite_generic_filter.py
> > +++ b/tests/TestSuite_generic_filter.py
> > @@ -119,6 +119,12 @@ class TestGeneric_filter(TestCase):
> >          """
> >          Run before each test case.
> >          """
> > +        if self._suite_result.test_case == "test_128_queues":
> > +            print('will rebuild dpdk')
> > +            self.dut.send_expect(
> > +                "sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES
> > + 64$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128/'
> > + drivers/net/ixgbe/ixgbe_ethdev.h",
> 
> Patching dpdk to pass a test means there is something wrong either in dpdk or
> in the test.
Thanks David for adding me.
We are starting to discuss these issues in the DTS working group.

This looks like a build configuration issue. i.e. meson build system should allow to configure driver specific constants. This is one of the topics that has come up in the meson build system improvements.

> 
> 
> --
> David Marchand


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-16  6:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06 15:10 [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy Bo Chen
2021-05-06  7:14 ` Chen, BoX C
2021-05-26  6:13 ` Tu, Lijuan
2021-05-26 11:17 ` David Marchand
2021-05-27  2:14   ` Honnappa Nagarahalli

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).