Lines Matching +full:2 +full:c
4 # This test is for checking the A-TCAM and C-TCAM operation in Spectrum-2.
15 NUM_NETIFS=2
47 local cmd=$2
56 local seconds=$2
73 local count=$2
104 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
110 tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
113 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
116 tc_check_packets "dev $h2 ingress" 101 2
119 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 198.51.100.1 -B 198.51.100.2 \
127 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 198.51.100.1 -B 198.51.100.2 \
130 tc_check_packets "dev $h2 ingress" 102 2
133 tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
141 # one needs to be inserted into the C-TCAM. This test verifies
142 # that filters are correctly spilled to C-TCAM and that the right
149 tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
152 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
160 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
164 check_err $? "Did not match C-TCAM filter after A-TCAM delete"
169 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
172 tc_check_packets "dev $h2 ingress" 102 2
173 check_err $? "Did not match C-TCAM filter after A-TCAM add"
175 tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
177 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
181 check_err $? "Did not match A-TCAM filter after C-TCAM delete"
200 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
208 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
214 tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
217 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
224 tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
233 # masks are spilled to the C-TCAM. This test verifies that
254 err_msg="$i filters - C-TCAM spill did not happen when it was expected"
257 err_msg="$i filters - C-TCAM spill happened when it should not"
270 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 \
280 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 \
283 tc_check_packets "dev $h2 ingress" $index 2
297 # First case: C-TCAM is disabled when there are two A-TCAM masks.
298 # We push a filter into the C-TCAM by using two identical filters
304 # Filter goes into C-TCAM
305 tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
311 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
317 # Delete both A-TCAM and C-TCAM filters and make sure the remaining
319 tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
322 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
337 # Second case: C-TCAM is disabled when there is one A-TCAM mask.
341 tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
343 # Filter goes into C-TCAM
347 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
351 check_err $? "Did not match C-TCAM filter"
355 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
361 tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
370 # Third case: C-TCAM is disabled when there are no A-TCAM masks
372 # to its initial state after deleting the last C-TCAM mask
377 # Filter goes into C-TCAM
378 tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
382 tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
389 # When the C-TCAM is disabled after deleting the last C-TCAM
417 pref 2 handle 102 flower $tcflags dst_ip 192.0.2.2 \
424 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
440 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
443 tc_check_packets "dev $h2 ingress" 102 2
447 pref 2 handle 102 flower"
458 # If 2 keys are the same and only differ in mask in a way that
460 # there should be no C-TCAM spill.
472 check_err $? "incorrect C-TCAM spill while inserting the first rule"
475 pref 2 handle 102 flower $tcflags dst_ip 192.0.2.2 \
478 check_err $? "incorrect C-TCAM spill while inserting the second rule"
480 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
488 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
494 tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
523 tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
528 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
555 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
564 tc_check_packets "dev $h2 ingress" 102 2
568 tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
598 tc filter add dev $h2 ingress protocol ipv6 pref 2 handle 102 flower \
599 $tcflags dst_ip 2001:db8:2::2 action drop
603 $MZ $h1 -6 -c 1 -p 64 -a $h1mac -b $h2mac \
604 -A 2001:db8:2::1 -B 2001:db8:2::2 -t udp -q
630 $MZ $h1 -6 -c 1 -p 64 -a $h1mac -b $h2mac \
631 -A 2001:db8:2::1 -B 2001:db8:2::2 -t udp -q
639 tc_check_packets "dev $h2 ingress" 102 2
643 tc filter del dev $h2 ingress protocol ipv6 pref 2 handle 102 flower
655 local tcflags=$2
677 local index=$2
697 local tcflags=$2
713 local tcflags=$2
767 tc filter add dev $h2 ingress protocol ipv6 pref 2 handle 102 flower \
768 $tcflags dst_ip 2001:db8:2::2 action drop
772 $MZ $h1 -6 -c 1 -p 64 -a $h1mac -b $h2mac \
773 -A 2001:db8:2::1 -B 2001:db8:2::2 -t udp -q
790 $MZ $h1 -6 -c 1 -p 64 -a $h1mac -b $h2mac \
791 -A 2001:db8:2::1 -B 2001:db8:2::2 -t udp -q
799 tc_check_packets "dev $h2 ingress" 102 2
803 tc filter del dev $h2 ingress protocol ipv6 pref 2 handle 102 flower
833 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
839 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 198.51.100.1 -B 198.51.100.2 \
847 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
853 tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
856 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 198.51.100.1 -B 198.51.100.2 \
863 tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
881 # Create chain with up to 2 key blocks (ip_proto only)
884 # Create chain with 2-4 key blocks (ip_proto, src MAC)
885 tc chain add dev $h2 ingress chain 2 protocol ip flower \
897 # We need at least 2 rules in every region to have eRP table active
902 pref 2 handle $index flower \
913 $tcflags action goto chain 2
914 tc filter add dev $h2 ingress chain 2 protocol ip \
925 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
938 pref 2 handle $index flower
966 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.1.2.1 -B 192.1.2.2 \
972 tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
975 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.2.1.1 -B 192.2.1.2 \
982 tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
1015 break 2
1054 if [[ $(( i % 2 )) == 1 ]]; then
1075 if [[ $(( i % 2 )) == 1 ]]; then