Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255676
b: refs/heads/master
c: 2ba279e
h: refs/heads/master
v: v3
  • Loading branch information
Emil Tantilov authored and Jeff Kirsher committed Jun 24, 2011
1 parent c486c8e commit 1afa8ba
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 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: c988ee829074073d3cd80090ef56a6e370b5c9b4
refs/heads/master: 2ba279e2f72a9112a2536eabc8fae5413bbbdfb6
44 changes: 33 additions & 11 deletions trunk/drivers/net/ixgbe/ixgbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,17 +458,6 @@ static u32 ixgbe_get_rx_csum(struct net_device *netdev)
return adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED;
}

static int ixgbe_set_rx_csum(struct net_device *netdev, u32 data)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
if (data)
adapter->flags |= IXGBE_FLAG_RX_CSUM_ENABLED;
else
adapter->flags &= ~IXGBE_FLAG_RX_CSUM_ENABLED;

return 0;
}

static void ixgbe_set_rsc(struct ixgbe_adapter *adapter)
{
int i;
Expand All @@ -484,6 +473,39 @@ static void ixgbe_set_rsc(struct ixgbe_adapter *adapter)
}
}

static int ixgbe_set_rx_csum(struct net_device *netdev, u32 data)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
bool need_reset = false;

if (data) {
adapter->flags |= IXGBE_FLAG_RX_CSUM_ENABLED;
} else {
adapter->flags &= ~IXGBE_FLAG_RX_CSUM_ENABLED;

if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) {
adapter->flags2 &= ~IXGBE_FLAG2_RSC_ENABLED;
netdev->features &= ~NETIF_F_LRO;
}

switch (adapter->hw.mac.type) {
case ixgbe_mac_X540:
ixgbe_set_rsc(adapter);
break;
case ixgbe_mac_82599EB:
need_reset = true;
break;
default:
break;
}
}

if (need_reset)
ixgbe_do_reset(netdev);

return 0;
}

static u32 ixgbe_get_tx_csum(struct net_device *netdev)
{
return (netdev->features & NETIF_F_IP_CSUM) != 0;
Expand Down

0 comments on commit 1afa8ba

Please sign in to comment.