Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3077761imw; Mon, 11 Jul 2022 00:57:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vEbCFAWzNut3bgxwhjM1rjPl0PKApw4RZnao5rbi7nGfYDP/YtVpMwE6siGhlvOooNB7OR X-Received: by 2002:a05:6402:84a:b0:426:262d:967e with SMTP id b10-20020a056402084a00b00426262d967emr22350239edz.286.1657526259868; Mon, 11 Jul 2022 00:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657526259; cv=none; d=google.com; s=arc-20160816; b=u40JsDtZFp31mUJTdQ9q1IoQKLk/iVciBhwBCb6sTZHHFfmUCld5puMma/ZTotVpuo OiXnbWZHO2js5GCMBrSd0Yn/wgkFoPWlfHJpga8nNBQGGiLRF7+xywrtrCRIgf6XyVaO CtnEM4ge2gZjOrrUV8xrKiGMxd4yNXpiIj7He99BLcyYRgKSX+gmivBF2vFIfWnwE3uU ZME2B90wF36bRkLazUcHpOZIWTClFyQ9dYtArNfEjaTI5vRJK7PA/YS1mz5BLmRsSTgf Hszn1b79kTM8Z/1wKXsU4FZ7GjMNkoUZOaqlWLp1bPGghkJ0mdlvHZqyfzdkqwWiRE2u DTXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=96NPKNV5utpii2rkUS01Aniyev+v25Q5+vYskwTWNgA=; b=o5tizIjDeJmIVMdXy1pfQPDOkrYiT/a2TAyZzzEqr0vV9ekylldqp1WkaNyq1ig4mp 58UNaW3FCNR6jZ2pxMOIZDKuGVZkdwVyEQioVZqO/PJZAMsx6eMN5KtsIkncio9hQ225 +4w8qMC/CvHIeZjyGs7kwAJ7bDHL1alm5Q891q7YUG9T83Mg+hT24+57H1/BQ3KAHDWZ H8Zz5UA58eT+l4Dc6XneCIfWT7QxYkep6N6Si0j3/aXLpvkKWdD4v8QQmj3/17lC180Q 3XcRvcs1hFpcajI1HWerh5DfcSB93+XamjuTK12uCMtJs4XulcXeYlpOhYzWq4Iuo5VV 3I/w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc13-20020a1709078a0d00b0072b4b37b209si6119917ejc.141.2022.07.11.00.57.15; Mon, 11 Jul 2022 00:57:39 -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 S230013AbiGKHbP (ORCPT + 99 others); Mon, 11 Jul 2022 03:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbiGKHbN (ORCPT ); Mon, 11 Jul 2022 03:31:13 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D9471A39F; Mon, 11 Jul 2022 00:31:12 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LhFsN4xVVzFpyY; Mon, 11 Jul 2022 15:30:16 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 11 Jul 2022 15:31:09 +0800 From: Zhengchao Shao To: , , , , , , , CC: , , Subject: [PATCH] net: change the type of ip_route_input_rcu to static Date: Mon, 11 Jul 2022 15:35:49 +0800 Message-ID: <20220711073549.8947-1-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500026.china.huawei.com (7.185.36.106) 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,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 The type of ip_route_input_rcu should be static. Signed-off-by: Zhengchao Shao --- include/net/route.h | 4 ---- net/ipv4/route.c | 34 +++++++++++++++++----------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/include/net/route.h b/include/net/route.h index b6743ff88e30..4929a710c24b 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -201,10 +201,6 @@ int ip_mc_validate_source(struct sk_buff *skb, __be32 daddr, __be32 saddr, struct in_device *in_dev, u32 *itag); int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src, u8 tos, struct net_device *devin); -int ip_route_input_rcu(struct sk_buff *skb, __be32 dst, __be32 src, - u8 tos, struct net_device *devin, - struct fib_result *res); - int ip_route_use_hint(struct sk_buff *skb, __be32 dst, __be32 src, u8 tos, struct net_device *devin, const struct sk_buff *hint); diff --git a/net/ipv4/route.c b/net/ipv4/route.c index bd351fab46e6..328beff85a1e 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2432,24 +2432,9 @@ out: return err; goto out; } -int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr, - u8 tos, struct net_device *dev) -{ - struct fib_result res; - int err; - - tos &= IPTOS_RT_MASK; - rcu_read_lock(); - err = ip_route_input_rcu(skb, daddr, saddr, tos, dev, &res); - rcu_read_unlock(); - - return err; -} -EXPORT_SYMBOL(ip_route_input_noref); - /* called with rcu_read_lock held */ -int ip_route_input_rcu(struct sk_buff *skb, __be32 daddr, __be32 saddr, - u8 tos, struct net_device *dev, struct fib_result *res) +static int ip_route_input_rcu(struct sk_buff *skb, __be32 daddr, __be32 saddr, + u8 tos, struct net_device *dev, struct fib_result *res) { /* Multicast recognition logic is moved from route cache to here. * The problem was that too many Ethernet cards have broken/missing @@ -2498,6 +2483,21 @@ int ip_route_input_rcu(struct sk_buff *skb, __be32 daddr, __be32 saddr, return ip_route_input_slow(skb, daddr, saddr, tos, dev, res); } +int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr, + u8 tos, struct net_device *dev) +{ + struct fib_result res; + int err; + + tos &= IPTOS_RT_MASK; + rcu_read_lock(); + err = ip_route_input_rcu(skb, daddr, saddr, tos, dev, &res); + rcu_read_unlock(); + + return err; +} +EXPORT_SYMBOL(ip_route_input_noref); + /* called with rcu_read_lock() */ static struct rtable *__mkroute_output(const struct fib_result *res, const struct flowi4 *fl4, int orig_oif, -- 2.17.1