diff options
author | Or Gerlitz <ogerlitz@voltaire.com> | 2010-03-04 08:16:52 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-04-21 20:17:30 -0400 |
commit | d414371795d54fa916938f948105d08928abfbb9 (patch) | |
tree | a7f34094105b580336a40ecdf3b99599ed4593ea | |
parent | 0eddb519b9127c73d53db4bf3ec1d45b13f844d1 (diff) |
IPoIB: Allow disabling/enabling TSO on the fly through ethtool
Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c index d10b4ec68d28..40e858492f90 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | |||
@@ -49,6 +49,25 @@ static u32 ipoib_get_rx_csum(struct net_device *dev) | |||
49 | !test_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); | 49 | !test_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); |
50 | } | 50 | } |
51 | 51 | ||
52 | static int ipoib_set_tso(struct net_device *dev, u32 data) | ||
53 | { | ||
54 | struct ipoib_dev_priv *priv = netdev_priv(dev); | ||
55 | |||
56 | if (data) { | ||
57 | if (!test_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags) && | ||
58 | (dev->features & NETIF_F_SG) && | ||
59 | (priv->hca_caps & IB_DEVICE_UD_TSO)) { | ||
60 | dev->features |= NETIF_F_TSO; | ||
61 | } else { | ||
62 | ipoib_warn(priv, "can't set TSO on\n"); | ||
63 | return -EOPNOTSUPP; | ||
64 | } | ||
65 | } else | ||
66 | dev->features &= ~NETIF_F_TSO; | ||
67 | |||
68 | return 0; | ||
69 | } | ||
70 | |||
52 | static int ipoib_get_coalesce(struct net_device *dev, | 71 | static int ipoib_get_coalesce(struct net_device *dev, |
53 | struct ethtool_coalesce *coal) | 72 | struct ethtool_coalesce *coal) |
54 | { | 73 | { |
@@ -131,6 +150,7 @@ static void ipoib_get_ethtool_stats(struct net_device *dev, | |||
131 | static const struct ethtool_ops ipoib_ethtool_ops = { | 150 | static const struct ethtool_ops ipoib_ethtool_ops = { |
132 | .get_drvinfo = ipoib_get_drvinfo, | 151 | .get_drvinfo = ipoib_get_drvinfo, |
133 | .get_rx_csum = ipoib_get_rx_csum, | 152 | .get_rx_csum = ipoib_get_rx_csum, |
153 | .set_tso = ipoib_set_tso, | ||
134 | .get_coalesce = ipoib_get_coalesce, | 154 | .get_coalesce = ipoib_get_coalesce, |
135 | .set_coalesce = ipoib_set_coalesce, | 155 | .set_coalesce = ipoib_set_coalesce, |
136 | .get_flags = ethtool_op_get_flags, | 156 | .get_flags = ethtool_op_get_flags, |