* [dts] [PATCH V2] fix RX TX different
@ 2018-02-05 9:59 xu,gang
2018-02-08 6:13 ` Liu, Yong
0 siblings, 1 reply; 2+ messages in thread
From: xu,gang @ 2018-02-05 9:59 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..eb13c31 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, vlan_strip=False, ports=None, pktSize=68, received=True,vlan=False, promisc=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, vlan_strip, promisc)
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, vlan_strip = False, promisc=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(vlan_strip, pktSize=vlan_jumbo_size - 1, vlan=True)
+ self.check_forwarding(vlan_strip, pktSize=vlan_jumbo_size, vlan=True)
+ self.check_forwarding(vlan_strip, pktSize=vlan_jumbo_size + 1, received=False, vlan=True)
self.dut.send_expect("stop", "testpmd> ")
--
1.9.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH V2] fix RX TX different
2018-02-05 9:59 [dts] [PATCH V2] fix RX TX different xu,gang
@ 2018-02-08 6:13 ` Liu, Yong
0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2018-02-08 6:13 UTC (permalink / raw)
To: Xu, GangX, dts; +Cc: Xu, GangX
Gang,
Please keep same sequence for the arguments, it will be a little confused if sequence not matched.
You can put vlan_strip to the end as it is new argument. Please also do not forget to add space after comma.
check_forwarding(self, vlan_strip=False, ports=None, pktSize=68,received=True,vlan=False, promisc=False):
self.send_packet(ports[0], ports[0], pktSize, received, vlan, promisc, vlan_strip)
Thanks,
Marvin
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,gang
> Sent: Monday, February 05, 2018 5:59 PM
> To: dts@dpdk.org
> Cc: Xu, GangX <gangx.xu@intel.com>
> Subject: [dts] [PATCH V2] fix RX TX different
>
> 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..eb13c31 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, vlan_strip=False, ports=None, pktSize=68,
> received=True,vlan=False, promisc=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,
> vlan_strip, promisc)
> 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, vlan_strip = False, promisc=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(vlan_strip, pktSize=vlan_jumbo_size - 1,
> vlan=True)
> + self.check_forwarding(vlan_strip, pktSize=vlan_jumbo_size,
> vlan=True)
> + self.check_forwarding(vlan_strip, pktSize=vlan_jumbo_size + 1,
> received=False, vlan=True)
>
> self.dut.send_expect("stop", "testpmd> ")
>
> --
> 1.9.3
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-08 6:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-05 9:59 [dts] [PATCH V2] fix RX TX different xu,gang
2018-02-08 6:13 ` 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).