]> git.dujemihanovic.xyz Git - linux.git/commitdiff
net: move skb_gro_receive_list from udp to core
authorFelix Fietkau <nbd@nbd.name>
Thu, 2 May 2024 08:44:42 +0000 (10:44 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Mon, 6 May 2024 09:54:03 +0000 (11:54 +0200)
This helper function will be used for TCP fraglist GRO support

Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/gro.h
net/core/gro.c
net/ipv4/udp_offload.c

index c1d4ca0463a178736d2416e172784e35e333e126..5df8bf3181976420fa3e029ac4b52742f37e037b 100644 (file)
@@ -438,6 +438,7 @@ static inline __wsum ip6_gro_compute_pseudo(const struct sk_buff *skb,
 }
 
 int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb);
+int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb);
 
 /* Pass the currently batched GRO_NORMAL SKBs up to the stack. */
 static inline void gro_normal_list(struct napi_struct *napi)
index 99a45a5211c995b9936a7455e9740e1da589da06..e2f84947fb743e91c2671fe47f1122b8918a8a9f 100644 (file)
@@ -231,6 +231,33 @@ done:
        return 0;
 }
 
+int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb)
+{
+       if (unlikely(p->len + skb->len >= 65536))
+               return -E2BIG;
+
+       if (NAPI_GRO_CB(p)->last == p)
+               skb_shinfo(p)->frag_list = skb;
+       else
+               NAPI_GRO_CB(p)->last->next = skb;
+
+       skb_pull(skb, skb_gro_offset(skb));
+
+       NAPI_GRO_CB(p)->last = skb;
+       NAPI_GRO_CB(p)->count++;
+       p->data_len += skb->len;
+
+       /* sk ownership - if any - completely transferred to the aggregated packet */
+       skb->destructor = NULL;
+       skb->sk = NULL;
+       p->truesize += skb->truesize;
+       p->len += skb->len;
+
+       NAPI_GRO_CB(skb)->same_flow = 1;
+
+       return 0;
+}
+
 
 static void napi_gro_complete(struct napi_struct *napi, struct sk_buff *skb)
 {
index 8721fe5beca2bea692eb2cfa454e724e649cea6d..f6d3c442e260ffa84cce087f0715fa7d489480c3 100644 (file)
@@ -433,33 +433,6 @@ out:
        return segs;
 }
 
-static int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb)
-{
-       if (unlikely(p->len + skb->len >= 65536))
-               return -E2BIG;
-
-       if (NAPI_GRO_CB(p)->last == p)
-               skb_shinfo(p)->frag_list = skb;
-       else
-               NAPI_GRO_CB(p)->last->next = skb;
-
-       skb_pull(skb, skb_gro_offset(skb));
-
-       NAPI_GRO_CB(p)->last = skb;
-       NAPI_GRO_CB(p)->count++;
-       p->data_len += skb->len;
-
-       /* sk ownership - if any - completely transferred to the aggregated packet */
-       skb->destructor = NULL;
-       skb->sk = NULL;
-       p->truesize += skb->truesize;
-       p->len += skb->len;
-
-       NAPI_GRO_CB(skb)->same_flow = 1;
-
-       return 0;
-}
-
 
 #define UDP_GRO_CNT_MAX 64
 static struct sk_buff *udp_gro_receive_segment(struct list_head *head,