Path: blob/master/tools/testing/selftests/drivers/net/bonding/bond-break-lacpdu-tx.sh
26292 views
#!/bin/sh1# SPDX-License-Identifier: GPL-2.023# Regression Test:4# Verify LACPDUs get transmitted after setting the MAC address of5# the bond.6#7# https://bugzilla.redhat.com/show_bug.cgi?id=20207738#9# +---------+10# | fab-br0 |11# +---------+12# |13# +---------+14# | fbond |15# +---------+16# | |17# +------+ +------+18# |veth1 | |veth2 |19# +------+ +------+20#21# We use veths instead of physical interfaces22REQUIRE_MZ=no23NUM_NETIFS=024lib_dir=$(dirname "$0")25source "$lib_dir"/../../../net/forwarding/lib.sh2627set -e28cleanup() {29ip link del fab-br0 >/dev/null 2>&1 || :30ip link del fbond >/dev/null 2>&1 || :31ip link del veth1-bond >/dev/null 2>&1 || :32ip link del veth2-bond >/dev/null 2>&1 || :33}3435trap cleanup 0 1 236cleanup3738# create the bridge39ip link add fab-br0 address 52:54:00:3B:7C:A6 mtu 1500 type bridge \40forward_delay 154142# create the bond43ip link add fbond type bond mode 4 miimon 200 xmit_hash_policy 1 \44ad_actor_sys_prio 65535 lacp_rate fast4546# set bond address47ip link set fbond address 52:54:00:3B:7C:A648ip link set fbond up4950# set again bond sysfs parameters51ip link set fbond type bond ad_actor_sys_prio 655355253# create veths54ip link add name veth1-bond type veth peer name veth1-end55ip link add name veth2-bond type veth peer name veth2-end5657# add ports58ip link set fbond master fab-br059ip link set veth1-bond master fbond60ip link set veth2-bond master fbond6162# bring up63ip link set veth1-end up64ip link set veth2-end up65ip link set fab-br0 up66ip link set fbond up67ip addr add dev fab-br0 10.0.0.36869rc=070tc qdisc add dev veth1-end clsact71tc filter add dev veth1-end ingress protocol 0x8809 pref 1 handle 101 flower skip_hw action pass72if slowwait_for_counter 15 2 \73tc_rule_handle_stats_get "dev veth1-end ingress" 101 ".packets" "" &> /dev/null; then74echo "PASS, captured 2"75else76echo "FAIL"77rc=178fi79exit $rc808182