1 # Copyright (c) 2021 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
14 | Library | resources.libraries.python.InterfaceUtil
15 | Library | resources.libraries.python.NodePath
16 | Library | resources.libraries.python.VhostUser
19 | ${dpdk_no_tx_checksum_offload}= | ${True}
22 | Set single interfaces in path up
24 | | ... | *Set UP state on single physical VPP interfaces in path on all DUT
25 | | ... | nodes and set maximal MTU.*
27 | | ... | *Arguments:*
28 | | ... | - pf - NIC physical function (physical port).
29 | | ... | Type: integer
33 | | ... | \| Set single interfaces in path \| 1 \|
35 | | [Arguments] | ${pf}=${1}
37 | | FOR | ${dut} | IN | @{duts}
38 | | | Set interfaces in path up on node on PF | ${dut} | ${pf}
40 | | All VPP Interfaces Ready Wait | ${nodes} | retries=${60}
42 | Set interfaces in path up
44 | | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set
45 | | ... | maximal MTU.*
47 | | ... | *Arguments:*
48 | | ... | - validate - Validate interfaces are up.
49 | | ... | Type: boolean
51 | | [Arguments] | ${validate}=${True}
53 | | FOR | ${dut} | IN | @{duts}
54 | | | Set interfaces in path up on node | ${dut}
56 | | Run Keyword If | ${validate}
57 | | ... | All VPP Interfaces Ready Wait | ${nodes} | retries=${60}
59 | Set interfaces in path up on node
61 | | ... | *Set UP state on VPP interfaces in path on specified DUT node and
62 | | ... | set maximal MTU.*
64 | | ... | *Arguments:*
65 | | ... | - dut - DUT node on which to set the interfaces up.
66 | | ... | Type: string
70 | | ... | \| Set interfaces in path up on node \| DUT1 \|
72 | | [Arguments] | ${dut}
74 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
75 | | | Set interfaces in path up on node on PF | ${dut} | ${pf}
78 | Set interfaces in path up on node on PF
80 | | ... | *Set UP state on VPP interfaces in path on specified DUT node and
81 | | ... | set maximal MTU.*
83 | | ... | *Arguments:*
84 | | ... | - dut - DUT node on which to set the interfaces up.
85 | | ... | Type: string
86 | | ... | - pf - NIC physical function (physical port).
87 | | ... | Type: integer
91 | | ... | \| Set interfaces in path up on node on PF \| DUT1 \| 1 \|
93 | | [Arguments] | ${dut} | ${pf}
95 | | ${_chains} | ${value}= | Run Keyword And Ignore Error
96 | | ... | Variable Should Exist | @{${dut}_${int}${pf}_1}
97 | | ${_id}= | Set Variable If | '${_chains}' == 'PASS' | _1 | ${EMPTY}
98 | | FOR | ${if} | IN | @{${dut}_${int}${pf}${_id}}
99 | | | Set Interface State | ${nodes['${dut}']} | ${if} | up
100 | | | VPP Set Interface MTU | ${nodes['${dut}']} | ${if}
103 | Pre-initialize layer driver
105 | | ... | Pre-initialize driver based interfaces on each DUT.
107 | | ... | *Arguments:*
108 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
109 | | ... | Type: string
113 | | ... | \| Pre-initialize layer driver \| vfio-pci \|
115 | | [Arguments] | ${driver}
117 | | Run Keyword | Pre-initialize layer ${driver} on all DUTs
119 | Pre-initialize layer tap on all DUTs
121 | | ... | Pre-initialize tap driver. Currently no operation.
125 | Pre-initialize layer vhost on all DUTs
127 | | ... | Pre-initialize vhost driver. Currently no operation.
131 | Pre-initialize layer vfio-pci on all DUTs
133 | | ... | Pre-initialize vfio-pci driver by adding related sections to startup
134 | | ... | config on all DUTs.
136 | | ${index}= | Get Index From List | ${TEST TAGS} | DPDK
137 | | Run Keyword If | ${index} >= 0 | Return From Keyword
138 | | FOR | ${dut} | IN | @{duts}
139 | | | Stop VPP Service | ${nodes['${dut}']}
140 | | | PCI Driver Unbind List | ${nodes['${dut}']} | @{${dut}_pf_pci}
141 | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci}
142 | | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
143 | | | ... | ${dut}.Add DPDK No Tx Checksum Offload
144 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
145 | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci
146 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
147 | | | Run Keyword If | not ${jumbo}
148 | | | ... | ${dut}.Add DPDK No Multi Seg
149 | | | Run Keyword If | ${nic_rxq_size} > 0
150 | | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size}
151 | | | Run Keyword If | ${nic_txq_size} > 0
152 | | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size}
153 | | | Run Keyword If | '${crypto_type}' != '${None}'
154 | | | ... | ${dut}.Add DPDK Cryptodev | ${thr_count_int}
156 | | ${_vlan_strip} | ${value}= | Run Keyword And Ignore Error
157 | | ... | Variable Should Exist | ${vlan_strip_off}
158 | | Run keyword If | '${_vlan_strip}' == 'PASS' and ${duts_count} == 2
159 | | ... | Add DPDK VLAN strip offload switch off between DUTs
161 | Pre-initialize layer avf on all DUTs
163 | | ... | Pre-initialize avf driver. Currently no operation.
167 | Pre-initialize layer rdma-core on all DUTs
169 | | ... | Pre-initialize rdma-core driver.
171 | | FOR | ${dut} | IN | @{duts}
172 | | | Set Interface Flow Control
173 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rx="off" | tx="off"
174 | | | Set PCI Parameter
175 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD"
178 | Pre-initialize layer mlx5_core on all DUTs
180 | | ... | Pre-initialize mlx5_core driver.
182 | | FOR | ${dut} | IN | @{duts}
183 | | | Run Keyword If | ${jumbo}
184 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200
186 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1500
187 | | | Set Interface Flow Control
188 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rx="off" | tx="off"
189 | | | Set PCI Parameter
190 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD"
193 | Initialize layer driver
195 | | ... | Initialize driver based interfaces on all DUT. Interfaces are
196 | | ... | brought up.
198 | | ... | *Arguments:*
199 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
200 | | ... | Type: string
201 | | ... | - validate - Validate interfaces are up.
202 | | ... | Type: boolean
206 | | ... | \| Initialize layer driver \| vfio-pci \|
208 | | [Arguments] | ${driver} | ${validate}=${True}
210 | | FOR | ${dut} | IN | @{duts}
211 | | | Initialize layer driver on node | ${dut} | ${driver}
213 | | Set Test Variable | ${int} | vf
214 | | Set interfaces in path up | validate=${validate}
216 | Initialize layer driver on node
218 | | ... | Initialize driver based interfaces on DUT.
220 | | ... | *Arguments:*
221 | | ... | - dut - DUT node.
222 | | ... | Type: string
223 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
224 | | ... | Type: string
228 | | ... | \| Initialize layer driver \| DUT1 \| vfio-pci \|
230 | | [Arguments] | ${dut} | ${driver}
232 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
234 | | | ... | Copy List | ${${dut}_${int}${pf}}
236 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_addr}
237 | | | ${_ip4_prefix}=
238 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_prefix}
240 | | | ... | Copy List | ${${dut}_${int}${pf}_mac}
242 | | | ... | Copy List | ${${dut}_${int}${pf}_pci}
244 | | | ... | Copy List | ${${dut}_${int}${pf}_vlan}
245 | | | Set Test Variable
246 | | | ... | ${${dut}_vf${pf}} | ${_vf}
247 | | | Set Test Variable
248 | | | ... | ${${dut}_vf${pf}_ip4_addr} | ${_ip4_addr}
249 | | | Set Suite Variable
250 | | | ... | ${${dut}_vf${pf}_ip4_prefix} | ${_ip4_prefix}
251 | | | Set Test Variable
252 | | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
253 | | | Set Test Variable
254 | | | ... | ${${dut}_vf${pf}_pci} | ${_pci}
255 | | | Set Test Variable
256 | | | ... | ${${dut}_vf${pf}_vlan} | ${_vlan}
257 | | | Run Keyword | Initialize layer ${driver} on node | ${dut} | ${pf}
260 | Initialize layer tap on node
262 | | ... | Initialize tap interfaces on DUT.
264 | | ... | *Arguments:*
265 | | ... | - dut - DUT node.
266 | | ... | Type: string
267 | | ... | - pf - TAP ID (logical port).
268 | | ... | Type: integer
272 | | ... | \| Initialize layer tap on node \| DUT1 \| 0 \|
274 | | [Arguments] | ${dut} | ${pf}
277 | | ... | ${nodes['${dut}']} | tap${${pf}-1}_namespace
278 | | ${tap_feature_mask}= | Create Tap feature mask | gso=${enable_gso}
280 | | ... | And Add Tap Interface | ${nodes['${dut}']} | tap${${pf}-1}
281 | | ... | host_namespace=tap${${pf}-1}_namespace
282 | | ... | num_rx_queues=${rxq_count_int}
283 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
284 | | ... | tap_feature_mask=${tap_feature_mask}
286 | | ... | Get Interface MAC | ${nodes['${dut}']} | tap${pf}
287 | | ${_tap}= | Create List | ${_tap}
288 | | ${_mac}= | Create List | ${_mac}
289 | | Vhost User Affinity
290 | | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0]
291 | | ... | skip_cnt=${${CPU_CNT_MAIN}+${CPU_CNT_SYSTEM}+${cpu_count_int}}
292 | | Set Test Variable
293 | | ... | ${${dut}_vf${pf}} | ${_tap}
294 | | Set Test Variable
295 | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
297 | Initialize layer vhost on node
299 | | ... | Initialize vhost interfaces on DUT.
301 | | ... | *Arguments:*
302 | | ... | - dut - DUT node.
303 | | ... | Type: string
304 | | ... | - pf - VHOST ID (logical port).
305 | | ... | Type: integer
309 | | ... | \| Initialize layer vhost on node \| DUT1 \| 0 \|
311 | | [Arguments] | ${dut} | ${pf}
313 | | ${virtio_feature_mask}= | Create Virtio feature mask | gso=${enable_gso}
314 | | ${vhost}= | Vpp Create Vhost User Interface
315 | | ... | ${nodes['${dut}']} | /var/run/vpp/sock-${pf}-1
316 | | ... | is_server=${True} | virtio_feature_mask=${virtio_feature_mask}
318 | | ... | Get Interface MAC | ${nodes['${dut}']} | vhost${pf}
319 | | ${_vhost}= | Create List | ${_vhost}
320 | | ${_mac}= | Create List | ${_mac}
321 | | Set Test Variable
322 | | ... | ${${dut}_vf${pf}} | ${_vhost}
323 | | Set Test Variable
324 | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
326 | Initialize layer vfio-pci on node
328 | | ... | Initialize vfio-pci interfaces on DUT on NIC PF.
329 | | ... | Currently no operation.
331 | | ... | *Arguments:*
332 | | ... | - dut - DUT node. Type: string
333 | | ... | - pf - NIC physical function (physical port). Type: integer
337 | | ... | \| Initialize layer vfio-pci on node \| DUT1 \| 1 \|
339 | | [Arguments] | ${dut} | ${pf}
343 | Initialize layer avf on node
345 | | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF.
347 | | ... | *Arguments:*
348 | | ... | - dut - DUT node. Type: string
349 | | ... | - pf - NIC physical function (physical port). Type: integer
353 | | ... | \| Initialize layer avf on node \| DUT1 \| 1 \|
355 | | [Arguments] | ${dut} | ${pf}
357 | | FOR | ${vf} | IN RANGE | 0 | ${nic_vfs}
358 | | | ${_avf}= | VPP Create AVF Interface
359 | | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[${vf}]
360 | | | ... | num_rx_queues=${rxq_count_int}
361 | | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
363 | | | ... | Get Interface IP4 | ${nodes['${dut}']} | ${_avf}
364 | | | ${_ip4_prefix}=
365 | | | ... | Get Interface IP4 Prefix Length | ${nodes['${dut}']} | ${_avf}
367 | | | ... | Get Interface MAC | ${nodes['${dut}']} | ${_avf}
369 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${_avf}
371 | | | ... | Get Interface VLAN | ${nodes['${dut}']} | ${_avf}
372 | | | Set List Value | ${${dut}_vf${pf}} | ${vf} | ${_avf}
373 | | | Set List Value | ${${dut}_vf${pf}_ip4_addr} | ${vf} | ${_ip4}
374 | | | Set List Value | ${${dut}_vf${pf}_ip4_prefix} | ${vf} | ${_ip4_prefix}
375 | | | Set List Value | ${${dut}_vf${pf}_mac} | ${vf} | ${_mac}
376 | | | Set List Value | ${${dut}_vf${pf}_pci} | ${vf} | ${_pci}
377 | | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan}
380 | Initialize layer rdma-core on node
382 | | ... | Initialize rdma-core (Mellanox VPP) interfaces on DUT on NIC PF.
384 | | ... | *Arguments:*
385 | | ... | - dut - DUT node. Type: string
386 | | ... | - pf - NIC physical function (physical port). Type: integer
390 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
392 | | [Arguments] | ${dut} | ${pf}
394 | | ${_rdma}= | VPP Create Rdma Interface
395 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
396 | | ... | num_rx_queues=${rxq_count_int}
397 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
398 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_rdma}
400 | Initialize layer mlx5_core on node
402 | | ... | Initialize mlx5_core interfaces on DUT on NIC PF.
403 | | ... | Currently no operation.
407 | Initialize layer interface
409 | | ... | Physical interfaces variables to be created on all DUTs.
411 | | ... | *Arguments:*
412 | | ... | - count - Number of untagged interfaces variables. Type: integer
416 | | ... | \| Initialize layer interface \| 1 \|
418 | | [Arguments] | ${count}=${1}
420 | | FOR | ${dut} | IN | @{duts}
421 | | | Initialize layer interface on node | ${dut} | count=${count}
424 | Initialize layer interface on node
426 | | ... | Physical interfaces variables to be created on all DUTs.
428 | | ... | *Arguments:*
429 | | ... | - dut - DUT node. Type: string
430 | | ... | - count - Number of baseline interface variables. Type: integer
434 | | ... | \| Initialize layer interface on node \| DUT1 \| 1 \|
436 | | [Arguments] | ${dut} | ${count}=${1}
438 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
439 | | | Initialize layer interface on node on PF | ${dut} | ${pf} | count=${count}
442 | Initialize layer interface on node on PF
444 | | ... | Baseline interfaces variables to be created.
446 | | ... | *Arguments:*
447 | | ... | - dut - DUT node. Type: string
448 | | ... | - pf - NIC physical function (physical port). Type: integer
449 | | ... | - count - Number of baseline interface variables. Type: integer
453 | | ... | \| Initialize layer interface on node on PF \| DUT1 \| 1 \| 1 \|
455 | | [Arguments] | ${dut} | ${pf} | ${count}=${1}
457 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
458 | | | Set Test Variable
459 | | | ... | ${${dut}_${int}${pf}_${id}} | ${${dut}_${int}${pf}}
462 | Initialize layer bonding
464 | | ... | Bonded interfaces and variables to be created on all DUT's interfaces.
466 | | ... | *Arguments:*
467 | | ... | - bond_mode - Link bonding mode. Type: string
468 | | ... | - lb_mode - Load balance mode. Type: string
469 | | ... | - count - Number of bond interface variables. Type: integer
473 | | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \|
475 | | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
477 | | FOR | ${dut} | IN | @{duts}
478 | | | Initialize layer bonding on node
479 | | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode}
480 | | | ... | count=${count}
482 | | Set Test Variable | ${int} | bond
484 | Initialize layer bonding on node
486 | | ... | Bonded interface and variables to be created on across east and
487 | | ... | west DUT's node interfaces.
489 | | ... | *Arguments:*
490 | | ... | - dut - DUT node. Type: string
491 | | ... | - bond_mode - Link bonding mode. Type: string
492 | | ... | - lb_mode - Load balance mode. Type: string
493 | | ... | - count - Number of bond interface variables. Type: integer
497 | | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \|
499 | | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
501 | | ${if_index}= | VPP Create Bond Interface
502 | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode}
503 | | ... | mac=00:00:00:01:01:01
504 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up
505 | | VPP Add Bond Member
506 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_1} | ${if_index}
507 | | VPP Add Bond Member
508 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_1} | ${if_index}
509 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
510 | | | Set Test Variable | ${${dut}_bond1_${id}} | ${if_index}
511 | | | Set Test Variable | ${${dut}_bond2_${id}} | ${if_index}
514 | Initialize layer dot1q
516 | | ... | Dot1q interfaces and variables to be created on all DUTs.
518 | | ... | *Arguments:*
519 | | ... | - count - Number of chains.
520 | | ... | Type: integer
521 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
522 | | ... | Type: boolean
523 | | ... | - start - Id of first chain, allows adding chains during test.
524 | | ... | Type: integer
526 | | ... | \| Initialize layer dot1q \| 1 \| True \| 1 \|
528 | | [Arguments] | ${count}=${1} | ${vlan_per_chain}=${True} | ${start}=${1}
530 | | FOR | ${dut} | IN | @{duts}
531 | | | Initialize layer dot1q on node
532 | | | ... | ${dut} | count=${count} | vlan_per_chain=${vlan_per_chain}
533 | | | ... | start=${start}
535 | | Set Test Variable | ${int} | dot1q
537 | Initialize layer dot1q on node
539 | | ... | Dot1q interfaces and variables to be created on all DUT's node.
541 | | ... | *Arguments:*
542 | | ... | - dut - DUT node.
543 | | ... | Type: string
544 | | ... | - count - Number of chains.
545 | | ... | Type: integer
546 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
547 | | ... | Type: boolean
548 | | ... | - start - Id of first chain, allows adding chains during test.
549 | | ... | Type: integer
553 | | ... | \| Initialize layer dot1q on node \| DUT1 \| 1 \| True \| 1 \|
555 | | [Arguments] | ${dut} | ${count}=${1} | ${vlan_per_chain}=${True}
556 | | ... | ${start}=${1}
558 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
559 | | | Initialize layer dot1q on node on PF | ${dut} | pf=${pf} | count=${count}
560 | | | ... | vlan_per_chain=${vlan_per_chain} | start=${start}
563 | Initialize layer dot1q on node on PF
565 | | ... | Dot1q interfaces and variables to be created on all DUT's node
566 | | ... | interfaces.
568 | | ... | *Arguments:*
569 | | ... | - dut - DUT node.
570 | | ... | Type: string
571 | | ... | - pf - NIC physical function (physical port).
572 | | ... | Type: integer
573 | | ... | - count - Number of chains.
574 | | ... | Type: integer
575 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
576 | | ... | Type: boolean
577 | | ... | - start - Id of first chain, allows adding chains during test.
578 | | ... | Type: integer
582 | | ... | \| Initialize layer dot1q on node on PF \| DUT1 \| 3 \| True \| 2 \|
584 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1}
585 | | ... | ${vlan_per_chain}=${True} | ${start}=${1}
587 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
588 | | | ${_dot1q}= | Initialize layer dot1q on node on PF for chain
589 | | | ... | dut=${dut} | pf=${pf} | id=${id} | vlan_per_chain=${vlan_per_chain}
590 | | | # First id results in non-None indices, after that _1_ are defined.
591 | | | ${_dot1q}= | Set Variable If | '${_dot1q}' == '${NONE}'
592 | | | ... | ${${dut}_dot1q${pf}_1}[0] | ${_dot1q}
593 | | | ${_dot1q}= | Create List | ${_dot1q}
594 | | | Set Test Variable | ${${dut}_dot1q${pf}_${id}} | ${_dot1q}
597 | Initialize layer dot1q on node on PF for chain
599 | | ... | Optionally create tag popping subinterface per chain.
600 | | ... | Return interface indices for dot1q layer interfaces,
601 | | ... | or Nones if subinterfaces are not created.
603 | | ... | *Arguments:*
604 | | ... | - dut - DUT node.
605 | | ... | Type: string
606 | | ... | - pf - NIC physical function (physical port).
607 | | ... | Type: integer
608 | | ... | - id - Positive index of the chain.
609 | | ... | Type: integer
610 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
611 | | ... | Type: boolean
615 | | ... | \| Initialize layer dot1q on node on PF for chain \| DUT1 \
616 | | ... | \| 1 \| 1 \| True \|
618 | | [Arguments] | ${dut} | ${pf} | ${id} | ${vlan_per_chain}=${True}
620 | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
622 | | ${_default}= | Evaluate | ${pf} * ${100} + ${id} - ${1}
623 | | ${_vlan}= | Get Variable Value | \${${dut}_pf${pf}_vlan}
624 | | ${_vlan}= | Set Variable If | '${_vlan}[0]' != '${NONE}'
625 | | ... | ${_vlan}[0] | ${_default}
626 | | ${_name} | ${_index}= | Create Vlan Subinterface
627 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0] | ${_vlan}
628 | | Set Interface State | ${nodes['${dut}']} | ${_index} | up
629 | | Configure L2 tag rewrite method on interfaces
630 | | ... | ${nodes['${dut}']} | ${_index} | TAG_REWRITE_METHOD=pop-1
631 | | Return From Keyword | ${_index}
633 | Initialize layer ip4vxlan
635 | | ... | VXLAN interfaces and variables to be created on all DUT's interfaces.
637 | | ... | *Arguments:*
638 | | ... | - count - Number of vxlan interfaces.
639 | | ... | Type: integer
640 | | ... | - start - Id of first chain, allows adding chains during test.
641 | | ... | Type: integer
643 | | ... | \| Initialize layer ip4vxlan \| 3 \| 2 \|
645 | | [Arguments] | ${count}=${1} | ${start}=${1}
647 | | FOR | ${dut} | IN | @{duts}
648 | | | Initialize layer ip4vxlan on node | ${dut} | count=${count}
649 | | | ... | start=${start}
651 | | Set Test Variable | ${int} | ip4vxlan
653 | Initialize layer ip4vxlan on node
655 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
656 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
657 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
658 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
660 | | ... | *Arguments:*
661 | | ... | - dut - DUT node.
662 | | ... | Type: string
663 | | ... | - count - Number of vxlan interfaces.
664 | | ... | Type: integer
665 | | ... | - start - Id of first chain, allows adding chains during test.
666 | | ... | Type: integer
670 | | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 3 \| 2 \|
672 | | [Arguments] | ${dut} | ${count}=${1} | ${start}=${1}
674 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
675 | | | Initialize layer ip4vxlan on node on PF | ${dut} | pf=${pf}
676 | | | ... | count=${count} | start=${start}
679 | Initialize layer ip4vxlan on node on PF
681 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
682 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
683 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
684 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
686 | | ... | *Arguments:*
687 | | ... | - dut - DUT node.
688 | | ... | Type: string
689 | | ... | - pf - NIC physical function (physical port).
690 | | ... | Type: integer
691 | | ... | - count - Number of vxlan interfaces.
692 | | ... | Type: integer
693 | | ... | - start - Id of first chain, allows adding chains during test.
694 | | ... | Type: integer
698 | | ... | \| Initialize layer ip4vxlan on node on PF \| DUT1 \| 3 \| 2 \|
700 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1} | ${start}=${1}
702 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
703 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_1}[0]
704 | | ... | 172.${pf}6.0.1 | 24
705 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
706 | | | ${_subnet}= | Evaluate | ${id} - 1
707 | | | ${_vni}= | Evaluate | ${id} - 1
708 | | | ${_ip4vxlan}= | Create VXLAN interface
709 | | | ... | ${nodes['${dut}']} | ${_vni}
710 | | | ... | 172.${pf}6.0.1 | 172.${pf}7.${_subnet}.2
712 | | | ... | Set Variable If | '${dut}' == 'DUT1'
713 | | | ... | ${TG_pf1_mac}[0] | ${DUT1_pf2_mac}[0]
715 | | | ... | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2
716 | | | ... | ${DUT2_pf1_mac}[0] | ${TG_pf2_mac}[0]
717 | | | ${_even}= | Evaluate | ${pf} % 2
718 | | | ${_mac}= | Set Variable If | ${_even}
719 | | | ... | ${_prev_mac} | ${_next_mac}
720 | | | VPP Add IP Neighbor
721 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
722 | | | ... | 172.${pf}6.${_subnet}.2 | ${_mac}
724 | | | ... | ${nodes['${dut}']} | 172.${pf}7.${_subnet}.0 | 24
725 | | | ... | gateway=172.${pf}6.${_subnet}.2
726 | | | ... | interface=${${dut}_${int}${pf}_${id}}[0]
727 | | | Set VXLAN Bypass
728 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
729 | | | ${_ip4vxlan}= | Create List | ${_ip4vxlan}
730 | | | Set Test Variable
731 | | | ... | ${${dut}_ip4vxlan${pf}_${id}} | ${_ip4vxlan}
734 | Configure vhost interfaces
736 | | ... | Create two Vhost-User interfaces on defined VPP node.
738 | | ... | *Arguments:*
739 | | ... | - ${dut_node} - DUT node.
740 | | ... | Type: dictionary
741 | | ... | - ${sock1} - Socket path for first Vhost-User interface.
742 | | ... | Type: string
743 | | ... | - ${sock2} - Socket path for second Vhost-User interface.
744 | | ... | Type: string
745 | | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional).
746 | | ... | Type: string
747 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
748 | | ... | Type: string
749 | | ... | - ${is_server} - Server side of connection (Optional).
750 | | ... | Type: boolean
751 | | ... | - ${virtio_feature_mask} - Enabled Virtio feature flags (Optional).
752 | | ... | Type: integer
754 | | ... | _NOTE:_ This KW sets following test case variable:
755 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
756 | | ... | - ${${vhost_if2}} - Second Vhost-User interface.
760 | | ... | \| Configure vhost interfaces \
761 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \|
763 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
764 | | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False}
765 | | ... | ${virtio_feature_mask}=${None}
767 | | ${vhost_1}= | Vpp Create Vhost User Interface
768 | | ... | ${dut_node} | ${sock1} | is_server=${is_server}
769 | | ... | virtio_feature_mask=${virtio_feature_mask}
770 | | ${vhost_2}= | Vpp Create Vhost User Interface
771 | | ... | ${dut_node} | ${sock2} | is_server=${is_server}
772 | | ... | virtio_feature_mask=${virtio_feature_mask}
773 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
774 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
775 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}
776 | | ${vhost_2_mac}= | Get Interface MAC | ${dut_node} | ${vhost_2_key}
777 | | Set Interface State | ${dut_node} | ${vhost_1} | up
778 | | Set Interface State | ${dut_node} | ${vhost_2} | up
779 | | Set Test Variable | ${${vhost_if1}} | ${vhost_1}
780 | | Set Test Variable | ${${vhost_if2}} | ${vhost_2}
781 | | Set Test Variable | ${${vhost_if1}_mac} | ${vhost_1_mac}
782 | | Set Test Variable | ${${vhost_if2}_mac} | ${vhost_2_mac}
785 | | [Documentation] | Get vhost-user dump.
787 | | ... | *Arguments:*
788 | | ... | - dut - DUT node data.
789 | | ... | Type: dictionary
791 | | [Arguments] | ${dut}
793 | | ${vhost_dump}= | Vhost User Dump | ${dut}
794 | | Return From Keyword | ${vhost_dump}