netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@tilera.com>
To: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>
Subject: [PATCH v3 01/13] tile: set hw_features and vlan_features in setup
Date: Thu, 1 Aug 2013 11:36:42 -0400	[thread overview]
Message-ID: <07af860a72f3ef63cb517aae9894147ee6390f74.1375385119.git.cmetcalf@tilera.com> (raw)
In-Reply-To: <cover.1375385119.git.cmetcalf@tilera.com>

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 <cmetcalf@tilera.com>
---
 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;
 }
 
 
-- 
1.8.3.1

  parent reply	other threads:[~2013-08-01 15:36 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 20:05 [PATCH 00/13] update tile network drivers Chris Metcalf
2013-07-23 20:05 ` [PATCH 04/13] tile: remove dead is_dup_ack() function from tilepro net driver Chris Metcalf
2013-07-23 20:05 ` [PATCH 03/13] tile: avoid bug in tilepro net driver built with old hypervisor Chris Metcalf
2013-07-23 20:05 ` [PATCH 11/13] tile: support TSO for IPv6 in tilegx network driver Chris Metcalf
2013-07-23 20:05 ` [PATCH 02/13] tile: support rx_dropped/rx_errors in tilepro net driver Chris Metcalf
2013-07-23 20:05 ` [PATCH 08/13] tile: fix panic bug in napi support for tilegx network driver Chris Metcalf
2013-07-23 20:05 ` [PATCH 01/13] tile: handle 64-bit statistics in tilepro " Chris Metcalf
2013-07-24  9:31   ` David Miller
2013-07-25 16:41   ` [PATCH v2] " Chris Metcalf
2013-07-30 23:16     ` David Miller
2013-07-31  0:34       ` Chris Metcalf
2013-07-31  0:36         ` David Miller
2013-07-23 20:05 ` [PATCH 07/13] tile: update dev->stats directly in tilegx " Chris Metcalf
2013-07-23 20:05 ` [PATCH 05/13] tile: support PTP using the tilegx mPIPE (IEEE 1588) Chris Metcalf
2013-07-24  6:25   ` Richard Cochran
2013-07-24  6:29   ` Richard Cochran
2013-07-24 16:17     ` Chris Metcalf
2013-07-25 15:19   ` [PATCH v2] " Chris Metcalf
2013-07-25 17:55     ` Richard Cochran
2013-07-23 20:05 ` [PATCH 09/13] tile: enable GRO in the tilegx network driver Chris Metcalf
2013-07-23 21:19   ` Eric Dumazet
2013-07-23 22:26     ` Chris Metcalf
2013-07-23 20:05 ` [PATCH 12/13] tile: make "tile_net.custom" a proper bool module parameter Chris Metcalf
2013-07-23 20:05 ` [PATCH 10/13] tile: support multiple mPIPE shims in tilegx network driver Chris Metcalf
2013-07-23 20:05 ` [PATCH 13/13] tile: remove deprecated NETIF_F_LLTX flag from tile drivers Chris Metcalf
2013-07-23 20:05 ` [PATCH 06/13] tile: support jumbo frames in the tilegx network driver Chris Metcalf
2013-07-31 15:05 ` [PATCH v2 00/12] update tile network drivers Chris Metcalf
2013-07-31 15:05   ` [PATCH 03/12] tile: remove dead is_dup_ack() function from tilepro net driver Chris Metcalf
2013-07-31 15:05   ` [PATCH 04/12] tile: support jumbo frames in the tilegx network driver Chris Metcalf
2013-07-31 15:05   ` [PATCH 06/12] tile: fix panic bug in napi support for " Chris Metcalf
2013-07-31 15:05   ` [PATCH 01/12] tile: support rx_dropped/rx_errors in tilepro net driver Chris Metcalf
2013-07-31 15:05   ` [PATCH 11/12] tile: remove deprecated NETIF_F_LLTX flag from tile drivers Chris Metcalf
2013-07-31 15:05   ` [PATCH 12/12] tile: support PTP using the tilegx mPIPE (IEEE 1588) Chris Metcalf
2013-07-31 15:05   ` [PATCH 10/12] tile: make "tile_net.custom" a proper bool module parameter Chris Metcalf
2013-07-31 15:05   ` [PATCH 07/12] tile: enable GRO in the tilegx network driver Chris Metcalf
2013-07-31 15:05   ` [PATCH 09/12] tile: support TSO for IPv6 in " Chris Metcalf
2013-07-31 19:25     ` David Miller
2013-08-01 15:36       ` [PATCH v2 13/12] tile: set hw_features and vlan_features in setup Chris Metcalf
2013-08-01 18:31         ` David Miller
2013-08-01 19:25         ` [PATCH v3 00/13] update tile network drivers Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 02/13] tile: support rx_dropped/rx_errors in tilepro net driver Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 06/13] tile: update dev->stats directly in tilegx network driver Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 08/13] tile: enable GRO in the " Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 09/13] tile: support multiple mPIPE shims in " Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 05/13] tile: support jumbo frames in the " Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 04/13] tile: remove dead is_dup_ack() function from tilepro net driver Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 03/13] tile: avoid bug in tilepro net driver built with old hypervisor Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 13/13] tile: support PTP using the tilegx mPIPE (IEEE 1588) Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 10/13] tile: support TSO for IPv6 in tilegx network driver Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 12/13] tile: remove deprecated NETIF_F_LLTX flag from tile drivers Chris Metcalf
2013-08-01 15:36           ` Chris Metcalf [this message]
2013-08-01 15:36           ` [PATCH v3 07/13] tile: fix panic bug in napi support for tilegx network driver Chris Metcalf
2013-08-01 15:36           ` [PATCH v3 11/13] tile: make "tile_net.custom" a proper bool module parameter Chris Metcalf
2013-08-01 21:42           ` [PATCH v3 00/13] update tile network drivers David Miller
2013-07-31 15:05   ` [PATCH 08/12] tile: support multiple mPIPE shims in tilegx network driver Chris Metcalf
2013-07-31 15:05   ` [PATCH 02/12] tile: avoid bug in tilepro net driver built with old hypervisor Chris Metcalf
2013-07-31 15:05   ` [PATCH 05/12] tile: update dev->stats directly in tilegx network driver Chris Metcalf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=07af860a72f3ef63cb517aae9894147ee6390f74.1375385119.git.cmetcalf@tilera.com \
    --to=cmetcalf@tilera.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).