#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# Check that route PMTU values match expectations, and that initial device MTU
# values are assigned correctly
#
# Tests currently implemented:
#
# - pmtu_ipv4
# Set up two namespaces, A and B, with two paths between them over routers
# R1 and R2 (also implemented with namespaces), with different MTUs:
#
# segment a_r1 segment b_r1 a_r1: 2000
# .--------------R1--------------. a_r2: 1500
# A B a_r3: 2000
# '--------------R2--------------' a_r4: 1400
# segment a_r2 segment b_r2
#
# Check that PMTU exceptions with the correct PMTU are created. Then
# decrease and increase the MTU of the local link for one of the paths,
# A to R1, checking that route exception PMTU changes accordingly over
# this path. Also check that locked exceptions are created when an ICMP
# message advertising a PMTU smaller than net.ipv4.route.min_pmtu is
# received
#
# - pmtu_ipv6
# Same as pmtu_ipv4, except for locked PMTU tests, using IPv6
#
# - pmtu_ipv4_vxlan4_exception
# Set up the same network topology as pmtu_ipv4, create a VXLAN tunnel
# over IPv4 between A and B, routed via R1. On the link between R1 and B,
# set a MTU lower than the VXLAN MTU and the MTU on the link between A and
# R1. Send IPv4 packets, exceeding the MTU between R1 and B, over VXLAN
# from A to B and check that the PMTU exception is created with the right
# value on A
#
# - pmtu_ipv6_vxlan4_exception
# Same as pmtu_ipv4_vxlan4_exception, but send IPv6 packets from A to B
#
# - pmtu_ipv4_vxlan6_exception
# Same as pmtu_ipv4_vxlan4_exception, but use IPv6 transport from A to B
#
# - pmtu_ipv6_vxlan6_exception
# Same as pmtu_ipv4_vxlan6_exception, but send IPv6 packets from A to B
#
# - pmtu_ipv4_geneve4_exception
# Same as pmtu_ipv4_vxlan4_exception, but using a GENEVE tunnel instead of
# VXLAN
#
# - pmtu_ipv6_geneve4_exception
# Same as pmtu_ipv6_vxlan4_exception, but using a GENEVE tunnel instead of
# VXLAN
#
# - pmtu_ipv4_geneve6_exception
# Same as pmtu_ipv4_vxlan6_exception, but using a GENEVE tunnel instead of
# VXLAN
#
# - pmtu_ipv6_geneve6_exception
# Same as pmtu_ipv6_vxlan6_exception, but using a GENEVE tunnel instead of
# VXLAN
#
# - pmtu_ipv{4,6}_fou{4,6}_exception
# Same as pmtu_ipv4_vxlan4, but using a direct IPv4/IPv6 encapsulation
# (FoU) over IPv4/IPv6, instead of VXLAN
#
# - pmtu_ipv{4,6}_fou{4,6}_exception
# Same as pmtu_ipv4_vxlan4, but using a generic UDP IPv4/IPv6
# encapsulation (GUE) over IPv4/IPv6, instead of VXLAN
#
# - pmtu_vti4_exception
# Set up vti tunnel on top of veth, with xfrm states and policies, in two
# namespaces with matching endpoints. Check that route exception is not
# created if link layer MTU is not exceeded, then exceed it and check that
# exception is created with the expected PMTU. The approach described
# below for IPv6 doesn't apply here, because, on IPv4, administrative MTU
# changes alone won't affect PMTU
#
# - pmtu_vti6_exception
# Set up vti6 tunnel on top of veth, with xfrm states and policies, in two
# namespaces with matching endpoints. Check that route exception is
# created by exceeding link layer MTU with ping to other endpoint. Then
# decrease and increase MTU of tunnel, checking that route exception PMTU
# changes accordingly
#
# - pmtu_vti4_default_mtu
# Set up vti4 tunnel on top of veth, in two namespaces with matching
# endpoints. Check that MTU assigned to vti interface is the MTU of the
# lower layer (veth) minus additional lower layer headers (zero, for veth)
# minus IPv4 header length
#
# - pmtu_vti6_default_mtu
# Same as above, for IPv6
#
# - pmtu_vti4_link_add_mtu
# Set up vti4 interface passing MTU value at link creation, check MTU is
# configured, and that link is not created with invalid MTU values
#
# - pmtu_vti6_link_add_mtu
# Same as above, for IPv6
#
# - pmtu_vti6_link_change_mtu
# Set up two dummy interfaces with different MTUs, create a vti6 tunnel
# and check that configured MTU is used on link creation and changes, and
# that MTU is properly calculated instead when MTU is not configured from
# userspace
#
# - cleanup_ipv4_exception
# Similar to pmtu_ipv4_vxlan4_exception, but explicitly generate PMTU
# exceptions on multiple CPUs and check that the veth device tear-down
# happens in a timely manner
#
# - cleanup_ipv6_exception
# Same as above, but use IPv6 transport from A to B
#
# - list_flush_ipv4_exception
# Using the same topology as in pmtu_ipv4, create exceptions, and check
# they are shown when listing exception caches, gone after flushing them
#
# - list_flush_ipv6_exception
# Using the same topology as in pmtu_ipv6, create exceptions, and check
# they are shown when listing exception caches, gone after flushing them
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
PAUSE_ON_FAIL=no
VER