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}
155 | | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT}
157 | | ${_vlan_strip} | ${value}= | Run Keyword And Ignore Error
158 | | ... | Variable Should Exist | ${vlan_strip_off}
159 | | Run keyword If | '${_vlan_strip}' == 'PASS' and ${duts_count} == 2
160 | | ... | Add DPDK VLAN strip offload switch off between DUTs
162 | Pre-initialize layer avf on all DUTs
164 | | ... | Pre-initialize avf driver. Currently no operation.
168 | Pre-initialize layer rdma-core on all DUTs
170 | | ... | Pre-initialize rdma-core driver.
172 | | FOR | ${dut} | IN | @{duts}
173 | | | Set Interface Flow Control
174 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rx="off" | tx="off"
175 | | | Set PCI Parameter
176 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD"
179 | Pre-initialize layer mlx5_core on all DUTs
181 | | ... | Pre-initialize mlx5_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=1500
188 | | | Set Interface Flow Control
189 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rx="off" | tx="off"
190 | | | Set PCI Parameter
191 | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD"
194 | Initialize layer driver
196 | | ... | Initialize driver based interfaces on all DUT. Interfaces are
197 | | ... | brought up.
199 | | ... | *Arguments:*
200 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
201 | | ... | Type: string
202 | | ... | - validate - Validate interfaces are up.
203 | | ... | Type: boolean
207 | | ... | \| Initialize layer driver \| vfio-pci \|
209 | | [Arguments] | ${driver} | ${validate}=${True}
211 | | FOR | ${dut} | IN | @{duts}
212 | | | Initialize layer driver on node | ${dut} | ${driver}
214 | | Set Test Variable | ${int} | vf
215 | | Set interfaces in path up | validate=${validate}
217 | Initialize layer driver on node
219 | | ... | Initialize driver based interfaces on DUT.
221 | | ... | *Arguments:*
222 | | ... | - dut - DUT node.
223 | | ... | Type: string
224 | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core].
225 | | ... | Type: string
229 | | ... | \| Initialize layer driver \| DUT1 \| vfio-pci \|
231 | | [Arguments] | ${dut} | ${driver}
233 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
235 | | | ... | Copy List | ${${dut}_${int}${pf}}
237 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_addr}
238 | | | ${_ip4_prefix}=
239 | | | ... | Copy List | ${${dut}_${int}${pf}_ip4_prefix}
241 | | | ... | Copy List | ${${dut}_${int}${pf}_mac}
243 | | | ... | Copy List | ${${dut}_${int}${pf}_pci}
245 | | | ... | Copy List | ${${dut}_${int}${pf}_vlan}
246 | | | Set Test Variable
247 | | | ... | ${${dut}_vf${pf}} | ${_vf}
248 | | | Set Test Variable
249 | | | ... | ${${dut}_vf${pf}_ip4_addr} | ${_ip4_addr}
250 | | | Set Suite Variable
251 | | | ... | ${${dut}_vf${pf}_ip4_prefix} | ${_ip4_prefix}
252 | | | Set Test Variable
253 | | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
254 | | | Set Test Variable
255 | | | ... | ${${dut}_vf${pf}_pci} | ${_pci}
256 | | | Set Test Variable
257 | | | ... | ${${dut}_vf${pf}_vlan} | ${_vlan}
258 | | | Run Keyword | Initialize layer ${driver} on node | ${dut} | ${pf}
261 | Initialize layer tap on node
263 | | ... | Initialize tap interfaces on DUT.
265 | | ... | *Arguments:*
266 | | ... | - dut - DUT node.
267 | | ... | Type: string
268 | | ... | - pf - TAP ID (logical port).
269 | | ... | Type: integer
273 | | ... | \| Initialize layer tap on node \| DUT1 \| 0 \|
275 | | [Arguments] | ${dut} | ${pf}
278 | | ... | ${nodes['${dut}']} | tap${${pf}-1}_namespace
279 | | ${tap_feature_mask}= | Create Tap feature mask | gso=${enable_gso}
281 | | ... | And Add Tap Interface | ${nodes['${dut}']} | tap${${pf}-1}
282 | | ... | host_namespace=tap${${pf}-1}_namespace
283 | | ... | num_rx_queues=${rxq_count_int}
284 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
285 | | ... | tap_feature_mask=${tap_feature_mask}
287 | | ... | Get Interface MAC | ${nodes['${dut}']} | tap${pf}
288 | | ${_tap}= | Create List | ${_tap}
289 | | ${_mac}= | Create List | ${_mac}
290 | | Vhost User Affinity
291 | | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0]
292 | | ... | skip_cnt=${${CPU_CNT_MAIN}+${CPU_CNT_SYSTEM}+${cpu_count_int}}
293 | | Set Test Variable
294 | | ... | ${${dut}_vf${pf}} | ${_tap}
295 | | Set Test Variable
296 | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
298 | Initialize layer vhost on node
300 | | ... | Initialize vhost interfaces on DUT.
302 | | ... | *Arguments:*
303 | | ... | - dut - DUT node.
304 | | ... | Type: string
305 | | ... | - pf - VHOST ID (logical port).
306 | | ... | Type: integer
310 | | ... | \| Initialize layer vhost on node \| DUT1 \| 0 \|
312 | | [Arguments] | ${dut} | ${pf}
314 | | ${virtio_feature_mask}= | Create Virtio feature mask | gso=${enable_gso}
315 | | ${vhost}= | Vpp Create Vhost User Interface
316 | | ... | ${nodes['${dut}']} | /var/run/vpp/sock-${pf}-1
317 | | ... | is_server=${True} | virtio_feature_mask=${virtio_feature_mask}
319 | | ... | Get Interface MAC | ${nodes['${dut}']} | vhost${pf}
320 | | ${_vhost}= | Create List | ${_vhost}
321 | | ${_mac}= | Create List | ${_mac}
322 | | Set Test Variable
323 | | ... | ${${dut}_vf${pf}} | ${_vhost}
324 | | Set Test Variable
325 | | ... | ${${dut}_vf${pf}_mac} | ${_mac}
327 | Initialize layer vfio-pci on node
329 | | ... | Initialize vfio-pci interfaces on DUT on NIC PF.
330 | | ... | Currently no operation.
332 | | ... | *Arguments:*
333 | | ... | - dut - DUT node. Type: string
334 | | ... | - pf - NIC physical function (physical port). Type: integer
338 | | ... | \| Initialize layer vfio-pci on node \| DUT1 \| 1 \|
340 | | [Arguments] | ${dut} | ${pf}
344 | Initialize layer avf on node
346 | | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF.
348 | | ... | *Arguments:*
349 | | ... | - dut - DUT node. Type: string
350 | | ... | - pf - NIC physical function (physical port). Type: integer
354 | | ... | \| Initialize layer avf on node \| DUT1 \| 1 \|
356 | | [Arguments] | ${dut} | ${pf}
358 | | FOR | ${vf} | IN RANGE | 0 | ${nic_vfs}
359 | | | ${_avf}= | VPP Create AVF Interface
360 | | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[${vf}]
361 | | | ... | num_rx_queues=${rxq_count_int}
362 | | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
364 | | | ... | Get Interface IP4 | ${nodes['${dut}']} | ${_avf}
365 | | | ${_ip4_prefix}=
366 | | | ... | Get Interface IP4 Prefix Length | ${nodes['${dut}']} | ${_avf}
368 | | | ... | Get Interface MAC | ${nodes['${dut}']} | ${_avf}
370 | | | ... | Get Interface PCI Addr | ${nodes['${dut}']} | ${_avf}
372 | | | ... | Get Interface VLAN | ${nodes['${dut}']} | ${_avf}
373 | | | Set List Value | ${${dut}_vf${pf}} | ${vf} | ${_avf}
374 | | | Set List Value | ${${dut}_vf${pf}_ip4_addr} | ${vf} | ${_ip4}
375 | | | Set List Value | ${${dut}_vf${pf}_ip4_prefix} | ${vf} | ${_ip4_prefix}
376 | | | Set List Value | ${${dut}_vf${pf}_mac} | ${vf} | ${_mac}
377 | | | Set List Value | ${${dut}_vf${pf}_pci} | ${vf} | ${_pci}
378 | | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan}
381 | Initialize layer rdma-core on node
383 | | ... | Initialize rdma-core (Mellanox VPP) interfaces on DUT on NIC PF.
385 | | ... | *Arguments:*
386 | | ... | - dut - DUT node. Type: string
387 | | ... | - pf - NIC physical function (physical port). Type: integer
391 | | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \|
393 | | [Arguments] | ${dut} | ${pf}
395 | | ${_rdma}= | VPP Create Rdma Interface
396 | | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0]
397 | | ... | num_rx_queues=${rxq_count_int}
398 | | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size}
399 | | Set List Value | ${${dut}_vf${pf}} | 0 | ${_rdma}
401 | Initialize layer mlx5_core on node
403 | | ... | Initialize mlx5_core interfaces on DUT on NIC PF.
404 | | ... | Currently no operation.
408 | Initialize layer interface
410 | | ... | Physical interfaces variables to be created on all DUTs.
412 | | ... | *Arguments:*
413 | | ... | - count - Number of untagged interfaces variables. Type: integer
417 | | ... | \| Initialize layer interface \| 1 \|
419 | | [Arguments] | ${count}=${1}
421 | | FOR | ${dut} | IN | @{duts}
422 | | | Initialize layer interface on node | ${dut} | count=${count}
425 | Initialize layer interface on node
427 | | ... | Physical interfaces variables to be created on all DUTs.
429 | | ... | *Arguments:*
430 | | ... | - dut - DUT node. Type: string
431 | | ... | - count - Number of baseline interface variables. Type: integer
435 | | ... | \| Initialize layer interface on node \| DUT1 \| 1 \|
437 | | [Arguments] | ${dut} | ${count}=${1}
439 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
440 | | | Initialize layer interface on node on PF | ${dut} | ${pf} | count=${count}
443 | Initialize layer interface on node on PF
445 | | ... | Baseline interfaces variables to be created.
447 | | ... | *Arguments:*
448 | | ... | - dut - DUT node. Type: string
449 | | ... | - pf - NIC physical function (physical port). Type: integer
450 | | ... | - count - Number of baseline interface variables. Type: integer
454 | | ... | \| Initialize layer interface on node on PF \| DUT1 \| 1 \| 1 \|
456 | | [Arguments] | ${dut} | ${pf} | ${count}=${1}
458 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
459 | | | Set Test Variable
460 | | | ... | ${${dut}_${int}${pf}_${id}} | ${${dut}_${int}${pf}}
463 | Initialize layer bonding
465 | | ... | Bonded interfaces and variables to be created on all DUT's interfaces.
467 | | ... | *Arguments:*
468 | | ... | - bond_mode - Link bonding mode. Type: string
469 | | ... | - lb_mode - Load balance mode. Type: string
470 | | ... | - count - Number of bond interface variables. Type: integer
474 | | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \|
476 | | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
478 | | FOR | ${dut} | IN | @{duts}
479 | | | Initialize layer bonding on node
480 | | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode}
481 | | | ... | count=${count}
483 | | Set Test Variable | ${int} | bond
485 | Initialize layer bonding on node
487 | | ... | Bonded interface and variables to be created on across east and
488 | | ... | west DUT's node interfaces.
490 | | ... | *Arguments:*
491 | | ... | - dut - DUT node. Type: string
492 | | ... | - bond_mode - Link bonding mode. Type: string
493 | | ... | - lb_mode - Load balance mode. Type: string
494 | | ... | - count - Number of bond interface variables. Type: integer
498 | | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \|
500 | | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1}
502 | | ${if_index}= | VPP Create Bond Interface
503 | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode}
504 | | ... | mac=00:00:00:01:01:01
505 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up
506 | | VPP Add Bond Member
507 | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_1} | ${if_index}
508 | | VPP Add Bond Member
509 | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_1} | ${if_index}
510 | | FOR | ${id} | IN RANGE | 1 | ${count} + 1
511 | | | Set Test Variable | ${${dut}_bond1_${id}} | ${if_index}
512 | | | Set Test Variable | ${${dut}_bond2_${id}} | ${if_index}
515 | Initialize layer dot1q
517 | | ... | Dot1q interfaces and variables to be created on all DUTs.
519 | | ... | *Arguments:*
520 | | ... | - count - Number of chains.
521 | | ... | Type: integer
522 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
523 | | ... | Type: boolean
524 | | ... | - start - Id of first chain, allows adding chains during test.
525 | | ... | Type: integer
527 | | ... | \| Initialize layer dot1q \| 1 \| True \| 1 \|
529 | | [Arguments] | ${count}=${1} | ${vlan_per_chain}=${True} | ${start}=${1}
531 | | FOR | ${dut} | IN | @{duts}
532 | | | Initialize layer dot1q on node
533 | | | ... | ${dut} | count=${count} | vlan_per_chain=${vlan_per_chain}
534 | | | ... | start=${start}
536 | | Set Test Variable | ${int} | dot1q
538 | Initialize layer dot1q on node
540 | | ... | Dot1q interfaces and variables to be created on all DUT's node.
542 | | ... | *Arguments:*
543 | | ... | - dut - DUT node.
544 | | ... | Type: string
545 | | ... | - count - Number of chains.
546 | | ... | Type: integer
547 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
548 | | ... | Type: boolean
549 | | ... | - start - Id of first chain, allows adding chains during test.
550 | | ... | Type: integer
554 | | ... | \| Initialize layer dot1q on node \| DUT1 \| 1 \| True \| 1 \|
556 | | [Arguments] | ${dut} | ${count}=${1} | ${vlan_per_chain}=${True}
557 | | ... | ${start}=${1}
559 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
560 | | | Initialize layer dot1q on node on PF | ${dut} | pf=${pf} | count=${count}
561 | | | ... | vlan_per_chain=${vlan_per_chain} | start=${start}
564 | Initialize layer dot1q on node on PF
566 | | ... | Dot1q interfaces and variables to be created on all DUT's node
567 | | ... | interfaces.
569 | | ... | *Arguments:*
570 | | ... | - dut - DUT node.
571 | | ... | Type: string
572 | | ... | - pf - NIC physical function (physical port).
573 | | ... | Type: integer
574 | | ... | - count - Number of chains.
575 | | ... | Type: integer
576 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
577 | | ... | Type: boolean
578 | | ... | - start - Id of first chain, allows adding chains during test.
579 | | ... | Type: integer
583 | | ... | \| Initialize layer dot1q on node on PF \| DUT1 \| 3 \| True \| 2 \|
585 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1}
586 | | ... | ${vlan_per_chain}=${True} | ${start}=${1}
588 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
589 | | | ${_dot1q}= | Initialize layer dot1q on node on PF for chain
590 | | | ... | dut=${dut} | pf=${pf} | id=${id} | vlan_per_chain=${vlan_per_chain}
591 | | | # First id results in non-None indices, after that _1_ are defined.
592 | | | ${_dot1q}= | Set Variable If | '${_dot1q}' == '${NONE}'
593 | | | ... | ${${dut}_dot1q${pf}_1}[0] | ${_dot1q}
594 | | | ${_dot1q}= | Create List | ${_dot1q}
595 | | | Set Test Variable | ${${dut}_dot1q${pf}_${id}} | ${_dot1q}
598 | Initialize layer dot1q on node on PF for chain
600 | | ... | Optionally create tag popping subinterface per chain.
601 | | ... | Return interface indices for dot1q layer interfaces,
602 | | ... | or Nones if subinterfaces are not created.
604 | | ... | *Arguments:*
605 | | ... | - dut - DUT node.
606 | | ... | Type: string
607 | | ... | - pf - NIC physical function (physical port).
608 | | ... | Type: integer
609 | | ... | - id - Positive index of the chain.
610 | | ... | Type: integer
611 | | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
612 | | ... | Type: boolean
616 | | ... | \| Initialize layer dot1q on node on PF for chain \| DUT1 \
617 | | ... | \| 1 \| 1 \| True \|
619 | | [Arguments] | ${dut} | ${pf} | ${id} | ${vlan_per_chain}=${True}
621 | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
623 | | ${_default}= | Evaluate | ${pf} * ${100} + ${id} - ${1}
624 | | ${_vlan}= | Get Variable Value | \${${dut}_pf${pf}_vlan}
625 | | ${_vlan}= | Set Variable If | '${_vlan}[0]' != '${NONE}'
626 | | ... | ${_vlan}[0] | ${_default}
627 | | ${_name} | ${_index}= | Create Vlan Subinterface
628 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0] | ${_vlan}
629 | | Set Interface State | ${nodes['${dut}']} | ${_index} | up
630 | | Configure L2 tag rewrite method on interfaces
631 | | ... | ${nodes['${dut}']} | ${_index} | TAG_REWRITE_METHOD=pop-1
632 | | Return From Keyword | ${_index}
634 | Initialize layer ip4vxlan
636 | | ... | VXLAN interfaces and variables to be created on all DUT's interfaces.
638 | | ... | *Arguments:*
639 | | ... | - count - Number of vxlan interfaces.
640 | | ... | Type: integer
641 | | ... | - start - Id of first chain, allows adding chains during test.
642 | | ... | Type: integer
644 | | ... | \| Initialize layer ip4vxlan \| 3 \| 2 \|
646 | | [Arguments] | ${count}=${1} | ${start}=${1}
648 | | FOR | ${dut} | IN | @{duts}
649 | | | Initialize layer ip4vxlan on node | ${dut} | count=${count}
650 | | | ... | start=${start}
652 | | Set Test Variable | ${int} | ip4vxlan
654 | Initialize layer ip4vxlan on node
656 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
657 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
658 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
659 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
661 | | ... | *Arguments:*
662 | | ... | - dut - DUT node.
663 | | ... | Type: string
664 | | ... | - count - Number of vxlan interfaces.
665 | | ... | Type: integer
666 | | ... | - start - Id of first chain, allows adding chains during test.
667 | | ... | Type: integer
671 | | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 3 \| 2 \|
673 | | [Arguments] | ${dut} | ${count}=${1} | ${start}=${1}
675 | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
676 | | | Initialize layer ip4vxlan on node on PF | ${dut} | pf=${pf}
677 | | | ... | count=${count} | start=${start}
680 | Initialize layer ip4vxlan on node on PF
682 | | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting
683 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
684 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
685 | | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces.
687 | | ... | *Arguments:*
688 | | ... | - dut - DUT node.
689 | | ... | Type: string
690 | | ... | - pf - NIC physical function (physical port).
691 | | ... | Type: integer
692 | | ... | - count - Number of vxlan interfaces.
693 | | ... | Type: integer
694 | | ... | - start - Id of first chain, allows adding chains during test.
695 | | ... | Type: integer
699 | | ... | \| Initialize layer ip4vxlan on node on PF \| DUT1 \| 3 \| 2 \|
701 | | [Arguments] | ${dut} | ${pf}=${1} | ${count}=${1} | ${start}=${1}
703 | | Run Keyword If | "${start}" == "1" | VPP Interface Set IP Address
704 | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_1}[0]
705 | | ... | 172.${pf}6.0.1 | 24
706 | | FOR | ${id} | IN RANGE | ${start} | ${count} + 1
707 | | | ${_subnet}= | Evaluate | ${id} - 1
708 | | | ${_vni}= | Evaluate | ${id} - 1
709 | | | ${_ip4vxlan}= | Create VXLAN interface
710 | | | ... | ${nodes['${dut}']} | ${_vni}
711 | | | ... | 172.${pf}6.0.1 | 172.${pf}7.${_subnet}.2
713 | | | ... | Set Variable If | '${dut}' == 'DUT1'
714 | | | ... | ${TG_pf1_mac}[0] | ${DUT1_pf2_mac}[0]
716 | | | ... | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2
717 | | | ... | ${DUT2_pf1_mac}[0] | ${TG_pf2_mac}[0]
718 | | | ${_even}= | Evaluate | ${pf} % 2
719 | | | ${_mac}= | Set Variable If | ${_even}
720 | | | ... | ${_prev_mac} | ${_next_mac}
721 | | | VPP Add IP Neighbor
722 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
723 | | | ... | 172.${pf}6.${_subnet}.2 | ${_mac}
725 | | | ... | ${nodes['${dut}']} | 172.${pf}7.${_subnet}.0 | 24
726 | | | ... | gateway=172.${pf}6.${_subnet}.2
727 | | | ... | interface=${${dut}_${int}${pf}_${id}}[0]
728 | | | Set VXLAN Bypass
729 | | | ... | ${nodes['${dut}']} | ${${dut}_${int}${pf}_${id}}[0]
730 | | | ${_ip4vxlan}= | Create List | ${_ip4vxlan}
731 | | | Set Test Variable
732 | | | ... | ${${dut}_ip4vxlan${pf}_${id}} | ${_ip4vxlan}
735 | Configure vhost interfaces
737 | | ... | Create two Vhost-User interfaces on defined VPP node.
739 | | ... | *Arguments:*
740 | | ... | - ${dut_node} - DUT node.
741 | | ... | Type: dictionary
742 | | ... | - ${sock1} - Socket path for first Vhost-User interface.
743 | | ... | Type: string
744 | | ... | - ${sock2} - Socket path for second Vhost-User interface.
745 | | ... | Type: string
746 | | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional).
747 | | ... | Type: string
748 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
749 | | ... | Type: string
750 | | ... | - ${is_server} - Server side of connection (Optional).
751 | | ... | Type: boolean
752 | | ... | - ${virtio_feature_mask} - Enabled Virtio feature flags (Optional).
753 | | ... | Type: integer
755 | | ... | _NOTE:_ This KW sets following test case variable:
756 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
757 | | ... | - ${${vhost_if2}} - Second Vhost-User interface.
761 | | ... | \| Configure vhost interfaces \
762 | | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \|
764 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
765 | | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False}
766 | | ... | ${virtio_feature_mask}=${None}
768 | | ${vhost_1}= | Vpp Create Vhost User Interface
769 | | ... | ${dut_node} | ${sock1} | is_server=${is_server}
770 | | ... | virtio_feature_mask=${virtio_feature_mask}
771 | | ${vhost_2}= | Vpp Create Vhost User Interface
772 | | ... | ${dut_node} | ${sock2} | is_server=${is_server}
773 | | ... | virtio_feature_mask=${virtio_feature_mask}
774 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
775 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
776 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}
777 | | ${vhost_2_mac}= | Get Interface MAC | ${dut_node} | ${vhost_2_key}
778 | | Set Interface State | ${dut_node} | ${vhost_1} | up
779 | | Set Interface State | ${dut_node} | ${vhost_2} | up
780 | | Set Test Variable | ${${vhost_if1}} | ${vhost_1}
781 | | Set Test Variable | ${${vhost_if2}} | ${vhost_2}
782 | | Set Test Variable | ${${vhost_if1}_mac} | ${vhost_1_mac}
783 | | Set Test Variable | ${${vhost_if2}_mac} | ${vhost_2_mac}
786 | | [Documentation] | Get vhost-user dump.
788 | | ... | *Arguments:*
789 | | ... | - dut - DUT node data.
790 | | ... | Type: dictionary
792 | | [Arguments] | ${dut}
794 | | ${vhost_dump}= | Vhost User Dump | ${dut}
795 | | Return From Keyword | ${vhost_dump}