Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp398343pxp; Wed, 16 Mar 2022 08:03:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXh9gfs941NmlKyKSrcpU1eHJKZ9AP83VGcrQF9IVcySHWfUMDBE1CjuGrfCvCO9dH4Qf5 X-Received: by 2002:aa7:d945:0:b0:418:f041:f9bc with SMTP id l5-20020aa7d945000000b00418f041f9bcmr800050eds.305.1647443026468; Wed, 16 Mar 2022 08:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647443026; cv=none; d=google.com; s=arc-20160816; b=tdfFNiRMNJIca2Or/O55E3c2pLaB+jdJBE905N8T6wTRLWR72RyHtegMkXlJo15u6x yprxzU0Oj05qYAr+QfD8FDJyInUsXQKdn/GS7MefOnZuYeITgQRv+a8mFsUU2JOLlGmw J7BBG+bZ06IEG+lvKgktaEfov4X3I6JT+FoaVze1+zpKsewIQ+Zw97YIayg3Btfj1pEH uPZ4U2ZpknPxKvrFnRZ9oGFGauQKzWlzi3YvxZIaXVZKpGmXQUiT5gOxhsX/o7MxRia/ TlRhK66cOqGi3ZYGKGIe0KTcTkc3hkrjlDrJtiNfUjye8GHL4GKCuEdK6R74aNZBSiSz QOkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rPYmFcC42TNNZaujwudrj52htWnVwvXWSSs1izoA9K0=; b=f1hcErSqUS1DuQLI3FOvzIUkOYPc3vw1xpZ/E9ZJlXnUPlojMqMF72hGKiNe1h/ioM wmu1qG71Hb4xHmj3PTilOGvVNu35vGqpGY3SMQOCsNBO+8NOTDNptEh8fJcmwiNqPcK2 In6A2V+HbfsatA0Ufgk51/6MPiTvGFfTLptgAFmvrlcAhrSc1LPFKufLBIpLn1c0H8hQ XmqZvgfkQ/KZ/PirApGihTuJ5XKfnONZWkyQIqvZYXzsz0x6B7OhenkyucfVSqxS2h3e wgg6NV0WtuknwLLqEiTOe26B/zAhHpPYJeroVwDKh/0r5sPsWyab37ztS8SZoMrMy1pT eSTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0hNV++Rg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a170906414700b006db4742dbebsi1123076ejk.626.2022.03.16.08.03.09; Wed, 16 Mar 2022 08:03:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0hNV++Rg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244089AbiCNMbk (ORCPT + 99 others); Mon, 14 Mar 2022 08:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243225AbiCNMU0 (ORCPT ); Mon, 14 Mar 2022 08:20:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B11053737; Mon, 14 Mar 2022 05:15:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 83F07604F5; Mon, 14 Mar 2022 12:15:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DCB9C340E9; Mon, 14 Mar 2022 12:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647260130; bh=poBCh3atWgfX9sp+dz+kc64kDx5yncm1QzRxAHWn7Jk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0hNV++Rg37h2RyryxxptKQKPROSxC38edkhCfVm0PW7QqCBZXRSFOumOrh9c4LlR3 O0pqT7ec01EUNF1JpV3uD2Y+yJUVvuryjN4nvDqhaGHKlIEAA32wGa4w7Di861qqBX cusXeK559Lie+OGOR7YgkEkzH6tFfj6XycH31rP0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , "David S. Miller" , Sasha Levin Subject: [PATCH 5.16 025/121] net: gro: move skb_gro_receive_list to udp_offload.c Date: Mon, 14 Mar 2022 12:53:28 +0100 Message-Id: <20220314112744.832009339@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112744.120491875@linuxfoundation.org> References: <20220314112744.120491875@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Dumazet [ Upstream commit 0b935d7f8c07bf0a192712bdbf76dbf45ef8b115 ] This helper is used once, no need to keep it in fat net/core/skbuff.c Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/linux/netdevice.h | 1 - net/core/skbuff.c | 26 -------------------------- net/ipv4/udp_offload.c | 27 +++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 049858c671ef..7500ac08c9ba 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3007,7 +3007,6 @@ struct net_device *dev_get_by_napi_id(unsigned int napi_id); int netdev_get_name(struct net *net, char *name, int ifindex); int dev_restart(struct net_device *dev); 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); static inline unsigned int skb_gro_offset(const struct sk_buff *skb) { diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 56e23333e708..f1e3d70e8987 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -3919,32 +3919,6 @@ struct sk_buff *skb_segment_list(struct sk_buff *skb, } EXPORT_SYMBOL_GPL(skb_segment_list); -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 owenrship - if any - completely transferred to the aggregated packet */ - skb->destructor = NULL; - p->truesize += skb->truesize; - p->len += skb->len; - - NAPI_GRO_CB(skb)->same_flow = 1; - - return 0; -} - /** * skb_segment - Perform protocol segmentation on skb. * @head_skb: buffer to segment diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index 86d32a1e62ac..c2398f9e46f0 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -424,6 +424,33 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, 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 owenrship - if any - completely transferred to the aggregated packet */ + skb->destructor = 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, struct sk_buff *skb) -- 2.34.1