aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-05-06 06:25:23 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-06 18:33:41 -0400
commit7beb0146fc965ffee928eff53525aac0173b0b07 (patch)
treeefd247f9a2cc044ac32c9e55c1820a25d06595a0 /drivers/net/igb
parent0364d6fd2c353d2d82da865a6f093f97c69b669c (diff)
igb/igbvf: set rx csum always enabled in hw, disable via sw
An issue was found in which rx checksum could not be enabled without resetting the interface. The issue was the hardware enable was not being done via ethtool. To resolve this issue and prevent conflicts with VF configuration we will leave the feature always enabled in hardware, and then in software we will choose to ignore the results via a sw flag. 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/igb')
-rw-r--r--drivers/net/igb/igb.h2
-rw-r--r--drivers/net/igb/igb_ethtool.c8
-rw-r--r--drivers/net/igb/igb_main.c12
3 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index 4e8464b9df2e..154c5acc6fce 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -238,7 +238,6 @@ struct igb_adapter {
238 u64 hw_csum_err; 238 u64 hw_csum_err;
239 u64 hw_csum_good; 239 u64 hw_csum_good;
240 u32 alloc_rx_buff_failed; 240 u32 alloc_rx_buff_failed;
241 bool rx_csum;
242 u32 gorc; 241 u32 gorc;
243 u64 gorc_old; 242 u64 gorc_old;
244 u16 rx_ps_hdr_size; 243 u16 rx_ps_hdr_size;
@@ -286,6 +285,7 @@ struct igb_adapter {
286#define IGB_FLAG_DCA_ENABLED (1 << 1) 285#define IGB_FLAG_DCA_ENABLED (1 << 1)
287#define IGB_FLAG_QUAD_PORT_A (1 << 2) 286#define IGB_FLAG_QUAD_PORT_A (1 << 2)
288#define IGB_FLAG_NEED_CTX_IDX (1 << 3) 287#define IGB_FLAG_NEED_CTX_IDX (1 << 3)
288#define IGB_FLAG_RX_CSUM_DISABLED (1 << 4)
289 289
290enum e1000_state_t { 290enum e1000_state_t {
291 __IGB_TESTING, 291 __IGB_TESTING,
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index b1367ce6586e..b8551a57dd3f 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -275,13 +275,17 @@ static int igb_set_pauseparam(struct net_device *netdev,
275static u32 igb_get_rx_csum(struct net_device *netdev) 275static u32 igb_get_rx_csum(struct net_device *netdev)
276{ 276{
277 struct igb_adapter *adapter = netdev_priv(netdev); 277 struct igb_adapter *adapter = netdev_priv(netdev);
278 return adapter->rx_csum; 278 return !(adapter->flags & IGB_FLAG_RX_CSUM_DISABLED);
279} 279}
280 280
281static int igb_set_rx_csum(struct net_device *netdev, u32 data) 281static int igb_set_rx_csum(struct net_device *netdev, u32 data)
282{ 282{
283 struct igb_adapter *adapter = netdev_priv(netdev); 283 struct igb_adapter *adapter = netdev_priv(netdev);
284 adapter->rx_csum = data; 284
285 if (data)
286 adapter->flags &= ~IGB_FLAG_RX_CSUM_DISABLED;
287 else
288 adapter->flags |= IGB_FLAG_RX_CSUM_DISABLED;
285 289
286 return 0; 290 return 0;
287} 291}
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index bca7e9f76be4..8de8629b07ec 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1395,8 +1395,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1395 1395
1396 igb_validate_mdi_setting(hw); 1396 igb_validate_mdi_setting(hw);
1397 1397
1398 adapter->rx_csum = 1;
1399
1400 /* Initial Wake on LAN setting If APM wake is enabled in the EEPROM, 1398 /* Initial Wake on LAN setting If APM wake is enabled in the EEPROM,
1401 * enable the ACPI Magic Packet filter 1399 * enable the ACPI Magic Packet filter
1402 */ 1400 */
@@ -2249,13 +2247,12 @@ static void igb_configure_rx(struct igb_adapter *adapter)
2249 rxcsum = rd32(E1000_RXCSUM); 2247 rxcsum = rd32(E1000_RXCSUM);
2250 /* Disable raw packet checksumming */ 2248 /* Disable raw packet checksumming */
2251 rxcsum |= E1000_RXCSUM_PCSD; 2249 rxcsum |= E1000_RXCSUM_PCSD;
2252 /* Don't need to set TUOFL or IPOFL, they default to 1 */ 2250
2253 if (!adapter->rx_csum) 2251 if (adapter->hw.mac.type == e1000_82576)
2254 rxcsum &= ~(E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPOFL);
2255 else if (adapter->hw.mac.type == e1000_82576)
2256 /* Enable Receive Checksum Offload for SCTP */ 2252 /* Enable Receive Checksum Offload for SCTP */
2257 rxcsum |= E1000_RXCSUM_CRCOFL; 2253 rxcsum |= E1000_RXCSUM_CRCOFL;
2258 2254
2255 /* Don't need to set TUOFL or IPOFL, they default to 1 */
2259 wr32(E1000_RXCSUM, rxcsum); 2256 wr32(E1000_RXCSUM, rxcsum);
2260 2257
2261 /* Set the default pool for the PF's first queue */ 2258 /* Set the default pool for the PF's first queue */
@@ -4455,7 +4452,8 @@ static inline void igb_rx_checksum_adv(struct igb_adapter *adapter,
4455 skb->ip_summed = CHECKSUM_NONE; 4452 skb->ip_summed = CHECKSUM_NONE;
4456 4453
4457 /* Ignore Checksum bit is set or checksum is disabled through ethtool */ 4454 /* Ignore Checksum bit is set or checksum is disabled through ethtool */
4458 if ((status_err & E1000_RXD_STAT_IXSM) || !adapter->rx_csum) 4455 if ((status_err & E1000_RXD_STAT_IXSM) ||
4456 (adapter->flags & IGB_FLAG_RX_CSUM_DISABLED))
4459 return; 4457 return;
4460 /* TCP/UDP checksum error bit is set */ 4458 /* TCP/UDP checksum error bit is set */
4461 if (status_err & 4459 if (status_err &