aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-06-04 14:50:00 -0400
committerDavid S. Miller <davem@davemloft.net>2008-06-04 14:50:00 -0400
commit8b91ac09732895f928ed6107bda5318cf260520b (patch)
tree5fc787bb3e0f4a4f84a928b7708023e4996608cd
parent8aca6cb1179ed9bef9351028c8d8af852903eae2 (diff)
parent56997fa838e333cea33ab641d4aeedd23aef0eb1 (diff)
Merge branch 'davem-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
-rw-r--r--drivers/net/atlx/atl1.c1
-rw-r--r--drivers/net/cs89x0.c10
-rw-r--r--drivers/net/myri10ge/myri10ge.c2
-rw-r--r--drivers/net/sc92031.c2
-rw-r--r--drivers/net/sfc/falcon_xmac.c2
-rw-r--r--drivers/net/tulip/tulip_core.c10
-rw-r--r--drivers/net/ucc_geth_ethtool.c3
-rw-r--r--drivers/net/virtio_net.c36
8 files changed, 52 insertions, 14 deletions
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 6e4c80d41b08..6ddc911e7d15 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2023,6 +2023,7 @@ rrd_ok:
2023 /* Good Receive */ 2023 /* Good Receive */
2024 pci_unmap_page(adapter->pdev, buffer_info->dma, 2024 pci_unmap_page(adapter->pdev, buffer_info->dma,
2025 buffer_info->length, PCI_DMA_FROMDEVICE); 2025 buffer_info->length, PCI_DMA_FROMDEVICE);
2026 buffer_info->dma = 0;
2026 skb = buffer_info->skb; 2027 skb = buffer_info->skb;
2027 length = le16_to_cpu(rrd->xsz.xsum_sz.pkt_size); 2028 length = le16_to_cpu(rrd->xsz.xsum_sz.pkt_size);
2028 2029
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 348371fda597..fba87abe78ee 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -1394,7 +1394,11 @@ net_open(struct net_device *dev)
1394#endif 1394#endif
1395 if (!result) { 1395 if (!result) {
1396 printk(KERN_ERR "%s: EEPROM is configured for unavailable media\n", dev->name); 1396 printk(KERN_ERR "%s: EEPROM is configured for unavailable media\n", dev->name);
1397 release_irq: 1397release_dma:
1398#if ALLOW_DMA
1399 free_dma(dev->dma);
1400#endif
1401release_irq:
1398#if ALLOW_DMA 1402#if ALLOW_DMA
1399 release_dma_buff(lp); 1403 release_dma_buff(lp);
1400#endif 1404#endif
@@ -1442,12 +1446,12 @@ net_open(struct net_device *dev)
1442 if ((result = detect_bnc(dev)) != DETECTED_NONE) 1446 if ((result = detect_bnc(dev)) != DETECTED_NONE)
1443 break; 1447 break;
1444 printk(KERN_ERR "%s: no media detected\n", dev->name); 1448 printk(KERN_ERR "%s: no media detected\n", dev->name);
1445 goto release_irq; 1449 goto release_dma;
1446 } 1450 }
1447 switch(result) { 1451 switch(result) {
1448 case DETECTED_NONE: 1452 case DETECTED_NONE:
1449 printk(KERN_ERR "%s: no network cable attached to configured media\n", dev->name); 1453 printk(KERN_ERR "%s: no network cable attached to configured media\n", dev->name);
1450 goto release_irq; 1454 goto release_dma;
1451 case DETECTED_RJ45H: 1455 case DETECTED_RJ45H:
1452 printk(KERN_INFO "%s: using half-duplex 10Base-T (RJ-45)\n", dev->name); 1456 printk(KERN_INFO "%s: using half-duplex 10Base-T (RJ-45)\n", dev->name);
1453 break; 1457 break;
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 36be6efc6398..e0d76c75aea0 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -75,7 +75,7 @@
75#include "myri10ge_mcp.h" 75#include "myri10ge_mcp.h"
76#include "myri10ge_mcp_gen_header.h" 76#include "myri10ge_mcp_gen_header.h"
77 77
78#define MYRI10GE_VERSION_STR "1.3.2-1.287" 78#define MYRI10GE_VERSION_STR "1.3.99-1.347"
79 79
80MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); 80MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
81MODULE_AUTHOR("Maintainer: help@myri.com"); 81MODULE_AUTHOR("Maintainer: help@myri.com");
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index b4b63805ee8f..61955f8d8011 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -972,7 +972,7 @@ static int sc92031_start_xmit(struct sk_buff *skb, struct net_device *dev)
972 skb_copy_and_csum_dev(skb, priv->tx_bufs + entry * TX_BUF_SIZE); 972 skb_copy_and_csum_dev(skb, priv->tx_bufs + entry * TX_BUF_SIZE);
973 973
974 len = skb->len; 974 len = skb->len;
975 if (unlikely(len < ETH_ZLEN)) { 975 if (len < ETH_ZLEN) {
976 memset(priv->tx_bufs + entry * TX_BUF_SIZE + len, 976 memset(priv->tx_bufs + entry * TX_BUF_SIZE + len,
977 0, ETH_ZLEN - len); 977 0, ETH_ZLEN - len);
978 len = ETH_ZLEN; 978 len = ETH_ZLEN;
diff --git a/drivers/net/sfc/falcon_xmac.c b/drivers/net/sfc/falcon_xmac.c
index dbdcee4b0f8d..55c0d9760be8 100644
--- a/drivers/net/sfc/falcon_xmac.c
+++ b/drivers/net/sfc/falcon_xmac.c
@@ -459,7 +459,7 @@ static int falcon_check_xaui_link_up(struct efx_nic *efx)
459 tries--; 459 tries--;
460 } 460 }
461 461
462 EFX_ERR(efx, "Failed to bring XAUI link back up in %d tries!\n", 462 EFX_LOG(efx, "Failed to bring XAUI link back up in %d tries!\n",
463 max_tries); 463 max_tries);
464 return 0; 464 return 0;
465} 465}
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index f9d13fa05d64..55670b5eb611 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -1729,12 +1729,15 @@ static int tulip_suspend (struct pci_dev *pdev, pm_message_t state)
1729 if (!dev) 1729 if (!dev)
1730 return -EINVAL; 1730 return -EINVAL;
1731 1731
1732 if (netif_running(dev)) 1732 if (!netif_running(dev))
1733 tulip_down(dev); 1733 goto save_state;
1734
1735 tulip_down(dev);
1734 1736
1735 netif_device_detach(dev); 1737 netif_device_detach(dev);
1736 free_irq(dev->irq, dev); 1738 free_irq(dev->irq, dev);
1737 1739
1740save_state:
1738 pci_save_state(pdev); 1741 pci_save_state(pdev);
1739 pci_disable_device(pdev); 1742 pci_disable_device(pdev);
1740 pci_set_power_state(pdev, pci_choose_state(pdev, state)); 1743 pci_set_power_state(pdev, pci_choose_state(pdev, state));
@@ -1754,6 +1757,9 @@ static int tulip_resume(struct pci_dev *pdev)
1754 pci_set_power_state(pdev, PCI_D0); 1757 pci_set_power_state(pdev, PCI_D0);
1755 pci_restore_state(pdev); 1758 pci_restore_state(pdev);
1756 1759
1760 if (!netif_running(dev))
1761 return 0;
1762
1757 if ((retval = pci_enable_device(pdev))) { 1763 if ((retval = pci_enable_device(pdev))) {
1758 printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); 1764 printk (KERN_ERR "tulip: pci_enable_device failed in resume\n");
1759 return retval; 1765 return retval;
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
index 299b7f176950..f5839c4a5cbd 100644
--- a/drivers/net/ucc_geth_ethtool.c
+++ b/drivers/net/ucc_geth_ethtool.c
@@ -73,6 +73,7 @@ static char tx_fw_stat_gstrings[][ETH_GSTRING_LEN] = {
73 "tx-frames-ok", 73 "tx-frames-ok",
74 "tx-excessive-differ-frames", 74 "tx-excessive-differ-frames",
75 "tx-256-511-frames", 75 "tx-256-511-frames",
76 "tx-512-1023-frames",
76 "tx-1024-1518-frames", 77 "tx-1024-1518-frames",
77 "tx-jumbo-frames", 78 "tx-jumbo-frames",
78}; 79};
@@ -308,7 +309,7 @@ static void uec_get_strings(struct net_device *netdev, u32 stringset, u8 *buf)
308 buf += UEC_TX_FW_STATS_LEN * ETH_GSTRING_LEN; 309 buf += UEC_TX_FW_STATS_LEN * ETH_GSTRING_LEN;
309 } 310 }
310 if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX) 311 if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX)
311 memcpy(buf, tx_fw_stat_gstrings, UEC_RX_FW_STATS_LEN * 312 memcpy(buf, rx_fw_stat_gstrings, UEC_RX_FW_STATS_LEN *
312 ETH_GSTRING_LEN); 313 ETH_GSTRING_LEN);
313} 314}
314 315
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index fe7cdf2a2a23..5450eac9e263 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -47,6 +47,9 @@ struct virtnet_info
47 /* Number of input buffers, and max we've ever had. */ 47 /* Number of input buffers, and max we've ever had. */
48 unsigned int num, max; 48 unsigned int num, max;
49 49
50 /* For cleaning up after transmission. */
51 struct tasklet_struct tasklet;
52
50 /* Receive & send queues. */ 53 /* Receive & send queues. */
51 struct sk_buff_head recv; 54 struct sk_buff_head recv;
52 struct sk_buff_head send; 55 struct sk_buff_head send;
@@ -68,8 +71,13 @@ static void skb_xmit_done(struct virtqueue *svq)
68 71
69 /* Suppress further interrupts. */ 72 /* Suppress further interrupts. */
70 svq->vq_ops->disable_cb(svq); 73 svq->vq_ops->disable_cb(svq);
74
71 /* We were waiting for more output buffers. */ 75 /* We were waiting for more output buffers. */
72 netif_wake_queue(vi->dev); 76 netif_wake_queue(vi->dev);
77
78 /* Make sure we re-xmit last_xmit_skb: if there are no more packets
79 * queued, start_xmit won't be called. */
80 tasklet_schedule(&vi->tasklet);
73} 81}
74 82
75static void receive_skb(struct net_device *dev, struct sk_buff *skb, 83static void receive_skb(struct net_device *dev, struct sk_buff *skb,
@@ -278,6 +286,18 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
278 return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb); 286 return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
279} 287}
280 288
289static void xmit_tasklet(unsigned long data)
290{
291 struct virtnet_info *vi = (void *)data;
292
293 netif_tx_lock_bh(vi->dev);
294 if (vi->last_xmit_skb && xmit_skb(vi, vi->last_xmit_skb) == 0) {
295 vi->svq->vq_ops->kick(vi->svq);
296 vi->last_xmit_skb = NULL;
297 }
298 netif_tx_unlock_bh(vi->dev);
299}
300
281static int start_xmit(struct sk_buff *skb, struct net_device *dev) 301static int start_xmit(struct sk_buff *skb, struct net_device *dev)
282{ 302{
283 struct virtnet_info *vi = netdev_priv(dev); 303 struct virtnet_info *vi = netdev_priv(dev);
@@ -287,21 +307,25 @@ again:
287 free_old_xmit_skbs(vi); 307 free_old_xmit_skbs(vi);
288 308
289 /* If we has a buffer left over from last time, send it now. */ 309 /* If we has a buffer left over from last time, send it now. */
290 if (vi->last_xmit_skb) { 310 if (unlikely(vi->last_xmit_skb)) {
291 if (xmit_skb(vi, vi->last_xmit_skb) != 0) { 311 if (xmit_skb(vi, vi->last_xmit_skb) != 0) {
292 /* Drop this skb: we only queue one. */ 312 /* Drop this skb: we only queue one. */
293 vi->dev->stats.tx_dropped++; 313 vi->dev->stats.tx_dropped++;
294 kfree_skb(skb); 314 kfree_skb(skb);
315 skb = NULL;
295 goto stop_queue; 316 goto stop_queue;
296 } 317 }
297 vi->last_xmit_skb = NULL; 318 vi->last_xmit_skb = NULL;
298 } 319 }
299 320
300 /* Put new one in send queue and do transmit */ 321 /* Put new one in send queue and do transmit */
301 __skb_queue_head(&vi->send, skb); 322 if (likely(skb)) {
302 if (xmit_skb(vi, skb) != 0) { 323 __skb_queue_head(&vi->send, skb);
303 vi->last_xmit_skb = skb; 324 if (xmit_skb(vi, skb) != 0) {
304 goto stop_queue; 325 vi->last_xmit_skb = skb;
326 skb = NULL;
327 goto stop_queue;
328 }
305 } 329 }
306done: 330done:
307 vi->svq->vq_ops->kick(vi->svq); 331 vi->svq->vq_ops->kick(vi->svq);
@@ -428,6 +452,8 @@ static int virtnet_probe(struct virtio_device *vdev)
428 skb_queue_head_init(&vi->recv); 452 skb_queue_head_init(&vi->recv);
429 skb_queue_head_init(&vi->send); 453 skb_queue_head_init(&vi->send);
430 454
455 tasklet_init(&vi->tasklet, xmit_tasklet, (unsigned long)vi);
456
431 err = register_netdev(dev); 457 err = register_netdev(dev);
432 if (err) { 458 if (err) {
433 pr_debug("virtio_net: registering device failed\n"); 459 pr_debug("virtio_net: registering device failed\n");