From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B691FA2E1B for ; Wed, 4 Sep 2019 07:09:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AE1E11EC1D; Wed, 4 Sep 2019 07:09:43 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 4946B1E9CF for ; Wed, 4 Sep 2019 07:09:42 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 22:09:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,465,1559545200"; d="scan'208";a="182367195" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga008.fm.intel.com with ESMTP; 03 Sep 2019 22:09:41 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 3 Sep 2019 22:09:40 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by shsmsx102.ccr.corp.intel.com ([169.254.2.113]) with mapi id 14.03.0439.000; Wed, 4 Sep 2019 13:09:38 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pkt Thread-Index: AQHVXKcpj8BP3sPFb0iAGmc6t8l3KqcbBI9w Date: Wed, 4 Sep 2019 05:09:37 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB1BEF4@SHSMSX101.ccr.corp.intel.com> References: <1566863431-9701-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1566863431-9701-1-git-send-email-lihongx.ma@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTA4MWZkYmUtNjIwMi00MWQyLTkyODktMDQ5MTZhYjA2MzIxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSGNJNndaNDJ5cVh4RERWeFBkQmJRM25CMTg0WHBqVkpwWVNwdU9yMnIxT0ZGeDZ2NGdibGFIZ3dBaDE4amxUcyJ9 x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pkt X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: Tuesday, August 27, 2019 7:51 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/vhost_pmd_xstats: fix issue about send pk= t >=20 > 1. remove useless import > 2. add mtu set when the pkt size greater then 1518 >=20 > Signed-off-by: lihong > --- > tests/TestSuite_vhost_pmd_xstats.py | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/tests/TestSuite_vhost_pmd_xstats.py > b/tests/TestSuite_vhost_pmd_xstats.py > index 75b87a6..82dcc4b 100755 > --- a/tests/TestSuite_vhost_pmd_xstats.py > +++ b/tests/TestSuite_vhost_pmd_xstats.py > @@ -34,20 +34,17 @@ DPDK Test suite. >=20 > vhost pmd xstats test suite. > """ > -import os > -import string > import re > import time > import utils > import datetime > import copy > from test_case import TestCase > -from exception import VerifyFailure > from settings import HEADER_SIZE > -from etgen import IxiaPacketGenerator > from qemu_kvm import QEMUKvm > from packet import Packet > - > +ETHER_JUMBO_FRAME_MTU =3D 9000 > +DEFAULT_JUMBO_FRAME_MTU =3D 1500 >=20 > class TestVhostPmdXstats(TestCase): >=20 > @@ -61,6 +58,8 @@ class TestVhostPmdXstats(TestCase): > self.dut.unbind_interfaces_linux(self.unbind_ports) > cores =3D self.dut.get_core_list("1S/4C/1T") > self.coremask =3D utils.create_mask(cores) > + txport =3D self.tester.get_local_port(self.dut_ports[0]) > + self.txItf =3D self.tester.get_interface(txport) >=20 > self.scapy_num =3D 0 > self.dmac =3D self.dut.get_mac_address(self.dut_ports[0]) > @@ -124,8 +123,6 @@ class TestVhostPmdXstats(TestCase): > Send a packet to port > """ > self.scapy_num +=3D 1 > - txport =3D self.tester.get_local_port(self.dut_ports[0]) > - self.txItf =3D self.tester.get_interface(txport) > pkt =3D Packet(pkt_type=3D'TCP', pkt_len=3Dpktsize) > pkt.config_layer('ether', {'dst': dmac, }) > pkt.send_pkt(tx_port=3Dself.txItf, count=3Dnum) @@ -166,10 +163,= 13 @@ > class TestVhostPmdXstats(TestCase): > for cat in categories: > scope =3D re.search(r'(?<=3Drx_)\w+(?=3D_packets)', cat).gro= up(0) > pktsize =3D int(re.search(r'(?<=3Drx_size_)\d+', cat).group(= 0)) > + if pktsize > 1518: > + self.tester.send_expect('ifconfig %s mtu %d' % > + (self.txItf, ETHER_JUMBO_FRAME_MTU), '# ') >=20 > self.scapy_send_packet(pktsize, self.dmac, 10000) > self.send_verify(scope, 10000) > self.clear_port_xstats(scope) > + self.tester.send_expect('ifconfig %s mtu %d' % (self.txItf, > + DEFAULT_JUMBO_FRAME_MTU), '# ') >=20 > def clear_port_xstats(self, scope): >=20 > -- > 2.7.4