diff options
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_main.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index cd4f42328dbe..ce0296273e76 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -356,18 +356,15 @@ static struct ipoib_path *path_rec_create(struct net_device *dev, | |||
356 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 356 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
357 | struct ipoib_path *path; | 357 | struct ipoib_path *path; |
358 | 358 | ||
359 | path = kmalloc(sizeof *path, GFP_ATOMIC); | 359 | path = kzalloc(sizeof *path, GFP_ATOMIC); |
360 | if (!path) | 360 | if (!path) |
361 | return NULL; | 361 | return NULL; |
362 | 362 | ||
363 | path->dev = dev; | 363 | path->dev = dev; |
364 | path->pathrec.dlid = 0; | ||
365 | path->ah = NULL; | ||
366 | 364 | ||
367 | skb_queue_head_init(&path->queue); | 365 | skb_queue_head_init(&path->queue); |
368 | 366 | ||
369 | INIT_LIST_HEAD(&path->neigh_list); | 367 | INIT_LIST_HEAD(&path->neigh_list); |
370 | path->query = NULL; | ||
371 | init_completion(&path->done); | 368 | init_completion(&path->done); |
372 | 369 | ||
373 | memcpy(path->pathrec.dgid.raw, gid->raw, sizeof (union ib_gid)); | 370 | memcpy(path->pathrec.dgid.raw, gid->raw, sizeof (union ib_gid)); |
@@ -551,11 +548,8 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
551 | struct ipoib_neigh *neigh; | 548 | struct ipoib_neigh *neigh; |
552 | unsigned long flags; | 549 | unsigned long flags; |
553 | 550 | ||
554 | local_irq_save(flags); | 551 | if (!spin_trylock_irqsave(&priv->tx_lock, flags)) |
555 | if (!spin_trylock(&priv->tx_lock)) { | ||
556 | local_irq_restore(flags); | ||
557 | return NETDEV_TX_LOCKED; | 552 | return NETDEV_TX_LOCKED; |
558 | } | ||
559 | 553 | ||
560 | /* | 554 | /* |
561 | * Check if our queue is stopped. Since we have the LLTX bit | 555 | * Check if our queue is stopped. Since we have the LLTX bit |
@@ -732,25 +726,21 @@ int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port) | |||
732 | 726 | ||
733 | /* Allocate RX/TX "rings" to hold queued skbs */ | 727 | /* Allocate RX/TX "rings" to hold queued skbs */ |
734 | 728 | ||
735 | priv->rx_ring = kmalloc(IPOIB_RX_RING_SIZE * sizeof (struct ipoib_rx_buf), | 729 | priv->rx_ring = kzalloc(IPOIB_RX_RING_SIZE * sizeof (struct ipoib_rx_buf), |
736 | GFP_KERNEL); | 730 | GFP_KERNEL); |
737 | if (!priv->rx_ring) { | 731 | if (!priv->rx_ring) { |
738 | printk(KERN_WARNING "%s: failed to allocate RX ring (%d entries)\n", | 732 | printk(KERN_WARNING "%s: failed to allocate RX ring (%d entries)\n", |
739 | ca->name, IPOIB_RX_RING_SIZE); | 733 | ca->name, IPOIB_RX_RING_SIZE); |
740 | goto out; | 734 | goto out; |
741 | } | 735 | } |
742 | memset(priv->rx_ring, 0, | ||
743 | IPOIB_RX_RING_SIZE * sizeof (struct ipoib_rx_buf)); | ||
744 | 736 | ||
745 | priv->tx_ring = kmalloc(IPOIB_TX_RING_SIZE * sizeof (struct ipoib_tx_buf), | 737 | priv->tx_ring = kzalloc(IPOIB_TX_RING_SIZE * sizeof (struct ipoib_tx_buf), |
746 | GFP_KERNEL); | 738 | GFP_KERNEL); |
747 | if (!priv->tx_ring) { | 739 | if (!priv->tx_ring) { |
748 | printk(KERN_WARNING "%s: failed to allocate TX ring (%d entries)\n", | 740 | printk(KERN_WARNING "%s: failed to allocate TX ring (%d entries)\n", |
749 | ca->name, IPOIB_TX_RING_SIZE); | 741 | ca->name, IPOIB_TX_RING_SIZE); |
750 | goto out_rx_ring_cleanup; | 742 | goto out_rx_ring_cleanup; |
751 | } | 743 | } |
752 | memset(priv->tx_ring, 0, | ||
753 | IPOIB_TX_RING_SIZE * sizeof (struct ipoib_tx_buf)); | ||
754 | 744 | ||
755 | /* priv->tx_head & tx_tail are already 0 */ | 745 | /* priv->tx_head & tx_tail are already 0 */ |
756 | 746 | ||
@@ -807,10 +797,6 @@ static void ipoib_setup(struct net_device *dev) | |||
807 | 797 | ||
808 | dev->watchdog_timeo = HZ; | 798 | dev->watchdog_timeo = HZ; |
809 | 799 | ||
810 | dev->rebuild_header = NULL; | ||
811 | dev->set_mac_address = NULL; | ||
812 | dev->header_cache_update = NULL; | ||
813 | |||
814 | dev->flags |= IFF_BROADCAST | IFF_MULTICAST; | 800 | dev->flags |= IFF_BROADCAST | IFF_MULTICAST; |
815 | 801 | ||
816 | /* | 802 | /* |