Commit e0c7b92
bpf: Allow bpf_xdp_shrink_data to shrink a frag from head and tail
Move skb_frag_t adjustment into bpf_xdp_shrink_data() and extend its
functionality to be able to shrink an xdp fragment from both head and
tail. In a later patch, bpf_xdp_pull_data() will reuse it to shrink an
xdp fragment from head.
Additionally, in bpf_xdp_frags_shrink_tail(), breaking the loop when
bpf_xdp_shrink_data() returns false (i.e., not releasing the current
fragment) is not necessary as the loop condition, offset > 0, has the
same effect. Remove the else branch to simplify the code.
Signed-off-by: Amery Hung <[email protected]>1 parent 90a9693 commit e0c7b92
2 files changed
+35
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
170 | 180 | | |
171 | 181 | | |
172 | 182 | | |
| |||
389 | 399 | | |
390 | 400 | | |
391 | 401 | | |
392 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
393 | 407 | | |
| 408 | + | |
394 | 409 | | |
395 | 410 | | |
396 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4153 | 4153 | | |
4154 | 4154 | | |
4155 | 4155 | | |
4156 | | - | |
| 4156 | + | |
4157 | 4157 | | |
4158 | 4158 | | |
4159 | | - | |
| 4159 | + | |
| 4160 | + | |
4160 | 4161 | | |
4161 | 4162 | | |
4162 | | - | |
| 4163 | + | |
4163 | 4164 | | |
4164 | 4165 | | |
4165 | | - | |
| 4166 | + | |
| 4167 | + | |
| 4168 | + | |
| 4169 | + | |
4166 | 4170 | | |
4167 | 4171 | | |
4168 | 4172 | | |
4169 | 4173 | | |
4170 | | - | |
| 4174 | + | |
4171 | 4175 | | |
4172 | 4176 | | |
4173 | 4177 | | |
4174 | 4178 | | |
4175 | 4179 | | |
4176 | | - | |
| 4180 | + | |
4177 | 4181 | | |
4178 | 4182 | | |
4179 | 4183 | | |
4180 | 4184 | | |
4181 | 4185 | | |
4182 | | - | |
4183 | 4186 | | |
| 4187 | + | |
| 4188 | + | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
4184 | 4193 | | |
4185 | 4194 | | |
4186 | 4195 | | |
| |||
4198 | 4207 | | |
4199 | 4208 | | |
4200 | 4209 | | |
4201 | | - | |
| 4210 | + | |
4202 | 4211 | | |
4203 | | - | |
4204 | | - | |
4205 | | - | |
4206 | | - | |
4207 | 4212 | | |
4208 | 4213 | | |
4209 | 4214 | | |
| |||
0 commit comments