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 38A1FA0352; Thu, 16 Jan 2020 10:35:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F13221C1E5; Thu, 16 Jan 2020 10:35:40 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 283421C1CA for ; Thu, 16 Jan 2020 10:35:38 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2020 01:35:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,325,1574150400"; d="scan'208";a="257276348" Received: from unknown (HELO dpdk-wenjielx-dtspatch135.sh.intel.com) ([10.240.176.135]) by fmsmga002.fm.intel.com with ESMTP; 16 Jan 2020 01:34:59 -0800 From: "han,yingya" To: dts@dpdk.org Cc: hanyingya Date: Thu, 16 Jan 2020 17:40:31 +0800 Message-Id: <1579167631-63456-1-git-send-email-yingyax.han@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V2]nic_single_core_perf: support CVL nic single core test 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" From: hanyingya Signed-off-by: hanyingya --- tests/TestSuite_nic_single_core_perf.py | 88 +++++++++++++++---------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/tests/TestSuite_nic_single_core_perf.py b/tests/TestSuite_nic_single_core_perf.py index f43b5db..3108957 100644 --- a/tests/TestSuite_nic_single_core_perf.py +++ b/tests/TestSuite_nic_single_core_perf.py @@ -53,17 +53,21 @@ class TestNicSingleCorePerf(TestCase): Run at the start of each test suite. PMD prerequisites. """ - self.verify(self.nic in ['niantic', 'fortville_25g', 'fortville_spirit', - 'ConnectX5_MT4121', 'ConnectX4_LX_MT4117'], + self.verify(self.nic in ['niantic', 'fortville_25g', 'fortville_spirit', 'ConnectX5_MT4121', + 'ConnectX4_LX_MT4117', 'columbiaville_100g', 'columbiaville_25g'], "Not required NIC ") self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE['ip'] - # Update DPDK config file and rebuild to get best perf on fortville + # Update DPDK config file and rebuild to get best perf on fortville and columbiaville. if self.nic in ["fortville_25g", "fortville_spirit"]: self.dut.send_expect( "sed -i -e 's/CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n/CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=y/' ./config/common_base", "#", 20) self.dut.build_install_dpdk(self.target) + elif self.nic in ["columbiaville_100g", "columbiaville_25g"]: + self.dut.send_expect( + "sed -i -e 's/CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=n/CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=y/' ./config/common_base", "#", 20) + self.dut.build_install_dpdk(self.target) # Based on h/w type, choose how many ports to use self.dut_ports = self.dut.get_ports() @@ -135,41 +139,55 @@ class TestNicSingleCorePerf(TestCase): 'IP(src="1.2.3.4",dst="192.18.2.0")', 'IP(src="1.2.3.4",dst="192.18.2.1")'] - def create_pacap_file(self, frame_size): + def create_pacap_file(self, frame_size, port_num): """ Prepare traffic flow """ payload_size = frame_size - HEADER_SIZE['ip'] - HEADER_SIZE['eth'] pcaps = {} for _port in self.dut_ports: - index = self.dut_ports[_port] - cnt = 0 - for layer in self.flows()[_port * 2:(_port + 1) * 2]: - flow = ['Ether(src="52:00:00:00:00:00")/%s/("X"*%d)' % (layer, payload_size)] - pcap = os.sep.join([self.output_path, "dst{0}_{1}.pcap".format(index, cnt)]) + if 1 == port_num: + flow = ['Ether(src="52:00:00:00:00:00")/%s/("X"*%d)' % (self.flows()[_port], payload_size)] + pcap = os.sep.join([self.output_path, "dst{0}.pcap".format(_port)]) self.tester.scapy_append('wrpcap("%s", [%s])' % (pcap, string.join(flow, ','))) self.tester.scapy_execute() - if index not in pcaps: - pcaps[index] = [] - pcaps[index].append(pcap) - cnt += 1 + pcaps[_port] = [] + pcaps[_port].append(pcap) + else: + index = self.dut_ports[_port] + cnt = 0 + for layer in self.flows()[_port * 2:(_port + 1) * 2]: + flow = ['Ether(src="52:00:00:00:00:00")/%s/("X"*%d)' % (layer, payload_size)] + pcap = os.sep.join([self.output_path, "dst{0}_{1}.pcap".format(index, cnt)]) + self.tester.scapy_append('wrpcap("%s", [%s])' % (pcap, string.join(flow, ','))) + self.tester.scapy_execute() + if index not in pcaps: + pcaps[index] = [] + pcaps[index].append(pcap) + cnt += 1 return pcaps - def prepare_stream(self, pcaps): + def prepare_stream(self, pcaps, port_num): """ create streams for ports,one port one stream """ tgen_input = [] - for rxPort in range(self.nb_ports): - if rxPort % self.nb_ports == 0 or self.nb_ports % rxPort == 2: - txIntf = self.tester.get_local_port(self.dut_ports[rxPort + 1]) - port_id = self.dut_ports[rxPort + 1] - else: - txIntf = self.tester.get_local_port(self.dut_ports[rxPort - 1]) - port_id = self.dut_ports[rxPort - 1] - rxIntf = self.tester.get_local_port(self.dut_ports[rxPort]) - for pcap in pcaps[port_id]: + if 1 == port_num: + txIntf = self.tester.get_local_port(self.dut_ports[0]) + rxIntf = txIntf + for pcap in pcaps[0]: tgen_input.append((txIntf, rxIntf, pcap)) + else: + for rxPort in range(self.nb_ports): + if rxPort % self.nb_ports == 0 or self.nb_ports % rxPort == 2: + txIntf = self.tester.get_local_port(self.dut_ports[rxPort + 1]) + port_id = self.dut_ports[rxPort + 1] + else: + txIntf = self.tester.get_local_port(self.dut_ports[rxPort - 1]) + port_id = self.dut_ports[rxPort - 1] + rxIntf = self.tester.get_local_port(self.dut_ports[rxPort]) + for pcap in pcaps[port_id]: + tgen_input.append((txIntf, rxIntf, pcap)) return tgen_input def test_perf_nic_single_core(self): @@ -177,8 +195,7 @@ class TestNicSingleCorePerf(TestCase): Run nic single core performance """ self.nb_ports = len(self.dut_ports) - self.verify(self.nb_ports == 2 or self.nb_ports == 4, - "Require 2 or 4 ports to test") + self.verify(self.nb_ports >= 1, "At least 1 port is required to test") self.perf_test(self.nb_ports) self.handle_results() @@ -203,8 +220,7 @@ class TestNicSingleCorePerf(TestCase): if load_global_setting(UPDATE_EXPECTED) == "yes": for frame_size in self.test_parameters.keys(): for nb_desc in self.test_parameters[frame_size]: - self.expected_throughput[frame_size][nb_desc] = \ - round(self.throughput[frame_size][nb_desc], 3) + self.expected_throughput[frame_size][nb_desc] = round(self.throughput[frame_size][nb_desc], 3) def perf_test(self, port_num): """ @@ -212,12 +228,12 @@ class TestNicSingleCorePerf(TestCase): """ # ports whitelist eal_para = "" - for i in range(self.nb_ports): + for i in range(port_num): eal_para += " -w " + self.dut.ports_info[i]['pci'] # run testpmd with 2 cores, one for interaction ,and one for forwarding core_config = "1S/2C/1T" - core_list = self.dut.get_core_list(core_config, socket = self.socket) + core_list = self.dut.get_core_list(core_config, socket=self.socket) self.logger.info("Executing Test Using cores: %s" % core_list) port_mask = utils.create_mask(self.dut_ports) @@ -226,17 +242,20 @@ class TestNicSingleCorePerf(TestCase): # fortville has to use 2 queues at least to get the best performance if self.nic in ["fortville_25g", "fortville_spirit"]: param += " --rxq=2 --txq=2" + # columbiaville use one queue per port for best performance. + elif self.nic in ["columbiaville_100g", "columbiaville_25g"]: + param += " --rxq=%d --rxq=%d" % (port_num, port_num) for frame_size in self.test_parameters.keys(): self.throughput[frame_size] = dict() - pcaps = self.create_pacap_file(frame_size) - tgenInput = self.prepare_stream(pcaps) + pcaps = self.create_pacap_file(frame_size, port_num) + tgenInput = self.prepare_stream(pcaps, port_num) for nb_desc in self.test_parameters[frame_size]: self.logger.info("Test running at parameters: " + "framesize: {}, rxd/txd: {}".format(frame_size, nb_desc)) parameter = param + " --txd=%d --rxd=%d" % (nb_desc, nb_desc) self.pmdout.start_testpmd( - core_config, parameter, eal_para, socket = self.socket) + core_config, parameter, eal_para, socket=self.socket) self.dut.send_expect("start", "testpmd> ", 15) vm_config = self.set_fields() @@ -365,5 +384,8 @@ class TestNicSingleCorePerf(TestCase): self.dut.send_expect( "sed -i -e 's/CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=y/CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n/' ./config/common_base", "#", 20) self.dut.build_install_dpdk(self.target) - + elif self.nic in ["columbiaville_100g", "columbiaville_25g"]: + self.dut.send_expect( + "sed -i -e 's/CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=y/CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=n/' ./config/common_base", "#", 20) + self.dut.build_install_dpdk(self.target) self.dut.kill_all() -- 2.17.1