From patchwork Fri Jun 24 03:38:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shan Wei X-Patchwork-Id: 101714 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 9C2EBB6F8E for ; Fri, 24 Jun 2011 13:38:03 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751414Ab1FXDho (ORCPT ); Thu, 23 Jun 2011 23:37:44 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:55787 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751304Ab1FXDho (ORCPT ); Thu, 23 Jun 2011 23:37:44 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id AF45C17012A; Fri, 24 Jun 2011 11:37:41 +0800 (CST) Received: from mailserver.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id p5O3bfJk027641; Fri, 24 Jun 2011 11:37:41 +0800 Received: from [10.167.225.31] ([10.167.225.31]) by mailserver.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2011062411371608-659594 ; Fri, 24 Jun 2011 11:37:16 +0800 Message-ID: <4E0406C4.6060004@cn.fujitsu.com> Date: Fri, 24 Jun 2011 11:38:44 +0800 From: Shan Wei User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: =?UTF-8?B?5Y2V5Y2r?= , Patrick McHardy , David Miller , netdev , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Ben Hutchings Subject: [RFC][PATCH 1/2] net: vlan: enable GSO by default X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-06-24 11:37:16, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-06-24 11:37:16, Serialize complete at 2011-06-24 11:37:16 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently, GSO for vlan device is off, and can't be set to on. Although underlying device don't support TSO, we still should use software segments for vlan device. In vlan_dev_fix_features(), final features is decided by features of real device and vlan_features of real device. real_dev->vlan_features is initialized in register_netdevice() only with NETIF_F_GRO, not NETIF_F_GSO. So, now GRO is ok, but GSO is broken by default. Signed-off-by: Shan Wei --- net/8021q/vlan_dev.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 1c9aa8c..d8f45ba 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -588,9 +588,14 @@ static void vlan_dev_uninit(struct net_device *dev) static u32 vlan_dev_fix_features(struct net_device *dev, u32 features) { struct net_device *real_dev = vlan_dev_info(dev)->real_dev; + u32 old_features = features; features &= real_dev->features; features &= real_dev->vlan_features; + + if (old_features & NETIF_F_SOFT_FEATURES) + features |= old_features & NETIF_F_SOFT_FEATURES; + if (dev_ethtool_get_rx_csum(real_dev)) features |= NETIF_F_RXCSUM; features |= NETIF_F_LLTX;