Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203190
b: refs/heads/master
c: d2ef859
h: refs/heads/master
v: v3
  • Loading branch information
Amerigo Wang authored and David S. Miller committed Jun 29, 2010
1 parent f4c6cfe commit fdd3027
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 958de1931cbfbcd9c0d425a2291a769a851f15d0
refs/heads/master: d2ef8590343f1f236f5f7f070fb4cd3f5c3ffb69
38 changes: 37 additions & 1 deletion trunk/drivers/net/mlx4/en_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,42 @@ static void mlx4_en_get_ringparam(struct net_device *dev,
param->tx_pending = mdev->profile.prof[priv->port].tx_ring_size;
}

static int mlx4_ethtool_op_set_flags(struct net_device *dev, u32 data)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
int rc = 0;
int changed = 0;

if (data & ~ETH_FLAG_LRO)
return -EOPNOTSUPP;

if (data & ETH_FLAG_LRO) {
if (mdev->profile.num_lro == 0)
return -EOPNOTSUPP;
if (!(dev->features & NETIF_F_LRO))
changed = 1;
} else if (dev->features & NETIF_F_LRO) {
changed = 1;
}

if (changed) {
if (netif_running(dev)) {
mutex_lock(&mdev->state_lock);
mlx4_en_stop_port(dev);
}
dev->features ^= NETIF_F_LRO;
if (netif_running(dev)) {
rc = mlx4_en_start_port(dev);
if (rc)
en_err(priv, "Failed to restart port\n");
mutex_unlock(&mdev->state_lock);
}
}

return rc;
}

const struct ethtool_ops mlx4_en_ethtool_ops = {
.get_drvinfo = mlx4_en_get_drvinfo,
.get_settings = mlx4_en_get_settings,
Expand Down Expand Up @@ -415,7 +451,7 @@ const struct ethtool_ops mlx4_en_ethtool_ops = {
.get_ringparam = mlx4_en_get_ringparam,
.set_ringparam = mlx4_en_set_ringparam,
.get_flags = ethtool_op_get_flags,
.set_flags = ethtool_op_set_flags,
.set_flags = mlx4_ethtool_op_set_flags,
};


Expand Down

0 comments on commit fdd3027

Please sign in to comment.