@@ -22,20 +22,34 @@ SB_ITC=0
22
22
h1_create ()
23
23
{
24
24
simple_if_init $h1 192.0.1.1/24
25
+ tc qdisc add dev $h1 clsact
26
+
27
+ # Add egress filter on $h1 that will guarantee that the packet sent,
28
+ # will be the only packet being passed to the device.
29
+ tc filter add dev $h1 egress pref 2 handle 102 matchall action drop
25
30
}
26
31
27
32
h1_destroy ()
28
33
{
34
+ tc filter del dev $h1 egress pref 2 handle 102 matchall action drop
35
+ tc qdisc del dev $h1 clsact
29
36
simple_if_fini $h1 192.0.1.1/24
30
37
}
31
38
32
39
h2_create ()
33
40
{
34
41
simple_if_init $h2 192.0.1.2/24
42
+ tc qdisc add dev $h2 clsact
43
+
44
+ # Add egress filter on $h2 that will guarantee that the packet sent,
45
+ # will be the only packet being passed to the device.
46
+ tc filter add dev $h2 egress pref 1 handle 101 matchall action drop
35
47
}
36
48
37
49
h2_destroy ()
38
50
{
51
+ tc filter del dev $h2 egress pref 1 handle 101 matchall action drop
52
+ tc qdisc del dev $h2 clsact
39
53
simple_if_fini $h2 192.0.1.2/24
40
54
}
41
55
@@ -101,18 +115,18 @@ port_pool_test()
101
115
local exp_max_occ=$( devlink_cell_size_get)
102
116
local max_occ
103
117
118
+ tc filter add dev $h1 egress protocol ip pref 1 handle 101 flower \
119
+ src_mac $h1mac dst_mac $h2mac \
120
+ src_ip 192.0.1.1 dst_ip 192.0.1.2 \
121
+ action pass
122
+
104
123
devlink sb occupancy clearmax $DEVLINK_DEV
105
124
106
125
$MZ $h1 -c 1 -p 10 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
107
126
-t ip -q
108
127
109
128
devlink sb occupancy snapshot $DEVLINK_DEV
110
129
111
- RET=0
112
- max_occ=$( sb_occ_pool_check $dl_port1 $SB_POOL_ING $exp_max_occ )
113
- check_err $? " Expected iPool($SB_POOL_ING ) max occupancy to be $exp_max_occ , but got $max_occ "
114
- log_test " physical port's($h1 ) ingress pool"
115
-
116
130
RET=0
117
131
max_occ=$( sb_occ_pool_check $dl_port2 $SB_POOL_ING $exp_max_occ )
118
132
check_err $? " Expected iPool($SB_POOL_ING ) max occupancy to be $exp_max_occ , but got $max_occ "
@@ -122,25 +136,30 @@ port_pool_test()
122
136
max_occ=$( sb_occ_pool_check $cpu_dl_port $SB_POOL_EGR_CPU $exp_max_occ )
123
137
check_err $? " Expected ePool($SB_POOL_EGR_CPU ) max occupancy to be $exp_max_occ , but got $max_occ "
124
138
log_test " CPU port's egress pool"
139
+
140
+ tc filter del dev $h1 egress protocol ip pref 1 handle 101 flower \
141
+ src_mac $h1mac dst_mac $h2mac \
142
+ src_ip 192.0.1.1 dst_ip 192.0.1.2 \
143
+ action pass
125
144
}
126
145
127
146
port_tc_ip_test ()
128
147
{
129
148
local exp_max_occ=$( devlink_cell_size_get)
130
149
local max_occ
131
150
151
+ tc filter add dev $h1 egress protocol ip pref 1 handle 101 flower \
152
+ src_mac $h1mac dst_mac $h2mac \
153
+ src_ip 192.0.1.1 dst_ip 192.0.1.2 \
154
+ action pass
155
+
132
156
devlink sb occupancy clearmax $DEVLINK_DEV
133
157
134
158
$MZ $h1 -c 1 -p 10 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
135
159
-t ip -q
136
160
137
161
devlink sb occupancy snapshot $DEVLINK_DEV
138
162
139
- RET=0
140
- max_occ=$( sb_occ_itc_check $dl_port2 $SB_ITC $exp_max_occ )
141
- check_err $? " Expected ingress TC($SB_ITC ) max occupancy to be $exp_max_occ , but got $max_occ "
142
- log_test " physical port's($h1 ) ingress TC - IP packet"
143
-
144
163
RET=0
145
164
max_occ=$( sb_occ_itc_check $dl_port2 $SB_ITC $exp_max_occ )
146
165
check_err $? " Expected ingress TC($SB_ITC ) max occupancy to be $exp_max_occ , but got $max_occ "
@@ -150,24 +169,27 @@ port_tc_ip_test()
150
169
max_occ=$( sb_occ_etc_check $cpu_dl_port $SB_ITC_CPU_IP $exp_max_occ )
151
170
check_err $? " Expected egress TC($SB_ITC_CPU_IP ) max occupancy to be $exp_max_occ , but got $max_occ "
152
171
log_test " CPU port's egress TC - IP packet"
172
+
173
+ tc filter del dev $h1 egress protocol ip pref 1 handle 101 flower \
174
+ src_mac $h1mac dst_mac $h2mac \
175
+ src_ip 192.0.1.1 dst_ip 192.0.1.2 \
176
+ action pass
153
177
}
154
178
155
179
port_tc_arp_test ()
156
180
{
157
181
local exp_max_occ=$( devlink_cell_size_get)
158
182
local max_occ
159
183
184
+ tc filter add dev $h1 egress protocol arp pref 1 handle 101 flower \
185
+ src_mac $h1mac action pass
186
+
160
187
devlink sb occupancy clearmax $DEVLINK_DEV
161
188
162
189
$MZ $h1 -c 1 -p 10 -a $h1mac -A 192.0.1.1 -t arp -q
163
190
164
191
devlink sb occupancy snapshot $DEVLINK_DEV
165
192
166
- RET=0
167
- max_occ=$( sb_occ_itc_check $dl_port2 $SB_ITC $exp_max_occ )
168
- check_err $? " Expected ingress TC($SB_ITC ) max occupancy to be $exp_max_occ , but got $max_occ "
169
- log_test " physical port's($h1 ) ingress TC - ARP packet"
170
-
171
193
RET=0
172
194
max_occ=$( sb_occ_itc_check $dl_port2 $SB_ITC $exp_max_occ )
173
195
check_err $? " Expected ingress TC($SB_ITC ) max occupancy to be $exp_max_occ , but got $max_occ "
@@ -177,6 +199,9 @@ port_tc_arp_test()
177
199
max_occ=$( sb_occ_etc_check $cpu_dl_port $SB_ITC_CPU_ARP $exp_max_occ )
178
200
check_err $? " Expected egress TC($SB_ITC_IP2ME ) max occupancy to be $exp_max_occ , but got $max_occ "
179
201
log_test " CPU port's egress TC - ARP packet"
202
+
203
+ tc filter del dev $h1 egress protocol arp pref 1 handle 101 flower \
204
+ src_mac $h1mac action pass
180
205
}
181
206
182
207
setup_prepare ()
0 commit comments