From patchwork Thu Jun 11 08:22:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Teras X-Patchwork-Id: 28557 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 8C297B7168 for ; Thu, 11 Jun 2009 18:23:14 +1000 (EST) Received: by ozlabs.org (Postfix) id 7BE5DDDD0C; Thu, 11 Jun 2009 18:23:14 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 0F6E5DDD01 for ; Thu, 11 Jun 2009 18:23:14 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760964AbZFKIWh (ORCPT ); Thu, 11 Jun 2009 04:22:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751529AbZFKIWg (ORCPT ); Thu, 11 Jun 2009 04:22:36 -0400 Received: from mail-ew0-f210.google.com ([209.85.219.210]:44926 "EHLO mail-ew0-f210.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760964AbZFKIWe (ORCPT ); Thu, 11 Jun 2009 04:22:34 -0400 Received: by ewy6 with SMTP id 6so1776533ewy.37 for ; Thu, 11 Jun 2009 01:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=vWSYsikeNAtPqexdNQ9UzsUEsQX4G38/3O+AiP7ednM=; b=l1WCrTkzOO/XOLoV8MtfEwe02rA3xB0iS6LuuXrWi/HqTcUuQW+QyEjM5Bd3YiuDFJ UNSgR4dFScLfCEkBTs9f0GGDF7ioJ482HsWyavMv7j1EdSgC9Fy0ZztPf5pkaSLaR4Xo S0zXGFDw4RRGx/85bNWwBqdp1mNAs9oLZ5RgM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=ATjBCqe5biXXTK755aWTYwJxXtrTNtDT9LzIHrOYrUQPbNkyulWl4jiJfjYVpu/K7B 4bRH+zas/W888p7uREtE63TYygSUtaZycpinIXCdpnhLjGmFfnMY1oYQklRi3tFVbzJu 6lUUTRf28vgQ7cRV8MhWLS/F2zAEPB+tUGids= Received: by 10.210.91.17 with SMTP id o17mr2804304ebb.71.1244708556017; Thu, 11 Jun 2009 01:22:36 -0700 (PDT) Received: from ?10.252.5.10? (xdsl-83-150-94-239.nebulazone.fi [83.150.94.239]) by mx.google.com with ESMTPS id 10sm805632eyz.41.2009.06.11.01.22.34 (version=SSLv3 cipher=RC4-MD5); Thu, 11 Jun 2009 01:22:34 -0700 (PDT) Message-ID: <4A30BECA.8030205@iki.fi> Date: Thu, 11 Jun 2009 11:22:34 +0300 From: =?ISO-8859-1?Q?Timo_Ter=E4s?= User-Agent: Thunderbird 2.0.0.21 (X11/20090409) MIME-Version: 1.0 To: netdev@vger.kernel.org CC: Herbert Xu , Alexey Kuznetsov , David Miller Subject: ip_gre headroom allocation Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org I'm not entirely sure about this, but shouldn't we do something like the below to make ip_gre allocation enough headroom for paths where e.g. xfrm transformations take place (as a speed optimization)? --- 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 e62510d..eb78dd9 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -812,7 +812,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) tunnel->err_count = 0; } - max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen; + max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->u.dst.header_len; if (skb_headroom(skb) < max_headroom || skb_shared(skb)|| (skb_cloned(skb) && !skb_clone_writable(skb, 0))) {