1 # Copyright (c) 2023 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 | | | Unbind PCI Devices From Other Driver | ${nodes['${dut}']} | vfio-pci |
141 | | | ... | @{${dut}_pf_pci}
142 | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci}
143 | | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
144 | | | ... | ${dut}.Add DPDK No Tx Checksum Offload
145 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
146 | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci
147 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
148 | | | Run Keyword If | not ${jumbo}
149 | | | ... | ${dut}.Add DPDK No Multi Seg
150 | | | Run Keyword If | ${nic_rxq_size} > 0
151 | | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size}
152 | | | Run Keyword If | ${nic_txq_size} > 0
153 | | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size}
154 | | | Run Keyword If | '${crypto_type}' != '${None}'
155 | | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int}
156 | | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT}
159 | Pre-initialize layer avf on all DUTs
161 | | ... | Pre-initialize avf driver. Currently no operation.
165 | Pre-initialize layer af_xdp on all DUTs
167 | | ... | Pre-initialize af_xdp driver.
169 | | FOR | ${dut} | IN | @{duts}
170 | | | Set Interface State PCI
171 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | state=up
172 | | | Set Interface XDP off
173 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci}
174 | | | Set Interface Channels
175 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | num_queues=${rxq_count_int}
176 | | | ... | channel=combined
179 | Pre-initialize layer rdma-core on all DUTs
181 | | ... | Pre-initialize rdma-core driver.
183 | | FOR | ${dut} | IN | @{duts}
184 | | | Run Keyword If | ${jumbo}
185 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200
187 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1518
188 | | | Set Interface Flow Control
189 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off"
192 | Pre-initialize layer mlx5_core on all DUTs
194 | | ... | Pre-initialize mlx5_core driver.
196 | | FOR | ${dut} | IN | @{duts}
197 | | | Run Keyword If | ${jumbo}
198 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200
200 | | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1518
201 | | | Set Interface Flow Control
202 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off"
204 | | ${index}= | Get Index From List | ${TEST TAGS} | DPDK
205 | | Run Keyword If | ${index} >= 0 | Return From Keyword
206 | | FOR | ${dut} | IN | @{duts}
207 | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci}
208 | | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
209 | | | ... | ${dut}.Add DPDK No Tx Checksum Offload
210 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
211 | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci
212 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
213 | | | Run Keyword If | not ${jumbo}
214 | | | ... | ${dut}.Add DPDK No Multi Seg
215 | | | Run Keyword If | ${nic_rxq_size} > 0
216 | | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size}
217 | | | Run Keyword If | ${nic_txq_size} > 0
218 | | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size}
219 | | | Run Keyword If | '${crypto_type}' != '${None}'
220 | | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int}
221 | | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT}
224 | Initialize layer driver
226 | | ... | Initialize driver based interfaces on all DUT. Interfaces are
227 | | ... | brought up.
229 | | ... | *Arguments:*
230 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
231 | | ... | Type: string
232 | | ... | - validate - Validate interfaces are up.
233 | | ... | Type: boolean
237 | | ... | \| Initialize layer driver \| vfio-pci \|
239 | | [Arguments] | ${driver} | ${validate}=${True}
241 | | FOR | ${dut} | IN | @{duts}
242 | | | Initialize layer driver on node | ${dut} | ${driver}
244 | | Set Test Variable | ${int} | vf
245 | | Set interfaces in path up | validate=${validate}
247 | Initialize layer driver on node
249 | | ... | Initialize driver based interfaces on DUT.
251 | | ... | *Arguments:*
252 | | ... | - dut - DUT node.
253 | | ... | Type: string
254 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
255 | | ... | Type: string
259 | | ... | \| Initialize layer driver \| DUT1 \| vfio-pci \|
261 | | [Arguments] | ${dut} | ${driver}
263 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
265 | | | ... | Copy List | ${${dut}_${int}${pf}}
267 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_addr}
268 | | | ${_ip4_prefix}=
269 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_prefix}
271 | | | ... | Copy List | ${${dut}_${int}${pf}_mac}
273 | | | ... | Copy List | ${${dut}_${int}${pf}_pci}
275 | | | ... | Copy List | ${${dut}_${int}${pf}_vlan}
276 | | | Set Test Variable
277 | | | ... | ${${dut}_vf${pf}} | ${_vf}
278 | | | Set Test Variable
279 | | | ... | ${${dut}_vf${pf}_ip4_addr} | ${_ip4_addr}
280 | | | Set Suite Variable
281 | | | ... | ${${dut}_vf${pf}_ip4_prefix} | ${_ip4_prefix}
282 | | | Set Test Variable
283 | | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
284 | | | Set Test Variable
285 | | | ... | ${${dut}_vf${pf}_pci} | ${_pci}
286 | | | Set Test Variable
287 | | | ... | ${${dut}_vf${pf}_vlan} | ${_vlan}
288 | | | Run Keyword | Initialize layer ${driver} on node | ${dut} | ${pf}
291 | Initialize layer tap on node
293 | | ... | Initialize tap interfaces on DUT.
295 | | ... | *Arguments:*
296 | | ... | - dut - DUT node.
297 | | ... | Type: string
298 | | ... | - pf - TAP ID (logical port).
299 | | ... | Type: integer
303 | | ... | \| Initialize layer tap on node \| DUT1 \| 0 \|
305 | | [Arguments] | ${dut} | ${pf}
308 | | ... | ${nodes['${dut}']} | tap${${pf}-1}_namespace
309 | | ${tap_feature_mask}= | Create Tap feature mask | gso=${enable_gso}
311 | | ... | And Add Tap Interface | ${nodes['${dut}']} | tap${${pf}-1}
312 | | ... | host_namespace=tap${${pf}-1}_namespace
313 | | ... | num_rx_queues=${rxq_count_int}
314 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
315 | | ... | tap_feature_mask=${tap_feature_mask}
317 | | ... | Get Interface MAC | ${nodes['${dut}']} | tap${pf}
318 | | ${_tap}= | Create List | ${_tap}
319 | | ${_mac}= | Create List | ${_mac}
320 | | Vhost User Affinity
321 | | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0]
322 | | ... | skip_cnt=${${CPU_CNT_MAIN}+${CPU_CNT_SYSTEM}+${cpu_count_int}}
323 | | Set Test Variable
324 | | ... | ${${dut}_vf${pf}} | ${_tap}
325 | | Set Test Variable
326 | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
328 | Initialize layer vhost on node
330 | | ... | Initialize vhost interfaces on DUT.
332 | | ... | *Arguments:*
333 | | ... | - dut - DUT node.
334 | | ... | Type: string
335 | | ... | - pf - VHOST ID (logical port).
336 | | ... | Type: integer
340 | | ... | \| Initialize layer vhost on node \| DUT1 \| 0 \|
342 | | [Arguments] | ${dut} | ${pf}
344 | | ${virtio_feature_mask}= | Create Virtio feature mask | gso=${enable_gso}
345 | | ${vhost}= | Vpp Create Vhost User Interface
346 | | ... | ${nodes['${dut}']} | /var/run/vpp/sock-${pf}-1
347 | | ... | is_server=${True} | virtio_feature_mask=${virtio_feature_mask}
349 | | ... | Get Interface MAC | ${nodes['${dut}']} | vhost${pf}
350 | | ${_vhost}= | Create List | ${_vhost}
351 | | ${_mac}= | Create List | ${_mac}
352 | | Set Test Variable
353 | | ... | ${${dut}_vf${pf}} | ${_vhost}
354 | | Set Test Variable
355 | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
357 | Initialize layer vfio-pci on node
359 | | ... | Initialize vfio-pci interfaces on DUT on NIC PF.
360 | | ... | Currently no operation.
362 | | ... | *Arguments:*
363 | | ... | - dut - DUT node. Type: string
364 | | ... | - pf - NIC physical function (physical port). Type: integer
368 | | ... | \| Initialize layer vfio-pci on node \| DUT1 \| 1 \|
370 | | [Arguments] | ${dut} | ${pf}
374 | Initialize layer avf on node
376 | | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF.
378 | | ... | *Arguments:*
379 | | ... | - dut - DUT node. Type: string
380 | | ... | - pf - NIC physical function (physical port). Type: integer
384 | | ... | \| Initialize layer avf on node \| DUT1 \| 1 \|
386 | | [Arguments] | ${dut} | ${pf}
388 | | FOR | ${vf} | IN RANGE | 0 | ${nic_vfs}
389 | | | ${_avf}= | VPP Create AVF Interface
390 | | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[${vf}]
391 | | | ... | num_rx_queues=${rxq_count_int}
392 | | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
394 | | | ... | Get Interface IP4 | ${nodes['${dut}']} | ${_avf}
395 | | | ${_ip4_prefix}=
396 | | | ... | Get Interface IP4 Prefix Length | ${nodes['${dut}']} | ${_avf}
398 | | | ... | Get Interface MAC | ${nodes['${dut}']} | ${_avf}
400 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${_avf}
402 | | | ... | Get Interface VLAN | ${nodes['${dut}']} | ${_avf}
403 | | | Set List Value | ${${dut}_vf${pf}} | ${vf} | ${_avf}
404 | | | Set List Value | ${${dut}_vf${pf}_ip4_addr} | ${vf} | ${_ip4}
405 | | | Set List Value | ${${dut}_vf${pf}_ip4_prefix} | ${vf} | ${_ip4_prefix}
406 | | | Set List Value | ${${dut}_vf${pf}_mac} | ${vf} | ${_mac}
407 | | | Set List Value | ${${dut}_vf${pf}_pci} | ${vf} | ${_pci}
408 | | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan}
411 | Initialize layer af_xdp on node
413 | | ... | Initialize AF_XDP (eBPF) interfaces on DUT on NIC PF.
415 | | ... | *Arguments:*
416 | | ... | - dut - DUT node. Type: string
417 | | ... | - pf - NIC physical function (physical port). Type: integer
421 | | ... | \| Initialize layer af_xdp on node \| DUT1 \| 1 \|
423 | | [Arguments] | ${dut} | ${pf}
425 | | ${_af_xdp}= | VPP Create AF XDP Interface
426 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
427 | | ... | num_rx_queues=${65535}
428 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
429 | | ${cpu_skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM}+${CPU_CNT_MAIN}
430 | | ${cpu_skip_cnt}= | Evaluate | ${cpu_skip_cnt}+${cpu_count_int}
431 | | ${cpu_skip_cnt}= | Evaluate | ${cpu_skip_cnt}+(${pf}-${1})*${rxq_count_int}
432 | | Set Interface IRQs Affinity
433 | | ... | ${nodes['${dut}']} | ${_af_xdp}
434 | | ... | cpu_skip_cnt=${cpu_skip_cnt} | cpu_cnt=${rxq_count_int}
435 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_af_xdp}
437 | Initialize layer rdma-core on node
439 | | ... | Initialize rdma-core (Mellanox VPP) interfaces on DUT on NIC PF.
441 | | ... | *Arguments:*
442 | | ... | - dut - DUT node. Type: string
443 | | ... | - pf - NIC physical function (physical port). Type: integer
447 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
449 | | [Arguments] | ${dut} | ${pf}
451 | | ${_rdma}= | VPP Create Rdma Interface
452 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
453 | | ... | num_rx_queues=${rxq_count_int}
454 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
455 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_rdma}
457 | Initialize layer mlx5_core on node
459 | | ... | Initialize mlx5_core interfaces on DUT on NIC PF.
460 | | ... | Currently no operation.
462 | | ... | *Arguments:*
463 | | ... | - dut - DUT node. Type: string
464 | | ... | - pf - NIC physical function (physical port). Type: integer
468 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
470 | | [Arguments] | ${dut} | ${pf}
474 | Initialize layer interface
476 | | ... | Physical interfaces variables to be created on all DUTs.
478 | | ... | *Arguments:*
479 | | ... | - count - Number of untagged interfaces variables. Type: integer
483 | | ... | \| Initialize layer interface \| 1 \|
485 | | [Arguments] | ${count}=${1}
487 | | FOR | ${dut} | IN | @{duts}
488 | | | Initialize layer interface on node | ${dut} | count=${count}
491 | Initialize layer interface on node
493 | | ... | Physical interfaces variables to be created on all DUTs.
495 | | ... | *Arguments:*
496 | | ... | - dut - DUT node. Type: string
497 | | ... | - count - Number of baseline interface variables. Type: integer
501 | | ... | \| Initialize layer interface on node \| DUT1 \| 1 \|
503 | | [Arguments] | ${dut} | ${count}=${1}
505 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
506 | | | Initialize layer interface on node on PF | ${dut} | ${pf} | count=${count}
509 | Initialize layer interface on node on PF
511 | | ... | Baseline interfaces variables to be created.
513 | | ... | *Arguments:*
514 | | ... | - dut - DUT node. Type: string
515 | | ... | - pf - NIC physical function (physical port). Type: integer
516 | | ... | - count - Number of baseline interface variables. Type: integer
520 | | ... | \| Initialize layer interface on node on PF \| DUT1 \| 1 \| 1 \|
522 | | [Arguments] | ${dut} | ${pf} | ${count}=${1}
524 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
525 | | | Set Test Variable
526 | | | ... | ${${dut}_${int}${pf}_${id}} | ${${dut}_${int}${pf}}
529 | Initialize layer bonding
531 | | ... | Bonded interfaces and variables to be created on all DUT's interfaces.
533 | | ... | *Arguments:*
534 | | ... | - bond_mode - Link bonding mode. Type: string
535 | | ... | - lb_mode - Load balance mode. Type: string
536 | | ... | - count - Number of bond interface variables. Type: integer
540 | | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \|
542 | | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
544 | | FOR | ${dut} | IN | @{duts}
545 | | | Initialize layer bonding on node
546 | | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode}
547 | | | ... | count=${count}
549 | | Set Test Variable | ${int} | bond
551 | Initialize layer bonding on node
553 | | ... | Bonded interface and variables to be created on across east and
554 | | ... | west DUT's node interfaces.
556 | | ... | *Arguments:*
557 | | ... | - dut - DUT node. Type: string
558 | | ... | - bond_mode - Link bonding mode. Type: string
559 | | ... | - lb_mode - Load balance mode. Type: string
560 | | ... | - count - Number of bond interface variables. Type: integer
564 | | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \|
566 | | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
568 | | ${if_index}= | VPP Create Bond Interface
569 | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode}
570 | | ... | mac=00:00:00:01:01:01
571 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up
572 | | VPP Add Bond Member
573 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_1} | ${if_index}
574 | | VPP Add Bond Member
575 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_1} | ${if_index}
576 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
577 | | | Set Test Variable | ${${dut}_bond1_${id}} | ${if_index}
578 | | | Set Test Variable | ${${dut}_bond2_${id}} | ${if_index}
581 | Initialize layer dot1q
583 | | ... | Dot1q interfaces and variables to be created on all DUTs.
585 | | ... | *Arguments:*
586 | | ... | - count - Number of chains.
587 | | ... | Type: integer
588 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
589 | | ... | Type: boolean
590 | | ... | - start - Id of first chain, allows adding chains during test.
591 | | ... | Type: integer
593 | | ... | \| Initialize layer dot1q \| 1 \| True \| 1 \|
595 | | [Arguments] | ${count}=${1} | ${vlan_per_chain}=${True} | ${start}=${1}
597 | | FOR | ${dut} | IN | @{duts}
598 | | | Initialize layer dot1q on node
599 | | | ... | ${dut} | count=${count} | vlan_per_chain=${vlan_per_chain}
600 | | | ... | start=${start}
602 | | Set Test Variable | ${int} | dot1q
604 | Initialize layer dot1q on node
606 | | ... | Dot1q interfaces and variables to be created on all DUT's node.
608 | | ... | *Arguments:*
609 | | ... | - dut - DUT node.
610 | | ... | Type: string
611 | | ... | - count - Number of chains.
612 | | ... | Type: integer
613 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
614 | | ... | Type: boolean
615 | | ... | - start - Id of first chain, allows adding chains during test.
616 | | ... | Type: integer
620 | | ... | \| Initialize layer dot1q on node \| DUT1 \| 1 \| True \| 1 \|
622 | | [Arguments] | ${dut} | ${count}=${1} | ${vlan_per_chain}=${True}
623 | | ... | ${start}=${1}
625 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
626 | | | Initialize layer dot1q on node on PF | ${dut} | pf=${pf} | count=${count}
627 | | | ... | vlan_per_chain=${vlan_per_chain} | start=${start}
630 | Initialize layer dot1q on node on PF
632 | | ... | Dot1q interfaces and variables to be created on all DUT's node
633 | | ... | interfaces.
635 | | ... | *Arguments:*
636 | | ... | - dut - DUT node.
637 | | ... | Type: string
638 | | ... | - pf - NIC physical function (physical port).
639 | | ... | Type: integer
640 | | ... | - count - Number of chains.
641 | | ... | Type: integer
642 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
643 | | ... | Type: boolean
644 | | ... | - start - Id of first chain, allows adding chains during test.
645 | | ... | Type: integer
649 | | ... | \| Initialize layer dot1q on node on PF \| DUT1 \| 3 \| True \| 2 \|
651 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1}
652 | | ... | ${vlan_per_chain}=${True} | ${start}=${1}
654 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
655 | | | ${_dot1q}= | Initialize layer dot1q on node on PF for chain
656 | | | ... | dut=${dut} | pf=${pf} | id=${id} | vlan_per_chain=${vlan_per_chain}
657 | | | # First id results in non-None indices, after that _1_ are defined.
658 | | | ${_dot1q}= | Set Variable If | '${_dot1q}' == '${NONE}'
659 | | | ... | ${${dut}_dot1q${pf}_1}[0] | ${_dot1q}
660 | | | ${_dot1q}= | Create List | ${_dot1q}
661 | | | Set Test Variable | ${${dut}_dot1q${pf}_${id}} | ${_dot1q}
664 | Initialize layer dot1q on node on PF for chain
666 | | ... | Optionally create tag popping subinterface per chain.
667 | | ... | Return interface indices for dot1q layer interfaces,
668 | | ... | or Nones if subinterfaces are not created.
670 | | ... | *Arguments:*
671 | | ... | - dut - DUT node.
672 | | ... | Type: string
673 | | ... | - pf - NIC physical function (physical port).
674 | | ... | Type: integer
675 | | ... | - id - Positive index of the chain.
676 | | ... | Type: integer
677 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
678 | | ... | Type: boolean
682 | | ... | \| Initialize layer dot1q on node on PF for chain \| DUT1 \
683 | | ... | \| 1 \| 1 \| True \|
685 | | [Arguments] | ${dut} | ${pf} | ${id} | ${vlan_per_chain}=${True}
687 | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
689 | | ${_default}= | Evaluate | ${pf} * ${100} + ${id} - ${1}
690 | | ${_vlan}= | Get Variable Value | \${${dut}_pf${pf}_vlan}
691 | | ${_vlan}= | Set Variable If | '${_vlan}[0]' != '${NONE}'
692 | | ... | ${_vlan}[0] | ${_default}
693 | | ${_name} | ${_index}= | Create Vlan Subinterface
694 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0] | ${_vlan}
695 | | Set Interface State | ${nodes['${dut}']} | ${_index} | up
696 | | Configure L2 tag rewrite method on interfaces
697 | | ... | ${nodes['${dut}']} | ${_index} | TAG_REWRITE_METHOD=pop-1
698 | | Return From Keyword | ${_index}
700 | Initialize layer ip4vxlan
702 | | ... | VXLAN interfaces and variables to be created on all DUT's interfaces.
704 | | ... | *Arguments:*
705 | | ... | - count - Number of vxlan interfaces.
706 | | ... | Type: integer
707 | | ... | - start - Id of first chain, allows adding chains during test.
708 | | ... | Type: integer
710 | | ... | \| Initialize layer ip4vxlan \| 3 \| 2 \|
712 | | [Arguments] | ${count}=${1} | ${start}=${1}
714 | | FOR | ${dut} | IN | @{duts}
715 | | | Initialize layer ip4vxlan on node | ${dut} | count=${count}
716 | | | ... | start=${start}
718 | | Set Test Variable | ${int} | ip4vxlan
720 | Initialize layer ip4vxlan on node
722 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
723 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
724 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
725 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
727 | | ... | *Arguments:*
728 | | ... | - dut - DUT node.
729 | | ... | Type: string
730 | | ... | - count - Number of vxlan interfaces.
731 | | ... | Type: integer
732 | | ... | - start - Id of first chain, allows adding chains during test.
733 | | ... | Type: integer
737 | | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 3 \| 2 \|
739 | | [Arguments] | ${dut} | ${count}=${1} | ${start}=${1}
741 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
742 | | | Initialize layer ip4vxlan on node on PF | ${dut} | pf=${pf}
743 | | | ... | count=${count} | start=${start}
746 | Initialize layer ip4vxlan on node on PF
748 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
749 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
750 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
751 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
753 | | ... | *Arguments:*
754 | | ... | - dut - DUT node.
755 | | ... | Type: string
756 | | ... | - pf - NIC physical function (physical port).
757 | | ... | Type: integer
758 | | ... | - count - Number of vxlan interfaces.
759 | | ... | Type: integer
760 | | ... | - start - Id of first chain, allows adding chains during test.
761 | | ... | Type: integer
765 | | ... | \| Initialize layer ip4vxlan on node on PF \| DUT1 \| 3 \| 2 \|
767 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1} | ${start}=${1}
769 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
770 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_1}[0]
771 | | ... | 172.${pf}6.0.1 | 24
772 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
773 | | | ${_subnet}= | Evaluate | ${id} - 1
774 | | | ${_vni}= | Evaluate | ${id} - 1
775 | | | ${_ip4vxlan}= | Create VXLAN interface
776 | | | ... | ${nodes['${dut}']} | ${_vni}
777 | | | ... | 172.${pf}6.0.1 | 172.${pf}7.${_subnet}.2
779 | | | ... | Set Variable If | '${dut}' == 'DUT1'
780 | | | ... | ${TG_pf1_mac}[0] | ${DUT1_pf2_mac}[0]
782 | | | ... | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2
783 | | | ... | ${DUT2_pf1_mac}[0] | ${TG_pf2_mac}[0]
784 | | | ${_even}= | Evaluate | ${pf} % 2
785 | | | ${_mac}= | Set Variable If | ${_even}
786 | | | ... | ${_prev_mac} | ${_next_mac}
787 | | | VPP Add IP Neighbor
788 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
789 | | | ... | 172.${pf}6.${_subnet}.2 | ${_mac}
791 | | | ... | ${nodes['${dut}']} | 172.${pf}7.${_subnet}.0 | 24
792 | | | ... | gateway=172.${pf}6.${_subnet}.2
793 | | | ... | interface=${${dut}_${int}${pf}_${id}}[0]
794 | | | Set VXLAN Bypass
795 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
796 | | | ${_ip4vxlan}= | Create List | ${_ip4vxlan}
797 | | | Set Test Variable
798 | | | ... | ${${dut}_ip4vxlan${pf}_${id}} | ${_ip4vxlan}
801 | Configure vhost interfaces
803 | | ... | Create two Vhost-User interfaces on defined VPP node.
805 | | ... | *Arguments:*
806 | | ... | - ${dut_node} - DUT node.
807 | | ... | Type: dictionary
808 | | ... | - ${sock1} - Socket path for first Vhost-User interface.
809 | | ... | Type: string
810 | | ... | - ${sock2} - Socket path for second Vhost-User interface.
811 | | ... | Type: string
812 | | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional).
813 | | ... | Type: string
814 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
815 | | ... | Type: string
816 | | ... | - ${is_server} - Server side of connection (Optional).
817 | | ... | Type: boolean
818 | | ... | - ${virtio_feature_mask} - Enabled Virtio feature flags (Optional).
819 | | ... | Type: integer
821 | | ... | _NOTE:_ This KW sets following test case variable:
822 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
823 | | ... | - ${${vhost_if2}} - Second Vhost-User interface.
827 | | ... | \| Configure vhost interfaces \
828 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \|
830 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
831 | | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False}
832 | | ... | ${virtio_feature_mask}=${None}
834 | | ${vhost_1}= | Vpp Create Vhost User Interface
835 | | ... | ${dut_node} | ${sock1} | is_server=${is_server}
836 | | ... | virtio_feature_mask=${virtio_feature_mask}
837 | | ${vhost_2}= | Vpp Create Vhost User Interface
838 | | ... | ${dut_node} | ${sock2} | is_server=${is_server}
839 | | ... | virtio_feature_mask=${virtio_feature_mask}
840 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
841 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
842 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}
843 | | ${vhost_2_mac}= | Get Interface MAC | ${dut_node} | ${vhost_2_key}
844 | | Set Interface State | ${dut_node} | ${vhost_1} | up
845 | | Set Interface State | ${dut_node} | ${vhost_2} | up
846 | | Set Test Variable | ${${vhost_if1}} | ${vhost_1}
847 | | Set Test Variable | ${${vhost_if2}} | ${vhost_2}
848 | | Set Test Variable | ${${vhost_if1}_mac} | ${vhost_1_mac}
849 | | Set Test Variable | ${${vhost_if2}_mac} | ${vhost_2_mac}
852 | | [Documentation] | Get vhost-user dump.
854 | | ... | *Arguments:*
855 | | ... | - dut - DUT node data.
856 | | ... | Type: dictionary
858 | | [Arguments] | ${dut}
860 | | ${vhost_dump}= | Vhost User Dump | ${dut}
861 | | Return From Keyword | ${vhost_dump}