__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Test for resource limit of offloaded flower rules. The test adds a given
# number of flower matches for different IPv6 addresses, then check the offload
# indication for all of the tc flower rules. This file contains functions to set
# up a testing topology and run the test, and is meant to be sourced from a test
# script that calls the testing routine with a given number of rules.
TC_FLOWER_NUM_NETIFS=2
tc_flower_h1_create()
{
simple_if_init $h1
tc qdisc add dev $h1 clsact
}
tc_flower_h1_destroy()
{
tc qdisc del dev $h1 clsact
simple_if_fini $h1
}
tc_flower_h2_create()
{
simple_if_init $h2
tc qdisc add dev $h2 clsact
}
tc_flower_h2_destroy()
{
tc qdisc del dev $h2 clsact
simple_if_fini $h2
}
tc_flower_setup_prepare()
{
h1=${NETIFS[p1]}
h2=${NETIFS[p2]}
vrf_prepare
tc_flower_h1_create
tc_flower_h2_create
}
tc_flower_cleanup()
{
pre_cleanup
tc_flower_h2_destroy
tc_flower_h1_destroy
vrf_cleanup
if [[ -v TC_FLOWER_BATCH_FILE ]]; then
rm -f $TC_FLOWER_BATCH_FILE
fi
}
tc_flower_addr()
{
local num=$1; shift
printf "2001:db8:1::%x" $num
}
tc_flower_rules_create()
{
local count=$1; shift
local should_fail=$1; shift
TC_FLOWER_BATCH_FILE="$(mktemp)"
for ((i = 0; i < count; ++i)); do
cat >> $TC_FLOWER_BATCH_FILE <<-EOF
filter add dev $h2 ingress \
prot ipv6 \
pref 1000 \
handle 42$i \
flower $tcflags dst_ip $(tc_flower_addr $i) \
action drop
EOF
done
tc -b $TC_FLOWER_BATCH_FILE
check_err_fail $should_fail $? "Rule insertion"
}
__tc_flower_test()
{
local count=$1; shift
local should_fail=$1; shift
local last=$((count - 1))
tc_flower_rules_create $count $should_fail
offload_count=$(tc -j -s filter show dev $h2 ingress |
jq -r '[ .[] | select(.kind == "flower") |
.options | .in_hw ]' | jq .[] | wc -l)
[[ $((offload_count - 1)) -eq $count ]]
check_err_fail $should_fail $? "Attempt to offload $count rules (actual result $((offload_count - 1)))"
}
tc_flower_test()
{
local count=$1; shift
local should_fail=$1; shift
# We use lower 16 bits of IPv6 address for match. Also there are only 16
# bits of rule priority space.
if ((count > 65536)); then
check_err 1 "Invalid count of $count. At most 65536 rules supported"
return
fi
if ! tc_offload_check $TC_FLOWER_NUM_NETIFS; then
check_err 1 "Could not test offloaded functionality"
return
fi
tcflags="skip_sw"
__tc_flower_test $count $should_fail
}
tc_flower_traffic_test()
{
local count=$1; shift
local i;
for ((i = count - 1; i > 0; i /= 2)); do
$MZ -6 $h1 -c 1 -d 20msec -p 100 -a own -b $(mac_get $h2) \
-A $(tc_flower_addr 0) -B $(tc_flower_addr $i) \
-q -t udp sp=54321,dp=12345
done
for ((i = count - 1; i > 0; i /= 2)); do
tc_check_packets "dev $h2 ingress" 42$i 1
check_err $? "Traffic not seen at rule #$i"
done
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| spectrum | Folder | 0755 |
|
|
| spectrum-2 | Folder | 0755 |
|
|
| blackhole_routes.sh | File | 4.96 KB | 0755 |
|
| devlink_linecard.sh | File | 7.5 KB | 0755 |
|
| devlink_trap.sh | File | 1.86 KB | 0755 |
|
| devlink_trap_acl_drops.sh | File | 2.4 KB | 0755 |
|
| devlink_trap_control.sh | File | 18.22 KB | 0755 |
|
| devlink_trap_l2_drops.sh | File | 12.87 KB | 0755 |
|
| devlink_trap_l3_drops.sh | File | 16.38 KB | 0755 |
|
| devlink_trap_l3_exceptions.sh | File | 13.64 KB | 0755 |
|
| devlink_trap_policer.sh | File | 9.75 KB | 0755 |
|
| devlink_trap_tunnel_ipip.sh | File | 5.24 KB | 0755 |
|
| devlink_trap_tunnel_ipip6.sh | File | 5.31 KB | 0755 |
|
| devlink_trap_tunnel_vxlan.sh | File | 8.84 KB | 0755 |
|
| devlink_trap_tunnel_vxlan_ipv6.sh | File | 9.32 KB | 0755 |
|
| egress_vid_classification.sh | File | 6.55 KB | 0755 |
|
| ethtool_lanes.sh | File | 4.02 KB | 0755 |
|
| extack.sh | File | 3.74 KB | 0755 |
|
| fib.sh | File | 5.43 KB | 0755 |
|
| fib_offload.sh | File | 9.93 KB | 0755 |
|
| hw_stats_l3.sh | File | 410 B | 0755 |
|
| ingress_rif_conf_1d.sh | File | 6.15 KB | 0755 |
|
| ingress_rif_conf_1q.sh | File | 6.23 KB | 0755 |
|
| ingress_rif_conf_vxlan.sh | File | 8.44 KB | 0755 |
|
| mirror_gre.sh | File | 3.78 KB | 0755 |
|
| mirror_gre_scale.sh | File | 5.43 KB | 0644 |
|
| mlxsw_lib.sh | File | 1.43 KB | 0644 |
|
| one_armed_router.sh | File | 6.82 KB | 0755 |
|
| pci_reset.sh | File | 1.27 KB | 0755 |
|
| port_range_occ.sh | File | 2.33 KB | 0755 |
|
| port_range_scale.sh | File | 1.51 KB | 0644 |
|
| port_scale.sh | File | 1.36 KB | 0644 |
|
| q_in_q_veto.sh | File | 8.06 KB | 0755 |
|
| qos_defprio.sh | File | 2.33 KB | 0755 |
|
| qos_dscp_bridge.sh | File | 4.14 KB | 0755 |
|
| qos_dscp_router.sh | File | 6.43 KB | 0755 |
|
| qos_ets_strict.sh | File | 9.09 KB | 0755 |
|
| qos_headroom.sh | File | 8.19 KB | 0755 |
|
| qos_lib.sh | File | 1.27 KB | 0644 |
|
| qos_max_descriptors.sh | File | 6.14 KB | 0755 |
|
| qos_mc_aware.sh | File | 9.54 KB | 0755 |
|
| qos_pfc.sh | File | 11.36 KB | 0755 |
|
| rif_bridge.sh | File | 4.12 KB | 0755 |
|
| rif_counter_scale.sh | File | 1.71 KB | 0644 |
|
| rif_lag.sh | File | 2.98 KB | 0755 |
|
| rif_lag_vlan.sh | File | 3.24 KB | 0755 |
|
| rif_mac_profile_scale.sh | File | 1.64 KB | 0644 |
|
| rif_mac_profiles.sh | File | 4.65 KB | 0755 |
|
| rif_mac_profiles_occ.sh | File | 2.87 KB | 0755 |
|
| router_bridge_lag.sh | File | 786 B | 0755 |
|
| router_scale.sh | File | 2.09 KB | 0644 |
|
| rtnetlink.sh | File | 26.93 KB | 0755 |
|
| sch_ets.sh | File | 2.3 KB | 0755 |
|
| sch_offload.sh | File | 5.25 KB | 0755 |
|
| sch_red_core.sh | File | 20.75 KB | 0644 |
|
| sch_red_ets.sh | File | 3.12 KB | 0755 |
|
| sch_red_prio.sh | File | 81 B | 0755 |
|
| sch_red_root.sh | File | 1.25 KB | 0755 |
|
| sch_tbf_ets.sh | File | 216 B | 0755 |
|
| sch_tbf_prio.sh | File | 217 B | 0755 |
|
| sch_tbf_root.sh | File | 217 B | 0755 |
|
| sharedbuffer.sh | File | 5.24 KB | 0755 |
|
| tc_action_hw_stats.sh | File | 2.24 KB | 0755 |
|
| tc_flower_scale.sh | File | 2.81 KB | 0644 |
|
| tc_police_occ.sh | File | 2.07 KB | 0755 |
|
| tc_police_scale.sh | File | 1.62 KB | 0644 |
|
| tc_restrictions.sh | File | 11.58 KB | 0755 |
|
| tc_sample.sh | File | 17.38 KB | 0755 |
|
| vxlan.sh | File | 30.19 KB | 0755 |
|
| vxlan_fdb_veto.sh | File | 3.11 KB | 0755 |
|
| vxlan_fdb_veto_ipv6.sh | File | 250 B | 0755 |
|
| vxlan_flooding.sh | File | 8.64 KB | 0755 |
|
| vxlan_ipv6.sh | File | 1.39 KB | 0755 |
|