1 # Copyright (c) 2020 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 | | FOR | ${dut} | IN | @{duts}
48 | | | Set interfaces in path up on node | ${dut}
50 | | All VPP Interfaces Ready Wait | ${nodes} | retries=${60}
52 | Set interfaces in path up on node
54 | | ... | *Set UP state on VPP interfaces in path on specified DUT node and
55 | | ... | set maximal MTU.*
57 | | ... | *Arguments:*
58 | | ... | - dut - DUT node on which to set the interfaces up.
59 | | ... | Type: string
63 | | ... | \| Set interfaces in path up on node \| DUT1 \|
65 | | [Arguments] | ${dut}
67 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
68 | | | Set interfaces in path up on node on PF | ${dut} | ${pf}
71 | Set interfaces in path up on node on PF
73 | | ... | *Set UP state on VPP interfaces in path on specified DUT node and
74 | | ... | set maximal MTU.*
76 | | ... | *Arguments:*
77 | | ... | - dut - DUT node on which to set the interfaces up.
78 | | ... | Type: string
79 | | ... | - pf - NIC physical function (physical port).
80 | | ... | Type: integer
84 | | ... | \| Set interfaces in path up on node on PF \| DUT1 \| 1 \|
86 | | [Arguments] | ${dut} | ${pf}
88 | | ${_chains} | ${value}= | Run Keyword And Ignore Error
89 | | ... | Variable Should Exist | @{${dut}_${int}${pf}_1}
90 | | ${_id}= | Set Variable If | '${_chains}' == 'PASS' | _1 | ${EMPTY}
91 | | FOR | ${if} | IN | @{${dut}_${int}${pf}${_id}}
92 | | | Set Interface State | ${nodes['${dut}']} | ${if} | up
93 | | | VPP Set Interface MTU | ${nodes['${dut}']} | ${if}
96 | Pre-initialize layer driver
98 | | ... | Pre-initialize driver based interfaces on each DUT.
100 | | ... | *Arguments:*
101 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
102 | | ... | Type: string
106 | | ... | \| Pre-initialize layer driver \| vfio-pci \|
108 | | [Arguments] | ${driver}
110 | | Run Keyword | Pre-initialize layer ${driver} on all DUTs
112 | Pre-initialize layer vfio-pci on all DUTs
114 | | ... | Pre-initialize vfio-pci driver by adding related sections to startup
115 | | ... | config on all DUTs.
117 | | ${index}= | Get Index From List | ${TEST TAGS} | DPDK
118 | | Run Keyword If | ${index} >= 0 | Return From Keyword
119 | | FOR | ${dut} | IN | @{duts}
120 | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci}
121 | | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
122 | | | ... | ${dut}.Add DPDK No Tx Checksum Offload
123 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
124 | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci
125 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
126 | | | Run Keyword If | not ${jumbo}
127 | | | ... | ${dut}.Add DPDK No Multi Seg
128 | | | Run Keyword If | ${nic_rxq_size} > 0
129 | | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size}
130 | | | Run Keyword If | ${nic_txq_size} > 0
131 | | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size}
132 | | | Run Keyword If | '${crypto_type}' != '${None}'
133 | | | ... | ${dut}.Add DPDK Cryptodev | ${thr_count_int}
135 | | ${_vlan_strip} | ${value}= | Run Keyword And Ignore Error
136 | | ... | Variable Should Exist | ${vlan_strip_off}
137 | | Run keyword If | '${_vlan_strip}' == 'PASS' and ${duts_count} == 2
138 | | ... | Add DPDK VLAN strip offload switch off between DUTs
140 | Pre-initialize layer avf on all DUTs
142 | | ... | Pre-initialize avf driver. Currently no operation.
146 | Pre-initialize layer rdma-core on all DUTs
148 | | ... | Pre-initialize rdma-core driver. Currently no operation.
152 | Pre-initialize layer mlx5_core on all DUTs
154 | | ... | Pre-initialize mlx5_core driver.
156 | | FOR | ${dut} | IN | @{duts}
157 | | | Run Keyword If | ${jumbo}
158 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200
160 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1500
163 | Initialize layer driver
165 | | ... | Initialize driver based interfaces on all DUT. Interfaces are
166 | | ... | brought up.
168 | | ... | *Arguments:*
169 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
170 | | ... | Type: string
174 | | ... | \| Initialize layer driver \| vfio-pci \|
176 | | [Arguments] | ${driver}
178 | | FOR | ${dut} | IN | @{duts}
179 | | | Initialize layer driver on node | ${dut} | ${driver}
181 | | Set Test Variable | ${int} | vf
182 | | Set interfaces in path up
184 | Initialize layer driver on node
186 | | ... | Initialize driver based interfaces on DUT.
188 | | ... | *Arguments:*
189 | | ... | - dut - DUT node.
190 | | ... | Type: string
191 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
192 | | ... | Type: string
196 | | ... | \| Initialize layer driver \| DUT1 \| vfio-pci \|
198 | | [Arguments] | ${dut} | ${driver}
200 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
202 | | | ... | Copy List | ${${dut}_${int}${pf}}
204 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_addr}
205 | | | ${_ip4_prefix}=
206 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_prefix}
208 | | | ... | Copy List | ${${dut}_${int}${pf}_mac}
210 | | | ... | Copy List | ${${dut}_${int}${pf}_pci}
212 | | | ... | Copy List | ${${dut}_${int}${pf}_vlan}
213 | | | Set Test Variable
214 | | | ... | ${${dut}_vf${pf}} | ${_vf}
215 | | | Set Test Variable
216 | | | ... | ${${dut}_vf${pf}_ip4_addr} | ${_ip4_addr}
217 | | | Set Suite Variable
218 | | | ... | ${${dut}_vf${pf}_ip4_prefix} | ${_ip4_prefix}
219 | | | Set Test Variable
220 | | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
221 | | | Set Test Variable
222 | | | ... | ${${dut}_vf${pf}_pci} | ${_pci}
223 | | | Set Test Variable
224 | | | ... | ${${dut}_vf${pf}_vlan} | ${_vlan}
225 | | | Run Keyword | Initialize layer ${driver} on node | ${dut} | ${pf}
228 | Initialize layer vfio-pci on node
230 | | ... | Initialize vfio-pci interfaces on DUT on NIC PF.
231 | | ... | Currently no operation.
233 | | ... | *Arguments:*
234 | | ... | - dut - DUT node. Type: string
235 | | ... | - pf - NIC physical function (physical port). Type: integer
239 | | ... | \| Initialize layer vfio-pci on node \| DUT1 \| 1 \|
241 | | [Arguments] | ${dut} | ${pf}
245 | Initialize layer avf on node
247 | | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF.
249 | | ... | *Arguments:*
250 | | ... | - dut - DUT node. Type: string
251 | | ... | - pf - NIC physical function (physical port). Type: integer
255 | | ... | \| Initialize layer avf on node \| DUT1 \| 1 \|
257 | | [Arguments] | ${dut} | ${pf}
259 | | FOR | ${vf} | IN RANGE | 0 | ${nic_vfs}
260 | | | ${_avf}= | VPP Create AVF Interface
261 | | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[${vf}]
262 | | | ... | num_rx_queues=${rxq_count_int}
263 | | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
265 | | | ... | Get Interface IP4 | ${nodes['${dut}']} | ${_avf}
266 | | | ${_ip4_prefix}=
267 | | | ... | Get Interface IP4 Prefix Length | ${nodes['${dut}']} | ${_avf}
269 | | | ... | Get Interface MAC | ${nodes['${dut}']} | ${_avf}
271 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${_avf}
273 | | | ... | Get Interface VLAN | ${nodes['${dut}']} | ${_avf}
274 | | | Set List Value | ${${dut}_vf${pf}} | ${vf} | ${_avf}
275 | | | Set List Value | ${${dut}_vf${pf}_ip4_addr} | ${vf} | ${_ip4}
276 | | | Set List Value | ${${dut}_vf${pf}_ip4_prefix} | ${vf} | ${_ip4_prefix}
277 | | | Set List Value | ${${dut}_vf${pf}_mac} | ${vf} | ${_mac}
278 | | | Set List Value | ${${dut}_vf${pf}_pci} | ${vf} | ${_pci}
279 | | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan}
282 | Initialize layer rdma-core on node
284 | | ... | Initialize rdma-core (Mellanox VPP) interfaces on DUT on NIC PF.
286 | | ... | *Arguments:*
287 | | ... | - dut - DUT node. Type: string
288 | | ... | - pf - NIC physical function (physical port). Type: integer
292 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
294 | | [Arguments] | ${dut} | ${pf}
296 | | ${_rdma}= | VPP Create Rdma Interface
297 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
298 | | ... | num_rx_queues=${rxq_count_int}
299 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
300 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_rdma}
302 | Initialize layer mlx5_core on node
304 | | ... | Initialize mlx5_core interfaces on DUT on NIC PF.
305 | | ... | Currently no operation.
309 | Initialize layer interface
311 | | ... | Physical interfaces variables to be created on all DUTs.
313 | | ... | *Arguments:*
314 | | ... | - count - Number of untagged interfaces variables. Type: integer
318 | | ... | \| Initialize layer interface \| 1 \|
320 | | [Arguments] | ${count}=${1}
322 | | FOR | ${dut} | IN | @{duts}
323 | | | Initialize layer interface on node | ${dut} | count=${count}
326 | Initialize layer interface on node
328 | | ... | Physical interfaces variables to be created on all DUTs.
330 | | ... | *Arguments:*
331 | | ... | - dut - DUT node. Type: string
332 | | ... | - count - Number of baseline interface variables. Type: integer
336 | | ... | \| Initialize layer interface on node \| DUT1 \| 1 \|
338 | | [Arguments] | ${dut} | ${count}=${1}
340 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
341 | | | Initialize layer interface on node on PF | ${dut} | ${pf} | count=${count}
344 | Initialize layer interface on node on PF
346 | | ... | Baseline interfaces variables to be created.
348 | | ... | *Arguments:*
349 | | ... | - dut - DUT node. Type: string
350 | | ... | - pf - NIC physical function (physical port). Type: integer
351 | | ... | - count - Number of baseline interface variables. Type: integer
355 | | ... | \| Initialize layer interface on node on PF \| DUT1 \| 1 \| 1 \|
357 | | [Arguments] | ${dut} | ${pf} | ${count}=${1}
359 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
360 | | | Set Test Variable
361 | | | ... | ${${dut}_${int}${pf}_${id}} | ${${dut}_${int}${pf}}
364 | Initialize layer bonding
366 | | ... | Bonded interfaces and variables to be created on all DUT's interfaces.
368 | | ... | *Arguments:*
369 | | ... | - bond_mode - Link bonding mode. Type: string
370 | | ... | - lb_mode - Load balance mode. Type: string
371 | | ... | - count - Number of bond interface variables. Type: integer
375 | | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \|
377 | | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
379 | | FOR | ${dut} | IN | @{duts}
380 | | | Initialize layer bonding on node
381 | | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode}
382 | | | ... | count=${count}
384 | | Set Test Variable | ${int} | bond
386 | Initialize layer bonding on node
388 | | ... | Bonded interface and variables to be created on across east and
389 | | ... | west DUT's node interfaces.
391 | | ... | *Arguments:*
392 | | ... | - dut - DUT node. Type: string
393 | | ... | - bond_mode - Link bonding mode. Type: string
394 | | ... | - lb_mode - Load balance mode. Type: string
395 | | ... | - count - Number of bond interface variables. Type: integer
399 | | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \|
401 | | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
403 | | ${if_index}= | VPP Create Bond Interface
404 | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode}
405 | | ... | mac=00:00:00:01:01:01
406 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up
407 | | VPP Enslave Physical Interface
408 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_1} | ${if_index}
409 | | VPP Enslave Physical Interface
410 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_1} | ${if_index}
411 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
412 | | | Set Test Variable | ${${dut}_bond1_${id}} | ${if_index}
413 | | | Set Test Variable | ${${dut}_bond2_${id}} | ${if_index}
416 | Initialize layer dot1q
418 | | ... | Dot1q interfaces and variables to be created on all DUTs.
420 | | ... | *Arguments:*
421 | | ... | - count - Number of chains.
422 | | ... | Type: integer
423 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
424 | | ... | Type: boolean
425 | | ... | - start - Id of first chain, allows adding chains during test.
426 | | ... | Type: integer
428 | | ... | \| Initialize layer dot1q \| 1 \| True \| 1 \|
430 | | [Arguments] | ${count}=${1} | ${vlan_per_chain}=${True} | ${start}=${1}
432 | | FOR | ${dut} | IN | @{duts}
433 | | | Initialize layer dot1q on node
434 | | | ... | ${dut} | count=${count} | vlan_per_chain=${vlan_per_chain}
435 | | | ... | start=${start}
437 | | Set Test Variable | ${int} | dot1q
439 | Initialize layer dot1q on node
441 | | ... | Dot1q interfaces and variables to be created on all DUT's node.
443 | | ... | *Arguments:*
444 | | ... | - dut - DUT node.
445 | | ... | Type: string
446 | | ... | - count - Number of chains.
447 | | ... | Type: integer
448 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
449 | | ... | Type: boolean
450 | | ... | - start - Id of first chain, allows adding chains during test.
451 | | ... | Type: integer
455 | | ... | \| Initialize layer dot1q on node \| DUT1 \| 1 \| True \| 1 \|
457 | | [Arguments] | ${dut} | ${count}=${1} | ${vlan_per_chain}=${True}
458 | | ... | ${start}=${1}
460 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
461 | | | Initialize layer dot1q on node on PF | ${dut} | pf=${pf} | count=${count}
462 | | | ... | vlan_per_chain=${vlan_per_chain} | start=${start}
465 | Initialize layer dot1q on node on PF
467 | | ... | Dot1q interfaces and variables to be created on all DUT's node
468 | | ... | interfaces.
470 | | ... | *Arguments:*
471 | | ... | - dut - DUT node.
472 | | ... | Type: string
473 | | ... | - pf - NIC physical function (physical port).
474 | | ... | Type: integer
475 | | ... | - count - Number of chains.
476 | | ... | Type: integer
477 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
478 | | ... | Type: boolean
479 | | ... | - start - Id of first chain, allows adding chains during test.
480 | | ... | Type: integer
484 | | ... | \| Initialize layer dot1q on node on PF \| DUT1 \| 3 \| True \| 2 \|
486 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1}
487 | | ... | ${vlan_per_chain}=${True} | ${start}=${1}
489 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
490 | | | ${_dot1q}= | Initialize layer dot1q on node on PF for chain
491 | | | ... | dut=${dut} | pf=${pf} | id=${id} | vlan_per_chain=${vlan_per_chain}
492 | | | # First id results in non-None indices, after that _1_ are defined.
493 | | | ${_dot1q}= | Set Variable If | '${_dot1q}' == '${NONE}'
494 | | | ... | ${${dut}_dot1q${pf}_1} | ${_dot1q}
495 | | | ${_dot1q}= | Create List | ${_dot1q}
496 | | | Set Test Variable | ${${dut}_dot1q${pf}_${id}} | ${_dot1q}
499 | Initialize layer dot1q on node on PF for chain
501 | | ... | Optionally create tag popping subinterface per chain.
502 | | ... | Return interface indices for dot1q layer interfaces,
503 | | ... | or Nones if subinterfaces are not created.
505 | | ... | *Arguments:*
506 | | ... | - dut - DUT node.
507 | | ... | Type: string
508 | | ... | - pf - NIC physical function (physical port).
509 | | ... | Type: integer
510 | | ... | - id - Positive index of the chain.
511 | | ... | Type: integer
512 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
513 | | ... | Type: boolean
517 | | ... | \| Initialize layer dot1q on node on PF for chain \| DUT1 \
518 | | ... | \| 1 \| 1 \| True \|
520 | | [Arguments] | ${dut} | ${pf} | ${id} | ${vlan_per_chain}=${True}
522 | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
523 | | ... | ${NONE} | ${NONE}
524 | | ${_default}= | Evaluate | ${pf} * ${100} + ${id} - ${1}
525 | | ${_vlan}= | Get Variable Value | \${${dut}_pf${pf}_vlan}
526 | | ${_vlan}= | Set Variable If | '${_vlan}[0]' != '${NONE}'
527 | | ... | ${_vlan}[0] | ${_default}
528 | | ${_name} | ${_index}= | Create Vlan Subinterface
529 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0] | ${_vlan}
530 | | Set Interface State | ${nodes['${dut}']} | ${_index} | up
531 | | Configure L2 tag rewrite method on interfaces
532 | | ... | ${nodes['${dut}']} | ${_index} | TAG_REWRITE_METHOD=pop-1
533 | | Return From Keyword | ${_index}
535 | Initialize layer ip4vxlan
537 | | ... | VXLAN interfaces and variables to be created on all DUT's interfaces.
539 | | ... | *Arguments:*
540 | | ... | - count - Number of vxlan interfaces.
541 | | ... | Type: integer
542 | | ... | - start - Id of first chain, allows adding chains during test.
543 | | ... | Type: integer
545 | | ... | \| Initialize layer ip4vxlan \| 3 \| 2 \|
547 | | [Arguments] | ${count}=${1} | ${start}=${1}
549 | | FOR | ${dut} | IN | @{duts}
550 | | | Initialize layer ip4vxlan on node | ${dut} | count=${count}
551 | | | ... | start=${start}
553 | | Set Test Variable | ${int} | ip4vxlan
555 | Initialize layer ip4vxlan on node
557 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
558 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
559 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
560 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
562 | | ... | *Arguments:*
563 | | ... | - dut - DUT node.
564 | | ... | Type: string
565 | | ... | - count - Number of vxlan interfaces.
566 | | ... | Type: integer
567 | | ... | - start - Id of first chain, allows adding chains during test.
568 | | ... | Type: integer
572 | | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 3 \| 2 \|
574 | | [Arguments] | ${dut} | ${count}=${1} | ${start}=${1}
576 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
577 | | | Initialize layer ip4vxlan on node on PF | ${dut} | pf=${pf}
578 | | | ... | count=${count} | start=${start}
581 | Initialize layer ip4vxlan on node on PF
583 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
584 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
585 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
586 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
588 | | ... | *Arguments:*
589 | | ... | - dut - DUT node.
590 | | ... | Type: string
591 | | ... | - pf - NIC physical function (physical port).
592 | | ... | Type: integer
593 | | ... | - count - Number of vxlan interfaces.
594 | | ... | Type: integer
595 | | ... | - start - Id of first chain, allows adding chains during test.
596 | | ... | Type: integer
600 | | ... | \| Initialize layer ip4vxlan on node on PF \| DUT1 \| 3 \| 2 \|
602 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1} | ${start}=${1}
604 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
605 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_1}[0]
606 | | ... | 172.${pf}6.0.1 | 24
607 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
608 | | | ${_subnet}= | Evaluate | ${id} - 1
609 | | | ${_vni}= | Evaluate | ${id} - 1
610 | | | ${_ip4vxlan}= | Create VXLAN interface
611 | | | ... | ${nodes['${dut}']} | ${_vni}
612 | | | ... | 172.${pf}6.0.1 | 172.${pf}7.${_subnet}.2
614 | | | ... | Set Variable If | '${dut}' == 'DUT1'
615 | | | ... | ${TG_pf1_mac}[0] | ${DUT1_pf2_mac}[0]
617 | | | ... | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2
618 | | | ... | ${DUT2_pf1_mac}[0] | ${TG_pf2_mac}[0]
619 | | | ${_even}= | Evaluate | ${pf} % 2
620 | | | ${_mac}= | Set Variable If | ${_even}
621 | | | ... | ${_prev_mac} | ${_next_mac}
622 | | | VPP Add IP Neighbor
623 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
624 | | | ... | 172.${pf}6.${_subnet}.2 | ${_mac}
626 | | | ... | ${nodes['${dut}']} | 172.${pf}7.${_subnet}.0 | 24
627 | | | ... | gateway=172.${pf}6.${_subnet}.2
628 | | | ... | interface=${${dut}_${int}${pf}_${id}}[0]
629 | | | Set VXLAN Bypass
630 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
631 | | | ${_ip4vxlan}= | Create List | ${_ip4vxlan}
632 | | | Set Test Variable
633 | | | ... | ${${dut}_ip4vxlan${pf}_${id}} | ${_ip4vxlan}
636 | Configure vhost interfaces
638 | | ... | Create two Vhost-User interfaces on defined VPP node.
640 | | ... | *Arguments:*
641 | | ... | - ${dut_node} - DUT node.
642 | | ... | Type: dictionary
643 | | ... | - ${sock1} - Socket path for first Vhost-User interface.
644 | | ... | Type: string
645 | | ... | - ${sock2} - Socket path for second Vhost-User interface.
646 | | ... | Type: string
647 | | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional).
648 | | ... | Type: string
649 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
650 | | ... | Type: string
651 | | ... | - ${is_server} - Server side of connection (Optional).
652 | | ... | Type: boolean
653 | | ... | - ${enable_gso} - Generic segmentation offloading (Optional).
654 | | ... | Type: boolean
656 | | ... | _NOTE:_ This KW sets following test case variable:
657 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
658 | | ... | - ${${vhost_if2}} - Second Vhost-User interface.
662 | | ... | \| Configure vhost interfaces \
663 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \|
665 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
666 | | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False}
667 | | ... | ${enable_gso}=${False}
669 | | ${vhost_1}= | Vpp Create Vhost User Interface
670 | | ... | ${dut_node} | ${sock1} | is_server=${is_server}
671 | | ... | enable_gso=${enable_gso}
672 | | ${vhost_2}= | Vpp Create Vhost User Interface
673 | | ... | ${dut_node} | ${sock2} | is_server=${is_server}
674 | | ... | enable_gso=${enable_gso}
675 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
676 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
677 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}
678 | | ${vhost_2_mac}= | Get Interface MAC | ${dut_node} | ${vhost_2_key}
679 | | Set Interface State | ${dut_node} | ${vhost_1} | up
680 | | Set Interface State | ${dut_node} | ${vhost_2} | up
681 | | Set Test Variable | ${${vhost_if1}} | ${vhost_1}
682 | | Set Test Variable | ${${vhost_if2}} | ${vhost_2}
683 | | Set Test Variable | ${${vhost_if1}_mac} | ${vhost_1_mac}
684 | | Set Test Variable | ${${vhost_if2}_mac} | ${vhost_2_mac}
687 | | [Documentation] | Get vhost-user dump.
689 | | ... | *Arguments:*
690 | | ... | - dut - DUT node data.
691 | | ... | Type: dictionary
693 | | [Arguments] | ${dut}
695 | | ${vhost_dump}= | Vhost User Dump | ${dut}
696 | | Return From Keyword | ${vhost_dump}