From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 92D5DA0032; Mon, 11 Jul 2022 16:07:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 62FB140C35; Mon, 11 Jul 2022 16:07:44 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 57EF340695 for ; Mon, 11 Jul 2022 16:07:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657548462; x=1689084462; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=ukWY/37wK+Z+y5Y8op1fNPvgitMOidhBhaVry7e7Tn4=; b=g9ix9D3Vz8fqfsRIOB000LG54ilb3v9jhUfuVn1qIU6okIv12VChE1M4 RCkp01vn3KBKK0mj8KddoORQI7EQqsPyqin7a53PBnVVITp0a3Eynyu2h 0vvWnZMju0SZYtL4xAgpyooNj4jJ5rMm4qjixeiExkg0iTCJzXHaxDSAm rvl9d5cHN1ogxNR1+yyCyDey9+OmXycYRMyhCDglrD5TE/8+lNMWygDRC rztNi50S2NybCtvUPsGqa0xVPxLY4oGDjqSkJ+BGlE9ZT/1pEQNJF+5xb eegqsXhUWselte+7fiyPnyavTF0XiDi+PAWlm06V6dQG/BbZPq98VZkra w==; X-IronPort-AV: E=McAfee;i="6400,9594,10404"; a="346353940" X-IronPort-AV: E=Sophos;i="5.92,263,1650956400"; d="scan'208";a="346353940" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2022 07:06:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,263,1650956400"; d="scan'208";a="627504516" Received: from silpixa00400629.ir.intel.com ([10.237.213.88]) by orsmga001.jf.intel.com with ESMTP; 11 Jul 2022 07:06:52 -0700 From: Marcin Danilewicz To: dts@dpdk.org, yuan.peng@intel.com Subject: [PATCH] tests/TestSuite_qos_meter: srTCM changed CBS-EBS Date: Mon, 11 Jul 2022 14:06:49 +0000 Message-Id: <20220711140649.303957-1-marcinx.danilewicz@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Adding test cased for "srTCM blind changed CBS and EBS" from test_plans/qos_meter_test_plan.rst Signed-off-by: Marcin Danilewicz --- tests/TestSuite_qos_meter.py | 163 ++++++++++++++++++++++++++++++++--- 1 file changed, 153 insertions(+), 10 deletions(-) diff --git a/tests/TestSuite_qos_meter.py b/tests/TestSuite_qos_meter.py index b1d13a32..24cadbcc 100644 --- a/tests/TestSuite_qos_meter.py +++ b/tests/TestSuite_qos_meter.py @@ -41,12 +41,14 @@ class TestQosMeter(TestCase): """ pass - def build_app_and_send_package(self): + def build_app_and_send_package(self, payload_size_block): """ Build app and send pkt return bps and pps """ - self.dut.send_expect("rm -rf ./examples/qos_meter/build", "#") + self.dut.send_expect("rm -rf ./examples/qos_meter/build", + "#", + ) out = self.dut.build_dpdk_apps("./examples/qos_meter") self.verify("Error" not in out, "Compilation error") self.verify("No such" not in out, "Compilation error") @@ -56,9 +58,9 @@ class TestQosMeter(TestCase): app_name = self.dut.apps_name["qos_meter"] cmd = app_name + eal_params + "-- -p 0x3" self.dut.send_expect(cmd, "TX = 1") - payload_size = 64 - HEADER_SIZE["eth"] - HEADER_SIZE["ip"] + payload_size = payload_size_block - HEADER_SIZE["eth"] - HEADER_SIZE["ip"] dts_mac = self.dut.get_mac_address(self.dut_ports[self.rx_port]) - pkt = Packet(pkt_type="IP_RAW") + pkt = Packet(pkt_type="IP_RAW", pkt_len=payload_size) pkt.save_pcapfile(self.tester, "%s/tester.pcap" % self.tester.tmp_file) stream_option = { "pcap": "%s/tester.pcap" % self.tester.tmp_file, @@ -79,7 +81,11 @@ class TestQosMeter(TestCase): ) self.tester.pktgen.config_stream(stream_id, stream_option) stream_ids.append(stream_id) - traffic_opt = {"method": "throughput", "rate": 100, "duration": 20} + traffic_opt = { + "method": "throughput", + "rate": 100, + "duration": 20 + } bps, pps = self.tester.pktgen.measure(stream_ids, traffic_opt) return bps, pps @@ -102,7 +108,7 @@ class TestQosMeter(TestCase): r"sed -i -e '/^#define APP_MODE /s/APP_MODE_*/APP_MODE_SRTCM_COLOR_BLIND/2' ./examples/qos_meter/main.c", "#", ) - bps, pps = self.build_app_and_send_package() + bps, pps = self.build_app_and_send_package(64) self.verify_throughput(pps, self.aware_pps) def test_perf_srTCM_blind_GREEN(self): @@ -117,7 +123,7 @@ class TestQosMeter(TestCase): r"sed -i -e '/^#define APP_MODE /s/APP_MODE_*/APP_MODE_SRTCM_COLOR_BLIND/2' ./examples/qos_meter/main.c", "#", ) - bps, pps = self.build_app_and_send_package() + bps, pps = self.build_app_and_send_package(64) self.verify_throughput(pps, self.blind_pps) def test_perf_srTCM_aware_RED(self): @@ -132,7 +138,7 @@ class TestQosMeter(TestCase): r"sed -i -e '/^#define APP_MODE /s/APP_MODE_*/APP_MODE_SRTCM_COLOR_AWARE/2' ./examples/qos_meter/main.c", "#", ) - bps, pps = self.build_app_and_send_package() + bps, pps = self.build_app_and_send_package(64) self.verify_throughput(pps, self.blind_pps) def test_perf_trTCM_blind(self): @@ -147,7 +153,7 @@ class TestQosMeter(TestCase): r"sed -i -e '/^#define APP_MODE /s/APP_MODE_*/APP_MODE_TRTCM_COLOR_BLIND/2' ./examples/qos_meter/main.c", "#", ) - bps, pps = self.build_app_and_send_package() + bps, pps = self.build_app_and_send_package(64) self.verify_throughput(pps, self.aware_pps) def test_perf_trTCM_aware(self): @@ -162,9 +168,146 @@ class TestQosMeter(TestCase): r"sed -i -e '/^#define APP_MODE /s/APP_MODE_*/APP_MODE_TRTCM_COLOR_AWARE/2' ./examples/qos_meter/main.c", "#", ) - bps, pps = self.build_app_and_send_package() + bps, pps = self.build_app_and_send_package(64) + self.verify_throughput(pps, self.blind_pps) + + def test_perf_trTCM_blind_changed_CBS_EBS_64B_frame(self): + """ + trTCM blind changed CBS and EBS + """ + self.dut.send_expect( + r"sed -i -e '/#define APP_PKT_COLOR_POS/s/[0-9]/5/g' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '/^#define APP_MODE\s/s/APP_MODE_.*/APP_MODE_TRTCM_COLOR_BLIND/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '91 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '100 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '92 s/[0-9]*$/512/' ./examples/qos_meter/main.c", + "#", + ) + bps, pps = self.build_app_and_send_package(64) + self.verify_throughput(pps, self.blind_pps) + + def test_perf_trTCM_blind_changed_CBS_EBS_82B_frame(self): + """ + trTCM blind changed CBS and EBS + """ + self.dut.send_expect( + r"sed -i -e '/#define APP_PKT_COLOR_POS/s/[0-9]/5/g' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '/^#define APP_MODE\s/s/APP_MODE_.*/APP_MODE_SRTCM_COLOR_BLIND/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '91 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '100 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '92 s/[0-9]*$/512/' ./examples/qos_meter/main.c", + "#", + ) + bps, pps = self.build_app_and_send_package(82) + self.verify_throughput(pps, self.blind_pps) + + def test_perf_trTCM_blind_changed_CBS_EBS_83B_frame(self): + """ + trTCM blind changed CBS and EBS + """ + self.dut.send_expect( + r"sed -i -e '/#define APP_PKT_COLOR_POS/s/[0-9]/5/g' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '/^#define APP_MODE\s/s/APP_MODE_.*/APP_MODE_SRTCM_COLOR_BLIND/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '91 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '100 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '92 s/[0-9]*$/512/' ./examples/qos_meter/main.c", + "#", + ) + bps, pps = self.build_app_and_send_package(83) self.verify_throughput(pps, self.blind_pps) + def test_perf_trTCM_blind_changed_CBS_EBS_146B_frame(self): + """ + trTCM blind changed CBS and EBS + """ + tc_pps = 10000000 + self.dut.send_expect( + r"sed -i -e '/#define APP_PKT_COLOR_POS/s/[0-9]/5/g' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '/^#define APP_MODE\s/s/APP_MODE_.*/APP_MODE_SRTCM_COLOR_BLIND/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '91 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '100 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '92 s/[0-9]*$/512/' ./examples/qos_meter/main.c", + "#", + ) + bps, pps = self.build_app_and_send_package(146) + self.verify_throughput(pps, tc_pps) + + def test_perf_trTCM_blind_changed_CBS_EBS_530B_frame(self): + """ + trTCM blind changed CBS and EBS + """ + tc_pps = 2500000 + self.dut.send_expect( + r"sed -i -e '/#define APP_PKT_COLOR_POS/s/[0-9]/5/g' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '/^#define APP_MODE\s/s/APP_MODE_.*/APP_MODE_SRTCM_COLOR_BLIND/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '91 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '100 s/cbs = [0-9]*,/cbs = 64,/' ./examples/qos_meter/main.c", + "#", + ) + self.dut.send_expect( + r"sed -i -e '92 s/[0-9]*$/512/' ./examples/qos_meter/main.c", + "#", + ) + bps, pps = self.build_app_and_send_package(530) + self.verify_throughput(pps, tc_pps) + def tear_down(self): """ Run after each test case. -- 2.25.1