bf01aec429cc7bd93c4ce76e81751824fc52a1d9
[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 | Collections
22
23 *** Keywords ***
24 | Start L2FWD '${m}' worker threads and rxqueues '${n}' with jumbo frames '${b}'
25 | | [Documentation] |  Start the l2fwd with M worker threads without HTT
26 | | ...             |  and rxqueues N and B(yes or no) jumbo frames in all DUTs
27 | | ${nb-cores}= | Catenate | ${m}
28 | | ${cpu}= | Run Keyword If | '${m}' == '1' | Catenate | 0x3
29 | | ...     | ELSE IF        | '${m}' == '2' | Catenate | 0x403
30 | | ...     | ELSE IF        | '${m}' == '4' | Catenate | 0xc07
31 | | ...     | ELSE IF        | '${m}' == '6' | Catenate | 0x1c0f
32 | | ...     | ELSE IF        | '${m}' == '8' | Catenate | 0x3c1f
33 | | ...     | ELSE           | Fail | Not supported combination
34 | | ${rxqueues}= | Catenate | ${n}
35 | | ${jumbo_frames}= | Catenate | ${b}
36 | | Start l2fwd to all DUTs | ${cpu} | ${nb-cores}
37 | | ...     | ${rxqueues} | ${jumbo_frames}
38
39 | Start l2fwd to all DUTs
40 | | [Documentation] | Setup worker threads and rxqueues in l2fwd startup
41 | | ...             | configuration to all DUTs
42 | | ...
43 | | ... | *Arguments:*
44 | | ... | - ${cpu} - CPU configuration. Type: string
45 | | ... | - ${nb-cores} - cores for the packet forwarding. Type: string
46 | | ... | - ${rxqueues} - rxqueues configuration. Type: string
47 | | ... | - ${jumbo_frames} - Enable the jumbo frames or not. Type: string
48 | | ...
49 | | ... | *Example:*
50 | | ...
51 | | ... | \| Start l2fwd to all DUTs \| 0x403 \| 2 \
52 | | ... | \| 1 \| no
53 | | [Arguments] | ${cpu} | ${nb-cores} | ${rxqueues} | ${jumbo_frames}
54 | | ${duts}= | Get Matches | ${nodes} | DUT*
55 | | :FOR | ${dut} | IN | @{duts}
56 | | | Start the l2fwd test | ${nodes['${dut}']}
57 | | | ...            | ${cpu} | ${nb-cores} | ${rxqueues} | ${jumbo_frames}
58