test suite reviews and discussions
 help / color / mirror / Atom feed
From: Wenjie Li <wenjiex.a.li@intel.com>
To: dts@dpdk.org
Cc: Wenjie Li <wenjiex.a.li@intel.com>
Subject: [dts] [PATCH V1] tests/userspace_ethtool: optimze port_mtu for springville/powerville
Date: Mon, 15 Jul 2019 18:37:49 +0000	[thread overview]
Message-ID: <1563215869-27837-1-git-send-email-wenjiex.a.li@intel.com> (raw)

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


             reply	other threads:[~2019-07-15  9:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 18:37 Wenjie Li [this message]
2019-08-07  2:23 ` Tu, Lijuan

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=1563215869-27837-1-git-send-email-wenjiex.a.li@intel.com \
    --to=wenjiex.a.li@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).