2 # SPDX-License-Identifier: GPL-2.0
4 ALL_TESTS="shared_block_test"
13 simple_if_init $h1 192.0.2.1/24
18 simple_if_fini $h1 192.0.2.1/24
23 simple_if_init $h2 192.0.2.1/24
28 simple_if_fini $h2 192.0.2.1/24
33 simple_if_init $swp1 192.0.2.2/24
34 tc qdisc add dev $swp1 ingress_block 22 egress_block 23 clsact
36 simple_if_init $swp2 192.0.2.2/24
37 tc qdisc add dev $swp2 ingress_block 22 egress_block 23 clsact
42 tc qdisc del dev $swp2 clsact
43 simple_if_fini $swp2 192.0.2.2/24
45 tc qdisc del dev $swp1 clsact
46 simple_if_fini $swp1 192.0.2.2/24
53 tc filter add block 22 protocol ip pref 1 handle 101 flower \
54 $tcflags dst_ip 192.0.2.2 action drop
56 $MZ $h1 -c 1 -p 64 -a $h1mac -b $swmac -A 192.0.2.1 -B 192.0.2.2 \
59 tc_check_packets "block 22" 101 1
60 check_err $? "Did not match first incoming packet on a block"
62 $MZ $h2 -c 1 -p 64 -a $h2mac -b $swmac -A 192.0.2.1 -B 192.0.2.2 \
65 tc_check_packets "block 22" 101 2
66 check_err $? "Did not match second incoming packet on a block"
68 tc filter del block 22 protocol ip pref 1 handle 101 flower
70 log_test "shared block ($tcflags)"
84 swmac=$(mac_get $swp1)
85 swp2origmac=$(mac_get $swp2)
86 ip link set $swp2 address $swmac
105 ip link set $swp2 address $swp2origmac
116 if [[ $? -ne 0 ]]; then
117 log_info "Could not test offloaded functionality"