test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V2] tests/userspace_ethtool Modify judgment conditions
@ 2019-04-09  3:39 zhuwenhui
  2019-04-09  5:11 ` Yao, BingX Y
  2019-04-15 19:55 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: zhuwenhui @ 2019-04-09  3:39 UTC (permalink / raw)
  To: dts; +Cc: zhuwenhui

The second package pkt_size needs to be added HEADER_SIZE['eth'].
The mtu threshold is 2022, when mtu is over 2022,require to open/stop port


Signed-off-by: zhuwenhui <wenhuix.zhu@intel.com>
---
 tests/TestSuite_userspace_ethtool.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py
index 4208e0f..f8428ea 100644
--- a/tests/TestSuite_userspace_ethtool.py
+++ b/tests/TestSuite_userspace_ethtool.py
@@ -547,6 +547,7 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
         """
         self.dut.send_expect(self.cmd, "EthApp>", 60)
         mtus = [1519, 2048]
+        mtu_threshold = 2022
         for index in range(len(self.ports)):
             port = self.ports[index]
             # change mtu
@@ -555,14 +556,19 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             ori_mtu = self.strip_mtu(intf)
             self.tester.send_expect("ifconfig %s mtu 9000" % (intf), "# ")
             for mtu in mtus:
+                # The mtu threshold is 2022,When it is greater than 2022, the open/stop port is required.
+                if mtu > mtu_threshold:
+                    self.dut.send_expect("stop %s" % index, "EthApp>")
+                    self.dut.send_expect("mtu %d %d" % (index, mtu), "EthApp>")
+                    self.dut.send_expect("open %s" % index, "EthApp>")
                 self.dut.send_expect("mtu %d %d" % (index, mtu), "EthApp>")
                 ori_rx_pkts, _ = self.strip_portstats(index)
                 pkt_size = mtu + HEADER_SIZE['eth']
                 pkt = Packet(pkt_len=pkt_size)
                 pkt.send_pkt(tx_port=intf)
                 rx_pkts, _ = self.strip_portstats(index)
-                self.verify(rx_pkts == ori_rx_pkts, "Packet match mtu not forwarded as expected")
-                pkt = Packet(pkt_len=mtu + 1)
+                self.verify(rx_pkts == ori_rx_pkts + 1, "Packet match mtu not forwarded as expected")
+                pkt = Packet(pkt_len=mtu + 1 + HEADER_SIZE['eth'])
                 pkt.send_pkt(tx_port=intf)
                 rx_pkts_over, _ = self.strip_portstats(index)
                 self.verify(rx_pkts == rx_pkts_over, "Packet over mtu should not be forwarded")
-- 
2.17.2


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

* Re: [dts] [PATCH V2] tests/userspace_ethtool Modify judgment conditions
  2019-04-09  3:39 [dts] [PATCH V2] tests/userspace_ethtool Modify judgment conditions zhuwenhui
@ 2019-04-09  5:11 ` Yao, BingX Y
  2019-04-15 19:55 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Yao, BingX Y @ 2019-04-09  5:11 UTC (permalink / raw)
  To: Zhu, WenhuiX, dts; +Cc: Zhu, WenhuiX, Yao, BingX Y

Tested-by:Yao, BingX Y <bingx.y.yao@intel.com>

-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhuwenhui
Sent: Tuesday, April 9, 2019 11:39 AM
To: dts@dpdk.org
Cc: Zhu, WenhuiX <wenhuix.zhu@intel.com>
Subject: [dts] [PATCH V2] tests/userspace_ethtool Modify judgment conditions

The second package pkt_size needs to be added HEADER_SIZE['eth'].
The mtu threshold is 2022, when mtu is over 2022,require to open/stop port


Signed-off-by: zhuwenhui <wenhuix.zhu@intel.com>
---
 tests/TestSuite_userspace_ethtool.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py
index 4208e0f..f8428ea 100644
--- a/tests/TestSuite_userspace_ethtool.py
+++ b/tests/TestSuite_userspace_ethtool.py
@@ -547,6 +547,7 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
         """
         self.dut.send_expect(self.cmd, "EthApp>", 60)
         mtus = [1519, 2048]
+        mtu_threshold = 2022
         for index in range(len(self.ports)):
             port = self.ports[index]
             # change mtu
@@ -555,14 +556,19 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             ori_mtu = self.strip_mtu(intf)
             self.tester.send_expect("ifconfig %s mtu 9000" % (intf), "# ")
             for mtu in mtus:
+                # The mtu threshold is 2022,When it is greater than 2022, the open/stop port is required.
+                if mtu > mtu_threshold:
+                    self.dut.send_expect("stop %s" % index, "EthApp>")
+                    self.dut.send_expect("mtu %d %d" % (index, mtu), "EthApp>")
+                    self.dut.send_expect("open %s" % index, "EthApp>")
                 self.dut.send_expect("mtu %d %d" % (index, mtu), "EthApp>")
                 ori_rx_pkts, _ = self.strip_portstats(index)
                 pkt_size = mtu + HEADER_SIZE['eth']
                 pkt = Packet(pkt_len=pkt_size)
                 pkt.send_pkt(tx_port=intf)
                 rx_pkts, _ = self.strip_portstats(index)
-                self.verify(rx_pkts == ori_rx_pkts, "Packet match mtu not forwarded as expected")
-                pkt = Packet(pkt_len=mtu + 1)
+                self.verify(rx_pkts == ori_rx_pkts + 1, "Packet match mtu not forwarded as expected")
+                pkt = Packet(pkt_len=mtu + 1 + HEADER_SIZE['eth'])
                 pkt.send_pkt(tx_port=intf)
                 rx_pkts_over, _ = self.strip_portstats(index)
                 self.verify(rx_pkts == rx_pkts_over, "Packet over mtu should not be forwarded")
-- 
2.17.2


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

* Re: [dts] [PATCH V2] tests/userspace_ethtool Modify judgment conditions
  2019-04-09  3:39 [dts] [PATCH V2] tests/userspace_ethtool Modify judgment conditions zhuwenhui
  2019-04-09  5:11 ` Yao, BingX Y
@ 2019-04-15 19:55 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2019-04-15 19:55 UTC (permalink / raw)
  To: Zhu, WenhuiX, dts; +Cc: Zhu, WenhuiX

Applied, thaks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhuwenhui
> Sent: Monday, April 8, 2019 8:39 PM
> To: dts@dpdk.org
> Cc: Zhu, WenhuiX <wenhuix.zhu@intel.com>
> Subject: [dts] [PATCH V2] tests/userspace_ethtool Modify judgment
> conditions
> 
> The second package pkt_size needs to be added HEADER_SIZE['eth'].
> The mtu threshold is 2022, when mtu is over 2022,require to open/stop port
> 
> 
> Signed-off-by: zhuwenhui <wenhuix.zhu@intel.com>
> ---
>  tests/TestSuite_userspace_ethtool.py | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/TestSuite_userspace_ethtool.py
> b/tests/TestSuite_userspace_ethtool.py
> index 4208e0f..f8428ea 100644
> --- a/tests/TestSuite_userspace_ethtool.py
> +++ b/tests/TestSuite_userspace_ethtool.py
> @@ -547,6 +547,7 @@ class TestUserspaceEthtool(TestCase,
> IxiaPacketGenerator):
>          """
>          self.dut.send_expect(self.cmd, "EthApp>", 60)
>          mtus = [1519, 2048]
> +        mtu_threshold = 2022
>          for index in range(len(self.ports)):
>              port = self.ports[index]
>              # change mtu
> @@ -555,14 +556,19 @@ class TestUserspaceEthtool(TestCase,
> IxiaPacketGenerator):
>              ori_mtu = self.strip_mtu(intf)
>              self.tester.send_expect("ifconfig %s mtu 9000" % (intf), "# ")
>              for mtu in mtus:
> +                # The mtu threshold is 2022,When it is greater than 2022, the
> open/stop port is required.
> +                if mtu > mtu_threshold:
> +                    self.dut.send_expect("stop %s" % index, "EthApp>")
> +                    self.dut.send_expect("mtu %d %d" % (index, mtu), "EthApp>")
> +                    self.dut.send_expect("open %s" % index, "EthApp>")
>                  self.dut.send_expect("mtu %d %d" % (index, mtu), "EthApp>")
>                  ori_rx_pkts, _ = self.strip_portstats(index)
>                  pkt_size = mtu + HEADER_SIZE['eth']
>                  pkt = Packet(pkt_len=pkt_size)
>                  pkt.send_pkt(tx_port=intf)
>                  rx_pkts, _ = self.strip_portstats(index)
> -                self.verify(rx_pkts == ori_rx_pkts, "Packet match mtu not
> forwarded as expected")
> -                pkt = Packet(pkt_len=mtu + 1)
> +                self.verify(rx_pkts == ori_rx_pkts + 1, "Packet match mtu not
> forwarded as expected")
> +                pkt = Packet(pkt_len=mtu + 1 + HEADER_SIZE['eth'])
>                  pkt.send_pkt(tx_port=intf)
>                  rx_pkts_over, _ = self.strip_portstats(index)
>                  self.verify(rx_pkts == rx_pkts_over, "Packet over mtu should not be
> forwarded")
> --
> 2.17.2


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

end of thread, other threads:[~2019-04-15 19:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09  3:39 [dts] [PATCH V2] tests/userspace_ethtool Modify judgment conditions zhuwenhui
2019-04-09  5:11 ` Yao, BingX Y
2019-04-15 19:55 ` 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).