aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3/cxgb3_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_main.c')
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 2847f947499d..0089746b8d02 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -546,7 +546,7 @@ static int setup_sge_qsets(struct adapter *adap)
546 pi->qs = &adap->sge.qs[pi->first_qset]; 546 pi->qs = &adap->sge.qs[pi->first_qset];
547 for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; 547 for (j = pi->first_qset; j < pi->first_qset + pi->nqsets;
548 ++j, ++qset_idx) { 548 ++j, ++qset_idx) {
549 set_qset_lro(dev, qset_idx, pi->rx_csum_offload); 549 set_qset_lro(dev, qset_idx, pi->rx_offload & T3_LRO);
550 err = t3_sge_alloc_qset(adap, qset_idx, 1, 550 err = t3_sge_alloc_qset(adap, qset_idx, 1,
551 (adap->flags & USING_MSIX) ? qset_idx + 1 : 551 (adap->flags & USING_MSIX) ? qset_idx + 1 :
552 irq_idx, 552 irq_idx,
@@ -1657,17 +1657,19 @@ static u32 get_rx_csum(struct net_device *dev)
1657{ 1657{
1658 struct port_info *p = netdev_priv(dev); 1658 struct port_info *p = netdev_priv(dev);
1659 1659
1660 return p->rx_csum_offload; 1660 return p->rx_offload & T3_RX_CSUM;
1661} 1661}
1662 1662
1663static int set_rx_csum(struct net_device *dev, u32 data) 1663static int set_rx_csum(struct net_device *dev, u32 data)
1664{ 1664{
1665 struct port_info *p = netdev_priv(dev); 1665 struct port_info *p = netdev_priv(dev);
1666 1666
1667 p->rx_csum_offload = data; 1667 if (data) {
1668 if (!data) { 1668 p->rx_offload |= T3_RX_CSUM;
1669 } else {
1669 int i; 1670 int i;
1670 1671
1672 p->rx_offload &= ~(T3_RX_CSUM | T3_LRO);
1671 for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) 1673 for (i = p->first_qset; i < p->first_qset + p->nqsets; i++)
1672 set_qset_lro(dev, i, 0); 1674 set_qset_lro(dev, i, 0);
1673 } 1675 }
@@ -1830,15 +1832,18 @@ static int cxgb3_set_flags(struct net_device *dev, u32 data)
1830 int i; 1832 int i;
1831 1833
1832 if (data & ETH_FLAG_LRO) { 1834 if (data & ETH_FLAG_LRO) {
1833 if (!pi->rx_csum_offload) 1835 if (!(pi->rx_offload & T3_RX_CSUM))
1834 return -EINVAL; 1836 return -EINVAL;
1835 1837
1838 pi->rx_offload |= T3_LRO;
1836 for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) 1839 for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++)
1837 set_qset_lro(dev, i, 1); 1840 set_qset_lro(dev, i, 1);
1838 1841
1839 } else 1842 } else {
1843 pi->rx_offload &= ~T3_LRO;
1840 for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) 1844 for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++)
1841 set_qset_lro(dev, i, 0); 1845 set_qset_lro(dev, i, 0);
1846 }
1842 1847
1843 return 0; 1848 return 0;
1844} 1849}
@@ -1926,7 +1931,7 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
1926 pi = adap2pinfo(adapter, i); 1931 pi = adap2pinfo(adapter, i);
1927 if (t.qset_idx >= pi->first_qset && 1932 if (t.qset_idx >= pi->first_qset &&
1928 t.qset_idx < pi->first_qset + pi->nqsets && 1933 t.qset_idx < pi->first_qset + pi->nqsets &&
1929 !pi->rx_csum_offload) 1934 !(pi->rx_offload & T3_RX_CSUM))
1930 return -EINVAL; 1935 return -EINVAL;
1931 } 1936 }
1932 1937
@@ -2946,7 +2951,7 @@ static int __devinit init_one(struct pci_dev *pdev,
2946 adapter->port[i] = netdev; 2951 adapter->port[i] = netdev;
2947 pi = netdev_priv(netdev); 2952 pi = netdev_priv(netdev);
2948 pi->adapter = adapter; 2953 pi->adapter = adapter;
2949 pi->rx_csum_offload = 1; 2954 pi->rx_offload = T3_RX_CSUM | T3_LRO;
2950 pi->port_id = i; 2955 pi->port_id = i;
2951 netif_carrier_off(netdev); 2956 netif_carrier_off(netdev);
2952 netif_tx_stop_all_queues(netdev); 2957 netif_tx_stop_all_queues(netdev);
@@ -2955,6 +2960,7 @@ static int __devinit init_one(struct pci_dev *pdev,
2955 netdev->mem_end = mmio_start + mmio_len - 1; 2960 netdev->mem_end = mmio_start + mmio_len - 1;
2956 netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; 2961 netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
2957 netdev->features |= NETIF_F_LLTX; 2962 netdev->features |= NETIF_F_LLTX;
2963 netdev->features |= NETIF_F_LRO;
2958 if (pci_using_dac) 2964 if (pci_using_dac)
2959 netdev->features |= NETIF_F_HIGHDMA; 2965 netdev->features |= NETIF_F_HIGHDMA;
2960 2966