Skip to content

Commit

Permalink
tile: set hw_features and vlan_features in setup
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Chris Metcalf authored and David S. Miller committed Aug 1, 2013
1 parent 84915c6 commit a8eaed5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 33 deletions.
15 changes: 11 additions & 4 deletions drivers/net/ethernet/tile/tilegx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 14 additions & 29 deletions drivers/net/ethernet/tile/tilepro.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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;
}


Expand Down

0 comments on commit a8eaed5

Please sign in to comment.