Resguardo inicial

This commit is contained in:
lastdragon
2026-09-06 12:53:21 -06:00
parent 662efe3c2a
commit ad2088d178
94853 changed files with 43200404 additions and 0 deletions
@@ -0,0 +1,36 @@
# SPDX-License-Identifier: GPL-2.0+ OR MIT
TEST_PROGS := \
bridge_locked_port.sh \
bridge_mdb.sh \
bridge_mld.sh \
bridge_vlan_aware.sh \
bridge_vlan_mcast.sh \
bridge_vlan_unaware.sh \
local_termination.sh \
no_forwarding.sh \
tc_actions.sh \
test_bridge_fdb_stress.sh \
# end of TEST_PROGS
TEST_FILES := \
forwarding.config \
run_net_forwarding_test.sh \
# end of TEST_FILES
TEST_INCLUDES := \
../../../net/forwarding/bridge_locked_port.sh \
../../../net/forwarding/bridge_mdb.sh \
../../../net/forwarding/bridge_mld.sh \
../../../net/forwarding/bridge_vlan_aware.sh \
../../../net/forwarding/bridge_vlan_mcast.sh \
../../../net/forwarding/bridge_vlan_unaware.sh \
../../../net/forwarding/lib.sh \
../../../net/forwarding/local_termination.sh \
../../../net/forwarding/no_forwarding.sh \
../../../net/forwarding/tc_actions.sh \
../../../net/forwarding/tc_common.sh \
../../../net/lib.sh \
# end of TEST_INCLUDES
include ../../../lib.mk
@@ -0,0 +1 @@
run_net_forwarding_test.sh
@@ -0,0 +1 @@
run_net_forwarding_test.sh
@@ -0,0 +1 @@
run_net_forwarding_test.sh
@@ -0,0 +1 @@
run_net_forwarding_test.sh
@@ -0,0 +1 @@
run_net_forwarding_test.sh
@@ -0,0 +1 @@
run_net_forwarding_test.sh
@@ -0,0 +1,2 @@
NETIF_CREATE=no
STABLE_MAC_ADDRS=yes
@@ -0,0 +1 @@
run_net_forwarding_test.sh
@@ -0,0 +1 @@
run_net_forwarding_test.sh
@@ -0,0 +1,9 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
libdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
testname=$(basename "${BASH_SOURCE[0]}")
source "$libdir"/forwarding.config
cd "$libdir"/../../../net/forwarding/ || exit 1
source "./$testname" "$@"
@@ -0,0 +1 @@
run_net_forwarding_test.sh
@@ -0,0 +1 @@
run_net_forwarding_test.sh
@@ -0,0 +1,47 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Bridge FDB entries can be offloaded to DSA switches without holding the
# rtnl_mutex. Traditionally this mutex has conferred drivers implicit
# serialization, which means their code paths are not well tested in the
# presence of concurrency.
# This test creates a background task that stresses the FDB by adding and
# deleting an entry many times in a row without the rtnl_mutex held.
# It then tests the driver resistance to concurrency by calling .ndo_fdb_dump
# (with rtnl_mutex held) from a foreground task.
# Since either the FDB dump or the additions/removals can fail, but the
# additions and removals are performed in deferred as opposed to process
# context, we cannot simply check for user space error codes.
WAIT_TIME=1
NUM_NETIFS=1
REQUIRE_JQ="no"
REQUIRE_MZ="no"
NETIF_CREATE="no"
lib_dir=$(dirname "$0")
source "$lib_dir"/../../../net/forwarding/lib.sh
cleanup() {
echo "Cleaning up"
kill $pid && wait $pid &> /dev/null
ip link del br0
echo "Please check kernel log for errors"
}
trap 'cleanup' EXIT
eth=${NETIFS[p1]}
ip link del br0 2>&1 >/dev/null || :
ip link add br0 type bridge && ip link set $eth master br0
(while :; do
bridge fdb add 00:01:02:03:04:05 dev $eth master static
bridge fdb del 00:01:02:03:04:05 dev $eth master static
done) &
pid=$!
for i in $(seq 1 50); do
bridge fdb show > /dev/null
sleep 3
echo "$((${i} * 2))% complete..."
done