aboutsummaryrefslogtreecommitdiff
path: root/net/core/gro.c
diff options
context:
space:
mode:
authorGravatar Yunsheng Lin <linyunsheng@huawei.com> 2023-05-11 09:12:12 +0800
committerGravatar David S. Miller <davem@davemloft.net> 2023-05-13 19:47:56 +0100
commitb51f4113ebb02011f0ca86abc3134b28d2071b6a (patch)
treeb28f53947c59ba27095dca90407b36ea38dce9aa /net/core/gro.c
parentselftests: net: vxlan: Add tests for vxlan nolocalbypass option. (diff)
downloadlinux-b51f4113ebb02011f0ca86abc3134b28d2071b6a.tar.gz
linux-b51f4113ebb02011f0ca86abc3134b28d2071b6a.tar.bz2
linux-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 <linyunsheng@huawei.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/gro.c')
-rw-r--r--net/core/gro.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/core/gro.c b/net/core/gro.c
index 2d84165cb4f1..6783a47a6136 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -239,9 +239,7 @@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb)
pinfo->nr_frags = nr_frags + 1 + skbinfo->nr_frags;
- __skb_frag_set_page(frag, page);
- skb_frag_off_set(frag, first_offset);
- skb_frag_size_set(frag, first_size);
+ skb_frag_fill_page_desc(frag, page, first_offset, first_size);
memcpy(frag + 1, skbinfo->frags, sizeof(*frag) * skbinfo->nr_frags);
/* We dont need to clear skbinfo->nr_frags here */