1 # Copyright (c) 2022 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.
14 | Library | resources.libraries.python.InterfaceUtil
15 | Library | resources.libraries.python.NodePath
16 | Library | resources.libraries.python.VhostUser
19 | ${dpdk_no_tx_checksum_offload}= | ${True}
22 | Set single interfaces in path up
24 | | ... | *Set UP state on single physical VPP interfaces in path on all DUT
25 | | ... | nodes and set maximal MTU.*
27 | | ... | *Arguments:*
28 | | ... | - pf - NIC physical function (physical port).
29 | | ... | Type: integer
33 | | ... | \| Set single interfaces in path \| 1 \|
35 | | [Arguments] | ${pf}=${1}
37 | | FOR | ${dut} | IN | @{duts}
38 | | | Set interfaces in path up on node on PF | ${dut} | ${pf}
40 | | All VPP Interfaces Ready Wait | ${nodes} | retries=${60}
42 | Set interfaces in path up
44 | | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set
45 | | ... | maximal MTU.*
47 | | ... | *Arguments:*
48 | | ... | - validate - Validate interfaces are up.
49 | | ... | Type: boolean
51 | | [Arguments] | ${validate}=${True}
53 | | FOR | ${dut} | IN | @{duts}
54 | | | Set interfaces in path up on node | ${dut}
56 | | Run Keyword If | ${validate}
57 | | ... | All VPP Interfaces Ready Wait | ${nodes} | retries=${60}
59 | Set interfaces in path up on node
61 | | ... | *Set UP state on VPP interfaces in path on specified DUT node and
62 | | ... | set maximal MTU.*
64 | | ... | *Arguments:*
65 | | ... | - dut - DUT node on which to set the interfaces up.
66 | | ... | Type: string
70 | | ... | \| Set interfaces in path up on node \| DUT1 \|
72 | | [Arguments] | ${dut}
74 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
75 | | | Set interfaces in path up on node on PF | ${dut} | ${pf}
78 | Set interfaces in path up on node on PF
80 | | ... | *Set UP state on VPP interfaces in path on specified DUT node and
81 | | ... | set maximal MTU.*
83 | | ... | *Arguments:*
84 | | ... | - dut - DUT node on which to set the interfaces up.
85 | | ... | Type: string
86 | | ... | - pf - NIC physical function (physical port).
87 | | ... | Type: integer
91 | | ... | \| Set interfaces in path up on node on PF \| DUT1 \| 1 \|
93 | | [Arguments] | ${dut} | ${pf}
95 | | ${_chains} | ${value}= | Run Keyword And Ignore Error
96 | | ... | Variable Should Exist | @{${dut}_${int}${pf}_1}
97 | | ${_id}= | Set Variable If | '${_chains}' == 'PASS' | _1 | ${EMPTY}
98 | | FOR | ${if} | IN | @{${dut}_${int}${pf}${_id}}
99 | | | Set Interface State | ${nodes['${dut}']} | ${if} | up
100 | | | VPP Set Interface MTU | ${nodes['${dut}']} | ${if}
103 | Pre-initialize layer driver
105 | | ... | Pre-initialize driver based interfaces on each DUT.
107 | | ... | *Arguments:*
108 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
109 | | ... | Type: string
113 | | ... | \| Pre-initialize layer driver \| vfio-pci \|
115 | | [Arguments] | ${driver}
117 | | Run Keyword | Pre-initialize layer ${driver} on all DUTs
119 | Pre-initialize layer tap on all DUTs
121 | | ... | Pre-initialize tap driver. Currently no operation.
125 | Pre-initialize layer vhost on all DUTs
127 | | ... | Pre-initialize vhost driver. Currently no operation.
131 | Pre-initialize layer vfio-pci on all DUTs
133 | | ... | Pre-initialize vfio-pci driver by adding related sections to startup
134 | | ... | config on all DUTs.
136 | | ${index}= | Get Index From List | ${TEST TAGS} | DPDK
137 | | Run Keyword If | ${index} >= 0 | Return From Keyword
138 | | FOR | ${dut} | IN | @{duts}
139 | | | Stop VPP Service | ${nodes['${dut}']}
140 | | | Unbind PCI Devices From Other Driver | ${nodes['${dut}']} | vfio-pci |
141 | | | ... | @{${dut}_pf_pci}
142 | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci}
143 | | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
144 | | | ... | ${dut}.Add DPDK No Tx Checksum Offload
145 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
146 | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci
147 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
148 | | | Run Keyword If | not ${jumbo}
149 | | | ... | ${dut}.Add DPDK No Multi Seg
150 | | | Run Keyword If | ${nic_rxq_size} > 0
151 | | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size}
152 | | | Run Keyword If | ${nic_txq_size} > 0
153 | | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size}
154 | | | Run Keyword If | '${crypto_type}' != '${None}'
155 | | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int}
156 | | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT}
159 | Pre-initialize layer avf on all DUTs
161 | | ... | Pre-initialize avf driver. Currently no operation.
165 | Pre-initialize layer af_xdp on all DUTs
167 | | ... | Pre-initialize af_xdp driver.
169 | | FOR | ${dut} | IN | @{duts}
170 | | | Set Interface State PCI
171 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | state=up
172 | | | Set Interface Channels
173 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | num_queues=${rxq_count_int}
174 | | | ... | channel=combined
177 | Pre-initialize layer rdma-core on all DUTs
179 | | ... | Pre-initialize rdma-core driver.
181 | | FOR | ${dut} | IN | @{duts}
182 | | | Run Keyword If | ${jumbo}
183 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200
185 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1518
186 | | FOR | ${dut} | IN | @{duts}
187 | | | Set Interface Flow Control
188 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off"
191 | Pre-initialize layer mlx5_core on all DUTs
193 | | ... | Pre-initialize mlx5_core driver.
195 | | FOR | ${dut} | IN | @{duts}
196 | | | Run Keyword If | ${jumbo}
197 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200
199 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1518
200 | | | Set Interface Flow Control
201 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off"
204 | Initialize layer driver
206 | | ... | Initialize driver based interfaces on all DUT. Interfaces are
207 | | ... | brought up.
209 | | ... | *Arguments:*
210 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
211 | | ... | Type: string
212 | | ... | - validate - Validate interfaces are up.
213 | | ... | Type: boolean
217 | | ... | \| Initialize layer driver \| vfio-pci \|
219 | | [Arguments] | ${driver} | ${validate}=${True}
221 | | FOR | ${dut} | IN | @{duts}
222 | | | Initialize layer driver on node | ${dut} | ${driver}
224 | | Set Test Variable | ${int} | vf
225 | | Set interfaces in path up | validate=${validate}
227 | Initialize layer driver on node
229 | | ... | Initialize driver based interfaces on DUT.
231 | | ... | *Arguments:*
232 | | ... | - dut - DUT node.
233 | | ... | Type: string
234 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
235 | | ... | Type: string
239 | | ... | \| Initialize layer driver \| DUT1 \| vfio-pci \|
241 | | [Arguments] | ${dut} | ${driver}
243 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
245 | | | ... | Copy List | ${${dut}_${int}${pf}}
247 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_addr}
248 | | | ${_ip4_prefix}=
249 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_prefix}
251 | | | ... | Copy List | ${${dut}_${int}${pf}_mac}
253 | | | ... | Copy List | ${${dut}_${int}${pf}_pci}
255 | | | ... | Copy List | ${${dut}_${int}${pf}_vlan}
256 | | | Set Test Variable
257 | | | ... | ${${dut}_vf${pf}} | ${_vf}
258 | | | Set Test Variable
259 | | | ... | ${${dut}_vf${pf}_ip4_addr} | ${_ip4_addr}
260 | | | Set Suite Variable
261 | | | ... | ${${dut}_vf${pf}_ip4_prefix} | ${_ip4_prefix}
262 | | | Set Test Variable
263 | | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
264 | | | Set Test Variable
265 | | | ... | ${${dut}_vf${pf}_pci} | ${_pci}
266 | | | Set Test Variable
267 | | | ... | ${${dut}_vf${pf}_vlan} | ${_vlan}
268 | | | Run Keyword | Initialize layer ${driver} on node | ${dut} | ${pf}
271 | Initialize layer tap on node
273 | | ... | Initialize tap interfaces on DUT.
275 | | ... | *Arguments:*
276 | | ... | - dut - DUT node.
277 | | ... | Type: string
278 | | ... | - pf - TAP ID (logical port).
279 | | ... | Type: integer
283 | | ... | \| Initialize layer tap on node \| DUT1 \| 0 \|
285 | | [Arguments] | ${dut} | ${pf}
288 | | ... | ${nodes['${dut}']} | tap${${pf}-1}_namespace
289 | | ${tap_feature_mask}= | Create Tap feature mask | gso=${enable_gso}
291 | | ... | And Add Tap Interface | ${nodes['${dut}']} | tap${${pf}-1}
292 | | ... | host_namespace=tap${${pf}-1}_namespace
293 | | ... | num_rx_queues=${rxq_count_int}
294 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
295 | | ... | tap_feature_mask=${tap_feature_mask}
297 | | ... | Get Interface MAC | ${nodes['${dut}']} | tap${pf}
298 | | ${_tap}= | Create List | ${_tap}
299 | | ${_mac}= | Create List | ${_mac}
300 | | Vhost User Affinity
301 | | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0]
302 | | ... | skip_cnt=${${CPU_CNT_MAIN}+${CPU_CNT_SYSTEM}+${cpu_count_int}}
303 | | Set Test Variable
304 | | ... | ${${dut}_vf${pf}} | ${_tap}
305 | | Set Test Variable
306 | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
308 | Initialize layer vhost on node
310 | | ... | Initialize vhost interfaces on DUT.
312 | | ... | *Arguments:*
313 | | ... | - dut - DUT node.
314 | | ... | Type: string
315 | | ... | - pf - VHOST ID (logical port).
316 | | ... | Type: integer
320 | | ... | \| Initialize layer vhost on node \| DUT1 \| 0 \|
322 | | [Arguments] | ${dut} | ${pf}
324 | | ${virtio_feature_mask}= | Create Virtio feature mask | gso=${enable_gso}
325 | | ${vhost}= | Vpp Create Vhost User Interface
326 | | ... | ${nodes['${dut}']} | /var/run/vpp/sock-${pf}-1
327 | | ... | is_server=${True} | virtio_feature_mask=${virtio_feature_mask}
329 | | ... | Get Interface MAC | ${nodes['${dut}']} | vhost${pf}
330 | | ${_vhost}= | Create List | ${_vhost}
331 | | ${_mac}= | Create List | ${_mac}
332 | | Set Test Variable
333 | | ... | ${${dut}_vf${pf}} | ${_vhost}
334 | | Set Test Variable
335 | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
337 | Initialize layer vfio-pci on node
339 | | ... | Initialize vfio-pci interfaces on DUT on NIC PF.
340 | | ... | Currently no operation.
342 | | ... | *Arguments:*
343 | | ... | - dut - DUT node. Type: string
344 | | ... | - pf - NIC physical function (physical port). Type: integer
348 | | ... | \| Initialize layer vfio-pci on node \| DUT1 \| 1 \|
350 | | [Arguments] | ${dut} | ${pf}
354 | Initialize layer avf on node
356 | | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF.
358 | | ... | *Arguments:*
359 | | ... | - dut - DUT node. Type: string
360 | | ... | - pf - NIC physical function (physical port). Type: integer
364 | | ... | \| Initialize layer avf on node \| DUT1 \| 1 \|
366 | | [Arguments] | ${dut} | ${pf}
368 | | FOR | ${vf} | IN RANGE | 0 | ${nic_vfs}
369 | | | ${_avf}= | VPP Create AVF Interface
370 | | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[${vf}]
371 | | | ... | num_rx_queues=${rxq_count_int}
372 | | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
374 | | | ... | Get Interface IP4 | ${nodes['${dut}']} | ${_avf}
375 | | | ${_ip4_prefix}=
376 | | | ... | Get Interface IP4 Prefix Length | ${nodes['${dut}']} | ${_avf}
378 | | | ... | Get Interface MAC | ${nodes['${dut}']} | ${_avf}
380 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${_avf}
382 | | | ... | Get Interface VLAN | ${nodes['${dut}']} | ${_avf}
383 | | | Set List Value | ${${dut}_vf${pf}} | ${vf} | ${_avf}
384 | | | Set List Value | ${${dut}_vf${pf}_ip4_addr} | ${vf} | ${_ip4}
385 | | | Set List Value | ${${dut}_vf${pf}_ip4_prefix} | ${vf} | ${_ip4_prefix}
386 | | | Set List Value | ${${dut}_vf${pf}_mac} | ${vf} | ${_mac}
387 | | | Set List Value | ${${dut}_vf${pf}_pci} | ${vf} | ${_pci}
388 | | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan}
391 | Initialize layer af_xdp on node
393 | | ... | Initialize AF_XDP (eBPF) interfaces on DUT on NIC PF.
395 | | ... | *Arguments:*
396 | | ... | - dut - DUT node. Type: string
397 | | ... | - pf - NIC physical function (physical port). Type: integer
401 | | ... | \| Initialize layer af_xdp on node \| DUT1 \| 1 \|
403 | | [Arguments] | ${dut} | ${pf}
405 | | ${_af_xdp}= | VPP Create AF XDP Interface
406 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
407 | | ... | num_rx_queues=${65535}
408 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
409 | | ${cpu_skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM}+${CPU_CNT_MAIN}
410 | | ${cpu_skip_cnt}= | Evaluate | ${cpu_skip_cnt}+${cpu_count_int}
411 | | ${cpu_skip_cnt}= | Evaluate | ${cpu_skip_cnt}+(${pf}-${1})*${rxq_count_int}
412 | | Set Interface IRQs Affinity
413 | | ... | ${nodes['${dut}']} | ${_af_xdp}
414 | | ... | cpu_skip_cnt=${cpu_skip_cnt} | cpu_cnt=${rxq_count_int}
415 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_af_xdp}
417 | Initialize layer rdma-core on node
419 | | ... | Initialize rdma-core (Mellanox VPP) interfaces on DUT on NIC PF.
421 | | ... | *Arguments:*
422 | | ... | - dut - DUT node. Type: string
423 | | ... | - pf - NIC physical function (physical port). Type: integer
427 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
429 | | [Arguments] | ${dut} | ${pf}
431 | | ${_rdma}= | VPP Create Rdma Interface
432 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
433 | | ... | num_rx_queues=${rxq_count_int}
434 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
435 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_rdma}
437 | Initialize layer mlx5_core on node
439 | | ... | Initialize mlx5_core interfaces on DUT on NIC PF.
440 | | ... | Currently no operation.
444 | Initialize layer interface
446 | | ... | Physical interfaces variables to be created on all DUTs.
448 | | ... | *Arguments:*
449 | | ... | - count - Number of untagged interfaces variables. Type: integer
453 | | ... | \| Initialize layer interface \| 1 \|
455 | | [Arguments] | ${count}=${1}
457 | | FOR | ${dut} | IN | @{duts}
458 | | | Initialize layer interface on node | ${dut} | count=${count}
461 | Initialize layer interface on node
463 | | ... | Physical interfaces variables to be created on all DUTs.
465 | | ... | *Arguments:*
466 | | ... | - dut - DUT node. Type: string
467 | | ... | - count - Number of baseline interface variables. Type: integer
471 | | ... | \| Initialize layer interface on node \| DUT1 \| 1 \|
473 | | [Arguments] | ${dut} | ${count}=${1}
475 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
476 | | | Initialize layer interface on node on PF | ${dut} | ${pf} | count=${count}
479 | Initialize layer interface on node on PF
481 | | ... | Baseline interfaces variables to be created.
483 | | ... | *Arguments:*
484 | | ... | - dut - DUT node. Type: string
485 | | ... | - pf - NIC physical function (physical port). Type: integer
486 | | ... | - count - Number of baseline interface variables. Type: integer
490 | | ... | \| Initialize layer interface on node on PF \| DUT1 \| 1 \| 1 \|
492 | | [Arguments] | ${dut} | ${pf} | ${count}=${1}
494 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
495 | | | Set Test Variable
496 | | | ... | ${${dut}_${int}${pf}_${id}} | ${${dut}_${int}${pf}}
499 | Initialize layer bonding
501 | | ... | Bonded interfaces and variables to be created on all DUT's interfaces.
503 | | ... | *Arguments:*
504 | | ... | - bond_mode - Link bonding mode. Type: string
505 | | ... | - lb_mode - Load balance mode. Type: string
506 | | ... | - count - Number of bond interface variables. Type: integer
510 | | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \|
512 | | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
514 | | FOR | ${dut} | IN | @{duts}
515 | | | Initialize layer bonding on node
516 | | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode}
517 | | | ... | count=${count}
519 | | Set Test Variable | ${int} | bond
521 | Initialize layer bonding on node
523 | | ... | Bonded interface and variables to be created on across east and
524 | | ... | west DUT's node interfaces.
526 | | ... | *Arguments:*
527 | | ... | - dut - DUT node. Type: string
528 | | ... | - bond_mode - Link bonding mode. Type: string
529 | | ... | - lb_mode - Load balance mode. Type: string
530 | | ... | - count - Number of bond interface variables. Type: integer
534 | | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \|
536 | | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
538 | | ${if_index}= | VPP Create Bond Interface
539 | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode}
540 | | ... | mac=00:00:00:01:01:01
541 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up
542 | | VPP Add Bond Member
543 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_1} | ${if_index}
544 | | VPP Add Bond Member
545 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_1} | ${if_index}
546 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
547 | | | Set Test Variable | ${${dut}_bond1_${id}} | ${if_index}
548 | | | Set Test Variable | ${${dut}_bond2_${id}} | ${if_index}
551 | Initialize layer dot1q
553 | | ... | Dot1q interfaces and variables to be created on all DUTs.
555 | | ... | *Arguments:*
556 | | ... | - count - Number of chains.
557 | | ... | Type: integer
558 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
559 | | ... | Type: boolean
560 | | ... | - start - Id of first chain, allows adding chains during test.
561 | | ... | Type: integer
563 | | ... | \| Initialize layer dot1q \| 1 \| True \| 1 \|
565 | | [Arguments] | ${count}=${1} | ${vlan_per_chain}=${True} | ${start}=${1}
567 | | FOR | ${dut} | IN | @{duts}
568 | | | Initialize layer dot1q on node
569 | | | ... | ${dut} | count=${count} | vlan_per_chain=${vlan_per_chain}
570 | | | ... | start=${start}
572 | | Set Test Variable | ${int} | dot1q
574 | Initialize layer dot1q on node
576 | | ... | Dot1q interfaces and variables to be created on all DUT's node.
578 | | ... | *Arguments:*
579 | | ... | - dut - DUT node.
580 | | ... | Type: string
581 | | ... | - count - Number of chains.
582 | | ... | Type: integer
583 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
584 | | ... | Type: boolean
585 | | ... | - start - Id of first chain, allows adding chains during test.
586 | | ... | Type: integer
590 | | ... | \| Initialize layer dot1q on node \| DUT1 \| 1 \| True \| 1 \|
592 | | [Arguments] | ${dut} | ${count}=${1} | ${vlan_per_chain}=${True}
593 | | ... | ${start}=${1}
595 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
596 | | | Initialize layer dot1q on node on PF | ${dut} | pf=${pf} | count=${count}
597 | | | ... | vlan_per_chain=${vlan_per_chain} | start=${start}
600 | Initialize layer dot1q on node on PF
602 | | ... | Dot1q interfaces and variables to be created on all DUT's node
603 | | ... | interfaces.
605 | | ... | *Arguments:*
606 | | ... | - dut - DUT node.
607 | | ... | Type: string
608 | | ... | - pf - NIC physical function (physical port).
609 | | ... | Type: integer
610 | | ... | - count - Number of chains.
611 | | ... | Type: integer
612 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
613 | | ... | Type: boolean
614 | | ... | - start - Id of first chain, allows adding chains during test.
615 | | ... | Type: integer
619 | | ... | \| Initialize layer dot1q on node on PF \| DUT1 \| 3 \| True \| 2 \|
621 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1}
622 | | ... | ${vlan_per_chain}=${True} | ${start}=${1}
624 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
625 | | | ${_dot1q}= | Initialize layer dot1q on node on PF for chain
626 | | | ... | dut=${dut} | pf=${pf} | id=${id} | vlan_per_chain=${vlan_per_chain}
627 | | | # First id results in non-None indices, after that _1_ are defined.
628 | | | ${_dot1q}= | Set Variable If | '${_dot1q}' == '${NONE}'
629 | | | ... | ${${dut}_dot1q${pf}_1}[0] | ${_dot1q}
630 | | | ${_dot1q}= | Create List | ${_dot1q}
631 | | | Set Test Variable | ${${dut}_dot1q${pf}_${id}} | ${_dot1q}
634 | Initialize layer dot1q on node on PF for chain
636 | | ... | Optionally create tag popping subinterface per chain.
637 | | ... | Return interface indices for dot1q layer interfaces,
638 | | ... | or Nones if subinterfaces are not created.
640 | | ... | *Arguments:*
641 | | ... | - dut - DUT node.
642 | | ... | Type: string
643 | | ... | - pf - NIC physical function (physical port).
644 | | ... | Type: integer
645 | | ... | - id - Positive index of the chain.
646 | | ... | Type: integer
647 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
648 | | ... | Type: boolean
652 | | ... | \| Initialize layer dot1q on node on PF for chain \| DUT1 \
653 | | ... | \| 1 \| 1 \| True \|
655 | | [Arguments] | ${dut} | ${pf} | ${id} | ${vlan_per_chain}=${True}
657 | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
659 | | ${_default}= | Evaluate | ${pf} * ${100} + ${id} - ${1}
660 | | ${_vlan}= | Get Variable Value | \${${dut}_pf${pf}_vlan}
661 | | ${_vlan}= | Set Variable If | '${_vlan}[0]' != '${NONE}'
662 | | ... | ${_vlan}[0] | ${_default}
663 | | ${_name} | ${_index}= | Create Vlan Subinterface
664 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0] | ${_vlan}
665 | | Set Interface State | ${nodes['${dut}']} | ${_index} | up
666 | | Configure L2 tag rewrite method on interfaces
667 | | ... | ${nodes['${dut}']} | ${_index} | TAG_REWRITE_METHOD=pop-1
668 | | Return From Keyword | ${_index}
670 | Initialize layer ip4vxlan
672 | | ... | VXLAN interfaces and variables to be created on all DUT's interfaces.
674 | | ... | *Arguments:*
675 | | ... | - count - Number of vxlan interfaces.
676 | | ... | Type: integer
677 | | ... | - start - Id of first chain, allows adding chains during test.
678 | | ... | Type: integer
680 | | ... | \| Initialize layer ip4vxlan \| 3 \| 2 \|
682 | | [Arguments] | ${count}=${1} | ${start}=${1}
684 | | FOR | ${dut} | IN | @{duts}
685 | | | Initialize layer ip4vxlan on node | ${dut} | count=${count}
686 | | | ... | start=${start}
688 | | Set Test Variable | ${int} | ip4vxlan
690 | Initialize layer ip4vxlan on node
692 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
693 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
694 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
695 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
697 | | ... | *Arguments:*
698 | | ... | - dut - DUT node.
699 | | ... | Type: string
700 | | ... | - count - Number of vxlan interfaces.
701 | | ... | Type: integer
702 | | ... | - start - Id of first chain, allows adding chains during test.
703 | | ... | Type: integer
707 | | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 3 \| 2 \|
709 | | [Arguments] | ${dut} | ${count}=${1} | ${start}=${1}
711 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
712 | | | Initialize layer ip4vxlan on node on PF | ${dut} | pf=${pf}
713 | | | ... | count=${count} | start=${start}
716 | Initialize layer ip4vxlan on node on PF
718 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
719 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
720 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
721 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
723 | | ... | *Arguments:*
724 | | ... | - dut - DUT node.
725 | | ... | Type: string
726 | | ... | - pf - NIC physical function (physical port).
727 | | ... | Type: integer
728 | | ... | - count - Number of vxlan interfaces.
729 | | ... | Type: integer
730 | | ... | - start - Id of first chain, allows adding chains during test.
731 | | ... | Type: integer
735 | | ... | \| Initialize layer ip4vxlan on node on PF \| DUT1 \| 3 \| 2 \|
737 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1} | ${start}=${1}
739 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
740 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_1}[0]
741 | | ... | 172.${pf}6.0.1 | 24
742 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
743 | | | ${_subnet}= | Evaluate | ${id} - 1
744 | | | ${_vni}= | Evaluate | ${id} - 1
745 | | | ${_ip4vxlan}= | Create VXLAN interface
746 | | | ... | ${nodes['${dut}']} | ${_vni}
747 | | | ... | 172.${pf}6.0.1 | 172.${pf}7.${_subnet}.2
749 | | | ... | Set Variable If | '${dut}' == 'DUT1'
750 | | | ... | ${TG_pf1_mac}[0] | ${DUT1_pf2_mac}[0]
752 | | | ... | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2
753 | | | ... | ${DUT2_pf1_mac}[0] | ${TG_pf2_mac}[0]
754 | | | ${_even}= | Evaluate | ${pf} % 2
755 | | | ${_mac}= | Set Variable If | ${_even}
756 | | | ... | ${_prev_mac} | ${_next_mac}
757 | | | VPP Add IP Neighbor
758 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
759 | | | ... | 172.${pf}6.${_subnet}.2 | ${_mac}
761 | | | ... | ${nodes['${dut}']} | 172.${pf}7.${_subnet}.0 | 24
762 | | | ... | gateway=172.${pf}6.${_subnet}.2
763 | | | ... | interface=${${dut}_${int}${pf}_${id}}[0]
764 | | | Set VXLAN Bypass
765 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
766 | | | ${_ip4vxlan}= | Create List | ${_ip4vxlan}
767 | | | Set Test Variable
768 | | | ... | ${${dut}_ip4vxlan${pf}_${id}} | ${_ip4vxlan}
771 | Configure vhost interfaces
773 | | ... | Create two Vhost-User interfaces on defined VPP node.
775 | | ... | *Arguments:*
776 | | ... | - ${dut_node} - DUT node.
777 | | ... | Type: dictionary
778 | | ... | - ${sock1} - Socket path for first Vhost-User interface.
779 | | ... | Type: string
780 | | ... | - ${sock2} - Socket path for second Vhost-User interface.
781 | | ... | Type: string
782 | | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional).
783 | | ... | Type: string
784 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
785 | | ... | Type: string
786 | | ... | - ${is_server} - Server side of connection (Optional).
787 | | ... | Type: boolean
788 | | ... | - ${virtio_feature_mask} - Enabled Virtio feature flags (Optional).
789 | | ... | Type: integer
791 | | ... | _NOTE:_ This KW sets following test case variable:
792 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
793 | | ... | - ${${vhost_if2}} - Second Vhost-User interface.
797 | | ... | \| Configure vhost interfaces \
798 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \|
800 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
801 | | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False}
802 | | ... | ${virtio_feature_mask}=${None}
804 | | ${vhost_1}= | Vpp Create Vhost User Interface
805 | | ... | ${dut_node} | ${sock1} | is_server=${is_server}
806 | | ... | virtio_feature_mask=${virtio_feature_mask}
807 | | ${vhost_2}= | Vpp Create Vhost User Interface
808 | | ... | ${dut_node} | ${sock2} | is_server=${is_server}
809 | | ... | virtio_feature_mask=${virtio_feature_mask}
810 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
811 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
812 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}
813 | | ${vhost_2_mac}= | Get Interface MAC | ${dut_node} | ${vhost_2_key}
814 | | Set Interface State | ${dut_node} | ${vhost_1} | up
815 | | Set Interface State | ${dut_node} | ${vhost_2} | up
816 | | Set Test Variable | ${${vhost_if1}} | ${vhost_1}
817 | | Set Test Variable | ${${vhost_if2}} | ${vhost_2}
818 | | Set Test Variable | ${${vhost_if1}_mac} | ${vhost_1_mac}
819 | | Set Test Variable | ${${vhost_if2}_mac} | ${vhost_2_mac}
822 | | [Documentation] | Get vhost-user dump.
824 | | ... | *Arguments:*
825 | | ... | - dut - DUT node data.
826 | | ... | Type: dictionary
828 | | [Arguments] | ${dut}
830 | | ${vhost_dump}= | Vhost User Dump | ${dut}
831 | | Return From Keyword | ${vhost_dump}