1 # Copyright (c) 2024 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
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.*
46 | | ... | *Arguments:*
47 | | ... | - validate - Validate interfaces are up.
48 | | ... | Type: boolean
50 | | [Arguments] | ${validate}=${True}
52 | | FOR | ${dut} | IN | @{duts}
53 | | | Set interfaces in path up on node | ${dut}
55 | | Run Keyword If | ${validate}
56 | | ... | All VPP Interfaces Ready Wait | ${nodes} | retries=${60}
58 | Set interfaces in path up on node
60 | | ... | *Set UP state on VPP interfaces in path on specified DUT node.*
62 | | ... | *Arguments:*
63 | | ... | - dut - DUT node on which to set the interfaces up.
64 | | ... | Type: string
68 | | ... | \| Set interfaces in path up on node \| DUT1 \|
70 | | [Arguments] | ${dut}
72 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
73 | | | Set interfaces in path up on node on PF | ${dut} | ${pf}
76 | Set interfaces in path up on node on PF
78 | | ... | *Set UP state on VPP interfaces in path on specified DUT node.*
80 | | ... | *Arguments:*
81 | | ... | - dut - DUT node on which to set the interfaces up.
82 | | ... | Type: string
83 | | ... | - pf - NIC physical function (physical port).
84 | | ... | Type: integer
88 | | ... | \| Set interfaces in path up on node on PF \| DUT1 \| 1 \|
90 | | [Arguments] | ${dut} | ${pf}
92 | | ${_chains} | ${value}= | Run Keyword And Ignore Error
93 | | ... | Variable Should Exist | @{${dut}_${int}${pf}_1}
94 | | ${_id}= | Set Variable If | '${_chains}' == 'PASS' | _1 | ${EMPTY}
95 | | FOR | ${if} | IN | @{${dut}_${int}${pf}${_id}}
96 | | | Set Interface State | ${nodes['${dut}']} | ${if} | up
99 | Pre-initialize layer driver
101 | | ... | Pre-initialize driver based interfaces on each DUT.
103 | | ... | *Arguments:*
104 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
105 | | ... | Type: string
109 | | ... | \| Pre-initialize layer driver \| vfio-pci \|
111 | | [Arguments] | ${driver}
113 | | Run Keyword | Pre-initialize layer ${driver} on all DUTs
115 | Pre-initialize layer tap on all DUTs
117 | | ... | Pre-initialize tap driver. Currently no operation.
121 | Pre-initialize layer vhost on all DUTs
123 | | ... | Pre-initialize vhost driver. Currently no operation.
127 | Pre-initialize layer vfio-pci on all DUTs
129 | | ... | Pre-initialize vfio-pci driver by adding related sections to startup
130 | | ... | config on all DUTs.
132 | | ${index}= | Get Index From List | ${TEST TAGS} | DPDK
133 | | Run Keyword If | ${index} >= 0 | Return From Keyword
134 | | FOR | ${dut} | IN | @{duts}
135 | | | Stop VPP Service | ${nodes['${dut}']}
136 | | | Unbind PCI Devices From Other Driver | ${nodes['${dut}']} | vfio-pci |
137 | | | ... | @{${dut}_pf_pci}
138 | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci}
139 | | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
140 | | | ... | ${dut}.Add DPDK No Tx Checksum Offload
141 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
142 | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci
143 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
144 | | | Run Keyword If | not ${jumbo}
145 | | | ... | ${dut}.Add DPDK No Multi Seg
146 | | | Run Keyword If | ${nic_rxq_size} > 0
147 | | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size}
148 | | | Run Keyword If | ${nic_txq_size} > 0
149 | | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size}
150 | | | Run Keyword If | '${crypto_type}' != '${None}'
151 | | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int}
152 | | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT}
155 | Pre-initialize layer avf on all DUTs
157 | | ... | Pre-initialize avf driver. Currently no operation.
161 | Pre-initialize layer af_xdp on all DUTs
163 | | ... | Pre-initialize af_xdp driver.
165 | | FOR | ${dut} | IN | @{duts}
166 | | | Set Interface State PCI
167 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | state=up
168 | | | Set Interface XDP off
169 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci}
170 | | | Set Interface Channels
171 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | num_queues=${rxq_count_int}
172 | | | ... | channel=combined
175 | Pre-initialize layer rdma-core on all DUTs
177 | | ... | Pre-initialize rdma-core driver.
179 | | FOR | ${dut} | IN | @{duts}
180 | | | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci}
181 | | | ... | mtu=${recommended_mtu}
182 | | | Set Interface Flow Control
183 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off"
186 | Pre-initialize layer mlx5_core on all DUTs
188 | | ... | Pre-initialize mlx5_core driver.
190 | | FOR | ${dut} | IN | @{duts}
191 | | | Set Interface Flow Control
192 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off"
194 | | ${index}= | Get Index From List | ${TEST TAGS} | DPDK
195 | | Run Keyword If | ${index} >= 0 | Return From Keyword
196 | | FOR | ${dut} | IN | @{duts}
197 | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci}
198 | | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
199 | | | ... | ${dut}.Add DPDK No Tx Checksum Offload
200 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
201 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
202 | | | Run Keyword If | not ${jumbo}
203 | | | ... | ${dut}.Add DPDK No Multi Seg
204 | | | Run Keyword If | ${nic_rxq_size} > 0
205 | | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size}
206 | | | Run Keyword If | ${nic_txq_size} > 0
207 | | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size}
208 | | | Run Keyword If | '${crypto_type}' != '${None}'
209 | | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int}
210 | | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT}
213 | Initialize layer driver
215 | | ... | Initialize driver based interfaces on all DUT. Interfaces are
216 | | ... | brought up.
218 | | ... | *Arguments:*
219 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
220 | | ... | Type: string
221 | | ... | - validate - Validate interfaces are up.
222 | | ... | Type: boolean
226 | | ... | \| Initialize layer driver \| vfio-pci \|
228 | | [Arguments] | ${driver} | ${validate}=${True}
230 | | FOR | ${dut} | IN | @{duts}
231 | | | Initialize layer driver on node | ${dut} | ${driver}
233 | | Set Test Variable | ${int} | vf
234 | | Set interfaces in path up | validate=${validate}
236 | Initialize layer driver on node
238 | | ... | Initialize driver based interfaces on DUT.
240 | | ... | *Arguments:*
241 | | ... | - dut - DUT node.
242 | | ... | Type: string
243 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
244 | | ... | Type: string
248 | | ... | \| Initialize layer driver \| DUT1 \| vfio-pci \|
250 | | [Arguments] | ${dut} | ${driver}
252 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
254 | | | ... | Copy List | ${${dut}_${int}${pf}}
256 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_addr}
257 | | | ${_ip4_prefix}=
258 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_prefix}
260 | | | ... | Copy List | ${${dut}_${int}${pf}_mac}
262 | | | ... | Copy List | ${${dut}_${int}${pf}_pci}
264 | | | ... | Copy List | ${${dut}_${int}${pf}_vlan}
265 | | | Set Test Variable
266 | | | ... | ${${dut}_vf${pf}} | ${_vf}
267 | | | Set Test Variable
268 | | | ... | ${${dut}_vf${pf}_ip4_addr} | ${_ip4_addr}
269 | | | Set Suite Variable
270 | | | ... | ${${dut}_vf${pf}_ip4_prefix} | ${_ip4_prefix}
271 | | | Set Test Variable
272 | | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
273 | | | Set Test Variable
274 | | | ... | ${${dut}_vf${pf}_pci} | ${_pci}
275 | | | Set Test Variable
276 | | | ... | ${${dut}_vf${pf}_vlan} | ${_vlan}
277 | | | Run Keyword | Initialize layer ${driver} on node | ${dut} | ${pf}
280 | Initialize layer tap on node
282 | | ... | Initialize tap interfaces on DUT.
284 | | ... | *Arguments:*
285 | | ... | - dut - DUT node.
286 | | ... | Type: string
287 | | ... | - pf - TAP ID (logical port).
288 | | ... | Type: integer
292 | | ... | \| Initialize layer tap on node \| DUT1 \| 0 \|
294 | | [Arguments] | ${dut} | ${pf}
297 | | ... | ${nodes['${dut}']} | tap${${pf}-1}_namespace
298 | | ${tap_feature_mask}= | Create Tap feature mask | gso=${enable_gso}
300 | | ... | And Add Tap Interface | ${nodes['${dut}']} | tap${${pf}-1}
301 | | ... | host_namespace=tap${${pf}-1}_namespace
302 | | ... | num_rx_queues=${rxq_count_int}
303 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
304 | | ... | tap_feature_mask=${tap_feature_mask}
306 | | ... | Get Interface MAC | ${nodes['${dut}']} | tap${pf}
307 | | ${_tap}= | Create List | ${_tap}
308 | | ${_mac}= | Create List | ${_mac}
309 | | Vhost User Affinity
310 | | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0]
311 | | ... | skip_cnt=${${CPU_CNT_MAIN}+${CPU_CNT_SYSTEM}+${cpu_count_int}}
312 | | Set Test Variable
313 | | ... | ${${dut}_vf${pf}} | ${_tap}
314 | | Set Test Variable
315 | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
317 | Initialize layer vhost on node
319 | | ... | Initialize vhost interfaces on DUT.
321 | | ... | *Arguments:*
322 | | ... | - dut - DUT node.
323 | | ... | Type: string
324 | | ... | - pf - VHOST ID (logical port).
325 | | ... | Type: integer
329 | | ... | \| Initialize layer vhost on node \| DUT1 \| 0 \|
331 | | [Arguments] | ${dut} | ${pf}
333 | | ${virtio_feature_mask}= | Create Virtio feature mask | gso=${enable_gso}
334 | | ${vhost}= | Vpp Create Vhost User Interface
335 | | ... | ${nodes['${dut}']} | /var/run/vpp/sock-${pf}-1
336 | | ... | is_server=${True} | virtio_feature_mask=${virtio_feature_mask}
338 | | ... | Get Interface MAC | ${nodes['${dut}']} | vhost${pf}
339 | | ${_vhost}= | Create List | ${_vhost}
340 | | ${_mac}= | Create List | ${_mac}
341 | | Set Test Variable
342 | | ... | ${${dut}_vf${pf}} | ${_vhost}
343 | | Set Test Variable
344 | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
346 | Initialize layer vfio-pci on node
348 | | ... | Initialize vfio-pci interfaces on DUT on NIC PF.
349 | | ... | Currently just set MTU to the recommended value.
351 | | ... | *Arguments:*
352 | | ... | - dut - DUT node. Type: string
353 | | ... | - pf - NIC physical function (physical port). Type: integer
357 | | ... | \| Initialize layer vfio-pci on node \| DUT1 \| 1 \|
359 | | [Arguments] | ${dut} | ${pf}
361 | | Set Interface State | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | down
362 | | VPP Set Interface MTU
363 | | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | mtu=${recommended_mtu}
365 | Initialize layer avf on node
367 | | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF.
369 | | ... | *Arguments:*
370 | | ... | - dut - DUT node. Type: string
371 | | ... | - pf - NIC physical function (physical port). Type: integer
375 | | ... | \| Initialize layer avf on node \| DUT1 \| 1 \|
377 | | [Arguments] | ${dut} | ${pf}
379 | | FOR | ${vf} | IN RANGE | 0 | ${nic_vfs}
380 | | | ${_avf}= | VPP Create AVF Interface
381 | | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[${vf}]
382 | | | ... | num_rx_queues=${rxq_count_int}
383 | | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
385 | | | ... | Get Interface IP4 | ${nodes['${dut}']} | ${_avf}
386 | | | ${_ip4_prefix}=
387 | | | ... | Get Interface IP4 Prefix Length | ${nodes['${dut}']} | ${_avf}
389 | | | ... | Get Interface MAC | ${nodes['${dut}']} | ${_avf}
391 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${_avf}
393 | | | ... | Get Interface VLAN | ${nodes['${dut}']} | ${_avf}
394 | | | Set List Value | ${${dut}_vf${pf}} | ${vf} | ${_avf}
395 | | | Set List Value | ${${dut}_vf${pf}_ip4_addr} | ${vf} | ${_ip4}
396 | | | Set List Value | ${${dut}_vf${pf}_ip4_prefix} | ${vf} | ${_ip4_prefix}
397 | | | Set List Value | ${${dut}_vf${pf}_mac} | ${vf} | ${_mac}
398 | | | Set List Value | ${${dut}_vf${pf}_pci} | ${vf} | ${_pci}
399 | | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan}
402 | Initialize layer af_xdp on node
404 | | ... | Initialize AF_XDP (eBPF) interfaces on DUT on NIC PF.
406 | | ... | *Arguments:*
407 | | ... | - dut - DUT node. Type: string
408 | | ... | - pf - NIC physical function (physical port). Type: integer
412 | | ... | \| Initialize layer af_xdp on node \| DUT1 \| 1 \|
414 | | [Arguments] | ${dut} | ${pf}
416 | | ${_af_xdp}= | VPP Create AF XDP Interface
417 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
418 | | ... | num_rx_queues=${65535}
419 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
420 | | ${cpu_skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM}+${CPU_CNT_MAIN}
421 | | ${cpu_skip_cnt}= | Evaluate | ${cpu_skip_cnt}+${cpu_count_int}
422 | | ${cpu_skip_cnt}= | Evaluate | ${cpu_skip_cnt}+(${pf}-${1})*${rxq_count_int}
423 | | Set Interface IRQs Affinity
424 | | ... | ${nodes['${dut}']} | ${_af_xdp}
425 | | ... | cpu_skip_cnt=${cpu_skip_cnt} | cpu_cnt=${rxq_count_int}
426 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_af_xdp}
428 | Initialize layer rdma-core on node
430 | | ... | Initialize rdma-core (Mellanox VPP) interfaces on DUT on NIC PF.
432 | | ... | *Arguments:*
433 | | ... | - dut - DUT node. Type: string
434 | | ... | - pf - NIC physical function (physical port). Type: integer
438 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
440 | | [Arguments] | ${dut} | ${pf}
442 | | ${_rdma}= | VPP Create Rdma Interface
443 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
444 | | ... | num_rx_queues=${rxq_count_int}
445 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
446 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_rdma}
448 | Initialize layer mlx5_core on node
450 | | ... | Initialize mlx5_core interfaces on DUT on NIC PF.
451 | | ... | Currently just set MTU to the recommended value.
453 | | ... | *Arguments:*
454 | | ... | - dut - DUT node. Type: string
455 | | ... | - pf - NIC physical function (physical port). Type: integer
459 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
461 | | [Arguments] | ${dut} | ${pf}
463 | | Set Interface State | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | down
464 | | VPP Set Interface MTU
465 | | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | mtu=${recommended_mtu}
467 | Initialize layer interface
469 | | ... | Physical interfaces variables to be created on all DUTs.
471 | | ... | *Arguments:*
472 | | ... | - count - Number of untagged interfaces variables. Type: integer
476 | | ... | \| Initialize layer interface \| 1 \|
478 | | [Arguments] | ${count}=${1}
480 | | FOR | ${dut} | IN | @{duts}
481 | | | Initialize layer interface on node | ${dut} | count=${count}
484 | Initialize layer interface on node
486 | | ... | Physical interfaces variables to be created on all DUTs.
488 | | ... | *Arguments:*
489 | | ... | - dut - DUT node. Type: string
490 | | ... | - count - Number of baseline interface variables. Type: integer
494 | | ... | \| Initialize layer interface on node \| DUT1 \| 1 \|
496 | | [Arguments] | ${dut} | ${count}=${1}
498 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
499 | | | Initialize layer interface on node on PF | ${dut} | ${pf} | count=${count}
502 | Initialize layer interface on node on PF
504 | | ... | Baseline interfaces variables to be created.
506 | | ... | *Arguments:*
507 | | ... | - dut - DUT node. Type: string
508 | | ... | - pf - NIC physical function (physical port). Type: integer
509 | | ... | - count - Number of baseline interface variables. Type: integer
513 | | ... | \| Initialize layer interface on node on PF \| DUT1 \| 1 \| 1 \|
515 | | [Arguments] | ${dut} | ${pf} | ${count}=${1}
517 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
518 | | | Set Test Variable
519 | | | ... | ${${dut}_${int}${pf}_${id}} | ${${dut}_${int}${pf}}
522 | Initialize layer bonding
524 | | ... | Bonded interfaces and variables to be created on all DUT's interfaces.
526 | | ... | *Arguments:*
527 | | ... | - bond_mode - Link bonding mode. Type: string
528 | | ... | - lb_mode - Load balance mode. Type: string
529 | | ... | - count - Number of bond interface variables. Type: integer
533 | | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \|
535 | | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
537 | | FOR | ${dut} | IN | @{duts}
538 | | | Initialize layer bonding on node
539 | | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode}
540 | | | ... | count=${count}
542 | | Set Test Variable | ${int} | bond
544 | Initialize layer bonding on node
546 | | ... | Bonded interface and variables to be created on across east and
547 | | ... | west DUT's node interfaces.
549 | | ... | *Arguments:*
550 | | ... | - dut - DUT node. Type: string
551 | | ... | - bond_mode - Link bonding mode. Type: string
552 | | ... | - lb_mode - Load balance mode. Type: string
553 | | ... | - count - Number of bond interface variables. Type: integer
557 | | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \|
559 | | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
561 | | ${if_index}= | VPP Create Bond Interface
562 | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode}
563 | | ... | mac=00:00:00:01:01:01
564 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up
565 | | VPP Add Bond Member
566 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_1} | ${if_index}
567 | | VPP Add Bond Member
568 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_1} | ${if_index}
569 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
570 | | | Set Test Variable | ${${dut}_bond1_${id}} | ${if_index}
571 | | | Set Test Variable | ${${dut}_bond2_${id}} | ${if_index}
574 | Initialize layer dot1q
576 | | ... | Dot1q interfaces and variables to be created on all DUTs.
578 | | ... | *Arguments:*
579 | | ... | - count - Number of chains.
580 | | ... | Type: integer
581 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
582 | | ... | Type: boolean
583 | | ... | - start - Id of first chain, allows adding chains during test.
584 | | ... | Type: integer
586 | | ... | \| Initialize layer dot1q \| 1 \| True \| 1 \|
588 | | [Arguments] | ${count}=${1} | ${vlan_per_chain}=${True} | ${start}=${1}
590 | | FOR | ${dut} | IN | @{duts}
591 | | | Initialize layer dot1q on node
592 | | | ... | ${dut} | count=${count} | vlan_per_chain=${vlan_per_chain}
593 | | | ... | start=${start}
595 | | Set Test Variable | ${int} | dot1q
597 | Initialize layer dot1q on node
599 | | ... | Dot1q interfaces and variables to be created on all DUT's node.
601 | | ... | *Arguments:*
602 | | ... | - dut - DUT node.
603 | | ... | Type: string
604 | | ... | - count - Number of chains.
605 | | ... | Type: integer
606 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
607 | | ... | Type: boolean
608 | | ... | - start - Id of first chain, allows adding chains during test.
609 | | ... | Type: integer
613 | | ... | \| Initialize layer dot1q on node \| DUT1 \| 1 \| True \| 1 \|
615 | | [Arguments] | ${dut} | ${count}=${1} | ${vlan_per_chain}=${True}
616 | | ... | ${start}=${1}
618 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
619 | | | Initialize layer dot1q on node on PF | ${dut} | pf=${pf} | count=${count}
620 | | | ... | vlan_per_chain=${vlan_per_chain} | start=${start}
623 | Initialize layer dot1q on node on PF
625 | | ... | Dot1q interfaces and variables to be created on all DUT's node
626 | | ... | interfaces.
628 | | ... | *Arguments:*
629 | | ... | - dut - DUT node.
630 | | ... | Type: string
631 | | ... | - pf - NIC physical function (physical port).
632 | | ... | Type: integer
633 | | ... | - count - Number of chains.
634 | | ... | Type: integer
635 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
636 | | ... | Type: boolean
637 | | ... | - start - Id of first chain, allows adding chains during test.
638 | | ... | Type: integer
642 | | ... | \| Initialize layer dot1q on node on PF \| DUT1 \| 3 \| True \| 2 \|
644 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1}
645 | | ... | ${vlan_per_chain}=${True} | ${start}=${1}
647 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
648 | | | ${_dot1q}= | Initialize layer dot1q on node on PF for chain
649 | | | ... | dut=${dut} | pf=${pf} | id=${id} | vlan_per_chain=${vlan_per_chain}
650 | | | # First id results in non-None indices, after that _1_ are defined.
651 | | | ${_dot1q}= | Set Variable If | '${_dot1q}' == '${NONE}'
652 | | | ... | ${${dut}_dot1q${pf}_1}[0] | ${_dot1q}
653 | | | ${_dot1q}= | Create List | ${_dot1q}
654 | | | Set Test Variable | ${${dut}_dot1q${pf}_${id}} | ${_dot1q}
657 | Initialize layer dot1q on node on PF for chain
659 | | ... | Optionally create tag popping subinterface per chain.
660 | | ... | Return interface indices for dot1q layer interfaces,
661 | | ... | or Nones if subinterfaces are not created.
663 | | ... | *Arguments:*
664 | | ... | - dut - DUT node.
665 | | ... | Type: string
666 | | ... | - pf - NIC physical function (physical port).
667 | | ... | Type: integer
668 | | ... | - id - Positive index of the chain.
669 | | ... | Type: integer
670 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
671 | | ... | Type: boolean
675 | | ... | \| Initialize layer dot1q on node on PF for chain \| DUT1 \
676 | | ... | \| 1 \| 1 \| True \|
678 | | [Arguments] | ${dut} | ${pf} | ${id} | ${vlan_per_chain}=${True}
680 | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
682 | | ${_default}= | Evaluate | ${pf} * ${100} + ${id} - ${1}
683 | | ${_vlan}= | Get Variable Value | \${${dut}_pf${pf}_vlan}
684 | | ${_vlan}= | Set Variable If | '${_vlan}[0]' != '${NONE}'
685 | | ... | ${_vlan}[0] | ${_default}
686 | | ${_name} | ${_index}= | Create Vlan Subinterface
687 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0] | ${_vlan}
688 | | Set Interface State | ${nodes['${dut}']} | ${_index} | up
689 | | Configure L2 tag rewrite method on interfaces
690 | | ... | ${nodes['${dut}']} | ${_index} | TAG_REWRITE_METHOD=pop-1
691 | | Return From Keyword | ${_index}
693 | Initialize layer ip4vxlan
695 | | ... | VXLAN interfaces and variables to be created on all DUT's interfaces.
697 | | ... | *Arguments:*
698 | | ... | - count - Number of vxlan interfaces.
699 | | ... | Type: integer
700 | | ... | - start - Id of first chain, allows adding chains during test.
701 | | ... | Type: integer
703 | | ... | \| Initialize layer ip4vxlan \| 3 \| 2 \|
705 | | [Arguments] | ${count}=${1} | ${start}=${1}
707 | | FOR | ${dut} | IN | @{duts}
708 | | | Initialize layer ip4vxlan on node | ${dut} | count=${count}
709 | | | ... | start=${start}
711 | | Set Test Variable | ${int} | ip4vxlan
713 | Initialize layer ip4vxlan on node
715 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
716 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
717 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
718 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
720 | | ... | *Arguments:*
721 | | ... | - dut - DUT node.
722 | | ... | Type: string
723 | | ... | - count - Number of vxlan interfaces.
724 | | ... | Type: integer
725 | | ... | - start - Id of first chain, allows adding chains during test.
726 | | ... | Type: integer
730 | | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 3 \| 2 \|
732 | | [Arguments] | ${dut} | ${count}=${1} | ${start}=${1}
734 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
735 | | | Initialize layer ip4vxlan on node on PF | ${dut} | pf=${pf}
736 | | | ... | count=${count} | start=${start}
739 | Initialize layer ip4vxlan on node on PF
741 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
742 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
743 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
744 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
746 | | ... | *Arguments:*
747 | | ... | - dut - DUT node.
748 | | ... | Type: string
749 | | ... | - pf - NIC physical function (physical port).
750 | | ... | Type: integer
751 | | ... | - count - Number of vxlan interfaces.
752 | | ... | Type: integer
753 | | ... | - start - Id of first chain, allows adding chains during test.
754 | | ... | Type: integer
758 | | ... | \| Initialize layer ip4vxlan on node on PF \| DUT1 \| 3 \| 2 \|
760 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1} | ${start}=${1}
762 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
763 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_1}[0]
764 | | ... | 172.${pf}6.0.1 | 24
765 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
766 | | | ${_subnet}= | Evaluate | ${id} - 1
767 | | | ${_vni}= | Evaluate | ${id} - 1
768 | | | ${_ip4vxlan}= | Create VXLAN interface
769 | | | ... | ${nodes['${dut}']} | ${_vni}
770 | | | ... | 172.${pf}6.0.1 | 172.${pf}7.${_subnet}.2
772 | | | ... | Set Variable If | '${dut}' == 'DUT1'
773 | | | ... | ${TG_pf1_mac}[0] | ${DUT1_pf2_mac}[0]
775 | | | ... | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2
776 | | | ... | ${DUT2_pf1_mac}[0] | ${TG_pf2_mac}[0]
777 | | | ${_even}= | Evaluate | ${pf} % 2
778 | | | ${_mac}= | Set Variable If | ${_even}
779 | | | ... | ${_prev_mac} | ${_next_mac}
780 | | | VPP Add IP Neighbor
781 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
782 | | | ... | 172.${pf}6.${_subnet}.2 | ${_mac}
784 | | | ... | ${nodes['${dut}']} | 172.${pf}7.${_subnet}.0 | 24
785 | | | ... | gateway=172.${pf}6.${_subnet}.2
786 | | | ... | interface=${${dut}_${int}${pf}_${id}}[0]
787 | | | Set VXLAN Bypass
788 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
789 | | | ${_ip4vxlan}= | Create List | ${_ip4vxlan}
790 | | | Set Test Variable
791 | | | ... | ${${dut}_ip4vxlan${pf}_${id}} | ${_ip4vxlan}
794 | Configure vhost interfaces
796 | | ... | Create two Vhost-User interfaces on defined VPP node.
798 | | ... | *Arguments:*
799 | | ... | - ${dut_node} - DUT node.
800 | | ... | Type: dictionary
801 | | ... | - ${sock1} - Socket path for first Vhost-User interface.
802 | | ... | Type: string
803 | | ... | - ${sock2} - Socket path for second Vhost-User interface.
804 | | ... | Type: string
805 | | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional).
806 | | ... | Type: string
807 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
808 | | ... | Type: string
809 | | ... | - ${is_server} - Server side of connection (Optional).
810 | | ... | Type: boolean
811 | | ... | - ${virtio_feature_mask} - Enabled Virtio feature flags (Optional).
812 | | ... | Type: integer
814 | | ... | _NOTE:_ This KW sets following test case variable:
815 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
816 | | ... | - ${${vhost_if2}} - Second Vhost-User interface.
820 | | ... | \| Configure vhost interfaces \
821 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \|
823 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
824 | | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False}
825 | | ... | ${virtio_feature_mask}=${None}
827 | | ${vhost_1}= | Vpp Create Vhost User Interface
828 | | ... | ${dut_node} | ${sock1} | is_server=${is_server}
829 | | ... | virtio_feature_mask=${virtio_feature_mask}
830 | | ${vhost_2}= | Vpp Create Vhost User Interface
831 | | ... | ${dut_node} | ${sock2} | is_server=${is_server}
832 | | ... | virtio_feature_mask=${virtio_feature_mask}
833 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
834 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
835 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}
836 | | ${vhost_2_mac}= | Get Interface MAC | ${dut_node} | ${vhost_2_key}
837 | | Set Interface State | ${dut_node} | ${vhost_1} | up
838 | | Set Interface State | ${dut_node} | ${vhost_2} | up
839 | | Set Test Variable | ${${vhost_if1}} | ${vhost_1}
840 | | Set Test Variable | ${${vhost_if2}} | ${vhost_2}
841 | | Set Test Variable | ${${vhost_if1}_mac} | ${vhost_1_mac}
842 | | Set Test Variable | ${${vhost_if2}_mac} | ${vhost_2_mac}
845 | | [Documentation] | Get vhost-user dump.
847 | | ... | *Arguments:*
848 | | ... | - dut - DUT node data.
849 | | ... | Type: dictionary
851 | | [Arguments] | ${dut}
853 | | ${vhost_dump}= | Vhost User Dump | ${dut}
854 | | Return From Keyword | ${vhost_dump}
856 | Lower DUT1-DUT2 MTU For Fragmentation
857 | | [Documentation] | Set lower MTU on both ends of DUT1-DUT2 link.
859 | | ... | This should force VPP to fragment (and reassembly) packets.
860 | | ... | Should be called after Initialize Layer Interface.
861 | | ... | Suite variables such as \${dut2_if1} should be defined by then.
863 | | ... | As VPP (at least dpdk plugin) require interface to be down
864 | | ... | before MTU can be changed, interfaces are temporarily downed.
866 | | # TODO: ip_reassembly_set to increase max_reassembly_length so jumbo passes.
867 | | Set Interface State | ${nodes['DUT1']} | ${dut1_if2} | down
868 | | Set Interface State | ${nodes['DUT2']} | ${dut2_if1} | down
869 | | VPP Set Interface MTU
870 | | ... | ${nodes['DUT1']} | ${dut1_if2} | ${MTU_FOR_FRAGMENTATION}
871 | | VPP Set Interface MTU
872 | | ... | ${nodes['DUT2']} | ${dut2_if1} | ${MTU_FOR_FRAGMENTATION}
873 | | Set Interface State | ${nodes['DUT1']} | ${dut1_if2} | up
874 | | Set Interface State | ${nodes['DUT2']} | ${dut2_if1} | up