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 3DB52A0613 for ; Tue, 27 Aug 2019 09:14:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2593D1C0D2; Tue, 27 Aug 2019 09:14:21 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 693911C0D0 for ; Tue, 27 Aug 2019 09:14:19 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2019 00:14:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,436,1559545200"; d="scan'208";a="181619765" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.119.68]) by fmsmga007.fm.intel.com with ESMTP; 27 Aug 2019 00:14:18 -0700 From: lihong To: dts@dpdk.org Cc: lihong Date: Tue, 27 Aug 2019 07:50:31 +0800 Message-Id: <1566863431-9701-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [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" 1. remove useless import 2. add mtu set when the pkt size greater then 1518 Signed-off-by: lihong --- tests/TestSuite_vhost_pmd_xstats.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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. 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 = 9000 +DEFAULT_JUMBO_FRAME_MTU = 1500 class TestVhostPmdXstats(TestCase): @@ -61,6 +58,8 @@ class TestVhostPmdXstats(TestCase): self.dut.unbind_interfaces_linux(self.unbind_ports) cores = self.dut.get_core_list("1S/4C/1T") self.coremask = utils.create_mask(cores) + txport = self.tester.get_local_port(self.dut_ports[0]) + self.txItf = self.tester.get_interface(txport) self.scapy_num = 0 self.dmac = self.dut.get_mac_address(self.dut_ports[0]) @@ -124,8 +123,6 @@ class TestVhostPmdXstats(TestCase): Send a packet to port """ self.scapy_num += 1 - txport = self.tester.get_local_port(self.dut_ports[0]) - self.txItf = self.tester.get_interface(txport) pkt = Packet(pkt_type='TCP', pkt_len=pktsize) pkt.config_layer('ether', {'dst': dmac, }) pkt.send_pkt(tx_port=self.txItf, count=num) @@ -166,10 +163,13 @@ class TestVhostPmdXstats(TestCase): for cat in categories: scope = re.search(r'(?<=rx_)\w+(?=_packets)', cat).group(0) pktsize = int(re.search(r'(?<=rx_size_)\d+', cat).group(0)) + if pktsize > 1518: + self.tester.send_expect('ifconfig %s mtu %d' % (self.txItf, ETHER_JUMBO_FRAME_MTU), '# ') 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), '# ') def clear_port_xstats(self, scope): -- 2.7.4