aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/myri10ge
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/myri10ge')
-rw-r--r--drivers/net/myri10ge/myri10ge.c168
1 files changed, 81 insertions, 87 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index fb2c0927d3cc..bf84849600ce 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -65,6 +65,7 @@
65#include <linux/io.h> 65#include <linux/io.h>
66#include <linux/log2.h> 66#include <linux/log2.h>
67#include <linux/slab.h> 67#include <linux/slab.h>
68#include <linux/prefetch.h>
68#include <net/checksum.h> 69#include <net/checksum.h>
69#include <net/ip.h> 70#include <net/ip.h>
70#include <net/tcp.h> 71#include <net/tcp.h>
@@ -205,7 +206,6 @@ struct myri10ge_priv {
205 int tx_boundary; /* boundary transmits cannot cross */ 206 int tx_boundary; /* boundary transmits cannot cross */
206 int num_slices; 207 int num_slices;
207 int running; /* running? */ 208 int running; /* running? */
208 int csum_flag; /* rx_csums? */
209 int small_bytes; 209 int small_bytes;
210 int big_bytes; 210 int big_bytes;
211 int max_intr_slots; 211 int max_intr_slots;
@@ -225,6 +225,7 @@ struct myri10ge_priv {
225 struct msix_entry *msix_vectors; 225 struct msix_entry *msix_vectors;
226#ifdef CONFIG_MYRI10GE_DCA 226#ifdef CONFIG_MYRI10GE_DCA
227 int dca_enabled; 227 int dca_enabled;
228 int relaxed_order;
228#endif 229#endif
229 u32 link_state; 230 u32 link_state;
230 unsigned int rdma_tags_available; 231 unsigned int rdma_tags_available;
@@ -252,7 +253,7 @@ struct myri10ge_priv {
252 unsigned long serial_number; 253 unsigned long serial_number;
253 int vendor_specific_offset; 254 int vendor_specific_offset;
254 int fw_multicast_support; 255 int fw_multicast_support;
255 unsigned long features; 256 u32 features;
256 u32 max_tso6; 257 u32 max_tso6;
257 u32 read_dma; 258 u32 read_dma;
258 u32 write_dma; 259 u32 write_dma;
@@ -990,7 +991,7 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
990 * RX queues, so if we get an error, first retry using a 991 * RX queues, so if we get an error, first retry using a
991 * single TX queue before giving up */ 992 * single TX queue before giving up */
992 if (status != 0 && mgp->dev->real_num_tx_queues > 1) { 993 if (status != 0 && mgp->dev->real_num_tx_queues > 1) {
993 mgp->dev->real_num_tx_queues = 1; 994 netif_set_real_num_tx_queues(mgp->dev, 1);
994 cmd.data0 = mgp->num_slices; 995 cmd.data0 = mgp->num_slices;
995 cmd.data1 = MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE; 996 cmd.data1 = MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE;
996 status = myri10ge_send_cmd(mgp, 997 status = myri10ge_send_cmd(mgp,
@@ -1074,10 +1075,28 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
1074} 1075}
1075 1076
1076#ifdef CONFIG_MYRI10GE_DCA 1077#ifdef CONFIG_MYRI10GE_DCA
1078static int myri10ge_toggle_relaxed(struct pci_dev *pdev, int on)
1079{
1080 int ret, cap, err;
1081 u16 ctl;
1082
1083 cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
1084 if (!cap)
1085 return 0;
1086
1087 err = pci_read_config_word(pdev, cap + PCI_EXP_DEVCTL, &ctl);
1088 ret = (ctl & PCI_EXP_DEVCTL_RELAX_EN) >> 4;
1089 if (ret != on) {
1090 ctl &= ~PCI_EXP_DEVCTL_RELAX_EN;
1091 ctl |= (on << 4);
1092 pci_write_config_word(pdev, cap + PCI_EXP_DEVCTL, ctl);
1093 }
1094 return ret;
1095}
1096
1077static void 1097static void
1078myri10ge_write_dca(struct myri10ge_slice_state *ss, int cpu, int tag) 1098myri10ge_write_dca(struct myri10ge_slice_state *ss, int cpu, int tag)
1079{ 1099{
1080 ss->cpu = cpu;
1081 ss->cached_dca_tag = tag; 1100 ss->cached_dca_tag = tag;
1082 put_be32(htonl(tag), ss->dca_tag); 1101 put_be32(htonl(tag), ss->dca_tag);
1083} 1102}
@@ -1088,9 +1107,10 @@ static inline void myri10ge_update_dca(struct myri10ge_slice_state *ss)
1088 int tag; 1107 int tag;
1089 1108
1090 if (cpu != ss->cpu) { 1109 if (cpu != ss->cpu) {
1091 tag = dca_get_tag(cpu); 1110 tag = dca3_get_tag(&ss->mgp->pdev->dev, cpu);
1092 if (ss->cached_dca_tag != tag) 1111 if (ss->cached_dca_tag != tag)
1093 myri10ge_write_dca(ss, cpu, tag); 1112 myri10ge_write_dca(ss, cpu, tag);
1113 ss->cpu = cpu;
1094 } 1114 }
1095 put_cpu(); 1115 put_cpu();
1096} 1116}
@@ -1113,9 +1133,13 @@ static void myri10ge_setup_dca(struct myri10ge_priv *mgp)
1113 "dca_add_requester() failed, err=%d\n", err); 1133 "dca_add_requester() failed, err=%d\n", err);
1114 return; 1134 return;
1115 } 1135 }
1136 mgp->relaxed_order = myri10ge_toggle_relaxed(pdev, 0);
1116 mgp->dca_enabled = 1; 1137 mgp->dca_enabled = 1;
1117 for (i = 0; i < mgp->num_slices; i++) 1138 for (i = 0; i < mgp->num_slices; i++) {
1118 myri10ge_write_dca(&mgp->ss[i], -1, 0); 1139 mgp->ss[i].cpu = -1;
1140 mgp->ss[i].cached_dca_tag = -1;
1141 myri10ge_update_dca(&mgp->ss[i]);
1142 }
1119} 1143}
1120 1144
1121static void myri10ge_teardown_dca(struct myri10ge_priv *mgp) 1145static void myri10ge_teardown_dca(struct myri10ge_priv *mgp)
@@ -1126,6 +1150,8 @@ static void myri10ge_teardown_dca(struct myri10ge_priv *mgp)
1126 if (!mgp->dca_enabled) 1150 if (!mgp->dca_enabled)
1127 return; 1151 return;
1128 mgp->dca_enabled = 0; 1152 mgp->dca_enabled = 0;
1153 if (mgp->relaxed_order)
1154 myri10ge_toggle_relaxed(pdev, 1);
1129 err = dca_remove_requester(&pdev->dev); 1155 err = dca_remove_requester(&pdev->dev);
1130} 1156}
1131 1157
@@ -1286,17 +1312,26 @@ myri10ge_unmap_rx_page(struct pci_dev *pdev,
1286 * page into an skb */ 1312 * page into an skb */
1287 1313
1288static inline int 1314static inline int
1289myri10ge_rx_done(struct myri10ge_slice_state *ss, struct myri10ge_rx_buf *rx, 1315myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum,
1290 int bytes, int len, __wsum csum) 1316 int lro_enabled)
1291{ 1317{
1292 struct myri10ge_priv *mgp = ss->mgp; 1318 struct myri10ge_priv *mgp = ss->mgp;
1293 struct sk_buff *skb; 1319 struct sk_buff *skb;
1294 struct skb_frag_struct rx_frags[MYRI10GE_MAX_FRAGS_PER_FRAME]; 1320 struct skb_frag_struct rx_frags[MYRI10GE_MAX_FRAGS_PER_FRAME];
1295 int i, idx, hlen, remainder; 1321 struct myri10ge_rx_buf *rx;
1322 int i, idx, hlen, remainder, bytes;
1296 struct pci_dev *pdev = mgp->pdev; 1323 struct pci_dev *pdev = mgp->pdev;
1297 struct net_device *dev = mgp->dev; 1324 struct net_device *dev = mgp->dev;
1298 u8 *va; 1325 u8 *va;
1299 1326
1327 if (len <= mgp->small_bytes) {
1328 rx = &ss->rx_small;
1329 bytes = mgp->small_bytes;
1330 } else {
1331 rx = &ss->rx_big;
1332 bytes = mgp->big_bytes;
1333 }
1334
1300 len += MXGEFW_PAD; 1335 len += MXGEFW_PAD;
1301 idx = rx->cnt & rx->mask; 1336 idx = rx->cnt & rx->mask;
1302 va = page_address(rx->info[idx].page) + rx->info[idx].page_offset; 1337 va = page_address(rx->info[idx].page) + rx->info[idx].page_offset;
@@ -1315,7 +1350,7 @@ myri10ge_rx_done(struct myri10ge_slice_state *ss, struct myri10ge_rx_buf *rx,
1315 remainder -= MYRI10GE_ALLOC_SIZE; 1350 remainder -= MYRI10GE_ALLOC_SIZE;
1316 } 1351 }
1317 1352
1318 if (dev->features & NETIF_F_LRO) { 1353 if (lro_enabled) {
1319 rx_frags[0].page_offset += MXGEFW_PAD; 1354 rx_frags[0].page_offset += MXGEFW_PAD;
1320 rx_frags[0].size -= MXGEFW_PAD; 1355 rx_frags[0].size -= MXGEFW_PAD;
1321 len -= MXGEFW_PAD; 1356 len -= MXGEFW_PAD;
@@ -1351,7 +1386,7 @@ myri10ge_rx_done(struct myri10ge_slice_state *ss, struct myri10ge_rx_buf *rx,
1351 skb->protocol = eth_type_trans(skb, dev); 1386 skb->protocol = eth_type_trans(skb, dev);
1352 skb_record_rx_queue(skb, ss - &mgp->ss[0]); 1387 skb_record_rx_queue(skb, ss - &mgp->ss[0]);
1353 1388
1354 if (mgp->csum_flag) { 1389 if (dev->features & NETIF_F_RXCSUM) {
1355 if ((skb->protocol == htons(ETH_P_IP)) || 1390 if ((skb->protocol == htons(ETH_P_IP)) ||
1356 (skb->protocol == htons(ETH_P_IPV6))) { 1391 (skb->protocol == htons(ETH_P_IPV6))) {
1357 skb->csum = csum; 1392 skb->csum = csum;
@@ -1437,7 +1472,7 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget)
1437{ 1472{
1438 struct myri10ge_rx_done *rx_done = &ss->rx_done; 1473 struct myri10ge_rx_done *rx_done = &ss->rx_done;
1439 struct myri10ge_priv *mgp = ss->mgp; 1474 struct myri10ge_priv *mgp = ss->mgp;
1440 struct net_device *netdev = mgp->dev; 1475
1441 unsigned long rx_bytes = 0; 1476 unsigned long rx_bytes = 0;
1442 unsigned long rx_packets = 0; 1477 unsigned long rx_packets = 0;
1443 unsigned long rx_ok; 1478 unsigned long rx_ok;
@@ -1448,18 +1483,18 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget)
1448 u16 length; 1483 u16 length;
1449 __wsum checksum; 1484 __wsum checksum;
1450 1485
1486 /*
1487 * Prevent compiler from generating more than one ->features memory
1488 * access to avoid theoretical race condition with functions that
1489 * change NETIF_F_LRO flag at runtime.
1490 */
1491 bool lro_enabled = ACCESS_ONCE(mgp->dev->features) & NETIF_F_LRO;
1492
1451 while (rx_done->entry[idx].length != 0 && work_done < budget) { 1493 while (rx_done->entry[idx].length != 0 && work_done < budget) {
1452 length = ntohs(rx_done->entry[idx].length); 1494 length = ntohs(rx_done->entry[idx].length);
1453 rx_done->entry[idx].length = 0; 1495 rx_done->entry[idx].length = 0;
1454 checksum = csum_unfold(rx_done->entry[idx].checksum); 1496 checksum = csum_unfold(rx_done->entry[idx].checksum);
1455 if (length <= mgp->small_bytes) 1497 rx_ok = myri10ge_rx_done(ss, length, checksum, lro_enabled);
1456 rx_ok = myri10ge_rx_done(ss, &ss->rx_small,
1457 mgp->small_bytes,
1458 length, checksum);
1459 else
1460 rx_ok = myri10ge_rx_done(ss, &ss->rx_big,
1461 mgp->big_bytes,
1462 length, checksum);
1463 rx_packets += rx_ok; 1498 rx_packets += rx_ok;
1464 rx_bytes += rx_ok * (unsigned long)length; 1499 rx_bytes += rx_ok * (unsigned long)length;
1465 cnt++; 1500 cnt++;
@@ -1471,7 +1506,7 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget)
1471 ss->stats.rx_packets += rx_packets; 1506 ss->stats.rx_packets += rx_packets;
1472 ss->stats.rx_bytes += rx_bytes; 1507 ss->stats.rx_bytes += rx_bytes;
1473 1508
1474 if (netdev->features & NETIF_F_LRO) 1509 if (lro_enabled)
1475 lro_flush_all(&rx_done->lro_mgr); 1510 lro_flush_all(&rx_done->lro_mgr);
1476 1511
1477 /* restock receive rings if needed */ 1512 /* restock receive rings if needed */
@@ -1555,12 +1590,12 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
1555 * valid since MSI-X irqs are not shared */ 1590 * valid since MSI-X irqs are not shared */
1556 if ((mgp->dev->real_num_tx_queues == 1) && (ss != mgp->ss)) { 1591 if ((mgp->dev->real_num_tx_queues == 1) && (ss != mgp->ss)) {
1557 napi_schedule(&ss->napi); 1592 napi_schedule(&ss->napi);
1558 return (IRQ_HANDLED); 1593 return IRQ_HANDLED;
1559 } 1594 }
1560 1595
1561 /* make sure it is our IRQ, and that the DMA has finished */ 1596 /* make sure it is our IRQ, and that the DMA has finished */
1562 if (unlikely(!stats->valid)) 1597 if (unlikely(!stats->valid))
1563 return (IRQ_NONE); 1598 return IRQ_NONE;
1564 1599
1565 /* low bit indicates receives are present, so schedule 1600 /* low bit indicates receives are present, so schedule
1566 * napi poll handler */ 1601 * napi poll handler */
@@ -1599,7 +1634,7 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
1599 myri10ge_check_statblock(mgp); 1634 myri10ge_check_statblock(mgp);
1600 1635
1601 put_be32(htonl(3), ss->irq_claim + 1); 1636 put_be32(htonl(3), ss->irq_claim + 1);
1602 return (IRQ_HANDLED); 1637 return IRQ_HANDLED;
1603} 1638}
1604 1639
1605static int 1640static int
@@ -1610,7 +1645,7 @@ myri10ge_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
1610 int i; 1645 int i;
1611 1646
1612 cmd->autoneg = AUTONEG_DISABLE; 1647 cmd->autoneg = AUTONEG_DISABLE;
1613 cmd->speed = SPEED_10000; 1648 ethtool_cmd_speed_set(cmd, SPEED_10000);
1614 cmd->duplex = DUPLEX_FULL; 1649 cmd->duplex = DUPLEX_FULL;
1615 1650
1616 /* 1651 /*
@@ -1722,43 +1757,6 @@ myri10ge_get_ringparam(struct net_device *netdev,
1722 ring->tx_pending = ring->tx_max_pending; 1757 ring->tx_pending = ring->tx_max_pending;
1723} 1758}
1724 1759
1725static u32 myri10ge_get_rx_csum(struct net_device *netdev)
1726{
1727 struct myri10ge_priv *mgp = netdev_priv(netdev);
1728
1729 if (mgp->csum_flag)
1730 return 1;
1731 else
1732 return 0;
1733}
1734
1735static int myri10ge_set_rx_csum(struct net_device *netdev, u32 csum_enabled)
1736{
1737 struct myri10ge_priv *mgp = netdev_priv(netdev);
1738 int err = 0;
1739
1740 if (csum_enabled)
1741 mgp->csum_flag = MXGEFW_FLAGS_CKSUM;
1742 else {
1743 netdev->features &= ~NETIF_F_LRO;
1744 mgp->csum_flag = 0;
1745
1746 }
1747 return err;
1748}
1749
1750static int myri10ge_set_tso(struct net_device *netdev, u32 tso_enabled)
1751{
1752 struct myri10ge_priv *mgp = netdev_priv(netdev);
1753 unsigned long flags = mgp->features & (NETIF_F_TSO6 | NETIF_F_TSO);
1754
1755 if (tso_enabled)
1756 netdev->features |= flags;
1757 else
1758 netdev->features &= ~flags;
1759 return 0;
1760}
1761
1762static const char myri10ge_gstrings_main_stats[][ETH_GSTRING_LEN] = { 1760static const char myri10ge_gstrings_main_stats[][ETH_GSTRING_LEN] = {
1763 "rx_packets", "tx_packets", "rx_bytes", "tx_bytes", "rx_errors", 1761 "rx_packets", "tx_packets", "rx_bytes", "tx_bytes", "rx_errors",
1764 "tx_errors", "rx_dropped", "tx_dropped", "multicast", "collisions", 1762 "tx_errors", "rx_dropped", "tx_dropped", "multicast", "collisions",
@@ -1909,11 +1907,6 @@ static u32 myri10ge_get_msglevel(struct net_device *netdev)
1909 return mgp->msg_enable; 1907 return mgp->msg_enable;
1910} 1908}
1911 1909
1912static int myri10ge_set_flags(struct net_device *netdev, u32 value)
1913{
1914 return ethtool_op_set_flags(netdev, value, ETH_FLAG_LRO);
1915}
1916
1917static const struct ethtool_ops myri10ge_ethtool_ops = { 1910static const struct ethtool_ops myri10ge_ethtool_ops = {
1918 .get_settings = myri10ge_get_settings, 1911 .get_settings = myri10ge_get_settings,
1919 .get_drvinfo = myri10ge_get_drvinfo, 1912 .get_drvinfo = myri10ge_get_drvinfo,
@@ -1922,19 +1915,12 @@ static const struct ethtool_ops myri10ge_ethtool_ops = {
1922 .get_pauseparam = myri10ge_get_pauseparam, 1915 .get_pauseparam = myri10ge_get_pauseparam,
1923 .set_pauseparam = myri10ge_set_pauseparam, 1916 .set_pauseparam = myri10ge_set_pauseparam,
1924 .get_ringparam = myri10ge_get_ringparam, 1917 .get_ringparam = myri10ge_get_ringparam,
1925 .get_rx_csum = myri10ge_get_rx_csum,
1926 .set_rx_csum = myri10ge_set_rx_csum,
1927 .set_tx_csum = ethtool_op_set_tx_hw_csum,
1928 .set_sg = ethtool_op_set_sg,
1929 .set_tso = myri10ge_set_tso,
1930 .get_link = ethtool_op_get_link, 1918 .get_link = ethtool_op_get_link,
1931 .get_strings = myri10ge_get_strings, 1919 .get_strings = myri10ge_get_strings,
1932 .get_sset_count = myri10ge_get_sset_count, 1920 .get_sset_count = myri10ge_get_sset_count,
1933 .get_ethtool_stats = myri10ge_get_ethtool_stats, 1921 .get_ethtool_stats = myri10ge_get_ethtool_stats,
1934 .set_msglevel = myri10ge_set_msglevel, 1922 .set_msglevel = myri10ge_set_msglevel,
1935 .get_msglevel = myri10ge_get_msglevel, 1923 .get_msglevel = myri10ge_get_msglevel,
1936 .get_flags = ethtool_op_get_flags,
1937 .set_flags = myri10ge_set_flags
1938}; 1924};
1939 1925
1940static int myri10ge_allocate_rings(struct myri10ge_slice_state *ss) 1926static int myri10ge_allocate_rings(struct myri10ge_slice_state *ss)
@@ -2710,7 +2696,7 @@ again:
2710 odd_flag = 0; 2696 odd_flag = 0;
2711 flags = (MXGEFW_FLAGS_NO_TSO | MXGEFW_FLAGS_FIRST); 2697 flags = (MXGEFW_FLAGS_NO_TSO | MXGEFW_FLAGS_FIRST);
2712 if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { 2698 if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
2713 cksum_offset = skb_transport_offset(skb); 2699 cksum_offset = skb_checksum_start_offset(skb);
2714 pseudo_hdr_offset = cksum_offset + skb->csum_offset; 2700 pseudo_hdr_offset = cksum_offset + skb->csum_offset;
2715 /* If the headers are excessively large, then we must 2701 /* If the headers are excessively large, then we must
2716 * fall back to a software checksum */ 2702 * fall back to a software checksum */
@@ -3101,6 +3087,14 @@ static int myri10ge_set_mac_address(struct net_device *dev, void *addr)
3101 return 0; 3087 return 0;
3102} 3088}
3103 3089
3090static u32 myri10ge_fix_features(struct net_device *dev, u32 features)
3091{
3092 if (!(features & NETIF_F_RXCSUM))
3093 features &= ~NETIF_F_LRO;
3094
3095 return features;
3096}
3097
3104static int myri10ge_change_mtu(struct net_device *dev, int new_mtu) 3098static int myri10ge_change_mtu(struct net_device *dev, int new_mtu)
3105{ 3099{
3106 struct myri10ge_priv *mgp = netdev_priv(dev); 3100 struct myri10ge_priv *mgp = netdev_priv(dev);
@@ -3377,9 +3371,7 @@ static int myri10ge_resume(struct pci_dev *pdev)
3377 return -EIO; 3371 return -EIO;
3378 } 3372 }
3379 3373
3380 status = pci_restore_state(pdev); 3374 pci_restore_state(pdev);
3381 if (status)
3382 return status;
3383 3375
3384 status = pci_enable_device(pdev); 3376 status = pci_enable_device(pdev);
3385 if (status) { 3377 if (status) {
@@ -3621,6 +3613,7 @@ static void myri10ge_free_slices(struct myri10ge_priv *mgp)
3621 dma_free_coherent(&pdev->dev, bytes, 3613 dma_free_coherent(&pdev->dev, bytes,
3622 ss->fw_stats, ss->fw_stats_bus); 3614 ss->fw_stats, ss->fw_stats_bus);
3623 ss->fw_stats = NULL; 3615 ss->fw_stats = NULL;
3616 netif_napi_del(&ss->napi);
3624 } 3617 }
3625 } 3618 }
3626 kfree(mgp->ss); 3619 kfree(mgp->ss);
@@ -3668,7 +3661,7 @@ abort:
3668 3661
3669/* 3662/*
3670 * This function determines the number of slices supported. 3663 * This function determines the number of slices supported.
3671 * The number slices is the minumum of the number of CPUS, 3664 * The number slices is the minimum of the number of CPUS,
3672 * the number of MSI-X irqs supported, the number of slices 3665 * the number of MSI-X irqs supported, the number of slices
3673 * supported by the firmware 3666 * supported by the firmware
3674 */ 3667 */
@@ -3753,8 +3746,8 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
3753 * slices. We give up on MSI-X if we can only get a single 3746 * slices. We give up on MSI-X if we can only get a single
3754 * vector. */ 3747 * vector. */
3755 3748
3756 mgp->msix_vectors = kzalloc(mgp->num_slices * 3749 mgp->msix_vectors = kcalloc(mgp->num_slices, sizeof(*mgp->msix_vectors),
3757 sizeof(*mgp->msix_vectors), GFP_KERNEL); 3750 GFP_KERNEL);
3758 if (mgp->msix_vectors == NULL) 3751 if (mgp->msix_vectors == NULL)
3759 goto disable_msix; 3752 goto disable_msix;
3760 for (i = 0; i < mgp->num_slices; i++) { 3753 for (i = 0; i < mgp->num_slices; i++) {
@@ -3800,6 +3793,7 @@ static const struct net_device_ops myri10ge_netdev_ops = {
3800 .ndo_get_stats = myri10ge_get_stats, 3793 .ndo_get_stats = myri10ge_get_stats,
3801 .ndo_validate_addr = eth_validate_addr, 3794 .ndo_validate_addr = eth_validate_addr,
3802 .ndo_change_mtu = myri10ge_change_mtu, 3795 .ndo_change_mtu = myri10ge_change_mtu,
3796 .ndo_fix_features = myri10ge_fix_features,
3803 .ndo_set_multicast_list = myri10ge_set_multicast_list, 3797 .ndo_set_multicast_list = myri10ge_set_multicast_list,
3804 .ndo_set_mac_address = myri10ge_set_mac_address, 3798 .ndo_set_mac_address = myri10ge_set_mac_address,
3805}; 3799};
@@ -3826,7 +3820,6 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3826 mgp = netdev_priv(netdev); 3820 mgp = netdev_priv(netdev);
3827 mgp->dev = netdev; 3821 mgp->dev = netdev;
3828 mgp->pdev = pdev; 3822 mgp->pdev = pdev;
3829 mgp->csum_flag = MXGEFW_FLAGS_CKSUM;
3830 mgp->pause = myri10ge_flow_control; 3823 mgp->pause = myri10ge_flow_control;
3831 mgp->intr_coal_delay = myri10ge_intr_coal_delay; 3824 mgp->intr_coal_delay = myri10ge_intr_coal_delay;
3832 mgp->msg_enable = netif_msg_init(myri10ge_debug, MYRI10GE_MSG_DEFAULT); 3825 mgp->msg_enable = netif_msg_init(myri10ge_debug, MYRI10GE_MSG_DEFAULT);
@@ -3923,7 +3916,8 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3923 dev_err(&pdev->dev, "failed to alloc slice state\n"); 3916 dev_err(&pdev->dev, "failed to alloc slice state\n");
3924 goto abort_with_firmware; 3917 goto abort_with_firmware;
3925 } 3918 }
3926 netdev->real_num_tx_queues = mgp->num_slices; 3919 netif_set_real_num_tx_queues(netdev, mgp->num_slices);
3920 netif_set_real_num_rx_queues(netdev, mgp->num_slices);
3927 status = myri10ge_reset(mgp); 3921 status = myri10ge_reset(mgp);
3928 if (status != 0) { 3922 if (status != 0) {
3929 dev_err(&pdev->dev, "failed reset\n"); 3923 dev_err(&pdev->dev, "failed reset\n");
@@ -3941,11 +3935,11 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3941 netdev->netdev_ops = &myri10ge_netdev_ops; 3935 netdev->netdev_ops = &myri10ge_netdev_ops;
3942 netdev->mtu = myri10ge_initial_mtu; 3936 netdev->mtu = myri10ge_initial_mtu;
3943 netdev->base_addr = mgp->iomem_base; 3937 netdev->base_addr = mgp->iomem_base;
3944 netdev->features = mgp->features; 3938 netdev->hw_features = mgp->features | NETIF_F_LRO | NETIF_F_RXCSUM;
3939 netdev->features = netdev->hw_features;
3945 3940
3946 if (dac_enabled) 3941 if (dac_enabled)
3947 netdev->features |= NETIF_F_HIGHDMA; 3942 netdev->features |= NETIF_F_HIGHDMA;
3948 netdev->features |= NETIF_F_LRO;
3949 3943
3950 netdev->vlan_features |= mgp->features; 3944 netdev->vlan_features |= mgp->features;
3951 if (mgp->fw_ver_tiny < 37) 3945 if (mgp->fw_ver_tiny < 37)
@@ -4040,7 +4034,7 @@ static void myri10ge_remove(struct pci_dev *pdev)
4040 if (mgp == NULL) 4034 if (mgp == NULL)
4041 return; 4035 return;
4042 4036
4043 flush_scheduled_work(); 4037 cancel_work_sync(&mgp->watchdog_work);
4044 netdev = mgp->dev; 4038 netdev = mgp->dev;
4045 unregister_netdev(netdev); 4039 unregister_netdev(netdev);
4046 4040