From patchwork Mon May 27 11:16:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Timo Teras X-Patchwork-Id: 246575 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 AB9F42C02BB for ; Mon, 27 May 2013 21:14:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757892Ab3E0LOs (ORCPT ); Mon, 27 May 2013 07:14:48 -0400 Received: from mail-ee0-f41.google.com ([74.125.83.41]:37673 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757851Ab3E0LOq (ORCPT ); Mon, 27 May 2013 07:14:46 -0400 Received: by mail-ee0-f41.google.com with SMTP id d4so3793364eek.14 for ; Mon, 27 May 2013 04:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=9/eDl0dv+BS6yRsVc2BAgoM+5XkMCPrCjmPBw2f/85w=; b=YY4YxH4/8e5fwOI753ooAAFnXf1LqjjPr5XYvbd+FoUfXuBb6WVWrBbb5vq+Ozv0DO sHa81iQPDtnZS7H8idom1b6xPtxJrK0t+Kk2kBd2CRlP4fKJv7DCVH0lXAqc095aI5Hi nnhBnxUe2NOpYCp2zCjO4PHsxkbWq+8Ds/2KO9NoKOrO5iDyPJBolaG+8AOwiMejbflB M4U3AB6O/lB+90D+PZWbC9me9U7WRwp0M/h2/HEx5nIHbMhvaPas0PcKRW44uztc3sXi WG4O6DKCUsWR5HKwWBIyDRHPt6YrBUAOwhgnqRCyjz92NMDdP5wwQ1fiicrB+TShXATb ZtnA== X-Received: by 10.14.100.68 with SMTP id y44mr9506374eef.70.1369653284896; Mon, 27 May 2013 04:14:44 -0700 (PDT) Received: from vostro.util.wtbts.net ([83.145.235.199]) by mx.google.com with ESMTPSA id e1sm6514935eem.10.2013.05.27.04.14.43 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 04:14:44 -0700 (PDT) From: =?UTF-8?q?Timo=20Ter=C3=A4s?= To: netdev@vger.kernel.org Cc: =?UTF-8?q?Timo=20Ter=C3=A4s?= Subject: [PATCH net-next 4/6] ipv4: rate limit updating of next hop exceptions with same pmtu Date: Mon, 27 May 2013 14:16:14 +0300 Message-Id: <1369653376-4731-5-git-send-email-timo.teras@iki.fi> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1369653376-4731-1-git-send-email-timo.teras@iki.fi> References: <1369653376-4731-1-git-send-email-timo.teras@iki.fi> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The tunnel devices call update_pmtu for each packet sent, this causes contention on the fnhe_lock. Ignore the pmtu update if pmtu is not actually changed, and there is still plenty of time before the entry expires. Signed-off-by: Timo Teräs --- net/ipv4/route.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 561a378..a4082be 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -947,6 +947,10 @@ static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu) if (mtu < ip_rt_min_pmtu) mtu = ip_rt_min_pmtu; + if (rt->rt_pmtu == mtu && + time_before(jiffies, dst->expires - ip_rt_mtu_expires / 2)) + return; + rcu_read_lock(); if (fib_lookup(dev_net(dst->dev), fl4, &res) == 0) { struct fib_nh *nh = &FIB_RES_NH(res);