diff options
author | Brice Goglin <brice@myri.com> | 2009-05-19 06:15:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-19 18:36:15 -0400 |
commit | 3a0c7d2d2bc61e510e900cfbb99c42d4eef2a443 (patch) | |
tree | 76938546736a15db7a3d0d7198d9b983dd7cc083 /drivers/net/myri10ge | |
parent | ab35cd4b8f42b5e4a9338949581a510e98503b28 (diff) |
myri10ge: allow LRO to be enabled via ethtool
Allow myri10ge LRO to be enabled/disabled via ethtool
(and by the stack for packet forwarding).
Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/myri10ge')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 140794a8d56a..dfd0994212e1 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -1300,7 +1300,7 @@ myri10ge_rx_done(struct myri10ge_slice_state *ss, struct myri10ge_rx_buf *rx, | |||
1300 | remainder -= MYRI10GE_ALLOC_SIZE; | 1300 | remainder -= MYRI10GE_ALLOC_SIZE; |
1301 | } | 1301 | } |
1302 | 1302 | ||
1303 | if (mgp->csum_flag && myri10ge_lro) { | 1303 | if (dev->features & NETIF_F_LRO) { |
1304 | rx_frags[0].page_offset += MXGEFW_PAD; | 1304 | rx_frags[0].page_offset += MXGEFW_PAD; |
1305 | rx_frags[0].size -= MXGEFW_PAD; | 1305 | rx_frags[0].size -= MXGEFW_PAD; |
1306 | len -= MXGEFW_PAD; | 1306 | len -= MXGEFW_PAD; |
@@ -1716,12 +1716,17 @@ static u32 myri10ge_get_rx_csum(struct net_device *netdev) | |||
1716 | static int myri10ge_set_rx_csum(struct net_device *netdev, u32 csum_enabled) | 1716 | static int myri10ge_set_rx_csum(struct net_device *netdev, u32 csum_enabled) |
1717 | { | 1717 | { |
1718 | struct myri10ge_priv *mgp = netdev_priv(netdev); | 1718 | struct myri10ge_priv *mgp = netdev_priv(netdev); |
1719 | int err = 0; | ||
1719 | 1720 | ||
1720 | if (csum_enabled) | 1721 | if (csum_enabled) |
1721 | mgp->csum_flag = MXGEFW_FLAGS_CKSUM; | 1722 | mgp->csum_flag = MXGEFW_FLAGS_CKSUM; |
1722 | else | 1723 | else { |
1724 | u32 flags = ethtool_op_get_flags(netdev); | ||
1725 | err = ethtool_op_set_flags(netdev, (flags & ~ETH_FLAG_LRO)); | ||
1723 | mgp->csum_flag = 0; | 1726 | mgp->csum_flag = 0; |
1724 | return 0; | 1727 | |
1728 | } | ||
1729 | return err; | ||
1725 | } | 1730 | } |
1726 | 1731 | ||
1727 | static int myri10ge_set_tso(struct net_device *netdev, u32 tso_enabled) | 1732 | static int myri10ge_set_tso(struct net_device *netdev, u32 tso_enabled) |
@@ -1904,7 +1909,9 @@ static const struct ethtool_ops myri10ge_ethtool_ops = { | |||
1904 | .get_sset_count = myri10ge_get_sset_count, | 1909 | .get_sset_count = myri10ge_get_sset_count, |
1905 | .get_ethtool_stats = myri10ge_get_ethtool_stats, | 1910 | .get_ethtool_stats = myri10ge_get_ethtool_stats, |
1906 | .set_msglevel = myri10ge_set_msglevel, | 1911 | .set_msglevel = myri10ge_set_msglevel, |
1907 | .get_msglevel = myri10ge_get_msglevel | 1912 | .get_msglevel = myri10ge_get_msglevel, |
1913 | .get_flags = ethtool_op_get_flags, | ||
1914 | .set_flags = ethtool_op_set_flags | ||
1908 | }; | 1915 | }; |
1909 | 1916 | ||
1910 | static int myri10ge_allocate_rings(struct myri10ge_slice_state *ss) | 1917 | static int myri10ge_allocate_rings(struct myri10ge_slice_state *ss) |
@@ -3910,6 +3917,8 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3910 | 3917 | ||
3911 | if (dac_enabled) | 3918 | if (dac_enabled) |
3912 | netdev->features |= NETIF_F_HIGHDMA; | 3919 | netdev->features |= NETIF_F_HIGHDMA; |
3920 | if (myri10ge_lro) | ||
3921 | netdev->features |= NETIF_F_LRO; | ||
3913 | 3922 | ||
3914 | /* make sure we can get an irq, and that MSI can be | 3923 | /* make sure we can get an irq, and that MSI can be |
3915 | * setup (if available). Also ensure netdev->irq | 3924 | * setup (if available). Also ensure netdev->irq |