Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150107
b: refs/heads/master
c: 7beb014
h: refs/heads/master
i:
  150105: 40135f5
  150103: 6c86656
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed May 6, 2009
1 parent 1cf6bca commit 06ec8d5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 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: 0364d6fd2c353d2d82da865a6f093f97c69b669c
refs/heads/master: 7beb0146fc965ffee928eff53525aac0173b0b07
2 changes: 1 addition & 1 deletion trunk/drivers/net/igb/igb.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ struct igb_adapter {
u64 hw_csum_err;
u64 hw_csum_good;
u32 alloc_rx_buff_failed;
bool rx_csum;
u32 gorc;
u64 gorc_old;
u16 rx_ps_hdr_size;
Expand Down Expand Up @@ -286,6 +285,7 @@ struct igb_adapter {
#define IGB_FLAG_DCA_ENABLED (1 << 1)
#define IGB_FLAG_QUAD_PORT_A (1 << 2)
#define IGB_FLAG_NEED_CTX_IDX (1 << 3)
#define IGB_FLAG_RX_CSUM_DISABLED (1 << 4)

enum e1000_state_t {
__IGB_TESTING,
Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/net/igb/igb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,17 @@ static int igb_set_pauseparam(struct net_device *netdev,
static u32 igb_get_rx_csum(struct net_device *netdev)
{
struct igb_adapter *adapter = netdev_priv(netdev);
return adapter->rx_csum;
return !(adapter->flags & IGB_FLAG_RX_CSUM_DISABLED);
}

static int igb_set_rx_csum(struct net_device *netdev, u32 data)
{
struct igb_adapter *adapter = netdev_priv(netdev);
adapter->rx_csum = data;

if (data)
adapter->flags &= ~IGB_FLAG_RX_CSUM_DISABLED;
else
adapter->flags |= IGB_FLAG_RX_CSUM_DISABLED;

return 0;
}
Expand Down
12 changes: 5 additions & 7 deletions trunk/drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1395,8 +1395,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,

igb_validate_mdi_setting(hw);

adapter->rx_csum = 1;

/* Initial Wake on LAN setting If APM wake is enabled in the EEPROM,
* enable the ACPI Magic Packet filter
*/
Expand Down Expand Up @@ -2249,13 +2247,12 @@ static void igb_configure_rx(struct igb_adapter *adapter)
rxcsum = rd32(E1000_RXCSUM);
/* Disable raw packet checksumming */
rxcsum |= E1000_RXCSUM_PCSD;
/* Don't need to set TUOFL or IPOFL, they default to 1 */
if (!adapter->rx_csum)
rxcsum &= ~(E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPOFL);
else if (adapter->hw.mac.type == e1000_82576)

if (adapter->hw.mac.type == e1000_82576)
/* Enable Receive Checksum Offload for SCTP */
rxcsum |= E1000_RXCSUM_CRCOFL;

/* Don't need to set TUOFL or IPOFL, they default to 1 */
wr32(E1000_RXCSUM, rxcsum);

/* Set the default pool for the PF's first queue */
Expand Down Expand Up @@ -4455,7 +4452,8 @@ static inline void igb_rx_checksum_adv(struct igb_adapter *adapter,
skb->ip_summed = CHECKSUM_NONE;

/* Ignore Checksum bit is set or checksum is disabled through ethtool */
if ((status_err & E1000_RXD_STAT_IXSM) || !adapter->rx_csum)
if ((status_err & E1000_RXD_STAT_IXSM) ||
(adapter->flags & IGB_FLAG_RX_CSUM_DISABLED))
return;
/* TCP/UDP checksum error bit is set */
if (status_err &
Expand Down

0 comments on commit 06ec8d5

Please sign in to comment.