From patchwork Thu Aug 1 15:36:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Metcalf X-Patchwork-Id: 264106 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 BF1C12C007C for ; Fri, 2 Aug 2013 05:39:41 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757444Ab3HATfX (ORCPT ); Thu, 1 Aug 2013 15:35:23 -0400 Received: from usmamail.tilera.com ([12.216.194.151]:21404 "EHLO USMAMAIL.TILERA.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754478Ab3HATfV (ORCPT ); Thu, 1 Aug 2013 15:35:21 -0400 Received: from farm-0021.internal.tilera.com (10.2.0.51) by USMAEXCH2.tad.internal.tilera.com (10.3.0.33) with Microsoft SMTP Server (TLS) id 14.0.722.0; Thu, 1 Aug 2013 15:35:21 -0400 Received: (from cmetcalf@localhost) by farm-0021.internal.tilera.com (8.14.4/8.12.11/Submit) id r71JZLbG026618; Thu, 1 Aug 2013 15:35:21 -0400 Message-ID: <07af860a72f3ef63cb517aae9894147ee6390f74.1375385119.git.cmetcalf@tilera.com> In-Reply-To: References: <20130801.113100.2059303096028571906.davem@davemloft.net> From: Chris Metcalf Date: Thu, 1 Aug 2013 11:36:42 -0400 Subject: [PATCH v3 01/13] tile: set hw_features and vlan_features in setup To: , MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This change allows the user to configure various features of the tile networking drivers on and off. There is no change to the default initialization state of either the tilegx or tilepro drivers. Neither driver needs the ndo_fix_features or ndo_set_features callbacks, since the generic code already handles the dependencies for fix_features, and there is no hardware state to tweak in set_features. Signed-off-by: Chris Metcalf --- drivers/net/ethernet/tile/tilegx.c | 15 +++++++++---- drivers/net/ethernet/tile/tilepro.c | 43 ++++++++++++------------------------- 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c index f3c2d03..6085571 100644 --- a/drivers/net/ethernet/tile/tilegx.c +++ b/drivers/net/ethernet/tile/tilegx.c @@ -1800,14 +1800,21 @@ static const struct net_device_ops tile_net_ops = { */ static void tile_net_setup(struct net_device *dev) { + netdev_features_t features = 0; + ether_setup(dev); dev->netdev_ops = &tile_net_ops; dev->watchdog_timeo = TILE_NET_TIMEOUT; - dev->features |= NETIF_F_LLTX; - dev->features |= NETIF_F_HW_CSUM; - dev->features |= NETIF_F_SG; - dev->features |= NETIF_F_TSO; dev->mtu = 1500; + + features |= NETIF_F_LLTX; + features |= NETIF_F_HW_CSUM; + features |= NETIF_F_SG; + features |= NETIF_F_TSO; + + dev->hw_features |= features; + dev->vlan_features |= features; + dev->features |= features; } /* Allocate the device structure, register the device, and obtain the diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c index f66ac20..34b43b4 100644 --- a/drivers/net/ethernet/tile/tilepro.c +++ b/drivers/net/ethernet/tile/tilepro.c @@ -89,10 +89,6 @@ /* ISSUE: This has not been thoroughly tested (except at 1500). */ #define TILE_NET_MTU 1500 -/* HACK: Define to support GSO. */ -/* ISSUE: This may actually hurt performance of the TCP blaster. */ -/* #define TILE_NET_GSO */ - /* Define this to collapse "duplicate" acks. */ /* #define IGNORE_DUP_ACKS */ @@ -2336,39 +2332,28 @@ static const struct net_device_ops tile_net_ops = { */ static void tile_net_setup(struct net_device *dev) { - PDEBUG("tile_net_setup()\n"); + netdev_features_t features = 0; ether_setup(dev); - dev->netdev_ops = &tile_net_ops; - dev->watchdog_timeo = TILE_NET_TIMEOUT; + dev->tx_queue_len = TILE_NET_TX_QUEUE_LEN; + dev->mtu = TILE_NET_MTU; - /* We want lockless xmit. */ - dev->features |= NETIF_F_LLTX; - - /* We support hardware tx checksums. */ - dev->features |= NETIF_F_HW_CSUM; - - /* We support scatter/gather. */ - dev->features |= NETIF_F_SG; - - /* We support TSO. */ - dev->features |= NETIF_F_TSO; - -#ifdef TILE_NET_GSO - /* We support GSO. */ - dev->features |= NETIF_F_GSO; -#endif + features |= NETIF_F_LLTX; + features |= NETIF_F_HW_CSUM; + features |= NETIF_F_SG; + features |= NETIF_F_TSO; + /* We can't support HIGHDMA without hash_default, since we need + * to be able to finv() with a VA if we don't have hash_default. + */ if (hash_default) - dev->features |= NETIF_F_HIGHDMA; - - /* ISSUE: We should support NETIF_F_UFO. */ + features |= NETIF_F_HIGHDMA; - dev->tx_queue_len = TILE_NET_TX_QUEUE_LEN; - - dev->mtu = TILE_NET_MTU; + dev->hw_features |= features; + dev->vlan_features |= features; + dev->features |= features; }