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 | | FOR | ${dut} | IN | @{duts}
118 | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci}
119 | | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
120 | | | ... | ${dut}.Add DPDK No Tx Checksum Offload
121 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
122 | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci
123 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
124 | | | Run Keyword If | not ${jumbo}
125 | | | ... | ${dut}.Add DPDK No Multi Seg
126 | | | Run Keyword If | ${nic_rxq_size} > 0
127 | | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size}
128 | | | Run Keyword If | ${nic_txq_size} > 0
129 | | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size}
130 | | | Run Keyword If | '${crypto_type}' != '${None}'
131 | | | ... | ${dut}.Add DPDK Cryptodev | ${thr_count_int}
133 | | ${_vlan_strip} | ${value}= | Run Keyword And Ignore Error
134 | | ... | Variable Should Exist | ${vlan_strip_off}
135 | | Run keyword If | '${_vlan_strip}' == 'PASS' and ${duts_count} == 2
136 | | ... | Add DPDK VLAN strip offload switch off between DUTs
138 | Pre-initialize layer avf on all DUTs
140 | | ... | Pre-initialize avf driver. Currently no operation.
144 | Pre-initialize layer rdma-core on all DUTs
146 | | ... | Pre-initialize rdma-core driver. Currently no operation.
150 | Initialize layer driver
152 | | ... | Initialize driver based interfaces on all DUT. Interfaces are
153 | | ... | brought up.
155 | | ... | *Arguments:*
156 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
157 | | ... | Type: string
161 | | ... | \| Initialize layer driver \| vfio-pci \|
163 | | [Arguments] | ${driver}
165 | | FOR | ${dut} | IN | @{duts}
166 | | | Initialize layer driver on node | ${dut} | ${driver}
168 | | Set Test Variable | ${int} | vf
169 | | Set interfaces in path up
171 | Initialize layer driver on node
173 | | ... | Initialize driver based interfaces on DUT.
175 | | ... | *Arguments:*
176 | | ... | - dut - DUT node.
177 | | ... | Type: string
178 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
179 | | ... | Type: string
183 | | ... | \| Initialize layer driver \| DUT1 \| vfio-pci \|
185 | | [Arguments] | ${dut} | ${driver}
187 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
189 | | | ... | Copy List | ${${dut}_${int}${pf}}
191 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_addr}
192 | | | ${_ip4_prefix}=
193 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_prefix}
195 | | | ... | Copy List | ${${dut}_${int}${pf}_mac}
197 | | | ... | Copy List | ${${dut}_${int}${pf}_pci}
199 | | | ... | Copy List | ${${dut}_${int}${pf}_vlan}
200 | | | Set Test Variable
201 | | | ... | ${${dut}_vf${pf}} | ${_vf}
202 | | | Set Test Variable
203 | | | ... | ${${dut}_vf${pf}_ip4_addr} | ${_ip4_addr}
204 | | | Set Suite Variable
205 | | | ... | ${${dut}_vf${pf}_ip4_prefix} | ${_ip4_prefix}
206 | | | Set Test Variable
207 | | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
208 | | | Set Test Variable
209 | | | ... | ${${dut}_vf${pf}_pci} | ${_pci}
210 | | | Set Test Variable
211 | | | ... | ${${dut}_vf${pf}_vlan} | ${_vlan}
212 | | | Run Keyword | Initialize layer ${driver} on node | ${dut} | ${pf}
215 | Initialize layer vfio-pci on node
217 | | ... | Initialize vfio-pci interfaces on DUT on NIC PF.
218 | | ... | Currently no operation.
220 | | ... | *Arguments:*
221 | | ... | - dut - DUT node. Type: string
222 | | ... | - pf - NIC physical function (physical port). Type: integer
226 | | ... | \| Initialize layer vfio-pci on node \| DUT1 \| 1 \|
228 | | [Arguments] | ${dut} | ${pf}
232 | Initialize layer avf on node
234 | | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF.
236 | | ... | *Arguments:*
237 | | ... | - dut - DUT node. Type: string
238 | | ... | - pf - NIC physical function (physical port). Type: integer
242 | | ... | \| Initialize layer avf on node \| DUT1 \| 1 \|
244 | | [Arguments] | ${dut} | ${pf}
246 | | FOR | ${vf} | IN RANGE | 0 | ${nic_vfs}
247 | | | ${_avf}= | VPP Create AVF Interface
248 | | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[${vf}]
249 | | | ... | num_rx_queues=${rxq_count_int}
250 | | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
252 | | | ... | Get Interface IP4 | ${nodes['${dut}']} | ${_avf}
253 | | | ${_ip4_prefix}=
254 | | | ... | Get Interface IP4 Prefix Length | ${nodes['${dut}']} | ${_avf}
256 | | | ... | Get Interface MAC | ${nodes['${dut}']} | ${_avf}
258 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${_avf}
260 | | | ... | Get Interface VLAN | ${nodes['${dut}']} | ${_avf}
261 | | | Set List Value | ${${dut}_vf${pf}} | ${vf} | ${_avf}
262 | | | Set List Value | ${${dut}_vf${pf}_ip4_addr} | ${vf} | ${_ip4}
263 | | | Set List Value | ${${dut}_vf${pf}_ip4_prefix} | ${vf} | ${_ip4_prefix}
264 | | | Set List Value | ${${dut}_vf${pf}_mac} | ${vf} | ${_mac}
265 | | | Set List Value | ${${dut}_vf${pf}_pci} | ${vf} | ${_pci}
266 | | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan}
269 | Initialize layer rdma-core on node
271 | | ... | Initialize rdma-core (Mellanox VPP) interfaces on DUT on NIC PF.
273 | | ... | *Arguments:*
274 | | ... | - dut - DUT node. Type: string
275 | | ... | - pf - NIC physical function (physical port). Type: integer
279 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
281 | | [Arguments] | ${dut} | ${pf}
283 | | ${_rdma}= | VPP Create Rdma Interface
284 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
285 | | ... | num_rx_queues=${rxq_count_int}
286 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
287 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_rdma}
289 | Initialize layer interface
291 | | ... | Physical interfaces variables to be created on all DUTs.
293 | | ... | *Arguments:*
294 | | ... | - count - Number of untagged interfaces variables. Type: integer
298 | | ... | \| Initialize layer interface \| 1 \|
300 | | [Arguments] | ${count}=${1}
302 | | FOR | ${dut} | IN | @{duts}
303 | | | Initialize layer interface on node | ${dut} | count=${count}
306 | Initialize layer interface on node
308 | | ... | Physical interfaces variables to be created on all DUTs.
310 | | ... | *Arguments:*
311 | | ... | - dut - DUT node. Type: string
312 | | ... | - count - Number of baseline interface variables. Type: integer
316 | | ... | \| Initialize layer interface on node \| DUT1 \| 1 \|
318 | | [Arguments] | ${dut} | ${count}=${1}
320 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
321 | | | Initialize layer interface on node on PF | ${dut} | ${pf} | count=${count}
324 | Initialize layer interface on node on PF
326 | | ... | Baseline interfaces variables to be created.
328 | | ... | *Arguments:*
329 | | ... | - dut - DUT node. Type: string
330 | | ... | - pf - NIC physical function (physical port). Type: integer
331 | | ... | - count - Number of baseline interface variables. Type: integer
335 | | ... | \| Initialize layer interface on node on PF \| DUT1 \| 1 \| 1 \|
337 | | [Arguments] | ${dut} | ${pf} | ${count}=${1}
339 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
340 | | | Set Test Variable
341 | | | ... | ${${dut}_${int}${pf}_${id}} | ${${dut}_${int}${pf}}
344 | Initialize layer bonding
346 | | ... | Bonded interfaces and variables to be created on all DUT's interfaces.
348 | | ... | *Arguments:*
349 | | ... | - bond_mode - Link bonding mode. Type: string
350 | | ... | - lb_mode - Load balance mode. Type: string
351 | | ... | - count - Number of bond interface variables. Type: integer
355 | | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \|
357 | | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
359 | | FOR | ${dut} | IN | @{duts}
360 | | | Initialize layer bonding on node
361 | | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode}
362 | | | ... | count=${count}
364 | | Set Test Variable | ${int} | bond
366 | Initialize layer bonding on node
368 | | ... | Bonded interface and variables to be created on across east and
369 | | ... | west DUT's node interfaces.
371 | | ... | *Arguments:*
372 | | ... | - dut - DUT node. Type: string
373 | | ... | - bond_mode - Link bonding mode. Type: string
374 | | ... | - lb_mode - Load balance mode. Type: string
375 | | ... | - count - Number of bond interface variables. Type: integer
379 | | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \|
381 | | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
383 | | ${if_index}= | VPP Create Bond Interface
384 | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode}
385 | | ... | mac=00:00:00:01:01:01
386 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up
387 | | VPP Enslave Physical Interface
388 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_1} | ${if_index}
389 | | VPP Enslave Physical Interface
390 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_1} | ${if_index}
391 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
392 | | | Set Test Variable | ${${dut}_bond1_${id}} | ${if_index}
393 | | | Set Test Variable | ${${dut}_bond2_${id}} | ${if_index}
396 | Initialize layer dot1q
398 | | ... | Dot1q interfaces and variables to be created on all DUTs.
400 | | ... | *Arguments:*
401 | | ... | - count - Number of chains.
402 | | ... | Type: integer
403 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
404 | | ... | Type: boolean
405 | | ... | - start - Id of first chain, allows adding chains during test.
406 | | ... | Type: integer
408 | | ... | \| Initialize layer dot1q \| 1 \| True \| 1 \|
410 | | [Arguments] | ${count}=${1} | ${vlan_per_chain}=${True} | ${start}=${1}
412 | | FOR | ${dut} | IN | @{duts}
413 | | | Initialize layer dot1q on node
414 | | | ... | ${dut} | count=${count} | vlan_per_chain=${vlan_per_chain}
415 | | | ... | start=${start}
417 | | Set Test Variable | ${int} | dot1q
419 | Initialize layer dot1q on node
421 | | ... | Dot1q interfaces and variables to be created on all DUT's node.
423 | | ... | *Arguments:*
424 | | ... | - dut - DUT node.
425 | | ... | Type: string
426 | | ... | - count - Number of chains.
427 | | ... | Type: integer
428 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
429 | | ... | Type: boolean
430 | | ... | - start - Id of first chain, allows adding chains during test.
431 | | ... | Type: integer
435 | | ... | \| Initialize layer dot1q on node \| DUT1 \| 1 \| True \| 1 \|
437 | | [Arguments] | ${dut} | ${count}=${1} | ${vlan_per_chain}=${True}
438 | | ... | ${start}=${1}
440 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
441 | | | Initialize layer dot1q on node on PF | ${dut} | pf=${pf} | count=${count}
442 | | | ... | vlan_per_chain=${vlan_per_chain} | start=${start}
445 | Initialize layer dot1q on node on PF
447 | | ... | Dot1q interfaces and variables to be created on all DUT's node
448 | | ... | interfaces.
450 | | ... | *Arguments:*
451 | | ... | - dut - DUT node.
452 | | ... | Type: string
453 | | ... | - pf - NIC physical function (physical port).
454 | | ... | Type: integer
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 on PF \| DUT1 \| 3 \| True \| 2 \|
466 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1}
467 | | ... | ${vlan_per_chain}=${True} | ${start}=${1}
469 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
470 | | | ${_dot1q} | Initialize layer dot1q on node on PF for chain
471 | | | ... | dut=${dut} | pf=${pf} | id=${id} | vlan_per_chain=${vlan_per_chain}
472 | | | # First id results in non-None indices, after that _1_ are defined.
473 | | | ${_dot1q}= | Set Variable If | '${_dot1q}' == '${NONE}'
474 | | | ... | ${${dut}_dot1q${pf}_1} | ${_dot1q}
475 | | | ${_dot1q}= | Create List | ${_dot1q}
476 | | | Set Test Variable | ${${dut}_dot1q${pf}_${id}} | ${_dot1q}
479 | Initialize layer dot1q on node on PF for chain
481 | | ... | Optionally create tag popping subinterface per chain.
482 | | ... | Return interface indices for dot1q layer interfaces,
483 | | ... | or Nones if subinterfaces are not created.
485 | | ... | *Arguments:*
486 | | ... | - dut - DUT node.
487 | | ... | Type: string
488 | | ... | - pf - NIC physical function (physical port).
489 | | ... | Type: integer
490 | | ... | - id - Positive index of the chain.
491 | | ... | Type: integer
492 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
493 | | ... | Type: boolean
497 | | ... | \| Initialize layer dot1q on node on PF for chain \| DUT1 \
498 | | ... | \| 1 \| 1 \| True \|
500 | | [Arguments] | ${dut} | ${pf} | ${id} | ${vlan_per_chain}=${True}
502 | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
503 | | ... | ${NONE} | ${NONE}
504 | | ${_default}= | Evaluate | ${pf} * ${100} + ${id} - ${1}
505 | | ${_vlan}= | Get Variable Value | \${${dut}_pf${pf}_vlan}
506 | | ${_vlan}= | Set Variable If | '${_vlan}[0]' != '${NONE}'
507 | | ... | ${_vlan}[0] | ${_default}
508 | | ${_name} | ${_index}= | Create Vlan Subinterface
509 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0] | ${_vlan}
510 | | Set Interface State | ${nodes['${dut}']} | ${_index} | up
511 | | Configure L2 tag rewrite method on interfaces
512 | | ... | ${nodes['${dut}']} | ${_index} | TAG_REWRITE_METHOD=pop-1
513 | | Return From Keyword | ${_index}
515 | Initialize layer ip4vxlan
517 | | ... | VXLAN interfaces and variables to be created on all DUT's interfaces.
519 | | ... | *Arguments:*
520 | | ... | - count - Number of vxlan interfaces.
521 | | ... | Type: integer
522 | | ... | - start - Id of first chain, allows adding chains during test.
523 | | ... | Type: integer
525 | | ... | \| Initialize layer ip4vxlan \| 3 \| 2 \|
527 | | [Arguments] | ${count}=${1} | ${start}=${1}
529 | | FOR | ${dut} | IN | @{duts}
530 | | | Initialize layer ip4vxlan on node | ${dut} | count=${count}
531 | | | ... | start=${start}
533 | | Set Test Variable | ${int} | ip4vxlan
535 | Initialize layer ip4vxlan on node
537 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
538 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
539 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
540 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
542 | | ... | *Arguments:*
543 | | ... | - dut - DUT node.
544 | | ... | Type: string
545 | | ... | - count - Number of vxlan interfaces.
546 | | ... | Type: integer
547 | | ... | - start - Id of first chain, allows adding chains during test.
548 | | ... | Type: integer
552 | | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 3 \| 2 \|
554 | | [Arguments] | ${dut} | ${count}=${1} | ${start}=${1}
556 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
557 | | | Initialize layer ip4vxlan on node on PF | ${dut} | pf=${pf}
558 | | | ... | count=${count} | start=${start}
561 | Initialize layer ip4vxlan on node on PF
563 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
564 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
565 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
566 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
568 | | ... | *Arguments:*
569 | | ... | - dut - DUT node.
570 | | ... | Type: string
571 | | ... | - pf - NIC physical function (physical port).
572 | | ... | Type: integer
573 | | ... | - count - Number of vxlan interfaces.
574 | | ... | Type: integer
575 | | ... | - start - Id of first chain, allows adding chains during test.
576 | | ... | Type: integer
580 | | ... | \| Initialize layer ip4vxlan on node on PF \| DUT1 \| 3 \| 2 \|
582 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1} | ${start}=${1}
584 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
585 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_1}[0]
586 | | ... | 172.${pf}6.0.1 | 24
587 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
588 | | | ${_subnet}= | Evaluate | ${id} - 1
589 | | | ${_vni}= | Evaluate | ${id} - 1
590 | | | ${_ip4vxlan}= | Create VXLAN interface
591 | | | ... | ${nodes['${dut}']} | ${_vni}
592 | | | ... | 172.${pf}6.0.1 | 172.${pf}7.${_subnet}.2
593 | | | ${_prev_mac}= | Set Variable If | '${dut}' == 'DUT1'
594 | | | ... | ${tg_if1_mac} | ${dut1_if2_mac}
595 | | | ${_next_mac}= | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2
596 | | | ... | ${dut2_if1_mac} | ${tg_if2_mac}
597 | | | ${_even}= | Evaluate | ${pf} % 2
598 | | | ${_mac}= | Set Variable If | ${_even}
599 | | | ... | ${_prev_mac} | ${_next_mac}
600 | | | VPP Add IP Neighbor
601 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
602 | | | ... | 172.${pf}6.${_subnet}.2 | ${_mac}
604 | | | ... | ${nodes['${dut}']} | 172.${pf}7.${_subnet}.0 | 24
605 | | | ... | gateway=172.${pf}6.${_subnet}.2
606 | | | ... | interface=${${dut}_${int}${pf}_${id}}[0]
607 | | | Set VXLAN Bypass
608 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
609 | | | ${_ip4vxlan}= | Create List | ${_ip4vxlan}
610 | | | Set Test Variable
611 | | | ... | ${${dut}_ip4vxlan${pf}_${id}} | ${_ip4vxlan}
614 | Configure vhost interfaces
616 | | ... | Create two Vhost-User interfaces on defined VPP node.
618 | | ... | *Arguments:*
619 | | ... | - ${dut_node} - DUT node.
620 | | ... | Type: dictionary
621 | | ... | - ${sock1} - Socket path for first Vhost-User interface.
622 | | ... | Type: string
623 | | ... | - ${sock2} - Socket path for second Vhost-User interface.
624 | | ... | Type: string
625 | | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional).
626 | | ... | Type: string
627 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
628 | | ... | Type: string
629 | | ... | - ${is_server} - Server side of connection (Optional).
630 | | ... | Type: boolean
631 | | ... | - ${enable_gso} - Generic segmentation offloading (Optional).
632 | | ... | Type: boolean
634 | | ... | _NOTE:_ This KW sets following test case variable:
635 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
636 | | ... | - ${${vhost_if2}} - Second Vhost-User interface.
640 | | ... | \| Configure vhost interfaces \
641 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \|
643 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
644 | | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False}
645 | | ... | ${enable_gso}=${False}
647 | | ${vhost_1}= | Vpp Create Vhost User Interface
648 | | ... | ${dut_node} | ${sock1} | is_server=${is_server}
649 | | ... | enable_gso=${enable_gso}
650 | | ${vhost_2}= | Vpp Create Vhost User Interface
651 | | ... | ${dut_node} | ${sock2} | is_server=${is_server}
652 | | ... | enable_gso=${enable_gso}
653 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
654 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
655 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}
656 | | ${vhost_2_mac}= | Get Interface MAC | ${dut_node} | ${vhost_2_key}
657 | | Set Interface State | ${dut_node} | ${vhost_1} | up
658 | | Set Interface State | ${dut_node} | ${vhost_2} | up
659 | | Set Test Variable | ${${vhost_if1}} | ${vhost_1}
660 | | Set Test Variable | ${${vhost_if2}} | ${vhost_2}
661 | | Set Test Variable | ${${vhost_if1}_mac} | ${vhost_1_mac}
662 | | Set Test Variable | ${${vhost_if2}_mac} | ${vhost_2_mac}
665 | | [Documentation] | Get vhost-user dump.
667 | | ... | *Arguments:*
668 | | ... | - dut - DUT node data.
669 | | ... | Type: dictionary
671 | | [Arguments] | ${dut}
673 | | ${vhost_dump}= | Vhost User Dump | ${dut}
674 | | Return From Keyword | ${vhost_dump}