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 2AFCCA00C4; Fri, 5 Jun 2020 11:27:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 222931D60A; Fri, 5 Jun 2020 11:27:05 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 08DB21D632 for ; Fri, 5 Jun 2020 11:27:03 +0200 (CEST) IronPort-SDR: qjwWvWxMlJvQUP3WoTZkVO2PksUTea5diO6nMFzmeyKksnB0KpFMsHGT4Gsh9e0fgCWNfVouXu H+mIYCO04I9A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2020 02:27:03 -0700 IronPort-SDR: jcN2z2YkJKIzoS9/t0k0w0ogxmEEVcg9XUrgob7B7rMNQ0IdkQaGgwFpritN83qfj4CmJuGKUw TZBAIypI8zGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,475,1583222400"; d="scan'208";a="287677086" Received: from unknown (HELO xqm-virtio_tester.sh.intel.com) ([10.240.183.52]) by orsmga002.jf.intel.com with ESMTP; 05 Jun 2020 02:27:02 -0700 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Fri, 5 Jun 2020 17:18:23 +0800 Message-Id: <1591348704-433901-17-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1591348704-433901-1-git-send-email-qimaix.xiao@intel.com> References: <1591348704-433901-1-git-send-email-qimaix.xiao@intel.com> Subject: [dts] [PATCH V2 16/17]virtio_user_for_container_networking: update mpps value to check perf 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" Signed-off-by: Xiao Qimai --- tests/TestSuite_virtio_user_for_container_networking.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/TestSuite_virtio_user_for_container_networking.py b/tests/TestSuite_virtio_user_for_container_networking.py index 1f9a666..76f0aea 100644 --- a/tests/TestSuite_virtio_user_for_container_networking.py +++ b/tests/TestSuite_virtio_user_for_container_networking.py @@ -71,6 +71,7 @@ class TestVirtioUserForContainer(TestCase): self.tester.send_expect('mkdir -p %s' % self.out_path, '# ') # create an instance to set stream field setting self.pktgen_helper = PacketGeneratorHelper() + self.number_of_ports = 1 def set_up(self): """ @@ -101,6 +102,15 @@ class TestVirtioUserForContainer(TestCase): self.core_list_virtio_user = core_list[self.nb_cores+1:self.nb_cores*2+2] self.core_mask_virtio_user = utils.create_mask(core_list_virtio_user) + @property + def check_value(self): + check_dict = dict.fromkeys(self.frame_sizes) + linerate = {64: 0.085, 128: 0.12, 256: 0.20, 512: 0.35, 1024: 0.50, 1280: 0.55, 1518: 0.60} + for size in self.frame_sizes: + speed = self.wirespeed(self.nic, size, self.number_of_ports) + check_dict[size] = round(speed * linerate[size], 2) + return check_dict + def send_and_verify(self): """ Send packet with packet generator and verify @@ -122,7 +132,9 @@ class TestVirtioUserForContainer(TestCase): vm_config, self.tester.pktgen) _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams) Mpps = pps / 1000000.0 - self.verify(Mpps > 0, '%s can not receive packets of frame size %d' % (self.running_case, frame_size)) + self.verify(Mpps > self.check_value[frame_size], + "%s of frame size %d speed verify failed, expect %s, result %s" % ( + self.running_case, frame_size, self.check_value[frame_size], Mpps)) throughput = Mpps * 100 / \ float(self.wirespeed(self.nic, frame_size, 1)) -- 1.8.3.1