From: "xu,gang" <gangx.xu@intel.com>
To: dts@dpdk.org
Cc: "xu,gang" <gangx.xu@intel.com>
Subject: [dts] [PATCH V4] fix shutdown_api RX TX different
Date: Mon, 12 Feb 2018 14:49:50 +0800 [thread overview]
Message-ID: <1518418190-54182-1-git-send-email-gangx.xu@intel.com> (raw)
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
next reply other threads:[~2018-02-12 6:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-12 6:49 xu,gang [this message]
2018-02-13 12:54 ` Liu, Yong
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=1518418190-54182-1-git-send-email-gangx.xu@intel.com \
--to=gangx.xu@intel.com \
--cc=dts@dpdk.org \
/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).