Lines Matching +full:1 +full:c
4 # This test is for checking the A-TCAM and C-TCAM operation in Spectrum-2.
45 local tracepoint=$1
54 local tracepoint=$1
63 local tracepoint=$1
71 local tracepoint=$1
76 return 1
83 local tracepoint=$1
87 return 1
100 tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
103 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
106 tc_check_packets "dev $h2 ingress" 101 1
112 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
118 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 198.51.100.1 -B 198.51.100.2 \
121 tc_check_packets "dev $h2 ingress" 102 1
124 tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
126 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 198.51.100.1 -B 198.51.100.2 \
140 # one needs to be inserted into the C-TCAM. This test verifies
141 # that filters are correctly spilled to C-TCAM and that the right
146 tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
151 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
154 tc_check_packets "dev $h2 ingress" 101 1
157 tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
159 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
162 tc_check_packets "dev $h2 ingress" 102 1
163 check_err $? "Did not match C-TCAM filter after A-TCAM delete"
168 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
172 check_err $? "Did not match C-TCAM filter after A-TCAM add"
176 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
179 tc_check_packets "dev $h2 ingress" 103 1
180 check_err $? "Did not match A-TCAM filter after C-TCAM delete"
194 tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
199 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
202 tc_check_packets "dev $h2 ingress" 101 1
205 tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
207 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
210 tc_check_packets "dev $h2 ingress" 103 1
216 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
219 tc_check_packets "dev $h2 ingress" 102 1
232 # masks are spilled to the C-TCAM. This test verifies that
248 for i in $(eval echo {1..$NUM_MASKS}); do
252 exp_hits=1
253 err_msg="$i filters - C-TCAM spill did not happen when it was expected"
256 err_msg="$i filters - C-TCAM spill happened when it should not"
269 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 \
272 tc_check_packets "dev $h2 ingress" $index 1
276 for i in $(eval echo {$NUM_MASKS..1}); do
279 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 \
296 # First case: C-TCAM is disabled when there are two A-TCAM masks.
297 # We push a filter into the C-TCAM by using two identical filters
301 tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
303 # Filter goes into C-TCAM
310 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
313 tc_check_packets "dev $h2 ingress" 101 1
316 # Delete both A-TCAM and C-TCAM filters and make sure the remaining
319 tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
321 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
324 tc_check_packets "dev $h2 ingress" 103 1
336 # Second case: C-TCAM is disabled when there is one A-TCAM mask.
342 # Filter goes into C-TCAM
343 tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
346 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
349 tc_check_packets "dev $h2 ingress" 101 1
350 check_err $? "Did not match C-TCAM filter"
352 tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
354 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
357 tc_check_packets "dev $h2 ingress" 102 1
369 # Third case: C-TCAM is disabled when there are no A-TCAM masks
371 # to its initial state after deleting the last C-TCAM mask
374 tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
376 # Filter goes into C-TCAM
380 tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
388 # When the C-TCAM is disabled after deleting the last C-TCAM
410 pref 1 handle 101 flower $tcflags dst_ip 192.0.0.0/24 \
412 tp_check_hits "objagg:objagg_obj_root_create" 1
420 tp_check_hits "objagg:objagg_obj_parent_assign" 1
423 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
426 tc_check_packets "dev $h2 ingress" 101 1
429 tc_check_packets "dev $h2 ingress" 102 1
433 pref 1 handle 101 flower"
439 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
447 tp_check_hits "objagg:objagg_obj_parent_unassign" 1
449 tp_check_hits "objagg:objagg_obj_root_destroy" 1
459 # there should be no C-TCAM spill.
468 pref 1 handle 101 flower $tcflags dst_ip 192.0.2.0/24 \
471 check_err $? "incorrect C-TCAM spill while inserting the first rule"
477 check_err $? "incorrect C-TCAM spill while inserting the second rule"
479 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
482 tc_check_packets "dev $h2 ingress" 101 1
485 tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
487 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
490 tc_check_packets "dev $h2 ingress" 102 1
518 sleep 1
520 tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
527 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
530 tc_check_packets "dev $h2 ingress" 101 1
533 tc_check_packets "dev $h2 ingress" 103 1
536 tc_check_packets "dev $h2 ingress" 102 1
554 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
557 tc_check_packets "dev $h2 ingress" 101 1
560 tc_check_packets "dev $h2 ingress" 103 1
568 tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
593 sleep 1
595 tc filter add dev $h2 ingress protocol ipv6 pref 1 handle 101 flower \
596 $tcflags dst_ip 2001:db8:1::0/121 action drop
602 $MZ $h1 -6 -c 1 -p 64 -a $h1mac -b $h2mac \
603 -A 2001:db8:2::1 -B 2001:db8:2::2 -t udp -q
605 tc_check_packets "dev $h2 ingress" 101 1
608 tc_check_packets "dev $h2 ingress" 103 1
611 tc_check_packets "dev $h2 ingress" 102 1
629 $MZ $h1 -6 -c 1 -p 64 -a $h1mac -b $h2mac \
630 -A 2001:db8:2::1 -B 2001:db8:2::2 -t udp -q
632 tc_check_packets "dev $h2 ingress" 101 1
635 tc_check_packets "dev $h2 ingress" 103 1
643 tc filter del dev $h2 ingress protocol ipv6 pref 1 handle 101 flower
653 local iface=$1
667 batch="${batch}filter add dev $iface ingress protocol ipv6 pref 1 \
669 src_ip 2001:db8:1::$hexnumber action drop\n"
675 local iface=$1
688 batch="${batch}filter del dev $iface ingress protocol ipv6 pref 1 \
695 local iface=$1
711 local iface=$1
719 for ((i=1;i<=total_count;i++)); do
721 ((skip=$RANDOM % $MAXSKIP + 1))
722 ((count=$RANDOM % $MAXCOUNT + 1))
725 ((skip-=1))
727 ((count-=1))
762 sleep 1
764 tc filter add dev $h2 ingress protocol ipv6 pref 1 handle 101 flower \
765 $tcflags dst_ip 2001:db8:1::0/121 action drop
771 $MZ $h1 -6 -c 1 -p 64 -a $h1mac -b $h2mac \
772 -A 2001:db8:2::1 -B 2001:db8:2::2 -t udp -q
774 tc_check_packets "dev $h2 ingress" 101 1
777 tc_check_packets "dev $h2 ingress" 103 1
780 tc_check_packets "dev $h2 ingress" 102 1
789 $MZ $h1 -6 -c 1 -p 64 -a $h1mac -b $h2mac \
790 -A 2001:db8:2::1 -B 2001:db8:2::2 -t udp -q
792 tc_check_packets "dev $h2 ingress" 101 1
795 tc_check_packets "dev $h2 ingress" 103 1
803 tc filter del dev $h2 ingress protocol ipv6 pref 1 handle 101 flower
806 for i in {1..5000}; do
825 tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
832 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
835 tc_check_packets "dev $h2 ingress" 101 1
838 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 198.51.100.1 -B 198.51.100.2 \
841 tc_check_packets "dev $h2 ingress" 104 1
844 tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
846 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
849 tc_check_packets "dev $h2 ingress" 103 1
855 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 198.51.100.1 -B 198.51.100.2 \
858 tc_check_packets "dev $h2 ingress" 102 1
881 tc chain add dev $h2 ingress chain 1 protocol ip flower \
899 index=$((BASE_INDEX - 1 - i))
908 pref 1 handle $((++index)) flower \
909 $tcflags dst_ip 192.0.0.0/16 action goto chain 1
910 tc filter add dev $h2 ingress chain 1 protocol ip \
911 pref 1 handle $((++index)) flower \
914 pref 1 handle $((++index)) flower \
917 pref 1 handle $((++index)) flower \
920 pref 1 handle $((++index)) flower \
924 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
928 index=$((BASE_INDEX + i + 1))
929 tc_check_packets "dev $h2 ingress" $index 1
935 index=$((BASE_INDEX - i - 1))
938 index=$((BASE_INDEX + i + 1))
940 pref 1 handle $index flower
944 for i in $(eval echo {$NUM_CHAINS..1}); do
965 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.1.2.1 -B 192.1.2.2 \
968 tc_check_packets "dev $h2 ingress" 103 1
974 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.2.1.1 -B 192.2.1.2 \
977 tc_check_packets "dev $h2 ingress" 102 1
1017 check_err 1 "Could not test offloaded functionality"