From patchwork Fri Oct 21 02:58:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 6492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp454362wrr; Thu, 20 Oct 2022 20:11:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Ig6nNbUVWsT98nPs9+VXs2kxprV72QyNKHdoCFLXcgzghUfswbbXs5G1WNq0VY1xwWYmK X-Received: by 2002:a50:85ca:0:b0:461:168c:83ab with SMTP id q10-20020a5085ca000000b00461168c83abmr3812390edh.359.1666321860105; Thu, 20 Oct 2022 20:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666321860; cv=none; d=google.com; s=arc-20160816; b=qX4dZ0sMIRlX5HoCjePpDc/VhFnTYQeu0fbN4FKXigzynO+EWx3tb0Xd98pWA1VBRv p+8KkYElRw4HjAUJPJhMb1AA/LxC2lxwbMWB0cbOm4PU7NYGTdRx58W6p1vBGnRxaEt5 IfuxdThXcOVja1QIky+iHPgagY2B+4daitWlplSZQyefDGA9LKC05KDm1Uvjh6F9uvme yYSALtp5YsEg9t4tXv6h7d9aKekS/plGyEqUfdCTOkctXNnedliOtdbWO3Qf/5sknk9/ kSpWU0uRV1kp67uhkzIx9WvAi7x45FRqmG8P8FX15fw5sl6nWr4sH6Uqw7SeMSKjK+k4 LzYw== 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 :message-id:date:subject:cc:to:from; bh=Jz/QGCBJYTLNqK2OcpcypaK9VeQp1ZPRfbo8dcn5THE=; b=zVIrj3Nk/Umsv8Jd8SEZ61mgvdIga56XQZh+DFY9pcMEBEpMFZrJCwXqqn17q2XuAc +KGn/0/U7FW4xvE5ehbvBKxr+plca3nvGvsasJzMPDyOe1E4VA1cVcLOyQFTyTd+fGOR CH0kUdGkHGJR1d4nVUAV0h3ea+N1Zboe9DfwxfqIv1GLrFq5frsLyXNf/KLB/2/lFYBa zS/tCSxsphovJhsgFPEeNTnI7uUUcxk5187TKV3gUrSqW8wmT0u1DZ7sbrwmLhdNjMUz Y6RaPvi20ah7CwvWaLR1BgIZdOEpHORBUQsHTtwkdHRrALpjMead2HT2x0Sqswe5zsll 6fGg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a056402400200b0045d02b75b4csi18191358eda.519.2022.10.20.20.10.35; Thu, 20 Oct 2022 20:11:00 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229828AbiJUC6G (ORCPT + 99 others); Thu, 20 Oct 2022 22:58:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiJUC6F (ORCPT ); Thu, 20 Oct 2022 22:58:05 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD77F1BC148; Thu, 20 Oct 2022 19:58:03 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Mtq004NnkzHvDj; Fri, 21 Oct 2022 10:57:52 +0800 (CST) Received: from dggpemm500005.china.huawei.com (7.185.36.74) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 21 Oct 2022 10:57:39 +0800 Received: from localhost.localdomain (10.69.192.56) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 21 Oct 2022 10:57:39 +0800 From: Yunsheng Lin To: , CC: , , , , , Subject: [PATCH net-next] net: skb: move skb_pp_recycle() to skbuff.c Date: Fri, 21 Oct 2022 10:58:22 +0800 Message-ID: <20221021025822.64381-1-linyunsheng@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747265110274277409?= X-GMAIL-MSGID: =?utf-8?q?1747265110274277409?= skb_pp_recycle() is only used by skb_free_head() in skbuff.c, so move it to skbuff.c. Signed-off-by: Yunsheng Lin Acked-by: Ilias Apalodimas --- include/linux/skbuff.h | 7 ------- net/core/skbuff.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 9fcf534f2d92..28a7b5fbc7b7 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -5048,12 +5048,5 @@ static inline void skb_mark_for_recycle(struct sk_buff *skb) } #endif -static inline bool skb_pp_recycle(struct sk_buff *skb, void *data) -{ - if (!IS_ENABLED(CONFIG_PAGE_POOL) || !skb->pp_recycle) - return false; - return page_pool_return_skb_page(virt_to_page(data)); -} - #endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */ diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 1d9719e72f9d..9b3b19816d2d 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -748,6 +748,13 @@ static void skb_clone_fraglist(struct sk_buff *skb) skb_get(list); } +static bool skb_pp_recycle(struct sk_buff *skb, void *data) +{ + if (!IS_ENABLED(CONFIG_PAGE_POOL) || !skb->pp_recycle) + return false; + return page_pool_return_skb_page(virt_to_page(data)); +} + static void skb_free_head(struct sk_buff *skb) { unsigned char *head = skb->head;