From patchwork Wed Sep 16 01:04:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 518204 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5F761140187 for ; Wed, 16 Sep 2015 11:14:33 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752641AbbIPBNp (ORCPT ); Tue, 15 Sep 2015 21:13:45 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:39401 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752580AbbIPBNm (ORCPT ); Tue, 15 Sep 2015 21:13:42 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1Zc1I5-0008EW-L7; Tue, 15 Sep 2015 19:13:41 -0600 Received: from 67-3-201-231.omah.qwest.net ([67.3.201.231] helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1Zc1GN-0002zs-S4; Tue, 15 Sep 2015 19:11:56 -0600 From: "Eric W. Biederman" To: Pablo Neira Ayuso , David Miller Cc: netfilter-devel@vger.kernel.org, Date: Tue, 15 Sep 2015 20:04:01 -0500 Message-Id: <1442365458-16349-13-git-send-email-ebiederm@xmission.com> X-Mailer: git-send-email 2.2.1 In-Reply-To: <87mvwn18my.fsf@x220.int.ebiederm.org> References: <87mvwn18my.fsf@x220.int.ebiederm.org> X-XM-AID: U2FsdGVkX19GW8w4eN0aN/2DoMG8FA+ksVtYPlqXCJA= X-SA-Exim-Connect-IP: 67.3.201.231 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa02.xmission.com X-Spam-Level: X-Spam-Status: No, score=0.8 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE, TVD_RCVD_IP, T_TooManySym_01, TooManyTo_001, XMSubLong autolearn=disabled version=3.4.0 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.3 TooManyTo_001 Multiple "To" Header Recipients 2x (uncommon) * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa02 1397; Body=1 Fuz1=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 X-Spam-Combo: ;Pablo Neira Ayuso , David Miller X-Spam-Relay-Country: X-Spam-Timing: total 350 ms - load_scoreonly_sql: 0.08 (0.0%), signal_user_changed: 3.9 (1.1%), b_tie_ro: 2.8 (0.8%), parse: 1.06 (0.3%), extract_message_metadata: 23 (6.7%), get_uri_detail_list: 1.51 (0.4%), tests_pri_-1000: 10 (2.8%), tests_pri_-950: 2.1 (0.6%), tests_pri_-900: 1.71 (0.5%), tests_pri_-400: 23 (6.6%), check_bayes: 21 (6.0%), b_tokenize: 8 (2.2%), b_tok_get_all: 4.9 (1.4%), b_comp_prob: 2.5 (0.7%), b_tok_touch_all: 2.4 (0.7%), b_finish: 1.23 (0.4%), tests_pri_0: 267 (76.1%), tests_pri_500: 13 (3.8%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH next 13/30] ipv4: Only compute net once in ip_finish_output2 X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: "Eric W. Biederman" --- net/ipv4/ip_output.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 095754c99061..fc550e97daac 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -177,14 +177,15 @@ static int ip_finish_output2(struct sock *sk, struct sk_buff *skb) struct dst_entry *dst = skb_dst(skb); struct rtable *rt = (struct rtable *)dst; struct net_device *dev = dst->dev; + struct net *net = dev_net(dev); unsigned int hh_len = LL_RESERVED_SPACE(dev); struct neighbour *neigh; u32 nexthop; if (rt->rt_type == RTN_MULTICAST) { - IP_UPD_PO_STATS(dev_net(dev), IPSTATS_MIB_OUTMCAST, skb->len); + IP_UPD_PO_STATS(net, IPSTATS_MIB_OUTMCAST, skb->len); } else if (rt->rt_type == RTN_BROADCAST) - IP_UPD_PO_STATS(dev_net(dev), IPSTATS_MIB_OUTBCAST, skb->len); + IP_UPD_PO_STATS(net, IPSTATS_MIB_OUTBCAST, skb->len); /* Be paranoid, rather than too clever. */ if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) {