From patchwork Thu Sep 30 05:32:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 66116 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 2C972B6F0D for ; Thu, 30 Sep 2010 15:33:11 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753750Ab0I3FdF (ORCPT ); Thu, 30 Sep 2010 01:33:05 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:40349 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753733Ab0I3FdE (ORCPT ); Thu, 30 Sep 2010 01:33:04 -0400 Received: by fxm4 with SMTP id 4so485377fxm.19 for ; Wed, 29 Sep 2010 22:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=4LDZvZNQi5Qm9l7NjIDKoq77HHOYiV+Exmbc9ublVfw=; b=MzxVMabKQGwy9T5CsrlFZhqUqOiF0H98ElaPSGs56lHbfcf7Qa8okfmVRUqAc+wWpI 7Y5XQ7hWvuQtsje22AmMunR+z9hLw/j3BVuk1yAfgG/HfQLZUlbq4V2MCYr7TtOXLSiV GJfC2LJ/mSN2Kl+wZmgk66eDT5S/iNKgGgUGk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=LeWQA/CVzsqMwDbI2n45G7NeodSPzZsit66i6Z9OdYtF0RDY0fWScQAa80zZxB/H5G uCcCC7A4wpL0HcK3jcfqYygqICEwqS7vF+n80DIiNr+WmJywt0oRzPjfTMtUuyGekb94 lIWv9394Z17WSYLvtvwSqgsL1vxJwPwK/ajIA= Received: by 10.223.99.137 with SMTP id u9mr2973269fan.45.1285824783240; Wed, 29 Sep 2010 22:33:03 -0700 (PDT) Received: from [10.150.51.210] (gw0.net.jmsp.net [212.23.165.14]) by mx.google.com with ESMTPS id k15sm4295884fai.16.2010.09.29.22.33.01 (version=SSLv3 cipher=RC4-MD5); Wed, 29 Sep 2010 22:33:02 -0700 (PDT) Subject: [PATCH net-next] ip_gre: comments change From: Eric Dumazet To: David Miller Cc: netdev Date: Thu, 30 Sep 2010 07:32:57 +0200 Message-ID: <1285824777.5211.663.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org HARD_TX_LOCK no longer protects tunnels from dead loops, but xmit_recursion percpu counter. Signed-off-by: Eric Dumazet --- net/ipv4/ip_gre.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 035db63..fbe2c47 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -64,13 +64,13 @@ We cannot track such dead loops during route installation, it is infeasible task. The most general solutions would be to keep skb->encapsulation counter (sort of local ttl), - and silently drop packet when it expires. It is the best + and silently drop packet when it expires. It is a good solution, but it supposes maintaing new variable in ALL skb, even if no tunneling is used. - Current solution: HARD_TX_LOCK lock breaks dead loops. - - + Current solution: xmit_recursion breaks dead loops. This is a percpu + counter, since when we enter the first ndo_xmit(), cpu migration is + forbidden. We force an exit if this counter reaches RECURSION_LIMIT 2. Networking dead loops would not kill routers, but would really kill network. IP hop limit plays role of "t->recursion" in this case,