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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
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
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.
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 | | ... | - rxd - Number of RX descriptors. Type: integer
31 | | ... | - txd - Number of TX descriptors. Type: integer
35 | | ... | \| Start testpmd on all DUTs \| ${1} \| ${1} \| ${False} \|
37 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo_frames}=${False}
38 | | ... | ${rxd}=${None} | ${txd}=${None}
40 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
41 | | ${dp_count_int} | Convert to Integer | ${phy_cores}
42 | | ${dp_cores}= | Evaluate | ${cpu_count_int}+1
43 | | FOR | ${dut} | IN | @{duts}
44 | | | &{compute_resource_info}= | Get Affinity Vswitch
45 | | | ... | ${nodes} | ${dut} | ${phy_cores} | rx_queues=${rx_queues}
46 | | | ... | rxd=${rxd} | txd=${txd}
47 | | | Set Test Variable | &{compute_resource_info}
48 | | | Create compute resources variables
50 | | | ... | ${nodes['${dut}']} | ${${dut}_pf1}[0] | ${${dut}_pf2}[0]
51 | | | ... | ${cpu_dp} | ${dp_count_int} | ${rxq_count_int} | ${jumbo_frames}
52 | | | ... | ${nic_rxq_size} | ${nic_txq_size}
55 | Start l3fwd on all DUTs
56 | | [Documentation] | Start the l3fwd with M worker threads and rxqueues N and
57 | | ... | jumbo support frames on/off on all DUTs.
59 | | ... | *Arguments:*
60 | | ... | - phy_cores - Number of physical cores to use. Type: integer
61 | | ... | - rx_queues - Number of RX queues. Type: integer
62 | | ... | - jumbo_frames - Jumbo frames on/off: boolean
63 | | ... | - rxd - Number of RX descriptors. Type: integer
64 | | ... | - txd - Number of TX descriptors. Type: integer
68 | | ... | \| Start l3fwd on all DUTs \| ${1} \| ${1} \| ${False} \|
70 | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo_frames}=${False}
71 | | ... | ${rxd}=${None} | ${txd}=${None}
73 | | ${cpu_count_int} | Convert to Integer | ${phy_cores}
74 | | ${dp_count_int} | Convert to Integer | ${phy_cores}
75 | | ${dp_cores}= | Evaluate | ${cpu_count_int}+1
76 | | FOR | ${dut} | IN | @{duts}
77 | | | &{compute_resource_info}= | Get Affinity Vswitch
78 | | | ... | ${nodes} | ${dut} | ${phy_cores} | rx_queues=${rx_queues}
79 | | | ... | rxd=${rxd} | txd=${txd}
80 | | | Set Test Variable | &{compute_resource_info}
81 | | | Create compute resources variables
83 | | | ... | ${nodes} | ${nodes['${dut}']} | ${${dut}_pf1}[0] | ${${dut}_pf2}[0]
84 | | | ... | ${cpu_dp} | ${dp_count_int} | ${rxq_count_int} | ${jumbo_frames}