diff options
| author | Yunsheng Lin <[email protected]> | 2023-05-11 01:12:12 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2023-05-13 18:47:56 +0000 |
| commit | b51f4113ebb02011f0ca86abc3134b28d2071b6a (patch) | |
| tree | b28f53947c59ba27095dca90407b36ea38dce9aa /net/xfrm/xfrm_ipcomp.c | |
| parent | selftests: net: vxlan: Add tests for vxlan nolocalbypass option. (diff) | |
| download | kernel-b51f4113ebb02011f0ca86abc3134b28d2071b6a.tar.gz kernel-b51f4113ebb02011f0ca86abc3134b28d2071b6a.zip | |
net: introduce and use skb_frag_fill_page_desc()
Most users use __skb_frag_set_page()/skb_frag_off_set()/
skb_frag_size_set() to fill the page desc for a skb frag.
Introduce skb_frag_fill_page_desc() to do that.
net/bpf/test_run.c does not call skb_frag_off_set() to
set the offset, "copy_from_user(page_address(page), ...)"
and 'shinfo' being part of the 'data' kzalloced in
bpf_test_init() suggest that it is assuming offset to be
initialized as zero, so call skb_frag_fill_page_desc()
with offset being zero for this case.
Also, skb_frag_set_page() is not used anymore, so remove
it.
Signed-off-by: Yunsheng Lin <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/xfrm/xfrm_ipcomp.c')
| -rw-r--r-- | net/xfrm/xfrm_ipcomp.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index 80143360bf09..9c0fa0e1786a 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -74,14 +74,11 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb) if (!page) return -ENOMEM; - __skb_frag_set_page(frag, page); - len = PAGE_SIZE; if (dlen < len) len = dlen; - skb_frag_off_set(frag, 0); - skb_frag_size_set(frag, len); + skb_frag_fill_page_desc(frag, page, 0, len); memcpy(skb_frag_address(frag), scratch, len); skb->truesize += len; |
