tools/testing/selftests/drivers/net/mlxsw/vxlan_fdb_veto.sh

Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/mlxsw/vxlan_fdb_veto.sh

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/drivers/net/mlxsw/vxlan_fdb_veto.sh
Extension
.sh
Size
3186 bytes
Lines
142
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# Test vetoing of FDB entries that mlxsw can not offload. This exercises several
# different veto vectors to test various rollback scenarios in the vxlan driver.

: ${LOCAL_IP:=198.51.100.1}
export LOCAL_IP

: ${REMOTE_IP_1:=198.51.100.2}
export REMOTE_IP_1

: ${REMOTE_IP_2:=198.51.100.3}
export REMOTE_IP_2

: ${UDPCSUM_FLAFS:=noudpcsum}
export UDPCSUM_FLAFS

: ${MC_IP:=224.0.0.1}
export MC_IP

lib_dir=$(dirname $0)/../../../net/forwarding

ALL_TESTS="
	fdb_create_veto_test
	fdb_replace_veto_test
	fdb_append_veto_test
	fdb_changelink_veto_test
"
NUM_NETIFS=2
source $lib_dir/lib.sh

setup_prepare()
{
	swp1=${NETIFS[p1]}
	swp2=${NETIFS[p2]}

	ip link add dev br0 type bridge mcast_snooping 0

	ip link set dev $swp1 up
	ip link set dev $swp1 master br0
	ip link set dev $swp2 up

	ip link add name vxlan0 up type vxlan id 10 nolearning $UDPCSUM_FLAFS \
		ttl 20 tos inherit local $LOCAL_IP dstport 4789
	ip link set dev vxlan0 master br0
}

cleanup()
{
	pre_cleanup

	ip link set dev vxlan0 nomaster
	ip link del dev vxlan0

	ip link set dev $swp2 down
	ip link set dev $swp1 nomaster
	ip link set dev $swp1 down

	ip link del dev br0
}

fdb_create_veto_test()
{
	RET=0

	bridge fdb add 01:02:03:04:05:06 dev vxlan0 self static \
	       dst $REMOTE_IP_1 2>/dev/null
	check_fail $? "multicast MAC not rejected"

Annotation

Implementation Notes