From patchwork Mon Apr 11 15:00:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 90608 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 5FE86B6F1B for ; Tue, 12 Apr 2011 01:00:47 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754109Ab1DKPAm (ORCPT ); Mon, 11 Apr 2011 11:00:42 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:43842 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753972Ab1DKPAl convert rfc822-to-8bit (ORCPT ); Mon, 11 Apr 2011 11:00:41 -0400 Received: from nehalam (static-50-53-80-93.bvtn.or.frontiernet.net [50.53.80.93]) (authenticated bits=0) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p3BF0AO1013815 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 11 Apr 2011 08:00:11 -0700 Date: Mon, 11 Apr 2011 08:00:09 -0700 From: Stephen Hemminger To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: netdev@vger.kernel.org Subject: Re: [PATCH] net: sky2: convert to hw_features Message-ID: <20110411080009.72c37538@nehalam> In-Reply-To: <20110411005100.GA22103@rere.qmqm.pl> References: <20110410131321.8CD9713A64@rere.qmqm.pl> <20110410115302.450794c7@nehalam> <20110411005100.GA22103@rere.qmqm.pl> Organization: Linux Foundation X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.0; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Spam-Status: No, hits=-106.068 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED, PATCH_SUBJECT_OSDL, USER_IN_WHITELIST X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 11 Apr 2011 02:51:00 +0200 Michał Mirosław wrote: > On Sun, Apr 10, 2011 at 11:53:02AM -0700, Stephen Hemminger wrote: > > On Sun, 10 Apr 2011 15:13:21 +0200 (CEST) > > Michał Mirosław wrote: > > > Caveats: > > > - driver modifies vlan_features on HW VLAN TX changes > > > - broken RX checksum will be reenabled on features change > > To be more precise. This is acceptable if and only if all cases > > where features are disabled in response to MTU and chip versions > > are exactly the same. We don't want to let some user stumble upon > > cases where hardware features don't work in their configuration. > > I was referring to the unlikely case detected by sky2_rx_checksum(). > Before this conversion, user could reenable the feature using ethtool. > The change is that now, in this case, it's reenabled also when other > features are changed (i.e. whenever netdev_update_features() gets called). > > Best Regards, > Michał Mirosław Ok. It does expose a pre-existing issue. If this logic trips (and I have gotten reports of it happening), then the GRO will not get disabled. Probably need to mask of GRO as well, since GRO depends on RXCSUM. --- 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 --- a/drivers/net/sky2.c 2011-04-11 07:56:50.569361209 -0700 +++ b/drivers/net/sky2.c 2011-04-11 07:57:34.502312648 -0700 @@ -2538,7 +2538,7 @@ static void sky2_rx_checksum(struct sky2 * It will be reenabled on next ndo_set_features, but if it's * really broken, will get disabled again */ - sky2->netdev->features &= ~NETIF_F_RXCSUM; + sky2->netdev->features &= ~(NETIF_F_RXCSUM | NETIF_F_GRO); sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR), BMU_DIS_RX_CHKSUM); }