test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V4] fix shutdown_api RX TX different
@ 2018-02-12  6:49 xu,gang
  2018-02-13 12:54 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: xu,gang @ 2018-02-12  6:49 UTC (permalink / raw)
  To: dts; +Cc: xu,gang

add vlan_strip option, when vlan_strip is off, RX-bytes and TX-bytes equal.
rx_vlan add|rm <vlan_id> <port_id> need open vlan filter

Signed-off-by: xu,gang <gangx.xu@intel.com>
---
 tests/TestSuite_shutdown_api.py | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py
index f81c3d5..af0b77d 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -83,14 +83,14 @@ class TestShutdownApi(TestCase):
         stats = output.get_pmd_stats(portid)
         return stats
 
-    def check_forwarding(self, ports=None, pktSize=68, received=True, vlan=False, promisc=False):
+    def check_forwarding(self, ports=None, pktSize=68, received=True, vlan=False, promisc=False, vlan_strip=False):
         if ports is None:
             ports = self.ports
         if len(ports) == 1:
-            self.send_packet(ports[0], ports[0], pktSize, received, vlan, promisc)
+            self.send_packet(ports[0], ports[0], pktSize, received, vlan, promisc, vlan_strip)
             return
 
-    def send_packet(self, txPort, rxPort, pktSize=68, received=True, vlan=False, promisc=False):
+    def send_packet(self, txPort, rxPort, pktSize=68, received=True, vlan=False, promisc=False, vlan_strip=False):
         """
         Send packages according to parameters.
         """
@@ -138,7 +138,7 @@ class TestShutdownApi(TestCase):
             # RRC will always strip rx/tx crc
             rx_bytes_exp -= 4
             tx_bytes_exp -= 4
-            if vlan is True:
+            if vlan_strip is True:
                 # RRC will always strip rx/tx vlan
                 rx_bytes_exp -= 4
                 tx_bytes_exp -= 4
@@ -146,8 +146,8 @@ class TestShutdownApi(TestCase):
             # some NIC will always include tx crc
             rx_bytes_exp -= 4
             tx_bytes_exp -= 4
-            if vlan is True:
-                # vlan strip default is on
+            if vlan_strip is True:
+                # vlan strip default is off
                 tx_bytes_exp -= 4
          
         # fortville nic enable send lldp packet function when port setup
@@ -337,6 +337,7 @@ class TestShutdownApi(TestCase):
         out = self.dut.send_expect("vlan set strip off all", "testpmd> ")
         if "fail" not in out:
             for port in self.ports:
+                self.dut.send_expect("vlan set filter on %d" % port, "testpmd> ")
                 self.dut.send_expect("rx_vlan add 1 %d" % port, "testpmd> ")
             self.dut.send_expect("set fwd mac", "testpmd>")
             self.dut.send_expect("port start all", "testpmd> ", 100)
@@ -347,10 +348,15 @@ class TestShutdownApi(TestCase):
                 vlan_jumbo_size = jumbo_size + 4
             else:
                 vlan_jumbo_size = jumbo_size
-
-            self.check_forwarding(pktSize=vlan_jumbo_size - 1, vlan=True)
-            self.check_forwarding(pktSize=vlan_jumbo_size, vlan=True)
-            self.check_forwarding(pktSize=vlan_jumbo_size + 1, received=False, vlan=True)
+            out = self.dut.send_expect("show port cap %d" % port, "testpmd> ")
+            state = re.findall("VLAN stripped:\s*([a-z]*)", out)
+            if state[0] == 'on':
+                vlan_strip = True
+            else:
+                vlan_strip = False
+            self.check_forwarding(pktSize=vlan_jumbo_size - 1, vlan=True, vlan_strip=vlan_strip)
+            self.check_forwarding(pktSize=vlan_jumbo_size, vlan=True, vlan_strip=vlan_strip)
+            self.check_forwarding(pktSize=vlan_jumbo_size + 1, received=False, vlan=True, vlan_strip=vlan_strip)
 
             self.dut.send_expect("stop", "testpmd> ")
 
-- 
1.9.3

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

* Re: [dts] [PATCH V4] fix shutdown_api RX TX different
  2018-02-12  6:49 [dts] [PATCH V4] fix shutdown_api RX TX different xu,gang
@ 2018-02-13 12:54 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2018-02-13 12:54 UTC (permalink / raw)
  To: xu,gang, dts

Thanks gang, applied.

On 02/12/2018 02:49 PM, xu,gang wrote:
> add vlan_strip option, when vlan_strip is off, RX-bytes and TX-bytes equal.
> rx_vlan add|rm <vlan_id> <port_id> need open vlan filter
>
> Signed-off-by: xu,gang<gangx.xu@intel.com>

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

end of thread, other threads:[~2018-02-13  5:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-12  6:49 [dts] [PATCH V4] fix shutdown_api RX TX different xu,gang
2018-02-13 12:54 ` Liu, Yong

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