b890db7d312f1903aa029b9d5d47b11925354cb3
[csit.git] / resources / libraries / robot / dpdk / default.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Variables | resources/libraries/python/topology.py
16 | Library | resources.libraries.python.topology.Topology
17 | Library | resources.libraries.python.CpuUtils
18 | Library | resources.libraries.python.DUTSetup
19 | Library | resources.libraries.python.TGSetup
20 | Library | resources.libraries.python.DPDK.L2fwdTest
21 | Library | resources.libraries.python.DPDK.L3fwdTest
22 | Library | Collections
23
24 *** Keywords ***
25
26 | Start L2FWD on all DUTs
27 | | [Documentation] | Start the l2fwd with M worker threads and rxqueues N and
28 | | ... | jumbo support frames on/off on all DUTs.
29 | | ...
30 | | [Arguments] | ${cpu_cnt} | ${rx_queues} | ${jumbo_frames}
31 | | ...
32 | | ${cpu_count_int} | Convert to Integer | ${cpu_cnt}
33 | | ${thr_count_int} | Convert to Integer | ${cpu_cnt}
34 | | ${dp_cores}= | Evaluate | ${cpu_count_int}+1
35 | | ${nb_cores}= | Set Variable | ${cpu_count_int}
36 | | ${duts}= | Get Matches | ${nodes} | DUT*
37 | | :FOR | ${dut} | IN | @{duts}
38 | | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']}
39 | | | ... | ${${dut}_if1} | ${${dut}_if2}
40 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
41 | | | ${cpus}= | Cpu Range Per Node Str | ${nodes['${dut}']} | ${numa}
42 | | | ... | skip_cnt=${1} | cpu_cnt=${dp_cores} | smt_used=${smt_used}
43 | | | Start the l2fwd test | ${nodes['${dut}']} | ${cpus} | ${nb_cores}
44 | | | ... | ${rxqueues} | ${jumbo_frames}
45 | | | ${thr_count_int}= | Run keyword if | ${smt_used} |
46 | | | ... | Evaluate | int(${cpu_count_int}*2) | ELSE | Set variable
47 | | | ... | ${thr_count_int}
48 | | | Run keyword if | ${thr_count_int} > 1
49 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
50 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
51
52 | Start L3FWD on all DUTs
53 | | [Documentation] | Start the l3fwd with M worker threads and rxqueues N and
54 | | ... | jumbo support frames on/off on all DUTs.
55 | | ...
56 | | [Arguments] | ${cpu_cnt} | ${rx_queues} | ${jumbo_frames}
57 | | ...
58 | | ${cpu_count_int} | Convert to Integer | ${cpu_cnt}
59 | | ${thr_count_int} | Convert to Integer | ${cpu_cnt}
60 | | ${dp_cores}= | Evaluate | ${cpu_count_int}+1
61 | | ${nb_cores}= | Set Variable | ${cpu_count_int}
62 | | ${duts}= | Get Matches | ${nodes} | DUT*
63 | | :FOR | ${dut} | IN | @{duts}
64 | | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']}
65 | | | ... | ${${dut}_if1} | ${${dut}_if2}
66 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
67 | | | ${cpus}= | Cpu List Per Node Str | ${nodes['${dut}']} | ${numa}
68 | | | ... | skip_cnt=${1} | cpu_cnt=${nb_cores} | smt_used=${smt_used}
69 | | | Start the l3fwd test | ${nodes} | ${nodes['${dut}']} | ${${dut}_if1}
70 | | | ... | ${${dut}_if2} | ${nb_cores} | ${cpus} | ${rxqueues}
71 | | | ... | ${jumbo_frames}
72 | | | ${thr_count_int}= | Run keyword if | ${smt_used} |
73 | | | ... | Evaluate | int(${cpu_count_int}*2) | ELSE | Set variable
74 | | | ... | ${thr_count_int}
75 | | | Run keyword if | ${thr_count_int} > 1
76 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
77 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C