aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/calxeda/xgmac.c23
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ethtool.c2
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c7
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_rx.c41
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h4
-rw-r--r--drivers/net/ethernet/moxa/moxart_ether.c22
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c5
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c4
-rw-r--r--drivers/net/ethernet/sfc/ef10.c87
-rw-r--r--drivers/net/ethernet/sfc/mcdi.c18
-rw-r--r--drivers/net/ethernet/sfc/mcdi_pcol.h56
-rw-r--r--drivers/net/ethernet/sfc/nic.c9
-rw-r--r--drivers/net/ethernet/sfc/nic.h12
-rw-r--r--drivers/net/ethernet/ti/cpsw.c10
14 files changed, 227 insertions, 73 deletions
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 78d6d6b970e1..48f52882a22b 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -106,7 +106,6 @@
106#define XGMAC_DMA_HW_FEATURE 0x00000f58 /* Enabled Hardware Features */ 106#define XGMAC_DMA_HW_FEATURE 0x00000f58 /* Enabled Hardware Features */
107 107
108#define XGMAC_ADDR_AE 0x80000000 108#define XGMAC_ADDR_AE 0x80000000
109#define XGMAC_MAX_FILTER_ADDR 31
110 109
111/* PMT Control and Status */ 110/* PMT Control and Status */
112#define XGMAC_PMT_POINTER_RESET 0x80000000 111#define XGMAC_PMT_POINTER_RESET 0x80000000
@@ -384,6 +383,7 @@ struct xgmac_priv {
384 struct device *device; 383 struct device *device;
385 struct napi_struct napi; 384 struct napi_struct napi;
386 385
386 int max_macs;
387 struct xgmac_extra_stats xstats; 387 struct xgmac_extra_stats xstats;
388 388
389 spinlock_t stats_lock; 389 spinlock_t stats_lock;
@@ -1291,14 +1291,12 @@ static void xgmac_set_rx_mode(struct net_device *dev)
1291 netdev_dbg(priv->dev, "# mcasts %d, # unicast %d\n", 1291 netdev_dbg(priv->dev, "# mcasts %d, # unicast %d\n",
1292 netdev_mc_count(dev), netdev_uc_count(dev)); 1292 netdev_mc_count(dev), netdev_uc_count(dev));
1293 1293
1294 if (dev->flags & IFF_PROMISC) { 1294 if (dev->flags & IFF_PROMISC)
1295 writel(XGMAC_FRAME_FILTER_PR, ioaddr + XGMAC_FRAME_FILTER); 1295 value |= XGMAC_FRAME_FILTER_PR;
1296 return;
1297 }
1298 1296
1299 memset(hash_filter, 0, sizeof(hash_filter)); 1297 memset(hash_filter, 0, sizeof(hash_filter));
1300 1298
1301 if (netdev_uc_count(dev) > XGMAC_MAX_FILTER_ADDR) { 1299 if (netdev_uc_count(dev) > priv->max_macs) {
1302 use_hash = true; 1300 use_hash = true;
1303 value |= XGMAC_FRAME_FILTER_HUC | XGMAC_FRAME_FILTER_HPF; 1301 value |= XGMAC_FRAME_FILTER_HUC | XGMAC_FRAME_FILTER_HPF;
1304 } 1302 }
@@ -1321,7 +1319,7 @@ static void xgmac_set_rx_mode(struct net_device *dev)
1321 goto out; 1319 goto out;
1322 } 1320 }
1323 1321
1324 if ((netdev_mc_count(dev) + reg - 1) > XGMAC_MAX_FILTER_ADDR) { 1322 if ((netdev_mc_count(dev) + reg - 1) > priv->max_macs) {
1325 use_hash = true; 1323 use_hash = true;
1326 value |= XGMAC_FRAME_FILTER_HMC | XGMAC_FRAME_FILTER_HPF; 1324 value |= XGMAC_FRAME_FILTER_HMC | XGMAC_FRAME_FILTER_HPF;
1327 } else { 1325 } else {
@@ -1342,8 +1340,8 @@ static void xgmac_set_rx_mode(struct net_device *dev)
1342 } 1340 }
1343 1341
1344out: 1342out:
1345 for (i = reg; i < XGMAC_MAX_FILTER_ADDR; i++) 1343 for (i = reg; i <= priv->max_macs; i++)
1346 xgmac_set_mac_addr(ioaddr, NULL, reg); 1344 xgmac_set_mac_addr(ioaddr, NULL, i);
1347 for (i = 0; i < XGMAC_NUM_HASH; i++) 1345 for (i = 0; i < XGMAC_NUM_HASH; i++)
1348 writel(hash_filter[i], ioaddr + XGMAC_HASH(i)); 1346 writel(hash_filter[i], ioaddr + XGMAC_HASH(i));
1349 1347
@@ -1761,6 +1759,13 @@ static int xgmac_probe(struct platform_device *pdev)
1761 uid = readl(priv->base + XGMAC_VERSION); 1759 uid = readl(priv->base + XGMAC_VERSION);
1762 netdev_info(ndev, "h/w version is 0x%x\n", uid); 1760 netdev_info(ndev, "h/w version is 0x%x\n", uid);
1763 1761
1762 /* Figure out how many valid mac address filter registers we have */
1763 writel(1, priv->base + XGMAC_ADDR_HIGH(31));
1764 if (readl(priv->base + XGMAC_ADDR_HIGH(31)) == 1)
1765 priv->max_macs = 31;
1766 else
1767 priv->max_macs = 7;
1768
1764 writel(0, priv->base + XGMAC_DMA_INTR_ENA); 1769 writel(0, priv->base + XGMAC_DMA_INTR_ENA);
1765 ndev->irq = platform_get_irq(pdev, 0); 1770 ndev->irq = platform_get_irq(pdev, 0);
1766 if (ndev->irq == -ENXIO) { 1771 if (ndev->irq == -ENXIO) {
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index ebdac0273501..0ae3177416c7 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -2657,6 +2657,8 @@ static int igb_set_eee(struct net_device *netdev,
2657 (hw->phy.media_type != e1000_media_type_copper)) 2657 (hw->phy.media_type != e1000_media_type_copper))
2658 return -EOPNOTSUPP; 2658 return -EOPNOTSUPP;
2659 2659
2660 memset(&eee_curr, 0, sizeof(struct ethtool_eee));
2661
2660 ret_val = igb_get_eee(netdev, &eee_curr); 2662 ret_val = igb_get_eee(netdev, &eee_curr);
2661 if (ret_val) 2663 if (ret_val)
2662 return ret_val; 2664 return ret_val;
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 99f16cbf2fd8..4cfae6c9a63f 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -1131,15 +1131,13 @@ static void mib_counters_update(struct mv643xx_eth_private *mp)
1131 p->rx_discard += rdlp(mp, RX_DISCARD_FRAME_CNT); 1131 p->rx_discard += rdlp(mp, RX_DISCARD_FRAME_CNT);
1132 p->rx_overrun += rdlp(mp, RX_OVERRUN_FRAME_CNT); 1132 p->rx_overrun += rdlp(mp, RX_OVERRUN_FRAME_CNT);
1133 spin_unlock_bh(&mp->mib_counters_lock); 1133 spin_unlock_bh(&mp->mib_counters_lock);
1134
1135 mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ);
1136} 1134}
1137 1135
1138static void mib_counters_timer_wrapper(unsigned long _mp) 1136static void mib_counters_timer_wrapper(unsigned long _mp)
1139{ 1137{
1140 struct mv643xx_eth_private *mp = (void *)_mp; 1138 struct mv643xx_eth_private *mp = (void *)_mp;
1141
1142 mib_counters_update(mp); 1139 mib_counters_update(mp);
1140 mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ);
1143} 1141}
1144 1142
1145 1143
@@ -2237,6 +2235,7 @@ static int mv643xx_eth_open(struct net_device *dev)
2237 mp->int_mask |= INT_TX_END_0 << i; 2235 mp->int_mask |= INT_TX_END_0 << i;
2238 } 2236 }
2239 2237
2238 add_timer(&mp->mib_counters_timer);
2240 port_start(mp); 2239 port_start(mp);
2241 2240
2242 wrlp(mp, INT_MASK_EXT, INT_EXT_LINK_PHY | INT_EXT_TX); 2241 wrlp(mp, INT_MASK_EXT, INT_EXT_LINK_PHY | INT_EXT_TX);
@@ -2534,6 +2533,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
2534 if (!ppdev) 2533 if (!ppdev)
2535 return -ENOMEM; 2534 return -ENOMEM;
2536 ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 2535 ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
2536 ppdev->dev.of_node = pnp;
2537 2537
2538 ret = platform_device_add_resources(ppdev, &res, 1); 2538 ret = platform_device_add_resources(ppdev, &res, 1);
2539 if (ret) 2539 if (ret)
@@ -2916,7 +2916,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
2916 mp->mib_counters_timer.data = (unsigned long)mp; 2916 mp->mib_counters_timer.data = (unsigned long)mp;
2917 mp->mib_counters_timer.function = mib_counters_timer_wrapper; 2917 mp->mib_counters_timer.function = mib_counters_timer_wrapper;
2918 mp->mib_counters_timer.expires = jiffies + 30 * HZ; 2918 mp->mib_counters_timer.expires = jiffies + 30 * HZ;
2919 add_timer(&mp->mib_counters_timer);
2920 2919
2921 spin_lock_init(&mp->mib_counters_lock); 2920 spin_lock_init(&mp->mib_counters_lock);
2922 2921
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index dec455c8f627..afe2efa69c86 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -70,14 +70,15 @@ static int mlx4_alloc_pages(struct mlx4_en_priv *priv,
70 put_page(page); 70 put_page(page);
71 return -ENOMEM; 71 return -ENOMEM;
72 } 72 }
73 page_alloc->size = PAGE_SIZE << order; 73 page_alloc->page_size = PAGE_SIZE << order;
74 page_alloc->page = page; 74 page_alloc->page = page;
75 page_alloc->dma = dma; 75 page_alloc->dma = dma;
76 page_alloc->offset = frag_info->frag_align; 76 page_alloc->page_offset = frag_info->frag_align;
77 /* Not doing get_page() for each frag is a big win 77 /* Not doing get_page() for each frag is a big win
78 * on asymetric workloads. 78 * on asymetric workloads.
79 */ 79 */
80 atomic_set(&page->_count, page_alloc->size / frag_info->frag_stride); 80 atomic_set(&page->_count,
81 page_alloc->page_size / frag_info->frag_stride);
81 return 0; 82 return 0;
82} 83}
83 84
@@ -96,16 +97,19 @@ static int mlx4_en_alloc_frags(struct mlx4_en_priv *priv,
96 for (i = 0; i < priv->num_frags; i++) { 97 for (i = 0; i < priv->num_frags; i++) {
97 frag_info = &priv->frag_info[i]; 98 frag_info = &priv->frag_info[i];
98 page_alloc[i] = ring_alloc[i]; 99 page_alloc[i] = ring_alloc[i];
99 page_alloc[i].offset += frag_info->frag_stride; 100 page_alloc[i].page_offset += frag_info->frag_stride;
100 if (page_alloc[i].offset + frag_info->frag_stride <= ring_alloc[i].size) 101
102 if (page_alloc[i].page_offset + frag_info->frag_stride <=
103 ring_alloc[i].page_size)
101 continue; 104 continue;
105
102 if (mlx4_alloc_pages(priv, &page_alloc[i], frag_info, gfp)) 106 if (mlx4_alloc_pages(priv, &page_alloc[i], frag_info, gfp))
103 goto out; 107 goto out;
104 } 108 }
105 109
106 for (i = 0; i < priv->num_frags; i++) { 110 for (i = 0; i < priv->num_frags; i++) {
107 frags[i] = ring_alloc[i]; 111 frags[i] = ring_alloc[i];
108 dma = ring_alloc[i].dma + ring_alloc[i].offset; 112 dma = ring_alloc[i].dma + ring_alloc[i].page_offset;
109 ring_alloc[i] = page_alloc[i]; 113 ring_alloc[i] = page_alloc[i];
110 rx_desc->data[i].addr = cpu_to_be64(dma); 114 rx_desc->data[i].addr = cpu_to_be64(dma);
111 } 115 }
@@ -117,7 +121,7 @@ out:
117 frag_info = &priv->frag_info[i]; 121 frag_info = &priv->frag_info[i];
118 if (page_alloc[i].page != ring_alloc[i].page) { 122 if (page_alloc[i].page != ring_alloc[i].page) {
119 dma_unmap_page(priv->ddev, page_alloc[i].dma, 123 dma_unmap_page(priv->ddev, page_alloc[i].dma,
120 page_alloc[i].size, PCI_DMA_FROMDEVICE); 124 page_alloc[i].page_size, PCI_DMA_FROMDEVICE);
121 page = page_alloc[i].page; 125 page = page_alloc[i].page;
122 atomic_set(&page->_count, 1); 126 atomic_set(&page->_count, 1);
123 put_page(page); 127 put_page(page);
@@ -131,10 +135,12 @@ static void mlx4_en_free_frag(struct mlx4_en_priv *priv,
131 int i) 135 int i)
132{ 136{
133 const struct mlx4_en_frag_info *frag_info = &priv->frag_info[i]; 137 const struct mlx4_en_frag_info *frag_info = &priv->frag_info[i];
138 u32 next_frag_end = frags[i].page_offset + 2 * frag_info->frag_stride;
139
134 140
135 if (frags[i].offset + frag_info->frag_stride > frags[i].size) 141 if (next_frag_end > frags[i].page_size)
136 dma_unmap_page(priv->ddev, frags[i].dma, frags[i].size, 142 dma_unmap_page(priv->ddev, frags[i].dma, frags[i].page_size,
137 PCI_DMA_FROMDEVICE); 143 PCI_DMA_FROMDEVICE);
138 144
139 if (frags[i].page) 145 if (frags[i].page)
140 put_page(frags[i].page); 146 put_page(frags[i].page);
@@ -161,7 +167,7 @@ out:
161 167
162 page_alloc = &ring->page_alloc[i]; 168 page_alloc = &ring->page_alloc[i];
163 dma_unmap_page(priv->ddev, page_alloc->dma, 169 dma_unmap_page(priv->ddev, page_alloc->dma,
164 page_alloc->size, PCI_DMA_FROMDEVICE); 170 page_alloc->page_size, PCI_DMA_FROMDEVICE);
165 page = page_alloc->page; 171 page = page_alloc->page;
166 atomic_set(&page->_count, 1); 172 atomic_set(&page->_count, 1);
167 put_page(page); 173 put_page(page);
@@ -184,10 +190,11 @@ static void mlx4_en_destroy_allocator(struct mlx4_en_priv *priv,
184 i, page_count(page_alloc->page)); 190 i, page_count(page_alloc->page));
185 191
186 dma_unmap_page(priv->ddev, page_alloc->dma, 192 dma_unmap_page(priv->ddev, page_alloc->dma,
187 page_alloc->size, PCI_DMA_FROMDEVICE); 193 page_alloc->page_size, PCI_DMA_FROMDEVICE);
188 while (page_alloc->offset + frag_info->frag_stride < page_alloc->size) { 194 while (page_alloc->page_offset + frag_info->frag_stride <
195 page_alloc->page_size) {
189 put_page(page_alloc->page); 196 put_page(page_alloc->page);
190 page_alloc->offset += frag_info->frag_stride; 197 page_alloc->page_offset += frag_info->frag_stride;
191 } 198 }
192 page_alloc->page = NULL; 199 page_alloc->page = NULL;
193 } 200 }
@@ -478,7 +485,7 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
478 /* Save page reference in skb */ 485 /* Save page reference in skb */
479 __skb_frag_set_page(&skb_frags_rx[nr], frags[nr].page); 486 __skb_frag_set_page(&skb_frags_rx[nr], frags[nr].page);
480 skb_frag_size_set(&skb_frags_rx[nr], frag_info->frag_size); 487 skb_frag_size_set(&skb_frags_rx[nr], frag_info->frag_size);
481 skb_frags_rx[nr].page_offset = frags[nr].offset; 488 skb_frags_rx[nr].page_offset = frags[nr].page_offset;
482 skb->truesize += frag_info->frag_stride; 489 skb->truesize += frag_info->frag_stride;
483 frags[nr].page = NULL; 490 frags[nr].page = NULL;
484 } 491 }
@@ -517,7 +524,7 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv,
517 524
518 /* Get pointer to first fragment so we could copy the headers into the 525 /* Get pointer to first fragment so we could copy the headers into the
519 * (linear part of the) skb */ 526 * (linear part of the) skb */
520 va = page_address(frags[0].page) + frags[0].offset; 527 va = page_address(frags[0].page) + frags[0].page_offset;
521 528
522 if (length <= SMALL_PACKET_SIZE) { 529 if (length <= SMALL_PACKET_SIZE) {
523 /* We are copying all relevant data to the skb - temporarily 530 /* We are copying all relevant data to the skb - temporarily
@@ -645,7 +652,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
645 dma_sync_single_for_cpu(priv->ddev, dma, sizeof(*ethh), 652 dma_sync_single_for_cpu(priv->ddev, dma, sizeof(*ethh),
646 DMA_FROM_DEVICE); 653 DMA_FROM_DEVICE);
647 ethh = (struct ethhdr *)(page_address(frags[0].page) + 654 ethh = (struct ethhdr *)(page_address(frags[0].page) +
648 frags[0].offset); 655 frags[0].page_offset);
649 656
650 if (is_multicast_ether_addr(ethh->h_dest)) { 657 if (is_multicast_ether_addr(ethh->h_dest)) {
651 struct mlx4_mac_entry *entry; 658 struct mlx4_mac_entry *entry;
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 5e0aa569306a..bf06e3610d27 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -237,8 +237,8 @@ struct mlx4_en_tx_desc {
237struct mlx4_en_rx_alloc { 237struct mlx4_en_rx_alloc {
238 struct page *page; 238 struct page *page;
239 dma_addr_t dma; 239 dma_addr_t dma;
240 u32 offset; 240 u32 page_offset;
241 u32 size; 241 u32 page_size;
242}; 242};
243 243
244struct mlx4_en_tx_ring { 244struct mlx4_en_tx_ring {
diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
index bd1a2d2bc2ae..ea54d95e5b9f 100644
--- a/drivers/net/ethernet/moxa/moxart_ether.c
+++ b/drivers/net/ethernet/moxa/moxart_ether.c
@@ -448,7 +448,8 @@ static int moxart_mac_probe(struct platform_device *pdev)
448 irq = irq_of_parse_and_map(node, 0); 448 irq = irq_of_parse_and_map(node, 0);
449 if (irq <= 0) { 449 if (irq <= 0) {
450 netdev_err(ndev, "irq_of_parse_and_map failed\n"); 450 netdev_err(ndev, "irq_of_parse_and_map failed\n");
451 return -EINVAL; 451 ret = -EINVAL;
452 goto irq_map_fail;
452 } 453 }
453 454
454 priv = netdev_priv(ndev); 455 priv = netdev_priv(ndev);
@@ -472,24 +473,32 @@ static int moxart_mac_probe(struct platform_device *pdev)
472 priv->tx_desc_base = dma_alloc_coherent(NULL, TX_REG_DESC_SIZE * 473 priv->tx_desc_base = dma_alloc_coherent(NULL, TX_REG_DESC_SIZE *
473 TX_DESC_NUM, &priv->tx_base, 474 TX_DESC_NUM, &priv->tx_base,
474 GFP_DMA | GFP_KERNEL); 475 GFP_DMA | GFP_KERNEL);
475 if (priv->tx_desc_base == NULL) 476 if (priv->tx_desc_base == NULL) {
477 ret = -ENOMEM;
476 goto init_fail; 478 goto init_fail;
479 }
477 480
478 priv->rx_desc_base = dma_alloc_coherent(NULL, RX_REG_DESC_SIZE * 481 priv->rx_desc_base = dma_alloc_coherent(NULL, RX_REG_DESC_SIZE *
479 RX_DESC_NUM, &priv->rx_base, 482 RX_DESC_NUM, &priv->rx_base,
480 GFP_DMA | GFP_KERNEL); 483 GFP_DMA | GFP_KERNEL);
481 if (priv->rx_desc_base == NULL) 484 if (priv->rx_desc_base == NULL) {
485 ret = -ENOMEM;
482 goto init_fail; 486 goto init_fail;
487 }
483 488
484 priv->tx_buf_base = kmalloc(priv->tx_buf_size * TX_DESC_NUM, 489 priv->tx_buf_base = kmalloc(priv->tx_buf_size * TX_DESC_NUM,
485 GFP_ATOMIC); 490 GFP_ATOMIC);
486 if (!priv->tx_buf_base) 491 if (!priv->tx_buf_base) {
492 ret = -ENOMEM;
487 goto init_fail; 493 goto init_fail;
494 }
488 495
489 priv->rx_buf_base = kmalloc(priv->rx_buf_size * RX_DESC_NUM, 496 priv->rx_buf_base = kmalloc(priv->rx_buf_size * RX_DESC_NUM,
490 GFP_ATOMIC); 497 GFP_ATOMIC);
491 if (!priv->rx_buf_base) 498 if (!priv->rx_buf_base) {
499 ret = -ENOMEM;
492 goto init_fail; 500 goto init_fail;
501 }
493 502
494 platform_set_drvdata(pdev, ndev); 503 platform_set_drvdata(pdev, ndev);
495 504
@@ -522,7 +531,8 @@ static int moxart_mac_probe(struct platform_device *pdev)
522init_fail: 531init_fail:
523 netdev_err(ndev, "init failed\n"); 532 netdev_err(ndev, "init failed\n");
524 moxart_mac_free_memory(ndev); 533 moxart_mac_free_memory(ndev);
525 534irq_map_fail:
535 free_netdev(ndev);
526 return ret; 536 return ret;
527} 537}
528 538
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 21d00a0449a1..f07f2b0fefa0 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2257,7 +2257,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2257 2257
2258 err = qlcnic_alloc_adapter_resources(adapter); 2258 err = qlcnic_alloc_adapter_resources(adapter);
2259 if (err) 2259 if (err)
2260 goto err_out_free_netdev; 2260 goto err_out_free_wq;
2261 2261
2262 adapter->dev_rst_time = jiffies; 2262 adapter->dev_rst_time = jiffies;
2263 adapter->ahw->revision_id = pdev->revision; 2263 adapter->ahw->revision_id = pdev->revision;
@@ -2396,6 +2396,9 @@ err_out_disable_msi:
2396err_out_free_hw: 2396err_out_free_hw:
2397 qlcnic_free_adapter_resources(adapter); 2397 qlcnic_free_adapter_resources(adapter);
2398 2398
2399err_out_free_wq:
2400 destroy_workqueue(adapter->qlcnic_wq);
2401
2399err_out_free_netdev: 2402err_out_free_netdev:
2400 free_netdev(netdev); 2403 free_netdev(netdev);
2401 2404
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index c8df52bac162..ee8df999494c 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -620,12 +620,16 @@ static struct sh_eth_cpu_data sh7734_data = {
620 .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | 620 .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT |
621 EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE | 621 EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
622 EESR_TDE | EESR_ECI, 622 EESR_TDE | EESR_ECI,
623 .fdr_value = 0x0000070f,
624 .rmcr_value = 0x00000001,
623 625
624 .apr = 1, 626 .apr = 1,
625 .mpr = 1, 627 .mpr = 1,
626 .tpauser = 1, 628 .tpauser = 1,
627 .bculr = 1, 629 .bculr = 1,
628 .hw_swap = 1, 630 .hw_swap = 1,
631 .rpadir = 1,
632 .rpadir_value = 2 << 16,
629 .no_trimd = 1, 633 .no_trimd = 1,
630 .no_ade = 1, 634 .no_ade = 1,
631 .tsu = 1, 635 .tsu = 1,
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 844ee7539d33..676c3c057bfb 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -754,6 +754,18 @@ static const struct efx_hw_stat_desc efx_ef10_stat_desc[EF10_STAT_COUNT] = {
754 EF10_DMA_STAT(rx_align_error, RX_ALIGN_ERROR_PKTS), 754 EF10_DMA_STAT(rx_align_error, RX_ALIGN_ERROR_PKTS),
755 EF10_DMA_STAT(rx_length_error, RX_LENGTH_ERROR_PKTS), 755 EF10_DMA_STAT(rx_length_error, RX_LENGTH_ERROR_PKTS),
756 EF10_DMA_STAT(rx_nodesc_drops, RX_NODESC_DROPS), 756 EF10_DMA_STAT(rx_nodesc_drops, RX_NODESC_DROPS),
757 EF10_DMA_STAT(rx_pm_trunc_bb_overflow, PM_TRUNC_BB_OVERFLOW),
758 EF10_DMA_STAT(rx_pm_discard_bb_overflow, PM_DISCARD_BB_OVERFLOW),
759 EF10_DMA_STAT(rx_pm_trunc_vfifo_full, PM_TRUNC_VFIFO_FULL),
760 EF10_DMA_STAT(rx_pm_discard_vfifo_full, PM_DISCARD_VFIFO_FULL),
761 EF10_DMA_STAT(rx_pm_trunc_qbb, PM_TRUNC_QBB),
762 EF10_DMA_STAT(rx_pm_discard_qbb, PM_DISCARD_QBB),
763 EF10_DMA_STAT(rx_pm_discard_mapping, PM_DISCARD_MAPPING),
764 EF10_DMA_STAT(rx_dp_q_disabled_packets, RXDP_Q_DISABLED_PKTS),
765 EF10_DMA_STAT(rx_dp_di_dropped_packets, RXDP_DI_DROPPED_PKTS),
766 EF10_DMA_STAT(rx_dp_streaming_packets, RXDP_STREAMING_PKTS),
767 EF10_DMA_STAT(rx_dp_emerg_fetch, RXDP_EMERGENCY_FETCH_CONDITIONS),
768 EF10_DMA_STAT(rx_dp_emerg_wait, RXDP_EMERGENCY_WAIT_CONDITIONS),
757}; 769};
758 770
759#define HUNT_COMMON_STAT_MASK ((1ULL << EF10_STAT_tx_bytes) | \ 771#define HUNT_COMMON_STAT_MASK ((1ULL << EF10_STAT_tx_bytes) | \
@@ -808,44 +820,72 @@ static const struct efx_hw_stat_desc efx_ef10_stat_desc[EF10_STAT_COUNT] = {
808#define HUNT_40G_EXTRA_STAT_MASK ((1ULL << EF10_STAT_rx_align_error) | \ 820#define HUNT_40G_EXTRA_STAT_MASK ((1ULL << EF10_STAT_rx_align_error) | \
809 (1ULL << EF10_STAT_rx_length_error)) 821 (1ULL << EF10_STAT_rx_length_error))
810 822
811#if BITS_PER_LONG == 64 823/* These statistics are only provided if the firmware supports the
812#define STAT_MASK_BITMAP(bits) (bits) 824 * capability PM_AND_RXDP_COUNTERS.
813#else 825 */
814#define STAT_MASK_BITMAP(bits) (bits) & 0xffffffff, (bits) >> 32 826#define HUNT_PM_AND_RXDP_STAT_MASK ( \
815#endif 827 (1ULL << EF10_STAT_rx_pm_trunc_bb_overflow) | \
816 828 (1ULL << EF10_STAT_rx_pm_discard_bb_overflow) | \
817static const unsigned long *efx_ef10_stat_mask(struct efx_nic *efx) 829 (1ULL << EF10_STAT_rx_pm_trunc_vfifo_full) | \
818{ 830 (1ULL << EF10_STAT_rx_pm_discard_vfifo_full) | \
819 static const unsigned long hunt_40g_stat_mask[] = { 831 (1ULL << EF10_STAT_rx_pm_trunc_qbb) | \
820 STAT_MASK_BITMAP(HUNT_COMMON_STAT_MASK | 832 (1ULL << EF10_STAT_rx_pm_discard_qbb) | \
821 HUNT_40G_EXTRA_STAT_MASK) 833 (1ULL << EF10_STAT_rx_pm_discard_mapping) | \
822 }; 834 (1ULL << EF10_STAT_rx_dp_q_disabled_packets) | \
823 static const unsigned long hunt_10g_only_stat_mask[] = { 835 (1ULL << EF10_STAT_rx_dp_di_dropped_packets) | \
824 STAT_MASK_BITMAP(HUNT_COMMON_STAT_MASK | 836 (1ULL << EF10_STAT_rx_dp_streaming_packets) | \
825 HUNT_10G_ONLY_STAT_MASK) 837 (1ULL << EF10_STAT_rx_dp_emerg_fetch) | \
826 }; 838 (1ULL << EF10_STAT_rx_dp_emerg_wait))
839
840static u64 efx_ef10_raw_stat_mask(struct efx_nic *efx)
841{
842 u64 raw_mask = HUNT_COMMON_STAT_MASK;
827 u32 port_caps = efx_mcdi_phy_get_caps(efx); 843 u32 port_caps = efx_mcdi_phy_get_caps(efx);
844 struct efx_ef10_nic_data *nic_data = efx->nic_data;
828 845
829 if (port_caps & (1 << MC_CMD_PHY_CAP_40000FDX_LBN)) 846 if (port_caps & (1 << MC_CMD_PHY_CAP_40000FDX_LBN))
830 return hunt_40g_stat_mask; 847 raw_mask |= HUNT_40G_EXTRA_STAT_MASK;
831 else 848 else
832 return hunt_10g_only_stat_mask; 849 raw_mask |= HUNT_10G_ONLY_STAT_MASK;
850
851 if (nic_data->datapath_caps &
852 (1 << MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN))
853 raw_mask |= HUNT_PM_AND_RXDP_STAT_MASK;
854
855 return raw_mask;
856}
857
858static void efx_ef10_get_stat_mask(struct efx_nic *efx, unsigned long *mask)
859{
860 u64 raw_mask = efx_ef10_raw_stat_mask(efx);
861
862#if BITS_PER_LONG == 64
863 mask[0] = raw_mask;
864#else
865 mask[0] = raw_mask & 0xffffffff;
866 mask[1] = raw_mask >> 32;
867#endif
833} 868}
834 869
835static size_t efx_ef10_describe_stats(struct efx_nic *efx, u8 *names) 870static size_t efx_ef10_describe_stats(struct efx_nic *efx, u8 *names)
836{ 871{
872 DECLARE_BITMAP(mask, EF10_STAT_COUNT);
873
874 efx_ef10_get_stat_mask(efx, mask);
837 return efx_nic_describe_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, 875 return efx_nic_describe_stats(efx_ef10_stat_desc, EF10_STAT_COUNT,
838 efx_ef10_stat_mask(efx), names); 876 mask, names);
839} 877}
840 878
841static int efx_ef10_try_update_nic_stats(struct efx_nic *efx) 879static int efx_ef10_try_update_nic_stats(struct efx_nic *efx)
842{ 880{
843 struct efx_ef10_nic_data *nic_data = efx->nic_data; 881 struct efx_ef10_nic_data *nic_data = efx->nic_data;
844 const unsigned long *stats_mask = efx_ef10_stat_mask(efx); 882 DECLARE_BITMAP(mask, EF10_STAT_COUNT);
845 __le64 generation_start, generation_end; 883 __le64 generation_start, generation_end;
846 u64 *stats = nic_data->stats; 884 u64 *stats = nic_data->stats;
847 __le64 *dma_stats; 885 __le64 *dma_stats;
848 886
887 efx_ef10_get_stat_mask(efx, mask);
888
849 dma_stats = efx->stats_buffer.addr; 889 dma_stats = efx->stats_buffer.addr;
850 nic_data = efx->nic_data; 890 nic_data = efx->nic_data;
851 891
@@ -853,8 +893,9 @@ static int efx_ef10_try_update_nic_stats(struct efx_nic *efx)
853 if (generation_end == EFX_MC_STATS_GENERATION_INVALID) 893 if (generation_end == EFX_MC_STATS_GENERATION_INVALID)
854 return 0; 894 return 0;
855 rmb(); 895 rmb();
856 efx_nic_update_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, stats_mask, 896 efx_nic_update_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, mask,
857 stats, efx->stats_buffer.addr, false); 897 stats, efx->stats_buffer.addr, false);
898 rmb();
858 generation_start = dma_stats[MC_CMD_MAC_GENERATION_START]; 899 generation_start = dma_stats[MC_CMD_MAC_GENERATION_START];
859 if (generation_end != generation_start) 900 if (generation_end != generation_start)
860 return -EAGAIN; 901 return -EAGAIN;
@@ -873,12 +914,14 @@ static int efx_ef10_try_update_nic_stats(struct efx_nic *efx)
873static size_t efx_ef10_update_stats(struct efx_nic *efx, u64 *full_stats, 914static size_t efx_ef10_update_stats(struct efx_nic *efx, u64 *full_stats,
874 struct rtnl_link_stats64 *core_stats) 915 struct rtnl_link_stats64 *core_stats)
875{ 916{
876 const unsigned long *mask = efx_ef10_stat_mask(efx); 917 DECLARE_BITMAP(mask, EF10_STAT_COUNT);
877 struct efx_ef10_nic_data *nic_data = efx->nic_data; 918 struct efx_ef10_nic_data *nic_data = efx->nic_data;
878 u64 *stats = nic_data->stats; 919 u64 *stats = nic_data->stats;
879 size_t stats_count = 0, index; 920 size_t stats_count = 0, index;
880 int retry; 921 int retry;
881 922
923 efx_ef10_get_stat_mask(efx, mask);
924
882 /* If we're unlucky enough to read statistics during the DMA, wait 925 /* If we're unlucky enough to read statistics during the DMA, wait
883 * up to 10ms for it to finish (typically takes <500us) 926 * up to 10ms for it to finish (typically takes <500us)
884 */ 927 */
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index c082562dbf4e..366c8e3e3784 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -963,7 +963,7 @@ static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating,
963 bool *was_attached) 963 bool *was_attached)
964{ 964{
965 MCDI_DECLARE_BUF(inbuf, MC_CMD_DRV_ATTACH_IN_LEN); 965 MCDI_DECLARE_BUF(inbuf, MC_CMD_DRV_ATTACH_IN_LEN);
966 MCDI_DECLARE_BUF(outbuf, MC_CMD_DRV_ATTACH_OUT_LEN); 966 MCDI_DECLARE_BUF(outbuf, MC_CMD_DRV_ATTACH_EXT_OUT_LEN);
967 size_t outlen; 967 size_t outlen;
968 int rc; 968 int rc;
969 969
@@ -981,6 +981,22 @@ static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating,
981 goto fail; 981 goto fail;
982 } 982 }
983 983
984 /* We currently assume we have control of the external link
985 * and are completely trusted by firmware. Abort probing
986 * if that's not true for this function.
987 */
988 if (driver_operating &&
989 outlen >= MC_CMD_DRV_ATTACH_EXT_OUT_LEN &&
990 (MCDI_DWORD(outbuf, DRV_ATTACH_EXT_OUT_FUNC_FLAGS) &
991 (1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL |
992 1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED)) !=
993 (1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL |
994 1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED)) {
995 netif_err(efx, probe, efx->net_dev,
996 "This driver version only supports one function per port\n");
997 return -ENODEV;
998 }
999
984 if (was_attached != NULL) 1000 if (was_attached != NULL)
985 *was_attached = MCDI_DWORD(outbuf, DRV_ATTACH_OUT_OLD_STATE); 1001 *was_attached = MCDI_DWORD(outbuf, DRV_ATTACH_OUT_OLD_STATE);
986 return 0; 1002 return 0;
diff --git a/drivers/net/ethernet/sfc/mcdi_pcol.h b/drivers/net/ethernet/sfc/mcdi_pcol.h
index b5cf62492f8e..e0a63ddb7a6c 100644
--- a/drivers/net/ethernet/sfc/mcdi_pcol.h
+++ b/drivers/net/ethernet/sfc/mcdi_pcol.h
@@ -2574,8 +2574,58 @@
2574#define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */ 2574#define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */
2575#define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */ 2575#define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */
2576#define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */ 2576#define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */
2577#define MC_CMD_GMAC_DMABUF_START 0x40 /* enum */ 2577/* enum: PM trunc_bb_overflow counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
2578#define MC_CMD_GMAC_DMABUF_END 0x5f /* enum */ 2578 * capability only.
2579 */
2580#define MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW 0x3c
2581/* enum: PM discard_bb_overflow counter. Valid for EF10 with
2582 * PM_AND_RXDP_COUNTERS capability only.
2583 */
2584#define MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW 0x3d
2585/* enum: PM trunc_vfifo_full counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
2586 * capability only.
2587 */
2588#define MC_CMD_MAC_PM_TRUNC_VFIFO_FULL 0x3e
2589/* enum: PM discard_vfifo_full counter. Valid for EF10 with
2590 * PM_AND_RXDP_COUNTERS capability only.
2591 */
2592#define MC_CMD_MAC_PM_DISCARD_VFIFO_FULL 0x3f
2593/* enum: PM trunc_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
2594 * capability only.
2595 */
2596#define MC_CMD_MAC_PM_TRUNC_QBB 0x40
2597/* enum: PM discard_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
2598 * capability only.
2599 */
2600#define MC_CMD_MAC_PM_DISCARD_QBB 0x41
2601/* enum: PM discard_mapping counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
2602 * capability only.
2603 */
2604#define MC_CMD_MAC_PM_DISCARD_MAPPING 0x42
2605/* enum: RXDP counter: Number of packets dropped due to the queue being
2606 * disabled. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
2607 */
2608#define MC_CMD_MAC_RXDP_Q_DISABLED_PKTS 0x43
2609/* enum: RXDP counter: Number of packets dropped by the DICPU. Valid for EF10
2610 * with PM_AND_RXDP_COUNTERS capability only.
2611 */
2612#define MC_CMD_MAC_RXDP_DI_DROPPED_PKTS 0x45
2613/* enum: RXDP counter: Number of non-host packets. Valid for EF10 with
2614 * PM_AND_RXDP_COUNTERS capability only.
2615 */
2616#define MC_CMD_MAC_RXDP_STREAMING_PKTS 0x46
2617/* enum: RXDP counter: Number of times an emergency descriptor fetch was
2618 * performed. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
2619 */
2620#define MC_CMD_MAC_RXDP_EMERGENCY_FETCH_CONDITIONS 0x47
2621/* enum: RXDP counter: Number of times the DPCPU waited for an existing
2622 * descriptor fetch. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
2623 */
2624#define MC_CMD_MAC_RXDP_EMERGENCY_WAIT_CONDITIONS 0x48
2625/* enum: Start of GMAC stats buffer space, for Siena only. */
2626#define MC_CMD_GMAC_DMABUF_START 0x40
2627/* enum: End of GMAC stats buffer space, for Siena only. */
2628#define MC_CMD_GMAC_DMABUF_END 0x5f
2579#define MC_CMD_MAC_GENERATION_END 0x60 /* enum */ 2629#define MC_CMD_MAC_GENERATION_END 0x60 /* enum */
2580#define MC_CMD_MAC_NSTATS 0x61 /* enum */ 2630#define MC_CMD_MAC_NSTATS 0x61 /* enum */
2581 2631
@@ -5065,6 +5115,8 @@
5065#define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_WIDTH 1 5115#define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_WIDTH 1
5066#define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_LBN 26 5116#define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_LBN 26
5067#define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_WIDTH 1 5117#define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_WIDTH 1
5118#define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN 27
5119#define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1
5068/* RxDPCPU firmware id. */ 5120/* RxDPCPU firmware id. */
5069#define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_OFST 4 5121#define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_OFST 4
5070#define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_LEN 2 5122#define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_LEN 2
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c
index c75009b8c0d9..9c90bf56090f 100644
--- a/drivers/net/ethernet/sfc/nic.c
+++ b/drivers/net/ethernet/sfc/nic.c
@@ -480,8 +480,7 @@ size_t efx_nic_describe_stats(const struct efx_hw_stat_desc *desc, size_t count,
480 * @count: Length of the @desc array 480 * @count: Length of the @desc array
481 * @mask: Bitmask of which elements of @desc are enabled 481 * @mask: Bitmask of which elements of @desc are enabled
482 * @stats: Buffer to update with the converted statistics. The length 482 * @stats: Buffer to update with the converted statistics. The length
483 * of this array must be at least the number of set bits in the 483 * of this array must be at least @count.
484 * first @count bits of @mask.
485 * @dma_buf: DMA buffer containing hardware statistics 484 * @dma_buf: DMA buffer containing hardware statistics
486 * @accumulate: If set, the converted values will be added rather than 485 * @accumulate: If set, the converted values will be added rather than
487 * directly stored to the corresponding elements of @stats 486 * directly stored to the corresponding elements of @stats
@@ -514,11 +513,9 @@ void efx_nic_update_stats(const struct efx_hw_stat_desc *desc, size_t count,
514 } 513 }
515 514
516 if (accumulate) 515 if (accumulate)
517 *stats += val; 516 stats[index] += val;
518 else 517 else
519 *stats = val; 518 stats[index] = val;
520 } 519 }
521
522 ++stats;
523 } 520 }
524} 521}
diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h
index 08883c8edf0e..11b6112d9249 100644
--- a/drivers/net/ethernet/sfc/nic.h
+++ b/drivers/net/ethernet/sfc/nic.h
@@ -402,6 +402,18 @@ enum {
402 EF10_STAT_rx_align_error, 402 EF10_STAT_rx_align_error,
403 EF10_STAT_rx_length_error, 403 EF10_STAT_rx_length_error,
404 EF10_STAT_rx_nodesc_drops, 404 EF10_STAT_rx_nodesc_drops,
405 EF10_STAT_rx_pm_trunc_bb_overflow,
406 EF10_STAT_rx_pm_discard_bb_overflow,
407 EF10_STAT_rx_pm_trunc_vfifo_full,
408 EF10_STAT_rx_pm_discard_vfifo_full,
409 EF10_STAT_rx_pm_trunc_qbb,
410 EF10_STAT_rx_pm_discard_qbb,
411 EF10_STAT_rx_pm_discard_mapping,
412 EF10_STAT_rx_dp_q_disabled_packets,
413 EF10_STAT_rx_dp_di_dropped_packets,
414 EF10_STAT_rx_dp_streaming_packets,
415 EF10_STAT_rx_dp_emerg_fetch,
416 EF10_STAT_rx_dp_emerg_wait,
405 EF10_STAT_COUNT 417 EF10_STAT_COUNT
406}; 418};
407 419
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 7290f11a937d..1fd8125e58a8 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1766,8 +1766,8 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
1766 } 1766 }
1767 data->mac_control = prop; 1767 data->mac_control = prop;
1768 1768
1769 if (!of_property_read_u32(node, "dual_emac", &prop)) 1769 if (of_property_read_bool(node, "dual_emac"))
1770 data->dual_emac = prop; 1770 data->dual_emac = 1;
1771 1771
1772 /* 1772 /*
1773 * Populate all the child nodes here... 1773 * Populate all the child nodes here...
@@ -1777,7 +1777,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
1777 if (ret) 1777 if (ret)
1778 pr_warn("Doesn't have any child node\n"); 1778 pr_warn("Doesn't have any child node\n");
1779 1779
1780 for_each_node_by_name(slave_node, "slave") { 1780 for_each_child_of_node(node, slave_node) {
1781 struct cpsw_slave_data *slave_data = data->slave_data + i; 1781 struct cpsw_slave_data *slave_data = data->slave_data + i;
1782 const void *mac_addr = NULL; 1782 const void *mac_addr = NULL;
1783 u32 phyid; 1783 u32 phyid;
@@ -1786,6 +1786,10 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
1786 struct device_node *mdio_node; 1786 struct device_node *mdio_node;
1787 struct platform_device *mdio; 1787 struct platform_device *mdio;
1788 1788
1789 /* This is no slave child node, continue */
1790 if (strcmp(slave_node->name, "slave"))
1791 continue;
1792
1789 parp = of_get_property(slave_node, "phy_id", &lenp); 1793 parp = of_get_property(slave_node, "phy_id", &lenp);
1790 if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { 1794 if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) {
1791 pr_err("Missing slave[%d] phy_id property\n", i); 1795 pr_err("Missing slave[%d] phy_id property\n", i);