From patchwork Tue May 28 06:46:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Timo Teras X-Patchwork-Id: 246707 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 2B9502C02B7 for ; Tue, 28 May 2013 16:45:06 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933145Ab3E1GpB (ORCPT ); Tue, 28 May 2013 02:45:01 -0400 Received: from mail-ea0-f169.google.com ([209.85.215.169]:45947 "EHLO mail-ea0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932977Ab3E1Go5 (ORCPT ); Tue, 28 May 2013 02:44:57 -0400 Received: by mail-ea0-f169.google.com with SMTP id m14so4204849eaj.14 for ; Mon, 27 May 2013 23:44:56 -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=ZW0/jYccZhaCFTEmytgs6CGlYtEeh/dPgcimzLQaliIbbIFR1SJcP2fBQL7EnFvpoz re8xCdgJzeyGu1duVtfBmWWDFKO5LNxvwCUu9DxWwLvgK18avLfB6f6AP/ommvX98JQx levFrYVfjGHgTqtxn3JZuFlpPwauV9zUJASRBrZtQL52a6+/jzIsjT8HRmRdqI0g3UsD o2eXbF8fYxfa9XFjHV7kmCBB4MlVFtn7eNxDBvy6ZQrWsOzFTQLd7QbHG1Y98BgMSiwD NpvyTNiidksRjfAIrQBh1XlVcdMSdsOoj7AlyNVlubmE4Ww1TKDg44JtI8iVoZdwrQSB 4gqA== X-Received: by 10.15.56.198 with SMTP id y46mr12950726eew.58.1369723495935; Mon, 27 May 2013 23:44:55 -0700 (PDT) Received: from vostro.util.wtbts.net ([83.145.235.199]) by mx.google.com with ESMTPSA id e1sm11389241eem.10.2013.05.27.23.44.54 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 23:44:55 -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 2/3] ipv4: rate limit updating of next hop exceptions with same pmtu Date: Tue, 28 May 2013 09:46:32 +0300 Message-Id: <1369723593-5307-2-git-send-email-timo.teras@iki.fi> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1369723593-5307-1-git-send-email-timo.teras@iki.fi> References: <20130527.233844.2081972819091665848.davem@davemloft.net> <1369723593-5307-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);