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 | | | Stop VPP Service | ${nodes['${dut}']}
121 | | | PCI Driver Unbind List | ${nodes['${dut}']} | @{${dut}_pf_pci}
122 | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci}
123 | | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
124 | | | ... | ${dut}.Add DPDK No Tx Checksum Offload
125 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
126 | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci
127 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
128 | | | Run Keyword If | not ${jumbo}
129 | | | ... | ${dut}.Add DPDK No Multi Seg
130 | | | Run Keyword If | ${nic_rxq_size} > 0
131 | | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size}
132 | | | Run Keyword If | ${nic_txq_size} > 0
133 | | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size}
134 | | | Run Keyword If | '${crypto_type}' != '${None}'
135 | | | ... | ${dut}.Add DPDK Cryptodev | ${thr_count_int}
137 | | ${_vlan_strip} | ${value}= | Run Keyword And Ignore Error
138 | | ... | Variable Should Exist | ${vlan_strip_off}
139 | | Run keyword If | '${_vlan_strip}' == 'PASS' and ${duts_count} == 2
140 | | ... | Add DPDK VLAN strip offload switch off between DUTs
142 | Pre-initialize layer avf on all DUTs
144 | | ... | Pre-initialize avf driver. Currently no operation.
148 | Pre-initialize layer rdma-core on all DUTs
150 | | ... | Pre-initialize rdma-core driver.
152 | | FOR | ${dut} | IN | @{duts}
153 | | | Set Interface Flow Control
154 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rx="off" | tx="off"
155 | | | Set PCI Parameter
156 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD"
159 | Pre-initialize layer mlx5_core on all DUTs
161 | | ... | Pre-initialize mlx5_core driver.
163 | | FOR | ${dut} | IN | @{duts}
164 | | | Run Keyword If | ${jumbo}
165 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200
167 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1500
168 | | | Set Interface Flow Control
169 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rx="off" | tx="off"
170 | | | Set PCI Parameter
171 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD"
174 | Initialize layer driver
176 | | ... | Initialize driver based interfaces on all DUT. Interfaces are
177 | | ... | brought up.
179 | | ... | *Arguments:*
180 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
181 | | ... | Type: string
185 | | ... | \| Initialize layer driver \| vfio-pci \|
187 | | [Arguments] | ${driver}
189 | | FOR | ${dut} | IN | @{duts}
190 | | | Initialize layer driver on node | ${dut} | ${driver}
192 | | Set Test Variable | ${int} | vf
193 | | Set interfaces in path up
195 | Initialize layer driver on node
197 | | ... | Initialize driver based interfaces on DUT.
199 | | ... | *Arguments:*
200 | | ... | - dut - DUT node.
201 | | ... | Type: string
202 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
203 | | ... | Type: string
207 | | ... | \| Initialize layer driver \| DUT1 \| vfio-pci \|
209 | | [Arguments] | ${dut} | ${driver}
211 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
213 | | | ... | Copy List | ${${dut}_${int}${pf}}
215 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_addr}
216 | | | ${_ip4_prefix}=
217 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_prefix}
219 | | | ... | Copy List | ${${dut}_${int}${pf}_mac}
221 | | | ... | Copy List | ${${dut}_${int}${pf}_pci}
223 | | | ... | Copy List | ${${dut}_${int}${pf}_vlan}
224 | | | Set Test Variable
225 | | | ... | ${${dut}_vf${pf}} | ${_vf}
226 | | | Set Test Variable
227 | | | ... | ${${dut}_vf${pf}_ip4_addr} | ${_ip4_addr}
228 | | | Set Suite Variable
229 | | | ... | ${${dut}_vf${pf}_ip4_prefix} | ${_ip4_prefix}
230 | | | Set Test Variable
231 | | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
232 | | | Set Test Variable
233 | | | ... | ${${dut}_vf${pf}_pci} | ${_pci}
234 | | | Set Test Variable
235 | | | ... | ${${dut}_vf${pf}_vlan} | ${_vlan}
236 | | | Run Keyword | Initialize layer ${driver} on node | ${dut} | ${pf}
239 | Initialize layer vfio-pci on node
241 | | ... | Initialize vfio-pci interfaces on DUT on NIC PF.
242 | | ... | Currently no operation.
244 | | ... | *Arguments:*
245 | | ... | - dut - DUT node. Type: string
246 | | ... | - pf - NIC physical function (physical port). Type: integer
250 | | ... | \| Initialize layer vfio-pci on node \| DUT1 \| 1 \|
252 | | [Arguments] | ${dut} | ${pf}
256 | Initialize layer avf on node
258 | | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF.
260 | | ... | *Arguments:*
261 | | ... | - dut - DUT node. Type: string
262 | | ... | - pf - NIC physical function (physical port). Type: integer
266 | | ... | \| Initialize layer avf on node \| DUT1 \| 1 \|
268 | | [Arguments] | ${dut} | ${pf}
270 | | FOR | ${vf} | IN RANGE | 0 | ${nic_vfs}
271 | | | ${_avf}= | VPP Create AVF Interface
272 | | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[${vf}]
273 | | | ... | num_rx_queues=${rxq_count_int}
274 | | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
276 | | | ... | Get Interface IP4 | ${nodes['${dut}']} | ${_avf}
277 | | | ${_ip4_prefix}=
278 | | | ... | Get Interface IP4 Prefix Length | ${nodes['${dut}']} | ${_avf}
280 | | | ... | Get Interface MAC | ${nodes['${dut}']} | ${_avf}
282 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${_avf}
284 | | | ... | Get Interface VLAN | ${nodes['${dut}']} | ${_avf}
285 | | | Set List Value | ${${dut}_vf${pf}} | ${vf} | ${_avf}
286 | | | Set List Value | ${${dut}_vf${pf}_ip4_addr} | ${vf} | ${_ip4}
287 | | | Set List Value | ${${dut}_vf${pf}_ip4_prefix} | ${vf} | ${_ip4_prefix}
288 | | | Set List Value | ${${dut}_vf${pf}_mac} | ${vf} | ${_mac}
289 | | | Set List Value | ${${dut}_vf${pf}_pci} | ${vf} | ${_pci}
290 | | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan}
293 | Initialize layer rdma-core on node
295 | | ... | Initialize rdma-core (Mellanox VPP) interfaces on DUT on NIC PF.
297 | | ... | *Arguments:*
298 | | ... | - dut - DUT node. Type: string
299 | | ... | - pf - NIC physical function (physical port). Type: integer
303 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
305 | | [Arguments] | ${dut} | ${pf}
307 | | ${_rdma}= | VPP Create Rdma Interface
308 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
309 | | ... | num_rx_queues=${rxq_count_int}
310 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
311 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_rdma}
313 | Initialize layer mlx5_core on node
315 | | ... | Initialize mlx5_core interfaces on DUT on NIC PF.
316 | | ... | Currently no operation.
320 | Initialize layer interface
322 | | ... | Physical interfaces variables to be created on all DUTs.
324 | | ... | *Arguments:*
325 | | ... | - count - Number of untagged interfaces variables. Type: integer
329 | | ... | \| Initialize layer interface \| 1 \|
331 | | [Arguments] | ${count}=${1}
333 | | FOR | ${dut} | IN | @{duts}
334 | | | Initialize layer interface on node | ${dut} | count=${count}
337 | Initialize layer interface on node
339 | | ... | Physical interfaces variables to be created on all DUTs.
341 | | ... | *Arguments:*
342 | | ... | - dut - DUT node. Type: string
343 | | ... | - count - Number of baseline interface variables. Type: integer
347 | | ... | \| Initialize layer interface on node \| DUT1 \| 1 \|
349 | | [Arguments] | ${dut} | ${count}=${1}
351 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
352 | | | Initialize layer interface on node on PF | ${dut} | ${pf} | count=${count}
355 | Initialize layer interface on node on PF
357 | | ... | Baseline interfaces variables to be created.
359 | | ... | *Arguments:*
360 | | ... | - dut - DUT node. Type: string
361 | | ... | - pf - NIC physical function (physical port). Type: integer
362 | | ... | - count - Number of baseline interface variables. Type: integer
366 | | ... | \| Initialize layer interface on node on PF \| DUT1 \| 1 \| 1 \|
368 | | [Arguments] | ${dut} | ${pf} | ${count}=${1}
370 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
371 | | | Set Test Variable
372 | | | ... | ${${dut}_${int}${pf}_${id}} | ${${dut}_${int}${pf}}
375 | Initialize layer bonding
377 | | ... | Bonded interfaces and variables to be created on all DUT's interfaces.
379 | | ... | *Arguments:*
380 | | ... | - bond_mode - Link bonding mode. Type: string
381 | | ... | - lb_mode - Load balance mode. Type: string
382 | | ... | - count - Number of bond interface variables. Type: integer
386 | | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \|
388 | | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
390 | | FOR | ${dut} | IN | @{duts}
391 | | | Initialize layer bonding on node
392 | | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode}
393 | | | ... | count=${count}
395 | | Set Test Variable | ${int} | bond
397 | Initialize layer bonding on node
399 | | ... | Bonded interface and variables to be created on across east and
400 | | ... | west DUT's node interfaces.
402 | | ... | *Arguments:*
403 | | ... | - dut - DUT node. Type: string
404 | | ... | - bond_mode - Link bonding mode. Type: string
405 | | ... | - lb_mode - Load balance mode. Type: string
406 | | ... | - count - Number of bond interface variables. Type: integer
410 | | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \|
412 | | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
414 | | ${if_index}= | VPP Create Bond Interface
415 | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode}
416 | | ... | mac=00:00:00:01:01:01
417 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up
418 | | VPP Enslave Physical Interface
419 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_1} | ${if_index}
420 | | VPP Enslave Physical Interface
421 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_1} | ${if_index}
422 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
423 | | | Set Test Variable | ${${dut}_bond1_${id}} | ${if_index}
424 | | | Set Test Variable | ${${dut}_bond2_${id}} | ${if_index}
427 | Initialize layer dot1q
429 | | ... | Dot1q interfaces and variables to be created on all DUTs.
431 | | ... | *Arguments:*
432 | | ... | - count - Number of chains.
433 | | ... | Type: integer
434 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
435 | | ... | Type: boolean
436 | | ... | - start - Id of first chain, allows adding chains during test.
437 | | ... | Type: integer
439 | | ... | \| Initialize layer dot1q \| 1 \| True \| 1 \|
441 | | [Arguments] | ${count}=${1} | ${vlan_per_chain}=${True} | ${start}=${1}
443 | | FOR | ${dut} | IN | @{duts}
444 | | | Initialize layer dot1q on node
445 | | | ... | ${dut} | count=${count} | vlan_per_chain=${vlan_per_chain}
446 | | | ... | start=${start}
448 | | Set Test Variable | ${int} | dot1q
450 | Initialize layer dot1q on node
452 | | ... | Dot1q interfaces and variables to be created on all DUT's node.
454 | | ... | *Arguments:*
455 | | ... | - dut - DUT node.
456 | | ... | Type: string
457 | | ... | - count - Number of chains.
458 | | ... | Type: integer
459 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
460 | | ... | Type: boolean
461 | | ... | - start - Id of first chain, allows adding chains during test.
462 | | ... | Type: integer
466 | | ... | \| Initialize layer dot1q on node \| DUT1 \| 1 \| True \| 1 \|
468 | | [Arguments] | ${dut} | ${count}=${1} | ${vlan_per_chain}=${True}
469 | | ... | ${start}=${1}
471 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
472 | | | Initialize layer dot1q on node on PF | ${dut} | pf=${pf} | count=${count}
473 | | | ... | vlan_per_chain=${vlan_per_chain} | start=${start}
476 | Initialize layer dot1q on node on PF
478 | | ... | Dot1q interfaces and variables to be created on all DUT's node
479 | | ... | interfaces.
481 | | ... | *Arguments:*
482 | | ... | - dut - DUT node.
483 | | ... | Type: string
484 | | ... | - pf - NIC physical function (physical port).
485 | | ... | Type: integer
486 | | ... | - count - Number of chains.
487 | | ... | Type: integer
488 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
489 | | ... | Type: boolean
490 | | ... | - start - Id of first chain, allows adding chains during test.
491 | | ... | Type: integer
495 | | ... | \| Initialize layer dot1q on node on PF \| DUT1 \| 3 \| True \| 2 \|
497 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1}
498 | | ... | ${vlan_per_chain}=${True} | ${start}=${1}
500 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
501 | | | ${_dot1q}= | Initialize layer dot1q on node on PF for chain
502 | | | ... | dut=${dut} | pf=${pf} | id=${id} | vlan_per_chain=${vlan_per_chain}
503 | | | # First id results in non-None indices, after that _1_ are defined.
504 | | | ${_dot1q}= | Set Variable If | '${_dot1q}' == '${NONE}'
505 | | | ... | ${${dut}_dot1q${pf}_1}[0] | ${_dot1q}
506 | | | ${_dot1q}= | Create List | ${_dot1q}
507 | | | Set Test Variable | ${${dut}_dot1q${pf}_${id}} | ${_dot1q}
510 | Initialize layer dot1q on node on PF for chain
512 | | ... | Optionally create tag popping subinterface per chain.
513 | | ... | Return interface indices for dot1q layer interfaces,
514 | | ... | or Nones if subinterfaces are not created.
516 | | ... | *Arguments:*
517 | | ... | - dut - DUT node.
518 | | ... | Type: string
519 | | ... | - pf - NIC physical function (physical port).
520 | | ... | Type: integer
521 | | ... | - id - Positive index of the chain.
522 | | ... | Type: integer
523 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
524 | | ... | Type: boolean
528 | | ... | \| Initialize layer dot1q on node on PF for chain \| DUT1 \
529 | | ... | \| 1 \| 1 \| True \|
531 | | [Arguments] | ${dut} | ${pf} | ${id} | ${vlan_per_chain}=${True}
533 | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
535 | | ${_default}= | Evaluate | ${pf} * ${100} + ${id} - ${1}
536 | | ${_vlan}= | Get Variable Value | \${${dut}_pf${pf}_vlan}
537 | | ${_vlan}= | Set Variable If | '${_vlan}[0]' != '${NONE}'
538 | | ... | ${_vlan}[0] | ${_default}
539 | | ${_name} | ${_index}= | Create Vlan Subinterface
540 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0] | ${_vlan}
541 | | Set Interface State | ${nodes['${dut}']} | ${_index} | up
542 | | Configure L2 tag rewrite method on interfaces
543 | | ... | ${nodes['${dut}']} | ${_index} | TAG_REWRITE_METHOD=pop-1
544 | | Return From Keyword | ${_index}
546 | Initialize layer ip4vxlan
548 | | ... | VXLAN interfaces and variables to be created on all DUT's interfaces.
550 | | ... | *Arguments:*
551 | | ... | - count - Number of vxlan interfaces.
552 | | ... | Type: integer
553 | | ... | - start - Id of first chain, allows adding chains during test.
554 | | ... | Type: integer
556 | | ... | \| Initialize layer ip4vxlan \| 3 \| 2 \|
558 | | [Arguments] | ${count}=${1} | ${start}=${1}
560 | | FOR | ${dut} | IN | @{duts}
561 | | | Initialize layer ip4vxlan on node | ${dut} | count=${count}
562 | | | ... | start=${start}
564 | | Set Test Variable | ${int} | ip4vxlan
566 | Initialize layer ip4vxlan on node
568 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
569 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
570 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
571 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
573 | | ... | *Arguments:*
574 | | ... | - dut - DUT node.
575 | | ... | Type: string
576 | | ... | - count - Number of vxlan interfaces.
577 | | ... | Type: integer
578 | | ... | - start - Id of first chain, allows adding chains during test.
579 | | ... | Type: integer
583 | | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 3 \| 2 \|
585 | | [Arguments] | ${dut} | ${count}=${1} | ${start}=${1}
587 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
588 | | | Initialize layer ip4vxlan on node on PF | ${dut} | pf=${pf}
589 | | | ... | count=${count} | start=${start}
592 | Initialize layer ip4vxlan on node on PF
594 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
595 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
596 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
597 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
599 | | ... | *Arguments:*
600 | | ... | - dut - DUT node.
601 | | ... | Type: string
602 | | ... | - pf - NIC physical function (physical port).
603 | | ... | Type: integer
604 | | ... | - count - Number of vxlan interfaces.
605 | | ... | Type: integer
606 | | ... | - start - Id of first chain, allows adding chains during test.
607 | | ... | Type: integer
611 | | ... | \| Initialize layer ip4vxlan on node on PF \| DUT1 \| 3 \| 2 \|
613 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1} | ${start}=${1}
615 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
616 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_1}[0]
617 | | ... | 172.${pf}6.0.1 | 24
618 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
619 | | | ${_subnet}= | Evaluate | ${id} - 1
620 | | | ${_vni}= | Evaluate | ${id} - 1
621 | | | ${_ip4vxlan}= | Create VXLAN interface
622 | | | ... | ${nodes['${dut}']} | ${_vni}
623 | | | ... | 172.${pf}6.0.1 | 172.${pf}7.${_subnet}.2
625 | | | ... | Set Variable If | '${dut}' == 'DUT1'
626 | | | ... | ${TG_pf1_mac}[0] | ${DUT1_pf2_mac}[0]
628 | | | ... | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2
629 | | | ... | ${DUT2_pf1_mac}[0] | ${TG_pf2_mac}[0]
630 | | | ${_even}= | Evaluate | ${pf} % 2
631 | | | ${_mac}= | Set Variable If | ${_even}
632 | | | ... | ${_prev_mac} | ${_next_mac}
633 | | | VPP Add IP Neighbor
634 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
635 | | | ... | 172.${pf}6.${_subnet}.2 | ${_mac}
637 | | | ... | ${nodes['${dut}']} | 172.${pf}7.${_subnet}.0 | 24
638 | | | ... | gateway=172.${pf}6.${_subnet}.2
639 | | | ... | interface=${${dut}_${int}${pf}_${id}}[0]
640 | | | Set VXLAN Bypass
641 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
642 | | | ${_ip4vxlan}= | Create List | ${_ip4vxlan}
643 | | | Set Test Variable
644 | | | ... | ${${dut}_ip4vxlan${pf}_${id}} | ${_ip4vxlan}
647 | Configure vhost interfaces
649 | | ... | Create two Vhost-User interfaces on defined VPP node.
651 | | ... | *Arguments:*
652 | | ... | - ${dut_node} - DUT node.
653 | | ... | Type: dictionary
654 | | ... | - ${sock1} - Socket path for first Vhost-User interface.
655 | | ... | Type: string
656 | | ... | - ${sock2} - Socket path for second Vhost-User interface.
657 | | ... | Type: string
658 | | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional).
659 | | ... | Type: string
660 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
661 | | ... | Type: string
662 | | ... | - ${is_server} - Server side of connection (Optional).
663 | | ... | Type: boolean
664 | | ... | - ${virtio_feature_mask} - Enabled Virtio feature flags (Optional).
665 | | ... | Type: integer
667 | | ... | _NOTE:_ This KW sets following test case variable:
668 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
669 | | ... | - ${${vhost_if2}} - Second Vhost-User interface.
673 | | ... | \| Configure vhost interfaces \
674 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \|
676 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
677 | | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False}
678 | | ... | ${virtio_feature_mask}=${None}
680 | | ${vhost_1}= | Vpp Create Vhost User Interface
681 | | ... | ${dut_node} | ${sock1} | is_server=${is_server}
682 | | ... | virtio_feature_mask=${virtio_feature_mask}
683 | | ${vhost_2}= | Vpp Create Vhost User Interface
684 | | ... | ${dut_node} | ${sock2} | is_server=${is_server}
685 | | ... | virtio_feature_mask=${virtio_feature_mask}
686 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
687 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
688 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}
689 | | ${vhost_2_mac}= | Get Interface MAC | ${dut_node} | ${vhost_2_key}
690 | | Set Interface State | ${dut_node} | ${vhost_1} | up
691 | | Set Interface State | ${dut_node} | ${vhost_2} | up
692 | | Set Test Variable | ${${vhost_if1}} | ${vhost_1}
693 | | Set Test Variable | ${${vhost_if2}} | ${vhost_2}
694 | | Set Test Variable | ${${vhost_if1}_mac} | ${vhost_1_mac}
695 | | Set Test Variable | ${${vhost_if2}_mac} | ${vhost_2_mac}
698 | | [Documentation] | Get vhost-user dump.
700 | | ... | *Arguments:*
701 | | ... | - dut - DUT node data.
702 | | ... | Type: dictionary
704 | | [Arguments] | ${dut}
706 | | ${vhost_dump}= | Vhost User Dump | ${dut}
707 | | Return From Keyword | ${vhost_dump}