test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/userspace_ethtool: optimze port_mtu for springville/powerville
@ 2019-07-15 18:37 Wenjie Li
  2019-08-07  2:23 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Wenjie Li @ 2019-07-15 18:37 UTC (permalink / raw)
  To: dts; +Cc: Wenjie Li

1. From DPDK-15062, max mtu of igb NIC is 2026; change mtu_threshold to
2026 for powerville and springville in script.
2. The ether headsize is 22 bytes(not 18) in igb nics; add an offset(4 bytes) for
the packets.

Signed-off-by: Wenjie Li <wenjiex.a.li@intel.com>
---
 tests/TestSuite_userspace_ethtool.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py
index c774552..afd5d00 100644
--- a/tests/TestSuite_userspace_ethtool.py
+++ b/tests/TestSuite_userspace_ethtool.py
@@ -548,6 +548,10 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
         self.dut.send_expect(self.cmd, "EthApp>", 60)
         mtus = [1519, 2048]
         mtu_threshold = 2022
+        offset = 0
+        if self.nic in ['powerville', 'springville']:
+            mtu_threshold = 2026
+            offset = 4
         for index in range(len(self.ports)):
             port = self.ports[index]
             # change mtu
@@ -558,17 +562,20 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             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:
+                    if self.nic in ['powerville', 'springville']:
+                        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>")
+                time.sleep(5)
                 ori_rx_pkts, _ = self.strip_portstats(index)
-                pkt_size = mtu + HEADER_SIZE['eth']
+                pkt_size = mtu + HEADER_SIZE['eth'] + offset
                 pkt = Packet(pkt_len=pkt_size)
                 pkt.send_pkt(tx_port=intf, count=4)
                 rx_pkts, _ = self.strip_portstats(index)
                 self.verify(rx_pkts == ori_rx_pkts + 4, "Packet match mtu not forwarded as expected")
-                pkt = Packet(pkt_len=mtu + 1 + HEADER_SIZE['eth'])
+                pkt = Packet(pkt_len=mtu + 1 + HEADER_SIZE['eth'] + offset)
                 pkt.send_pkt(tx_port=intf, count=4)
                 rx_pkts_over, _ = self.strip_portstats(index)
                 self.verify(rx_pkts == rx_pkts_over, "Packet over mtu should not be forwarded")
-- 
2.17.1


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

end of thread, other threads:[~2019-08-07  2:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 18:37 [dts] [PATCH V1] tests/userspace_ethtool: optimze port_mtu for springville/powerville Wenjie Li
2019-08-07  2:23 ` 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).