From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2644DA09E4; Mon, 4 Jan 2021 06:39:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E231C1606D0; Mon, 4 Jan 2021 06:39:11 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 89B3C1606CF for ; Mon, 4 Jan 2021 06:39:09 +0100 (CET) IronPort-SDR: BW1HwQqUXOMx9MmY4IG11KcNt7iQR0/NdxmjZXdylV/0IiQap7yjuKx83XH4NGz674LDbS+fdH +/YeqUiHpiWg== X-IronPort-AV: E=McAfee;i="6000,8403,9853"; a="173405460" X-IronPort-AV: E=Sophos;i="5.78,473,1599548400"; d="scan'208";a="173405460" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2021 21:39:08 -0800 IronPort-SDR: o+ZG8W8JMjJL3Gp15e6c4Qsj07ZrR+RHAdXSqtdVodGV4J0SUU1hMtsuGFWvuk5BPlNjjHU1g1 WMRQSHkuImmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,473,1599548400"; d="scan'208";a="386517128" Received: from bmca4bf01706bbf.iind.intel.com (HELO localhost.localdomain) ([10.190.213.111]) by orsmga007.jf.intel.com with ESMTP; 03 Jan 2021 21:39:06 -0800 From: Kumar Amber To: dts@dpdk.org Date: Mon, 4 Jan 2021 11:01:41 +0530 Message-Id: <20210104053141.103367-1-kumar.amber@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH] tests/cbdma: add multi app test 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 Sender: "dts" The test added implemnts test-pmd running as primary app and iotfwd as secondary app. Signed-off-by: Kumar Amber --- test_plans/cbdma_test_plan.rst | 15 ++++++++++ tests/TestSuite_cbdma.py | 55 ++++++++++++++++++++++++++-------- 2 files changed, 57 insertions(+), 13 deletions(-) mode change 100644 => 100755 tests/TestSuite_cbdma.py diff --git a/test_plans/cbdma_test_plan.rst b/test_plans/cbdma_test_plan.rst index aee05a61..94167097 100644 --- a/test_plans/cbdma_test_plan.rst +++ b/test_plans/cbdma_test_plan.rst @@ -194,3 +194,18 @@ Test Case6: CBDMA performance cmparison between HW copies and SW copies using di 7. Check performance from ioat app and compare with hw copy test:: Total packets Tx: xxx [pps] + +Test Case7: CBDMA multi application mode test +============================================= + +1.Bind four cbdma ports to ugb_uio driver. + +2.Launch test-pmd app with three cores and proc_type primary: + +./build/test-pmd -l 0-2 -n 2 -- -p 0x1 -q 4 --proc-type=primary + +3. Launch another ioatfwd app with three cores and proc_type secondary: + +./build/ioatfwd -l 0-2 -n 2 -- -p 0x1 -q 4 --proc-type=secondary + +4. check both the application should work and no one should report error. diff --git a/tests/TestSuite_cbdma.py b/tests/TestSuite_cbdma.py old mode 100644 new mode 100755 index 6a5be6a4..2685fc4f --- a/tests/TestSuite_cbdma.py +++ b/tests/TestSuite_cbdma.py @@ -39,6 +39,7 @@ import time from test_case import TestCase from packet import Packet from pktgen import TRANSMIT_CONT +from pmd_output import PmdOutput class TestCBDMA(TestCase): @@ -55,9 +56,10 @@ class TestCBDMA(TestCase): self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) self.get_cbdma_ports_info_and_bind_to_dpdk() out = self.dut.build_dpdk_apps('./examples/ioat') - self.app_path=self.dut.apps_name['ioat'] + self.ioat_path = self.dut.apps_name['ioat'] self.verify('Error' not in out, 'compilation ioat error') + def set_up(self): """ Run before each test case. @@ -71,7 +73,7 @@ class TestCBDMA(TestCase): self.table_header.append("Updating MAC") self.table_header.append("% linerate") self.result_table_create(self.table_header) - self.send_session = self.dut.new_session("new_session") + self.send_session = self.dut.new_session("new_session") def get_core_list(self): """ @@ -124,7 +126,7 @@ class TestCBDMA(TestCase): dev_info.append(self.cbdma_dev_infos[i]) return dev_info - def launch_ioatfwd_app(self, eal_params): + def launch_ioatfwd_app(self, eal_params, session=None): """ launch ioatfwd with different params """ @@ -140,17 +142,18 @@ class TestCBDMA(TestCase): when the cores num > 2, there will have 2 thread, and the max value of thread num is 2 ''' - # flush other output - target = self.app_path.split("/") - self.send_session.send_expect(f"cd {'/'.join(target[0:-1])} ", '# ') - self.send_session.get_session_before(timeout=1) - cmd_command = "./"+target[-1] + eal_params + \ - '-- -p %s -q %d %s -c %s' % (hex(port_info), - self.cbdma_ioat_dev_num/self.cbdma_nic_dev_num, mac_info, - self.cbdma_copy_mode) - self.send_session.send_expect(cmd_command, f'{target[-1].strip()},') + if session is None: + session = self.send_session + expected = self.ioat_path.split('/')[-1].strip() + self.logger.info('expected: {}'.format(expected)) + cmd_command = '%s %s %s %s -- -p %s -q %d %s -c %s' % (self.ioat_path, eal_params, + self.cbdma_proc, self.v_dev, hex(port_info), + self.cbdma_ioat_dev_num/self.cbdma_nic_dev_num, mac_info, + self.cbdma_copy_mode) + out = session.send_expect(cmd_command, expected) time.sleep(1) - out = self.send_session.get_session_before(timeout=1) + out = session.get_session_before(timeout=1) + self.logger.info('out before: {}'.format(out)) thread_num = 2 if self.cbdma_cores_num > 2 else 1 o_thread_info = 'Worker Threads = %d' % thread_num o_copy_info = 'Copy Mode = %s' % self.cbdma_copy_mode @@ -359,6 +362,32 @@ class TestCBDMA(TestCase): self.send_and_verify_throughput(check_channel=False) self.result_table_print() + def test_multi_app_mode(self): + """ + CBDMA multi app tests for the simultanous exection of primary + and secondary app + """ + self.cbdma_cores_num = 3 + self.cbdma_nic_dev_num = 1 + self.cbdma_ioat_dev_num = 4 + self.cbdma_updating_mac = 'disable' + self.cbdma_copy_mode = 'hw' + self.v_dev = "--vdev net_null_0" + dev_info = self.get_ports_info() + dev_info.pop(0) + self.get_core_list() + self.pmdout = PmdOutput(self.dut) + self.pmdout.start_testpmd(cores='', eal_param='--vdev net_null_0 --proc-type=primary', + ports=dev_info) + self.pmdout.execute_cmd('port stop all') + self.cbdma_proc = '--proc-type=secondary' + eal_params = self.dut.create_eal_parameters(cores=self.core_list, + ports=dev_info) + self.launch_ioatfwd_app(eal_params) + self.send_session.send_expect('^C','#') + self.pmdout.execute_cmd('^C') + self.result_table_print() + def tear_down(self): """ Run after each test case. -- 2.25.1