43
43
# - pmtu_ipv6_vxlan6_exception
44
44
# Same as pmtu_ipv4_vxlan6_exception, but send IPv6 packets from A to B
45
45
#
46
+ # - pmtu_ipv4_geneve4_exception
47
+ # Same as pmtu_ipv4_vxlan4_exception, but using a GENEVE tunnel instead of
48
+ # VXLAN
49
+ #
50
+ # - pmtu_ipv6_geneve4_exception
51
+ # Same as pmtu_ipv6_vxlan4_exception, but using a GENEVE tunnel instead of
52
+ # VXLAN
53
+ #
54
+ # - pmtu_ipv4_geneve6_exception
55
+ # Same as pmtu_ipv4_vxlan6_exception, but using a GENEVE tunnel instead of
56
+ # VXLAN
57
+ #
58
+ # - pmtu_ipv6_geneve6_exception
59
+ # Same as pmtu_ipv6_vxlan6_exception, but using a GENEVE tunnel instead of
60
+ # VXLAN
61
+ #
46
62
# - pmtu_vti4_exception
47
63
# Set up vti tunnel on top of veth, with xfrm states and policies, in two
48
64
# namespaces with matching endpoints. Check that route exception is not
@@ -93,6 +109,10 @@ tests="
93
109
pmtu_ipv6_vxlan4_exception IPv6 over vxlan4: PMTU exceptions
94
110
pmtu_ipv4_vxlan6_exception IPv4 over vxlan6: PMTU exceptions
95
111
pmtu_ipv6_vxlan6_exception IPv6 over vxlan6: PMTU exceptions
112
+ pmtu_ipv4_geneve4_exception IPv4 over geneve4: PMTU exceptions
113
+ pmtu_ipv6_geneve4_exception IPv6 over geneve4: PMTU exceptions
114
+ pmtu_ipv4_geneve6_exception IPv4 over geneve6: PMTU exceptions
115
+ pmtu_ipv6_geneve6_exception IPv6 over geneve6: PMTU exceptions
96
116
pmtu_vti6_exception vti6: PMTU exceptions
97
117
pmtu_vti4_exception vti4: PMTU exceptions
98
118
pmtu_vti4_default_mtu vti4: default MTU assignment
@@ -230,32 +250,50 @@ setup_vti6() {
230
250
setup_vti 6 ${veth6_a_addr} ${veth6_b_addr} ${tunnel6_a_addr} ${tunnel6_b_addr} ${tunnel6_mask}
231
251
}
232
252
233
- setup_vxlan () {
234
- a_addr=" ${1} "
235
- b_addr=" ${2} "
236
- opts=" ${3} "
253
+ setup_vxlan_or_geneve () {
254
+ type=" ${1} "
255
+ a_addr=" ${2} "
256
+ b_addr=" ${3} "
257
+ opts=" ${4} "
258
+
259
+ if [ " ${type} " = " vxlan" ]; then
260
+ opts=" ${opts} ttl 64 dstport 4789"
261
+ opts_a=" local ${a_addr} "
262
+ opts_b=" local ${b_addr} "
263
+ else
264
+ opts_a=" "
265
+ opts_b=" "
266
+ fi
237
267
238
- ${ns_a} ip link add vxlan_a type vxlan id 1 local ${a_addr } remote ${b_addr} ttl 64 dstport 4789 ${opts} || return 1
239
- ${ns_b} ip link add vxlan_b type vxlan id 1 local ${b_addr } remote ${a_addr} ttl 64 dstport 4789 ${opts}
268
+ ${ns_a} ip link add ${type} _a type ${type} id 1 ${opts_a } remote ${b_addr} ${opts} || return 1
269
+ ${ns_b} ip link add ${type} _b type ${type} id 1 ${opts_b } remote ${a_addr} ${opts}
240
270
241
- ${ns_a} ip addr add ${tunnel4_a_addr} /${tunnel4_mask} dev vxlan_a
242
- ${ns_b} ip addr add ${tunnel4_b_addr} /${tunnel4_mask} dev vxlan_b
271
+ ${ns_a} ip addr add ${tunnel4_a_addr} /${tunnel4_mask} dev ${type} _a
272
+ ${ns_b} ip addr add ${tunnel4_b_addr} /${tunnel4_mask} dev ${type} _b
243
273
244
- ${ns_a} ip addr add ${tunnel6_a_addr} /${tunnel6_mask} dev vxlan_a
245
- ${ns_b} ip addr add ${tunnel6_b_addr} /${tunnel6_mask} dev vxlan_b
274
+ ${ns_a} ip addr add ${tunnel6_a_addr} /${tunnel6_mask} dev ${type} _a
275
+ ${ns_b} ip addr add ${tunnel6_b_addr} /${tunnel6_mask} dev ${type} _b
246
276
247
- ${ns_a} ip link set vxlan_a up
248
- ${ns_b} ip link set vxlan_b up
277
+ ${ns_a} ip link set ${type} _a up
278
+ ${ns_b} ip link set ${type} _b up
249
279
250
280
sleep 1
251
281
}
252
282
283
+ setup_geneve4 () {
284
+ setup_vxlan_or_geneve geneve ${prefix4} .${a_r1} .1 ${prefix4} .${b_r1} .1 " df set"
285
+ }
286
+
253
287
setup_vxlan4 () {
254
- setup_vxlan ${prefix4} .${a_r1} .1 ${prefix4} .${b_r1} .1 " df set"
288
+ setup_vxlan_or_geneve vxlan ${prefix4} .${a_r1} .1 ${prefix4} .${b_r1} .1 " df set"
289
+ }
290
+
291
+ setup_geneve6 () {
292
+ setup_vxlan_or_geneve geneve ${prefix6} :${a_r1} ::1 ${prefix6} :${b_r1} ::1
255
293
}
256
294
257
295
setup_vxlan6 () {
258
- setup_vxlan ${prefix6} :${a_r1} ::1 ${prefix6} :${b_r1} ::1 " "
296
+ setup_vxlan_or_geneve vxlan ${prefix6} :${a_r1} ::1 ${prefix6} :${b_r1} ::1
259
297
}
260
298
261
299
setup_xfrm () {
@@ -514,22 +552,23 @@ test_pmtu_ipv6_exception() {
514
552
test_pmtu_ipvX 6
515
553
}
516
554
517
- test_pmtu_ipvX_over_vxlanY_exception () {
518
- family=${1}
519
- outer_family=${2}
555
+ test_pmtu_ipvX_over_vxlanY_or_geneveY_exception () {
556
+ type=${1}
557
+ family=${2}
558
+ outer_family=${3}
520
559
ll_mtu=4000
521
560
522
561
if [ ${outer_family} -eq 4 ]; then
523
- setup namespaces routing vxlan4 || return 2
524
- # IPv4 header UDP header VXLAN header Ethernet header
525
- exp_mtu=$(( ${ll_mtu} - 20 - 8 - 8 - 14 ))
562
+ setup namespaces routing ${type} 4 || return 2
563
+ # IPv4 header UDP header VXLAN/GENEVE header Ethernet header
564
+ exp_mtu=$(( ${ll_mtu} - 20 - 8 - 8 - 14 ))
526
565
else
527
- setup namespaces routing vxlan6 || return 2
528
- # IPv6 header UDP header VXLAN header Ethernet header
529
- exp_mtu=$(( ${ll_mtu} - 40 - 8 - 8 - 14 ))
566
+ setup namespaces routing ${type} 6 || return 2
567
+ # IPv6 header UDP header VXLAN/GENEVE header Ethernet header
568
+ exp_mtu=$(( ${ll_mtu} - 40 - 8 - 8 - 14 ))
530
569
fi
531
570
532
- trace " ${ns_a} " vxlan_a " ${ns_b} " vxlan_b \
571
+ trace " ${ns_a} " ${type} _a " ${ns_b} " ${type} _b \
533
572
" ${ns_a} " veth_A-R1 " ${ns_r1} " veth_R1-A \
534
573
" ${ns_b} " veth_B-R1 " ${ns_r1} " veth_R1-B
535
574
@@ -547,29 +586,45 @@ test_pmtu_ipvX_over_vxlanY_exception() {
547
586
mtu " ${ns_b} " veth_B-R1 ${ll_mtu}
548
587
mtu " ${ns_r1} " veth_R1-B ${ll_mtu}
549
588
550
- mtu " ${ns_a} " vxlan_a $(( ${ll_mtu} + 1000 ))
551
- mtu " ${ns_b} " vxlan_b $(( ${ll_mtu} + 1000 ))
589
+ mtu " ${ns_a} " ${type} _a $(( ${ll_mtu} + 1000 ))
590
+ mtu " ${ns_b} " ${type} _b $(( ${ll_mtu} + 1000 ))
552
591
${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s $(( ${ll_mtu} + 500 )) ${dst} > /dev/null
553
592
554
593
# Check that exception was created
555
594
pmtu=" $( route_get_dst_pmtu_from_exception " ${ns_a} " ${dst} ) "
556
- check_pmtu_value ${exp_mtu} " ${pmtu} " " exceeding link layer MTU on VXLAN interface"
595
+ check_pmtu_value ${exp_mtu} " ${pmtu} " " exceeding link layer MTU on ${type} interface"
557
596
}
558
597
559
598
test_pmtu_ipv4_vxlan4_exception () {
560
- test_pmtu_ipvX_over_vxlanY_exception 4 4
599
+ test_pmtu_ipvX_over_vxlanY_or_geneveY_exception vxlan 4 4
561
600
}
562
601
563
602
test_pmtu_ipv6_vxlan4_exception () {
564
- test_pmtu_ipvX_over_vxlanY_exception 6 4
603
+ test_pmtu_ipvX_over_vxlanY_or_geneveY_exception vxlan 6 4
604
+ }
605
+
606
+ test_pmtu_ipv4_geneve4_exception () {
607
+ test_pmtu_ipvX_over_vxlanY_or_geneveY_exception geneve 4 4
608
+ }
609
+
610
+ test_pmtu_ipv6_geneve4_exception () {
611
+ test_pmtu_ipvX_over_vxlanY_or_geneveY_exception geneve 6 4
565
612
}
566
613
567
614
test_pmtu_ipv4_vxlan6_exception () {
568
- test_pmtu_ipvX_over_vxlanY_exception 4 6
615
+ test_pmtu_ipvX_over_vxlanY_or_geneveY_exception vxlan 4 6
569
616
}
570
617
571
618
test_pmtu_ipv6_vxlan6_exception () {
572
- test_pmtu_ipvX_over_vxlanY_exception 6 6
619
+ test_pmtu_ipvX_over_vxlanY_or_geneveY_exception vxlan 6 6
620
+ }
621
+
622
+ test_pmtu_ipv4_geneve6_exception () {
623
+ test_pmtu_ipvX_over_vxlanY_or_geneveY_exception geneve 4 6
624
+ }
625
+
626
+ test_pmtu_ipv6_geneve6_exception () {
627
+ test_pmtu_ipvX_over_vxlanY_or_geneveY_exception geneve 6 6
573
628
}
574
629
575
630
test_pmtu_vti4_exception () {
0 commit comments