summaryrefslogtreecommitdiff
path: root/rust/helpers/mm.c
diff options
context:
space:
mode:
authorAmery Hung <ameryhung@gmail.com>2025-09-22 16:33:50 -0700
committerMartin KaFai Lau <martin.lau@kernel.org>2025-09-23 13:35:12 -0700
commitdea1526fbafb55099a788cde0b659530ee5b1c66 (patch)
treea72ea9808528d036ee8fde223e14c184289b4004 /rust/helpers/mm.c
parent8f12d1137c2382c80aada8e05d7cc650cd4e403c (diff)
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 <ameryhung@gmail.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Link: https://patch.msgid.link/20250922233356.3356453-3-ameryhung@gmail.com
Diffstat (limited to 'rust/helpers/mm.c')
0 files changed, 0 insertions, 0 deletions