diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-05-06 06:25:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-06 18:33:40 -0400 |
commit | 0364d6fd2c353d2d82da865a6f093f97c69b669c (patch) | |
tree | 5f0ce8756cf7317130e636e6f3103279483d32e5 /drivers/net/igbvf/ethtool.c | |
parent | e0ca84105bca8691f39ef7ff221a88046ba11f23 (diff) |
igbvf: cleanup flags and allow for rx checksum to be disabled
This patch cleans up a number of unused or unneeded feature flags. As a
result of these changes the user should now be able to enable or disable rx
checksumming via ethtool.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igbvf/ethtool.c')
-rw-r--r-- | drivers/net/igbvf/ethtool.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/drivers/net/igbvf/ethtool.c b/drivers/net/igbvf/ethtool.c index 1dcaa6905312..ee17a097d1ca 100644 --- a/drivers/net/igbvf/ethtool.c +++ b/drivers/net/igbvf/ethtool.c | |||
@@ -133,6 +133,24 @@ static int igbvf_set_pauseparam(struct net_device *netdev, | |||
133 | return -EOPNOTSUPP; | 133 | return -EOPNOTSUPP; |
134 | } | 134 | } |
135 | 135 | ||
136 | static u32 igbvf_get_rx_csum(struct net_device *netdev) | ||
137 | { | ||
138 | struct igbvf_adapter *adapter = netdev_priv(netdev); | ||
139 | return !(adapter->flags & IGBVF_FLAG_RX_CSUM_DISABLED); | ||
140 | } | ||
141 | |||
142 | static int igbvf_set_rx_csum(struct net_device *netdev, u32 data) | ||
143 | { | ||
144 | struct igbvf_adapter *adapter = netdev_priv(netdev); | ||
145 | |||
146 | if (data) | ||
147 | adapter->flags &= ~IGBVF_FLAG_RX_CSUM_DISABLED; | ||
148 | else | ||
149 | adapter->flags |= IGBVF_FLAG_RX_CSUM_DISABLED; | ||
150 | |||
151 | return 0; | ||
152 | } | ||
153 | |||
136 | static u32 igbvf_get_tx_csum(struct net_device *netdev) | 154 | static u32 igbvf_get_tx_csum(struct net_device *netdev) |
137 | { | 155 | { |
138 | return ((netdev->features & NETIF_F_IP_CSUM) != 0); | 156 | return ((netdev->features & NETIF_F_IP_CSUM) != 0); |
@@ -150,8 +168,6 @@ static int igbvf_set_tx_csum(struct net_device *netdev, u32 data) | |||
150 | static int igbvf_set_tso(struct net_device *netdev, u32 data) | 168 | static int igbvf_set_tso(struct net_device *netdev, u32 data) |
151 | { | 169 | { |
152 | struct igbvf_adapter *adapter = netdev_priv(netdev); | 170 | struct igbvf_adapter *adapter = netdev_priv(netdev); |
153 | int i; | ||
154 | struct net_device *v_netdev; | ||
155 | 171 | ||
156 | if (data) { | 172 | if (data) { |
157 | netdev->features |= NETIF_F_TSO; | 173 | netdev->features |= NETIF_F_TSO; |
@@ -159,24 +175,10 @@ static int igbvf_set_tso(struct net_device *netdev, u32 data) | |||
159 | } else { | 175 | } else { |
160 | netdev->features &= ~NETIF_F_TSO; | 176 | netdev->features &= ~NETIF_F_TSO; |
161 | netdev->features &= ~NETIF_F_TSO6; | 177 | netdev->features &= ~NETIF_F_TSO6; |
162 | /* disable TSO on all VLANs if they're present */ | ||
163 | if (!adapter->vlgrp) | ||
164 | goto tso_out; | ||
165 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { | ||
166 | v_netdev = vlan_group_get_device(adapter->vlgrp, i); | ||
167 | if (!v_netdev) | ||
168 | continue; | ||
169 | |||
170 | v_netdev->features &= ~NETIF_F_TSO; | ||
171 | v_netdev->features &= ~NETIF_F_TSO6; | ||
172 | vlan_group_set_device(adapter->vlgrp, i, v_netdev); | ||
173 | } | ||
174 | } | 178 | } |
175 | 179 | ||
176 | tso_out: | ||
177 | dev_info(&adapter->pdev->dev, "TSO is %s\n", | 180 | dev_info(&adapter->pdev->dev, "TSO is %s\n", |
178 | data ? "Enabled" : "Disabled"); | 181 | data ? "Enabled" : "Disabled"); |
179 | adapter->flags |= FLAG_TSO_FORCE; | ||
180 | return 0; | 182 | return 0; |
181 | } | 183 | } |
182 | 184 | ||
@@ -517,6 +519,8 @@ static const struct ethtool_ops igbvf_ethtool_ops = { | |||
517 | .set_ringparam = igbvf_set_ringparam, | 519 | .set_ringparam = igbvf_set_ringparam, |
518 | .get_pauseparam = igbvf_get_pauseparam, | 520 | .get_pauseparam = igbvf_get_pauseparam, |
519 | .set_pauseparam = igbvf_set_pauseparam, | 521 | .set_pauseparam = igbvf_set_pauseparam, |
522 | .get_rx_csum = igbvf_get_rx_csum, | ||
523 | .set_rx_csum = igbvf_set_rx_csum, | ||
520 | .get_tx_csum = igbvf_get_tx_csum, | 524 | .get_tx_csum = igbvf_get_tx_csum, |
521 | .set_tx_csum = igbvf_set_tx_csum, | 525 | .set_tx_csum = igbvf_set_tx_csum, |
522 | .get_sg = ethtool_op_get_sg, | 526 | .get_sg = ethtool_op_get_sg, |