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.
150 | | FOR | ${dut} | IN | @{duts}
151 | | | Set Interface Flow Control
152 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rx="off" | tx="off"
153 | | | Set PCI Parameter
154 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD"
157 | Pre-initialize layer mlx5_core on all DUTs
159 | | ... | Pre-initialize mlx5_core driver.
161 | | FOR | ${dut} | IN | @{duts}
162 | | | Run Keyword If | ${jumbo}
163 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200
165 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1500
166 | | | Set Interface Flow Control
167 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rx="off" | tx="off"
168 | | | Set PCI Parameter
169 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD"
172 | Initialize layer driver
174 | | ... | Initialize driver based interfaces on all DUT. Interfaces are
175 | | ... | brought up.
177 | | ... | *Arguments:*
178 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
179 | | ... | Type: string
183 | | ... | \| Initialize layer driver \| vfio-pci \|
185 | | [Arguments] | ${driver}
187 | | FOR | ${dut} | IN | @{duts}
188 | | | Initialize layer driver on node | ${dut} | ${driver}
190 | | Set Test Variable | ${int} | vf
191 | | Set interfaces in path up
193 | Initialize layer driver on node
195 | | ... | Initialize driver based interfaces on DUT.
197 | | ... | *Arguments:*
198 | | ... | - dut - DUT node.
199 | | ... | Type: string
200 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
201 | | ... | Type: string
205 | | ... | \| Initialize layer driver \| DUT1 \| vfio-pci \|
207 | | [Arguments] | ${dut} | ${driver}
209 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
211 | | | ... | Copy List | ${${dut}_${int}${pf}}
213 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_addr}
214 | | | ${_ip4_prefix}=
215 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_prefix}
217 | | | ... | Copy List | ${${dut}_${int}${pf}_mac}
219 | | | ... | Copy List | ${${dut}_${int}${pf}_pci}
221 | | | ... | Copy List | ${${dut}_${int}${pf}_vlan}
222 | | | Set Test Variable
223 | | | ... | ${${dut}_vf${pf}} | ${_vf}
224 | | | Set Test Variable
225 | | | ... | ${${dut}_vf${pf}_ip4_addr} | ${_ip4_addr}
226 | | | Set Suite Variable
227 | | | ... | ${${dut}_vf${pf}_ip4_prefix} | ${_ip4_prefix}
228 | | | Set Test Variable
229 | | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
230 | | | Set Test Variable
231 | | | ... | ${${dut}_vf${pf}_pci} | ${_pci}
232 | | | Set Test Variable
233 | | | ... | ${${dut}_vf${pf}_vlan} | ${_vlan}
234 | | | Run Keyword | Initialize layer ${driver} on node | ${dut} | ${pf}
237 | Initialize layer vfio-pci on node
239 | | ... | Initialize vfio-pci interfaces on DUT on NIC PF.
240 | | ... | Currently no operation.
242 | | ... | *Arguments:*
243 | | ... | - dut - DUT node. Type: string
244 | | ... | - pf - NIC physical function (physical port). Type: integer
248 | | ... | \| Initialize layer vfio-pci on node \| DUT1 \| 1 \|
250 | | [Arguments] | ${dut} | ${pf}
254 | Initialize layer avf on node
256 | | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF.
258 | | ... | *Arguments:*
259 | | ... | - dut - DUT node. Type: string
260 | | ... | - pf - NIC physical function (physical port). Type: integer
264 | | ... | \| Initialize layer avf on node \| DUT1 \| 1 \|
266 | | [Arguments] | ${dut} | ${pf}
268 | | FOR | ${vf} | IN RANGE | 0 | ${nic_vfs}
269 | | | ${_avf}= | VPP Create AVF Interface
270 | | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[${vf}]
271 | | | ... | num_rx_queues=${rxq_count_int}
272 | | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
274 | | | ... | Get Interface IP4 | ${nodes['${dut}']} | ${_avf}
275 | | | ${_ip4_prefix}=
276 | | | ... | Get Interface IP4 Prefix Length | ${nodes['${dut}']} | ${_avf}
278 | | | ... | Get Interface MAC | ${nodes['${dut}']} | ${_avf}
280 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${_avf}
282 | | | ... | Get Interface VLAN | ${nodes['${dut}']} | ${_avf}
283 | | | Set List Value | ${${dut}_vf${pf}} | ${vf} | ${_avf}
284 | | | Set List Value | ${${dut}_vf${pf}_ip4_addr} | ${vf} | ${_ip4}
285 | | | Set List Value | ${${dut}_vf${pf}_ip4_prefix} | ${vf} | ${_ip4_prefix}
286 | | | Set List Value | ${${dut}_vf${pf}_mac} | ${vf} | ${_mac}
287 | | | Set List Value | ${${dut}_vf${pf}_pci} | ${vf} | ${_pci}
288 | | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan}
291 | Initialize layer rdma-core on node
293 | | ... | Initialize rdma-core (Mellanox VPP) interfaces on DUT on NIC PF.
295 | | ... | *Arguments:*
296 | | ... | - dut - DUT node. Type: string
297 | | ... | - pf - NIC physical function (physical port). Type: integer
301 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
303 | | [Arguments] | ${dut} | ${pf}
305 | | ${_rdma}= | VPP Create Rdma Interface
306 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
307 | | ... | num_rx_queues=${rxq_count_int}
308 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
309 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_rdma}
311 | Initialize layer mlx5_core on node
313 | | ... | Initialize mlx5_core interfaces on DUT on NIC PF.
314 | | ... | Currently no operation.
318 | Initialize layer interface
320 | | ... | Physical interfaces variables to be created on all DUTs.
322 | | ... | *Arguments:*
323 | | ... | - count - Number of untagged interfaces variables. Type: integer
327 | | ... | \| Initialize layer interface \| 1 \|
329 | | [Arguments] | ${count}=${1}
331 | | FOR | ${dut} | IN | @{duts}
332 | | | Initialize layer interface on node | ${dut} | count=${count}
335 | Initialize layer interface on node
337 | | ... | Physical interfaces variables to be created on all DUTs.
339 | | ... | *Arguments:*
340 | | ... | - dut - DUT node. Type: string
341 | | ... | - count - Number of baseline interface variables. Type: integer
345 | | ... | \| Initialize layer interface on node \| DUT1 \| 1 \|
347 | | [Arguments] | ${dut} | ${count}=${1}
349 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
350 | | | Initialize layer interface on node on PF | ${dut} | ${pf} | count=${count}
353 | Initialize layer interface on node on PF
355 | | ... | Baseline interfaces variables to be created.
357 | | ... | *Arguments:*
358 | | ... | - dut - DUT node. Type: string
359 | | ... | - pf - NIC physical function (physical port). Type: integer
360 | | ... | - count - Number of baseline interface variables. Type: integer
364 | | ... | \| Initialize layer interface on node on PF \| DUT1 \| 1 \| 1 \|
366 | | [Arguments] | ${dut} | ${pf} | ${count}=${1}
368 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
369 | | | Set Test Variable
370 | | | ... | ${${dut}_${int}${pf}_${id}} | ${${dut}_${int}${pf}}
373 | Initialize layer bonding
375 | | ... | Bonded interfaces and variables to be created on all DUT's interfaces.
377 | | ... | *Arguments:*
378 | | ... | - bond_mode - Link bonding mode. Type: string
379 | | ... | - lb_mode - Load balance mode. Type: string
380 | | ... | - count - Number of bond interface variables. Type: integer
384 | | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \|
386 | | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
388 | | FOR | ${dut} | IN | @{duts}
389 | | | Initialize layer bonding on node
390 | | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode}
391 | | | ... | count=${count}
393 | | Set Test Variable | ${int} | bond
395 | Initialize layer bonding on node
397 | | ... | Bonded interface and variables to be created on across east and
398 | | ... | west DUT's node interfaces.
400 | | ... | *Arguments:*
401 | | ... | - dut - DUT node. Type: string
402 | | ... | - bond_mode - Link bonding mode. Type: string
403 | | ... | - lb_mode - Load balance mode. Type: string
404 | | ... | - count - Number of bond interface variables. Type: integer
408 | | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \|
410 | | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
412 | | ${if_index}= | VPP Create Bond Interface
413 | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode}
414 | | ... | mac=00:00:00:01:01:01
415 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up
416 | | VPP Enslave Physical Interface
417 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_1} | ${if_index}
418 | | VPP Enslave Physical Interface
419 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_1} | ${if_index}
420 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
421 | | | Set Test Variable | ${${dut}_bond1_${id}} | ${if_index}
422 | | | Set Test Variable | ${${dut}_bond2_${id}} | ${if_index}
425 | Initialize layer dot1q
427 | | ... | Dot1q interfaces and variables to be created on all DUTs.
429 | | ... | *Arguments:*
430 | | ... | - count - Number of chains.
431 | | ... | Type: integer
432 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
433 | | ... | Type: boolean
434 | | ... | - start - Id of first chain, allows adding chains during test.
435 | | ... | Type: integer
437 | | ... | \| Initialize layer dot1q \| 1 \| True \| 1 \|
439 | | [Arguments] | ${count}=${1} | ${vlan_per_chain}=${True} | ${start}=${1}
441 | | FOR | ${dut} | IN | @{duts}
442 | | | Initialize layer dot1q on node
443 | | | ... | ${dut} | count=${count} | vlan_per_chain=${vlan_per_chain}
444 | | | ... | start=${start}
446 | | Set Test Variable | ${int} | dot1q
448 | Initialize layer dot1q on node
450 | | ... | Dot1q interfaces and variables to be created on all DUT's node.
452 | | ... | *Arguments:*
453 | | ... | - dut - DUT node.
454 | | ... | Type: string
455 | | ... | - count - Number of chains.
456 | | ... | Type: integer
457 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
458 | | ... | Type: boolean
459 | | ... | - start - Id of first chain, allows adding chains during test.
460 | | ... | Type: integer
464 | | ... | \| Initialize layer dot1q on node \| DUT1 \| 1 \| True \| 1 \|
466 | | [Arguments] | ${dut} | ${count}=${1} | ${vlan_per_chain}=${True}
467 | | ... | ${start}=${1}
469 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
470 | | | Initialize layer dot1q on node on PF | ${dut} | pf=${pf} | count=${count}
471 | | | ... | vlan_per_chain=${vlan_per_chain} | start=${start}
474 | Initialize layer dot1q on node on PF
476 | | ... | Dot1q interfaces and variables to be created on all DUT's node
477 | | ... | interfaces.
479 | | ... | *Arguments:*
480 | | ... | - dut - DUT node.
481 | | ... | Type: string
482 | | ... | - pf - NIC physical function (physical port).
483 | | ... | Type: integer
484 | | ... | - count - Number of chains.
485 | | ... | Type: integer
486 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
487 | | ... | Type: boolean
488 | | ... | - start - Id of first chain, allows adding chains during test.
489 | | ... | Type: integer
493 | | ... | \| Initialize layer dot1q on node on PF \| DUT1 \| 3 \| True \| 2 \|
495 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1}
496 | | ... | ${vlan_per_chain}=${True} | ${start}=${1}
498 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
499 | | | ${_dot1q}= | Initialize layer dot1q on node on PF for chain
500 | | | ... | dut=${dut} | pf=${pf} | id=${id} | vlan_per_chain=${vlan_per_chain}
501 | | | # First id results in non-None indices, after that _1_ are defined.
502 | | | ${_dot1q}= | Set Variable If | '${_dot1q}' == '${NONE}'
503 | | | ... | ${${dut}_dot1q${pf}_1}[0] | ${_dot1q}
504 | | | ${_dot1q}= | Create List | ${_dot1q}
505 | | | Set Test Variable | ${${dut}_dot1q${pf}_${id}} | ${_dot1q}
508 | Initialize layer dot1q on node on PF for chain
510 | | ... | Optionally create tag popping subinterface per chain.
511 | | ... | Return interface indices for dot1q layer interfaces,
512 | | ... | or Nones if subinterfaces are not created.
514 | | ... | *Arguments:*
515 | | ... | - dut - DUT node.
516 | | ... | Type: string
517 | | ... | - pf - NIC physical function (physical port).
518 | | ... | Type: integer
519 | | ... | - id - Positive index of the chain.
520 | | ... | Type: integer
521 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
522 | | ... | Type: boolean
526 | | ... | \| Initialize layer dot1q on node on PF for chain \| DUT1 \
527 | | ... | \| 1 \| 1 \| True \|
529 | | [Arguments] | ${dut} | ${pf} | ${id} | ${vlan_per_chain}=${True}
531 | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
533 | | ${_default}= | Evaluate | ${pf} * ${100} + ${id} - ${1}
534 | | ${_vlan}= | Get Variable Value | \${${dut}_pf${pf}_vlan}
535 | | ${_vlan}= | Set Variable If | '${_vlan}[0]' != '${NONE}'
536 | | ... | ${_vlan}[0] | ${_default}
537 | | ${_name} | ${_index}= | Create Vlan Subinterface
538 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0] | ${_vlan}
539 | | Set Interface State | ${nodes['${dut}']} | ${_index} | up
540 | | Configure L2 tag rewrite method on interfaces
541 | | ... | ${nodes['${dut}']} | ${_index} | TAG_REWRITE_METHOD=pop-1
542 | | Return From Keyword | ${_index}
544 | Initialize layer ip4vxlan
546 | | ... | VXLAN interfaces and variables to be created on all DUT's interfaces.
548 | | ... | *Arguments:*
549 | | ... | - count - Number of vxlan interfaces.
550 | | ... | Type: integer
551 | | ... | - start - Id of first chain, allows adding chains during test.
552 | | ... | Type: integer
554 | | ... | \| Initialize layer ip4vxlan \| 3 \| 2 \|
556 | | [Arguments] | ${count}=${1} | ${start}=${1}
558 | | FOR | ${dut} | IN | @{duts}
559 | | | Initialize layer ip4vxlan on node | ${dut} | count=${count}
560 | | | ... | start=${start}
562 | | Set Test Variable | ${int} | ip4vxlan
564 | Initialize layer ip4vxlan on node
566 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
567 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
568 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
569 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
571 | | ... | *Arguments:*
572 | | ... | - dut - DUT node.
573 | | ... | Type: string
574 | | ... | - count - Number of vxlan interfaces.
575 | | ... | Type: integer
576 | | ... | - start - Id of first chain, allows adding chains during test.
577 | | ... | Type: integer
581 | | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 3 \| 2 \|
583 | | [Arguments] | ${dut} | ${count}=${1} | ${start}=${1}
585 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
586 | | | Initialize layer ip4vxlan on node on PF | ${dut} | pf=${pf}
587 | | | ... | count=${count} | start=${start}
590 | Initialize layer ip4vxlan on node on PF
592 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
593 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
594 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
595 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
597 | | ... | *Arguments:*
598 | | ... | - dut - DUT node.
599 | | ... | Type: string
600 | | ... | - pf - NIC physical function (physical port).
601 | | ... | Type: integer
602 | | ... | - count - Number of vxlan interfaces.
603 | | ... | Type: integer
604 | | ... | - start - Id of first chain, allows adding chains during test.
605 | | ... | Type: integer
609 | | ... | \| Initialize layer ip4vxlan on node on PF \| DUT1 \| 3 \| 2 \|
611 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1} | ${start}=${1}
613 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
614 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_1}[0]
615 | | ... | 172.${pf}6.0.1 | 24
616 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
617 | | | ${_subnet}= | Evaluate | ${id} - 1
618 | | | ${_vni}= | Evaluate | ${id} - 1
619 | | | ${_ip4vxlan}= | Create VXLAN interface
620 | | | ... | ${nodes['${dut}']} | ${_vni}
621 | | | ... | 172.${pf}6.0.1 | 172.${pf}7.${_subnet}.2
623 | | | ... | Set Variable If | '${dut}' == 'DUT1'
624 | | | ... | ${TG_pf1_mac}[0] | ${DUT1_pf2_mac}[0]
626 | | | ... | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2
627 | | | ... | ${DUT2_pf1_mac}[0] | ${TG_pf2_mac}[0]
628 | | | ${_even}= | Evaluate | ${pf} % 2
629 | | | ${_mac}= | Set Variable If | ${_even}
630 | | | ... | ${_prev_mac} | ${_next_mac}
631 | | | VPP Add IP Neighbor
632 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
633 | | | ... | 172.${pf}6.${_subnet}.2 | ${_mac}
635 | | | ... | ${nodes['${dut}']} | 172.${pf}7.${_subnet}.0 | 24
636 | | | ... | gateway=172.${pf}6.${_subnet}.2
637 | | | ... | interface=${${dut}_${int}${pf}_${id}}[0]
638 | | | Set VXLAN Bypass
639 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
640 | | | ${_ip4vxlan}= | Create List | ${_ip4vxlan}
641 | | | Set Test Variable
642 | | | ... | ${${dut}_ip4vxlan${pf}_${id}} | ${_ip4vxlan}
645 | Configure vhost interfaces
647 | | ... | Create two Vhost-User interfaces on defined VPP node.
649 | | ... | *Arguments:*
650 | | ... | - ${dut_node} - DUT node.
651 | | ... | Type: dictionary
652 | | ... | - ${sock1} - Socket path for first Vhost-User interface.
653 | | ... | Type: string
654 | | ... | - ${sock2} - Socket path for second Vhost-User interface.
655 | | ... | Type: string
656 | | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional).
657 | | ... | Type: string
658 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
659 | | ... | Type: string
660 | | ... | - ${is_server} - Server side of connection (Optional).
661 | | ... | Type: boolean
662 | | ... | - ${enable_gso} - Generic segmentation offloading (Optional).
663 | | ... | Type: boolean
665 | | ... | _NOTE:_ This KW sets following test case variable:
666 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
667 | | ... | - ${${vhost_if2}} - Second Vhost-User interface.
671 | | ... | \| Configure vhost interfaces \
672 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \|
674 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
675 | | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False}
676 | | ... | ${enable_gso}=${False}
678 | | ${vhost_1}= | Vpp Create Vhost User Interface
679 | | ... | ${dut_node} | ${sock1} | is_server=${is_server}
680 | | ... | enable_gso=${enable_gso}
681 | | ${vhost_2}= | Vpp Create Vhost User Interface
682 | | ... | ${dut_node} | ${sock2} | is_server=${is_server}
683 | | ... | enable_gso=${enable_gso}
684 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
685 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
686 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}
687 | | ${vhost_2_mac}= | Get Interface MAC | ${dut_node} | ${vhost_2_key}
688 | | Set Interface State | ${dut_node} | ${vhost_1} | up
689 | | Set Interface State | ${dut_node} | ${vhost_2} | up
690 | | Set Test Variable | ${${vhost_if1}} | ${vhost_1}
691 | | Set Test Variable | ${${vhost_if2}} | ${vhost_2}
692 | | Set Test Variable | ${${vhost_if1}_mac} | ${vhost_1_mac}
693 | | Set Test Variable | ${${vhost_if2}_mac} | ${vhost_2_mac}
696 | | [Documentation] | Get vhost-user dump.
698 | | ... | *Arguments:*
699 | | ... | - dut - DUT node data.
700 | | ... | Type: dictionary
702 | | [Arguments] | ${dut}
704 | | ${vhost_dump}= | Vhost User Dump | ${dut}
705 | | Return From Keyword | ${vhost_dump}