From patchwork Mon May 16 16:28:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Jarosch X-Patchwork-Id: 95785 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 AC93BB6EF3 for ; Tue, 17 May 2011 03:03:47 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752812Ab1EPRDn (ORCPT ); Mon, 16 May 2011 13:03:43 -0400 Received: from rs04.intra2net.com ([85.214.66.2]:49714 "EHLO rs04.intra2net.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752311Ab1EPRDm (ORCPT ); Mon, 16 May 2011 13:03:42 -0400 X-Greylist: delayed 2125 seconds by postgrey-1.27 at vger.kernel.org; Mon, 16 May 2011 13:03:42 EDT Received: from intranator.m.i2n (unknown [172.16.1.99]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by rs04.intra2net.com (Postfix) with ESMTP id E09B6220109; Mon, 16 May 2011 18:28:16 +0200 (CEST) Received: from localhost (intranator.m.i2n [127.0.0.1]) by localhost (Postfix) with ESMTP id 966162AC54; Mon, 16 May 2011 18:28:16 +0200 (CEST) X-Virus-Scanned: by Intranator (www.intra2net.com) with AMaViS and F-Secure AntiVirus (fsavdb 2011-05-16_03) X-Spam-Status: X-Spam-Level: 0 Received: from storm.localnet (storm.m.i2n [172.16.1.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: smtp-auth-user) by intranator.m.i2n (Postfix) with ESMTPSA id 78B482AC53; Mon, 16 May 2011 18:28:15 +0200 (CEST) To: netdev@vger.kernel.org Subject: [PATCH] vmxnet3: Fix inconsistent LRO state after initialization Cc: Shreyas Bhatewara From: Thomas Jarosch Organization: Intra2net AG Date: Mon, 16 May 2011 18:28:15 +0200 MIME-Version: 1.0 Message-Id: <201105161828.15237.thomas.jarosch@intra2net.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org During initialization of vmxnet3, the state of LRO gets out of sync with netdev->features. This leads to very poor TCP performance in a IP forwarding setup and is hitting many VMware users. Simplified call sequence: 1. vmxnet3_declare_features() initializes "adapter->lro" to true. 2. The kernel automatically disables LRO if IP forwarding is enabled, so vmxnet3_set_flags() gets called. This also updates netdev->features. 3. Now vmxnet3_setup_driver_shared() is called. "adapter->lro" is still set to true and LRO gets enabled again, even though netdev->features shows it's disabled. Fix it by updating "adapter->lro", too. The private vmxnet3 adapter flags are scheduled for removal in net-next, see commit a0d2730c9571aeba793cb5d3009094ee1d8fda35 "net: vmxnet3: convert to hw_features". Patch applies to 2.6.37 / 2.6.38 and 2.6.39-rc6. Please CC: comments. Signed-off-by: Thomas Jarosch Acked-by: Stephen Hemminger --- 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 -u -r -p linux-2.6.37.i686/drivers/net/vmxnet3/vmxnet3_ethtool.c linux-2.6.37.lro/drivers/net/vmxnet3/vmxnet3_ethtool.c --- linux-2.6.37.i686/drivers/net/vmxnet3/vmxnet3_ethtool.c 2011-05-16 17:43:26.652081801 +0200 +++ linux-2.6.37.lro/drivers/net/vmxnet3/vmxnet3_ethtool.c 2011-05-16 17:47:52.784081802 +0200 @@ -287,6 +287,9 @@ vmxnet3_set_flags(struct net_device *net /* toggle the LRO feature*/ netdev->features ^= NETIF_F_LRO; + /* Update private LRO flag */ + adapter->lro = lro_requested; + /* update harware LRO capability accordingly */ if (lro_requested) adapter->shared->devRead.misc.uptFeatures |=