From patchwork Thu Sep 23 10:46:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 65525 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 39431B70DC for ; Thu, 23 Sep 2010 20:46:21 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752922Ab0IWKqQ (ORCPT ); Thu, 23 Sep 2010 06:46:16 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:38241 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752489Ab0IWKqP (ORCPT ); Thu, 23 Sep 2010 06:46:15 -0400 Received: by fxm12 with SMTP id 12so630673fxm.19 for ; Thu, 23 Sep 2010 03:46:14 -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 :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=ZZSG/OX7jvyyOPuMuMjZsbOqbvXsCMSggBdwZqRnoAU=; b=Yx7e4lMsIDUFjXUthWOwrVU95fLbjZfnRJ+2PSOY2ErLVxmEi3AnQhaSKwNwIXZgZn n4yb+BsVuqxWhyNCBEP62TeoswTLL2++Hbhwzx/J9HNyMe6iNh+GUQ/5GqXNzz5qPu/v QHcUEZb+tSsbBnik9izRDFaDnXofssj5AT3mk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=atwwe2Q/T9AhIA12dDnMg2r1XHW4w9htHoeXeXUit1R0jm/06zJxVwSco5tgt9qJyH 7y4z/oT81TfUV5vfTAWr3GNgo6f1dm7mjocKrNtHX6r7MpJf4Mmgua+Id1SKOW8KLYoM C59fFKiUQKciWmXNvjUf7ehpwZWcZ0A0hOOJc= Received: by 10.223.119.211 with SMTP id a19mr1776323far.4.1285238774308; Thu, 23 Sep 2010 03:46:14 -0700 (PDT) Received: from [10.150.51.224] (gw0.net.jmsp.net [212.23.165.14]) by mx.google.com with ESMTPS id r10sm229844faq.29.2010.09.23.03.46.12 (version=SSLv3 cipher=RC4-MD5); Thu, 23 Sep 2010 03:46:13 -0700 (PDT) Subject: [PATCH net-next-2.6] net: propagate NETIF_F_HIGHDMA to vlans From: Eric Dumazet To: Jeff Kirsher , David Miller Cc: netdev@vger.kernel.org, gospo@redhat.com, bphilips@novell.com, yi.zou@intel.com In-Reply-To: <1285222405.2380.80.camel@edumazet-laptop> References: <20100923035755.11561.14170.stgit@localhost.localdomain> <20100922.212023.91330415.davem@davemloft.net> <1285219690.2380.70.camel@edumazet-laptop> <1285222405.2380.80.camel@edumazet-laptop> Date: Thu, 23 Sep 2010 12:46:11 +0200 Message-ID: <1285238771.2864.38.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Automatically allows vlans to get NETIF_F_HIGHDMA if underlying device supports it. On 32bit arches (and more precisely if CONFIG_HIGHMEM is enabled), it can help to reduce cost of illegal_highdma() and __skb_linearize() calls. Tested on tg3 , bnx2, bonding, this worked very well. This is a generalization of a patch provided by Yi Zou & Jeff Kirsher. Signed-off-by: Eric Dumazet --- net/core/dev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 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/core/dev.c b/net/core/dev.c index 2c7934f..e0c0b86 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -5058,10 +5058,11 @@ int register_netdevice(struct net_device *dev) if (dev->features & NETIF_F_SG) dev->features |= NETIF_F_GSO; - /* Enable GRO for vlans by default if dev->features has GRO also. - * vlan_dev_init() will do the dev->features check. + /* Enable GRO and NETIF_F_HIGHDMA for vlans by default, + * vlan_dev_init() will do the dev->features check, so these features + * are enabled only if supported by underlying device. */ - dev->vlan_features |= NETIF_F_GRO; + dev->vlan_features |= (NETIF_F_GRO | NETIF_F_HIGHDMA); ret = call_netdevice_notifiers(NETDEV_POST_INIT, dev); ret = notifier_to_errno(ret);