diff mbox

net: sky2: convert to hw_features

Message ID 20110411075829.7b9bf1e5@nehalam
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Stephen Hemminger April 11, 2011, 2:58 p.m. UTC
On Mon, 11 Apr 2011 02:51:00 +0200
Michał Mirosław <mirq-linux@rere.qmqm.pl> 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 <mirq-linux@rere.qmqm.pl> 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

Comments

Michał Mirosław April 11, 2011, 5:58 p.m. UTC | #1
On Mon, Apr 11, 2011 at 07:58:29AM -0700, Stephen Hemminger wrote:
> On Mon, 11 Apr 2011 02:51:00 +0200
> Michał Mirosław <mirq-linux@rere.qmqm.pl> 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 <mirq-linux@rere.qmqm.pl> 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).
> 
> 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.

This is not a problem, since the code checks skb->ip_summed for protocols
that implement GRO. See tcp4_gro_receive() for example. This might be
a slight hit in performance, though.

Best Regards,
Michał Mirosław
--
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
Stephen Hemminger April 11, 2011, 6:09 p.m. UTC | #2
On Mon, 11 Apr 2011 19:58:23 +0200
Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:

> On Mon, Apr 11, 2011 at 07:58:29AM -0700, Stephen Hemminger wrote:
> > On Mon, 11 Apr 2011 02:51:00 +0200
> > Michał Mirosław <mirq-linux@rere.qmqm.pl> 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 <mirq-linux@rere.qmqm.pl> 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).
> > 
> > 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.
> 
> This is not a problem, since the code checks skb->ip_summed for protocols
> that implement GRO. See tcp4_gro_receive() for example. This might be
> a slight hit in performance, though.

The performance hit is expected, just thought that GRO depended on rx checksum.
--
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 mbox

Patch

--- 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);
 	}