Dpdk in VM: Increase num_mbufs
[csit.git] / resources / libraries / robot / dpdk / default.robot
1 # Copyright (c) 2021 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 | Library | resources.libraries.python.InterfaceUtil
16 | Library | resources.libraries.python.CpuUtils
17 | Library | resources.libraries.python.DPDK.TestpmdTest
18 | Library | resources.libraries.python.DPDK.L3fwdTest
19 | Library | Collections
20
21 *** Keywords ***
22 | Start testpmd on all DUTs
23 | | [Documentation] | Start the testpmd with M worker threads and rxqueues N and
24 | | ... | jumbo support frames on/off on all DUTs.
25 | |
26 | | ... | *Arguments:*
27 | | ... | - phy_cores - Number of physical cores to use. Type: integer
28 | | ... | - rx_queues - Number of RX queues. Type: integer
29 | | ... | - jumbo_frames - Jumbo frames on/off: boolean
30 | |
31 | | ... | *Example:*
32 | |
33 | | ... | \| Start testpmd on all DUTs \| ${1} \| ${1} \| ${False} \|
34 | |
35 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo_frames}=${False}
36 | |
37 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
38 | | ${thr_count_int} | Convert to Integer | ${phy_cores}
39 | | ${dp_cores}= | Evaluate | ${cpu_count_int}+1
40 | | FOR | ${dut} | IN | @{duts}
41 | | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']}
42 | | | ... | ${${dut}_pf1}[0] | ${${dut}_pf2}[0]
43 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
44 | | | ${cpus}= | Cpu List Per Node Str | ${nodes['${dut}']} | ${numa}
45 | | | ... | skip_cnt=${2} | cpu_cnt=${cpu_count_int} | smt_used=${smt_used}
46 | | | ${thr_count_int}= | Run keyword if | ${smt_used} |
47 | | | ... | Evaluate | int(${cpu_count_int}*2) | ELSE | Set variable
48 | | | ... | ${thr_count_int}
49 | | | ${rxq_ratio} = | Get Variable Value | \${rxq_ratio} | ${1}
50 | | | ${rxq_count_int}= | Run Keyword If | ${rx_queues}
51 | | | ... | Set variable | ${rx_queues}
52 | | | ... | ELSE | Evaluate | int(${thr_count_int}/${rxq_ratio})
53 | | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
54 | | | ... | Set variable | ${1}
55 | | | ... | ELSE | Set variable | ${rxq_count_int}
56 | | | Start testpmd
57 | | | ... | ${nodes['${dut}']} | ${${dut}_pf1}[0] | ${${dut}_pf2}[0]
58 | | | ... | ${cpus} | ${thr_count_int} | ${rxq_count_int} | ${jumbo_frames}
59 | | | ... | ${nic_rxq_size} | ${nic_txq_size}
60 | | | Run keyword if | ${thr_count_int} > 1
61 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
62 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
63 | | END
64
65 | Start l3fwd on all DUTs
66 | | [Documentation] | Start the l3fwd with M worker threads and rxqueues N and
67 | | ... | jumbo support frames on/off on all DUTs.
68 | |
69 | | ... | *Arguments:*
70 | | ... | - phy_cores - Number of physical cores to use. Type: integer
71 | | ... | - rx_queues - Number of RX queues. Type: integer
72 | | ... | - jumbo_frames - Jumbo frames on/off: boolean
73 | |
74 | | ... | *Example:*
75 | |
76 | | ... | \| Start l3fwd on all DUTs \| ${1} \| ${1} \| ${False} \|
77 | |
78 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo_frames}=${False}
79 | |
80 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
81 | | ${thr_count_int} | Convert to Integer | ${phy_cores}
82 | | ${dp_cores}= | Evaluate | ${cpu_count_int}+1
83 | | FOR | ${dut} | IN | @{duts}
84 | | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']}
85 | | | ... | ${${dut}_pf1}[0] | ${${dut}_pf2}[0]
86 | | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
87 | | | ${cpus}= | Cpu List Per Node Str | ${nodes['${dut}']} | ${numa}
88 | | | ... | skip_cnt=${2} | cpu_cnt=${cpu_count_int} | smt_used=${smt_used}
89 | | | ${thr_count_int}= | Run keyword if | ${smt_used} |
90 | | | ... | Evaluate | int(${cpu_count_int}*2) | ELSE | Set variable
91 | | | ... | ${thr_count_int}
92 | | | ${rxq_count_int}= | Run keyword if | ${rx_queues}
93 | | | ... | Set variable | ${rx_queues}
94 | | | ... | ELSE | Evaluate | int(${thr_count_int}/1)
95 | | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
96 | | | ... | Set variable | ${1}
97 | | | ... | ELSE | Set variable | ${rxq_count_int}
98 | | | Start l3fwd
99 | | | ... | ${nodes} | ${nodes['${dut}']} | ${${dut}_pf1}[0] | ${${dut}_pf2}[0]
100 | | | ... | ${cpus} | ${thr_count_int} | ${rxq_count_int} | ${jumbo_frames}
101 | | | Run keyword if | ${thr_count_int} > 1
102 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
103 | | | Set Tags | ${thr_count_int}T${cpu_count_int}C
104 | | END