<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi David,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I found you just check the command “port config mtu (mtu_size)”, and no any stream to verify whether the function works. Is this your purpose?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">If you just want to check the testpmd configuration, and not care about the functionality, the case is ok, but as a validation member, I prefer to consider the
true functionality, we should check the whether it can transmit packet as expected. For example, packet size less than mtu should be transmitted successfully, and the grater one should failed. In my point, we should cover both positive and negative cases.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">There is test suite very similar as mtu, test_plans/jumboframes_test_plan.rst, I think they are testing the same functionality, but using different testpmd command.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></a></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> dts [<a href="mailto:dts-bounces@dpdk.org">mailto:dts-bounces@dpdk.org</a>]
<b>On Behalf Of </b>David Liu<br>
<b>Sent:</b> Thursday, April 23, 2020 10:04 PM<br>
<b>To:</b> <a href="mailto:dts@dpdk.org">dts@dpdk.org</a><br>
<b>Cc:</b> David Liu <<a href="mailto:dliu@iol.unh.edu">dliu@iol.unh.edu</a>><br>
<b>Subject:</b> [dts] [PATCH] Add MTU Check<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Signed-off-by: David Liu <<a href="mailto:dliu@iol.unh.edu" target="_blank">dliu@iol.unh.edu</a>><br>
---<br>
test_plans/MTU_test_plan.rst | 35 ++++++++++++++++++++++++<br>
tests/TestSuite_MTU.py | 53 ++++++++++++++++++++++++++++++++++++<br>
2 files changed, 88 insertions(+)<br>
create mode 100644 test_plans/MTU_test_plan.rst<br>
create mode 100644 tests/TestSuite_MTU.py<br>
<br>
diff --git a/test_plans/MTU_test_plan.rst b/test_plans/MTU_test_plan.rst<br>
new file mode 100644<br>
index 0000000..c343748<br>
--- /dev/null<br>
+++ b/test_plans/MTU_test_plan.rst<br>
@@ -0,0 +1,35 @@<br>
+=============================================<br>
+MTU Check<br>
+=============================================<br>
+<br>
+This check will use testpmmd to check if MTU is set to 1500/2400/4800/9000<br>
+as required and appear in the set status.<br>
+<br>
+Prerequisites<br>
+=============<br>
+<br>
+Compile DPDK and testpmd. Be able to have the testpmd run.<br>
+<br>
+Test Case: set MTU size<br>
+==========================================<br>
+<br>
+Run testpmd in interactive mode ::<br>
+<br>
+ $ ./dpdk-testpmd -- -i<br>
+<br>
+This can be run with other arguments as well, depending on your setup.<br>
+<br>
+(port_id) - the id for the port you are working on.<br>
+The port has to be stopped before setting MTU size.<br>
+Run this command in testpmd ::<br>
+<br>
+ testpmd> port stop (port_id)<br>
+<br>
+(mtu_size) - the size for MTU you want to set.<br>
+Run this command in testpmd ::<br>
+ testpmd> port config mtu (mtu_size)<br>
+<br>
+(port_id) - the id for the port you are working on.<br>
+Verify the output from matches with the correct size::<br>
+ testpmd> show port info (port_id)<br>
+<br>
diff --git a/tests/TestSuite_MTU.py b/tests/TestSuite_MTU.py<br>
new file mode 100644<br>
index 0000000..e84e23c<br>
--- /dev/null<br>
+++ b/tests/TestSuite_MTU.py<br>
@@ -0,0 +1,53 @@<br>
+"""<br>
+DPDK Test suite.<br>
+Testing MTU with different szie in testpmd<br>
+"""<br>
+<br>
+import utils<br>
+import time<br>
+from test_case import TestCase<br>
+from pmd_output import PmdOutput<br>
+<br>
+class TestMTU(TestCase):<br>
+<br>
+ def set_up_all(self):<br>
+ """<br>
+ Run at the start of each test suite.<br>
+ """<br>
+ self.dut.build_install_dpdk(self.target)<br>
+ self.pmdout = PmdOutput(self.dut)<br>
+ self.pmdout.start_testpmd()<br>
+ self.dut_ports = self.dut.get_ports()<br>
+<br>
+ def set_up(self):<br>
+ """ <br>
+ Run before each test case. <br>
+ Nothing to do.<br>
+ """ <br>
+ pass<br>
+<br>
+ def set_MTU_size(self):<br>
+ """<br>
+ Run port config mtu $port $size to set size and check if they have the right value<br>
+ """<br>
+ MTU_sizes = [1500, 2400, 4800, 9000]<br>
+ for size in MTU_sizes:<br>
+ for port in self.dut_ports:<br>
+ self.dut.send_command('port stop {}'.format(port))<br>
+ self.dut.send_command('port config mtu {} {}'.format(port, size))<br>
+ port_info = self.dut.send_command('show port {} {}'.format('info', port))<br>
+ self.verify(str(size) in port_info, 'MTU size set {}'.format(size))<br>
+<br>
+ def tear_down(self):<br>
+ """<br>
+ Run after each test case.<br>
+ Nothing to do.<br>
+ """ <br>
+ pass<br>
+<br>
+ def tear_down_all(self):<br>
+ """<br>
+ Quit out of testpmd<br>
+ """<br>
+ self.dut.send_expect("quit", "# ", 30) <br>
+ <br>
<span style="color:#888888">--<br>
2.17.1</span> <o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>