From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 4A5D59155 for ; Mon, 14 Aug 2017 09:44:32 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2017 00:44:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,372,1498546800"; d="scan'208";a="1205386631" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.67.111.132]) by fmsmga002.fm.intel.com with ESMTP; 14 Aug 2017 00:44:28 -0700 From: Lijuan Tu To: dts@dpdk.org Cc: Lijuan Tu Date: Mon, 14 Aug 2017 23:37:18 +0800 Message-Id: <20170814153718.56580-1-lijuanx.a.tu@intel.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 Content-Type: text/plain; charset=y Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH v5]test_plans: add test plan for multiple pthread 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: , X-List-Received-Date: Mon, 14 Aug 2017 07:44:33 -0000 When using multiple pthread, you can bind an EAL pthread to a specified physical CPU. Signed-off-by: Lijuan Tu --- test_plans/multiple_pthread_test_plan.rst | 242 ++++++++++++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 test_plans/multiple_pthread_test_plan.rst diff --git a/test_plans/multiple_pthread_test_plan.rst b/test_plans/multiple_pthread_test_plan.rst new file mode 100644 index 0000000..4deeb1a --- /dev/null +++ b/test_plans/multiple_pthread_test_plan.rst @@ -0,0 +1,242 @@ +.. Copyright (c) < 2017 >, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + +===================== +Multiple Pthread Test +===================== + + +Description +----------- + +This test is a basic multiple pthread test which demonstrates the basics +of control group. Cgroup is a Linux kernel feature that limits, accounts +for and isolates the resource usage, like CPU, memory, disk I/O, network, +etc of a collection of processes. Now, it's focus on the CPU usage. + +Prerequisites +------------- +Support igb_uio driver, kernel is 3.11+. +Use "modeprobe uio" "modprobe igb_uio" and then +use "./tools/dpdk_nic_bind.py --bind=igb_uio device_bus_id" to bind the ports. + +Assuming that an Intel's DPDK build has been set up and the testpmd +applications have been built. + +Os required: Linux and FreeBSD. +The command used in the test plan is only for Linux OS. + +The format pattern:: + + –lcores=’[@cpu_set][,[@cpu_set],...]’ + +‘lcore_set’ and ‘cpu_set’ can be a single number, range or a group. +A number is a “digit([0-9]+)”; a range is “-”; +a group is “([,,...])”. +If a ‘@cpu_set’ value is not supplied, +the value of ‘cpu_set’ will default to the value of ‘lcore_set’. +For example, "--lcores='1,2@(5-7),(3-5)@(0,2),(0,6),7-8'" +which means start 9 EAL thread:: + + lcore 0 runs on cpuset 0x41 (cpu 0,6); + lcore 1 runs on cpuset 0x2 (cpu 1); + lcore 2 runs on cpuset 0xe0 (cpu 5,6,7); + lcore 3,4,5 runs on cpuset 0x5 (cpu 0,2); + lcore 6 runs on cpuset 0x41 (cpu 0,6); + lcore 7 runs on cpuset 0x80 (cpu 7); + lcore 8 runs on cpuset 0x100 (cpu 8). + +Test Case 1: Basic operation +---------------------------- + +To run the application, start the testpmd with the lcoress all running with +threads and also the unique core assigned, command as follows:: + + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@9' -n 4 -- -i + +Using the command to make sure the lcore are init on the correct cpu:: + + ps -C testpmd -L -opid,tid,%cpu,psr,args + +Result as follows:: + + PID TID %CPU PSR COMMAND + 31038 31038 22.5 8 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i + 31038 31039 0.0 8 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i + 31038 31040 0.0 9 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i + 31038 31041 0.0 9 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i + 31038 31042 0.0 8 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i + +Their TIDs are for these threads as below:: + + +------------------------+ + | TID | THREAD | + +-------+----------------+ + | 31038 | Master thread | + +-------+----------------+ + | 31039 |Eal-intr-thread | + +------+-----------------+ + | 31040 | Lcore-slave-4 | + +-------+----------------+ + | 31041 | Lcore-slave-5 | + +-------+----------------+ + | 31042 | Pdump-thread | + +-------+----------------+ + +Before running the test, make sure the core is a unique one otherwise, +the throughput will be floating on different cores, +configure lcore 4&5 used for packet forwarding, command as follows:: + + testpmd>set corelist 4,5 + +Pay attention that set corelist need to be configured before start, +otherwise, it will not work:: + + testpmd>start + +Check forward configuration:: + + testpmd>show config fwd + Logical Core 4 (socket 0) forwards packets on 1 streams: + RX P=0/Q=0 (socket 1) -> TX P=1/Q=0 (socket 1) peer=02:00:00:00:00:01 + Logical Core 5 (socket 0) forwards packets on 1 streams: + RX P=1/Q=0 (socket 1) -> TX P=0/Q=0 (socket 1) peer=02:00:00:00:00:00 + +Send packets continuous:: + + PID TID %CPU PSR COMMAND + 31038 31038 0.6 8 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i + 31038 31039 0.0 8 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i + 31038 31040 1.5 9 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i + 31038 31041 1.5 9 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i + 31038 31042 0.0 8 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i + +You can see TID 31040(Lcore 4), 31041(Lore 5) are running. + + +Test Case 2: Positive Test +-------------------------- +Input random valid commands to make sure the commands can work, +Give examples, suppose DUT have 128 cpu core. + +Case 1:: + + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@(8-11)' -n 4 -- -i + +It means start 3 EAL thread:: + + lcore 0 runs on cpuset 0x100 (cpu 8); + lcore 4,5 runs on cpuset 0x780 (cpu 8,9,10,11). + +Case 2:: + + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='1,2@(0-4,6),(3-4,6)@5,(7,8)' -n 4 -- -i + +It means start 7 EAL thread:: + + lcore 1 runs on cpuset 0x2 (cpu 1); + lcore 2 runs on cpuset 0x5f (cpu 0,1,2,3,4,6); + lcore 3,4,6 runs on cpuset 0x10 (cpu 5); + lcore 7 runs on cpuset 0x80 (cpu 7); + lcore 8 runs on cpuset 0x100 (cpu 8). + +Case 3:: + + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,CONFIG_RTE_MAX_LCORE-1)@(4,5)' -n 4 -- -i + +(default CONFIG_RTE_MAX_LCORE=128). +It means start 2 EAL thread:: + + lcore 0,127 runs on cpuset 0x30 (cpu 4,5). + +Case 4:: + + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,64-66)@(4,5)' -n 4 -- -i + +It means start 4 EAL thread:: + + lcore 0,64,65,66 runs on cpuset 0x30 (cpu 4,5). + +Case 5:: + + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2-5,6,7-9' -n 4 -- -i + +It means start 8 EAL thread:: + + lcore 2 runs on cpuset 0x4 (cpu 2); + lcore 3 runs on cpuset 0x8 (cpu 3); + lcore 4 runs on cpuset 0x10 (cpu 4); + lcore 5 runs on cpuset 0x20 (cpu 5); + lcore 6 runs on cpuset 0x40 (cpu 6); + lcore 7 runs on cpuset 0x80 (cpu 7); + lcore 8 runs on cpuset 0x100 (cpu 8); + lcore 9 runs on cpuset 0x200 (cpu 9). + +Case 6:: + + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,(3-5)@3' -n 4 -- -i + +It means start 4 EAL thread:: + + lcore 2 runs on cpuset 0x4 (cpu 2); + lcore 3,4,5 runs on cpuset 0x8 (cpu 3). + +Case 7:: + + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,7-4)@(4,5)' -n 4 -- -i + +It means start 5 EAL thread:: + + lcore 0,4,5,6,7 runs on cpuset 0x30 (cpu 4,5) + + + +Test Case 3: Negative Test +-------------------------- +Input invalid commands to make sure the commands can't work:: + + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0-,4-7)@(4,5)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(-1,4-7)@(4,5)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7-9)@(4,5)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,abcd)@(4,5)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(1-,5)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(-1,5)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(4,5-8-9)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(abc,5)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(4,xyz)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)=(8,9)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,3 at 4,(0-1,,4))' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='[0-,4-7]@(4,5)' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0-,4-7)@[4,5]' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='3-4 at 3,2 at 5-6' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,,3''2--3' -n 4 -- -i + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,,,3''2--3' -n 4 -- -i -- 2.9.4