diff options
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_main.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx4/main.c | 13 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_cm.c | 12 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_utils.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 38 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/Kconfig | 2 | ||||
-rw-r--r-- | drivers/net/mlx4/main.c | 4 |
8 files changed, 47 insertions, 31 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index 3b77b674cbf6..c7b8a506af65 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -955,7 +955,7 @@ void ehca_poll_eqs(unsigned long data) | |||
955 | struct ehca_eq *eq = &shca->eq; | 955 | struct ehca_eq *eq = &shca->eq; |
956 | int max = 3; | 956 | int max = 3; |
957 | volatile u64 q_ofs, q_ofs2; | 957 | volatile u64 q_ofs, q_ofs2; |
958 | u64 flags; | 958 | unsigned long flags; |
959 | spin_lock_irqsave(&eq->spinlock, flags); | 959 | spin_lock_irqsave(&eq->spinlock, flags); |
960 | q_ofs = eq->ipz_queue.current_q_offset; | 960 | q_ofs = eq->ipz_queue.current_q_offset; |
961 | spin_unlock_irqrestore(&eq->spinlock, flags); | 961 | spin_unlock_irqrestore(&eq->spinlock, flags); |
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index dcefe1fceb5c..61588bd273bd 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -543,14 +543,21 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
543 | { | 543 | { |
544 | static int mlx4_ib_version_printed; | 544 | static int mlx4_ib_version_printed; |
545 | struct mlx4_ib_dev *ibdev; | 545 | struct mlx4_ib_dev *ibdev; |
546 | int num_ports = 0; | ||
546 | int i; | 547 | int i; |
547 | 548 | ||
548 | |||
549 | if (!mlx4_ib_version_printed) { | 549 | if (!mlx4_ib_version_printed) { |
550 | printk(KERN_INFO "%s", mlx4_ib_version); | 550 | printk(KERN_INFO "%s", mlx4_ib_version); |
551 | ++mlx4_ib_version_printed; | 551 | ++mlx4_ib_version_printed; |
552 | } | 552 | } |
553 | 553 | ||
554 | mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB) | ||
555 | num_ports++; | ||
556 | |||
557 | /* No point in registering a device with no ports... */ | ||
558 | if (num_ports == 0) | ||
559 | return NULL; | ||
560 | |||
554 | ibdev = (struct mlx4_ib_dev *) ib_alloc_device(sizeof *ibdev); | 561 | ibdev = (struct mlx4_ib_dev *) ib_alloc_device(sizeof *ibdev); |
555 | if (!ibdev) { | 562 | if (!ibdev) { |
556 | dev_err(&dev->pdev->dev, "Device struct alloc failed\n"); | 563 | dev_err(&dev->pdev->dev, "Device struct alloc failed\n"); |
@@ -574,9 +581,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
574 | ibdev->ib_dev.owner = THIS_MODULE; | 581 | ibdev->ib_dev.owner = THIS_MODULE; |
575 | ibdev->ib_dev.node_type = RDMA_NODE_IB_CA; | 582 | ibdev->ib_dev.node_type = RDMA_NODE_IB_CA; |
576 | ibdev->ib_dev.local_dma_lkey = dev->caps.reserved_lkey; | 583 | ibdev->ib_dev.local_dma_lkey = dev->caps.reserved_lkey; |
577 | ibdev->num_ports = 0; | 584 | ibdev->num_ports = num_ports; |
578 | mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB) | ||
579 | ibdev->num_ports++; | ||
580 | ibdev->ib_dev.phys_port_cnt = ibdev->num_ports; | 585 | ibdev->ib_dev.phys_port_cnt = ibdev->num_ports; |
581 | ibdev->ib_dev.num_comp_vectors = dev->caps.num_comp_vectors; | 586 | ibdev->ib_dev.num_comp_vectors = dev->caps.num_comp_vectors; |
582 | ibdev->ib_dev.dma_device = &dev->pdev->dev; | 587 | ibdev->ib_dev.dma_device = &dev->pdev->dev; |
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 6ba57e91d7ab..a01b4488208b 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c | |||
@@ -778,12 +778,13 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core, | |||
778 | unsigned long flags; | 778 | unsigned long flags; |
779 | struct list_head *hte; | 779 | struct list_head *hte; |
780 | struct nes_cm_node *cm_node; | 780 | struct nes_cm_node *cm_node; |
781 | __be32 tmp_addr = cpu_to_be32(loc_addr); | ||
781 | 782 | ||
782 | /* get a handle on the hte */ | 783 | /* get a handle on the hte */ |
783 | hte = &cm_core->connected_nodes; | 784 | hte = &cm_core->connected_nodes; |
784 | 785 | ||
785 | nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n", | 786 | nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n", |
786 | &loc_addr, loc_port, cm_core, hte); | 787 | &tmp_addr, loc_port, cm_core, hte); |
787 | 788 | ||
788 | /* walk list and find cm_node associated with this session ID */ | 789 | /* walk list and find cm_node associated with this session ID */ |
789 | spin_lock_irqsave(&cm_core->ht_lock, flags); | 790 | spin_lock_irqsave(&cm_core->ht_lock, flags); |
@@ -816,6 +817,7 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core, | |||
816 | { | 817 | { |
817 | unsigned long flags; | 818 | unsigned long flags; |
818 | struct nes_cm_listener *listen_node; | 819 | struct nes_cm_listener *listen_node; |
820 | __be32 tmp_addr = cpu_to_be32(dst_addr); | ||
819 | 821 | ||
820 | /* walk list and find cm_node associated with this session ID */ | 822 | /* walk list and find cm_node associated with this session ID */ |
821 | spin_lock_irqsave(&cm_core->listen_list_lock, flags); | 823 | spin_lock_irqsave(&cm_core->listen_list_lock, flags); |
@@ -833,7 +835,7 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core, | |||
833 | spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); | 835 | spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); |
834 | 836 | ||
835 | nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n", | 837 | nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n", |
836 | &dst_addr, dst_port); | 838 | &tmp_addr, dst_port); |
837 | 839 | ||
838 | /* no listener */ | 840 | /* no listener */ |
839 | return NULL; | 841 | return NULL; |
@@ -2059,6 +2061,7 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core, | |||
2059 | struct tcphdr *tcph; | 2061 | struct tcphdr *tcph; |
2060 | struct nes_cm_info nfo; | 2062 | struct nes_cm_info nfo; |
2061 | int skb_handled = 1; | 2063 | int skb_handled = 1; |
2064 | __be32 tmp_daddr, tmp_saddr; | ||
2062 | 2065 | ||
2063 | if (!skb) | 2066 | if (!skb) |
2064 | return 0; | 2067 | return 0; |
@@ -2074,8 +2077,11 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core, | |||
2074 | nfo.rem_addr = ntohl(iph->saddr); | 2077 | nfo.rem_addr = ntohl(iph->saddr); |
2075 | nfo.rem_port = ntohs(tcph->source); | 2078 | nfo.rem_port = ntohs(tcph->source); |
2076 | 2079 | ||
2080 | tmp_daddr = cpu_to_be32(iph->daddr); | ||
2081 | tmp_saddr = cpu_to_be32(iph->saddr); | ||
2082 | |||
2077 | nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n", | 2083 | nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n", |
2078 | &iph->daddr, tcph->dest, &iph->saddr, tcph->source); | 2084 | &tmp_daddr, tcph->dest, &tmp_saddr, tcph->source); |
2079 | 2085 | ||
2080 | do { | 2086 | do { |
2081 | cm_node = find_node(cm_core, | 2087 | cm_node = find_node(cm_core, |
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c index aa9b7348c728..6f3bc1b6bf22 100644 --- a/drivers/infiniband/hw/nes/nes_utils.c +++ b/drivers/infiniband/hw/nes/nes_utils.c | |||
@@ -655,6 +655,7 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti | |||
655 | struct nes_adapter *nesadapter = nesdev->nesadapter; | 655 | struct nes_adapter *nesadapter = nesdev->nesadapter; |
656 | int arp_index; | 656 | int arp_index; |
657 | int err = 0; | 657 | int err = 0; |
658 | __be32 tmp_addr; | ||
658 | 659 | ||
659 | for (arp_index = 0; (u32) arp_index < nesadapter->arp_table_size; arp_index++) { | 660 | for (arp_index = 0; (u32) arp_index < nesadapter->arp_table_size; arp_index++) { |
660 | if (nesadapter->arp_table[arp_index].ip_addr == ip_addr) | 661 | if (nesadapter->arp_table[arp_index].ip_addr == ip_addr) |
@@ -682,8 +683,9 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti | |||
682 | 683 | ||
683 | /* DELETE or RESOLVE */ | 684 | /* DELETE or RESOLVE */ |
684 | if (arp_index == nesadapter->arp_table_size) { | 685 | if (arp_index == nesadapter->arp_table_size) { |
686 | tmp_addr = cpu_to_be32(ip_addr); | ||
685 | nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n", | 687 | nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n", |
686 | &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete"); | 688 | &tmp_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete"); |
687 | return -1; | 689 | return -1; |
688 | } | 690 | } |
689 | 691 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 19e06bc38b39..dce0443f9d69 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -711,26 +711,26 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
711 | 711 | ||
712 | neigh = *to_ipoib_neigh(skb->dst->neighbour); | 712 | neigh = *to_ipoib_neigh(skb->dst->neighbour); |
713 | 713 | ||
714 | if (neigh->ah) | 714 | if (unlikely((memcmp(&neigh->dgid.raw, |
715 | if (unlikely((memcmp(&neigh->dgid.raw, | 715 | skb->dst->neighbour->ha + 4, |
716 | skb->dst->neighbour->ha + 4, | 716 | sizeof(union ib_gid))) || |
717 | sizeof(union ib_gid))) || | 717 | (neigh->dev != dev))) { |
718 | (neigh->dev != dev))) { | 718 | spin_lock_irqsave(&priv->lock, flags); |
719 | spin_lock_irqsave(&priv->lock, flags); | 719 | /* |
720 | /* | 720 | * It's safe to call ipoib_put_ah() inside |
721 | * It's safe to call ipoib_put_ah() inside | 721 | * priv->lock here, because we know that |
722 | * priv->lock here, because we know that | 722 | * path->ah will always hold one more reference, |
723 | * path->ah will always hold one more reference, | 723 | * so ipoib_put_ah() will never do more than |
724 | * so ipoib_put_ah() will never do more than | 724 | * decrement the ref count. |
725 | * decrement the ref count. | 725 | */ |
726 | */ | 726 | if (neigh->ah) |
727 | ipoib_put_ah(neigh->ah); | 727 | ipoib_put_ah(neigh->ah); |
728 | list_del(&neigh->list); | 728 | list_del(&neigh->list); |
729 | ipoib_neigh_free(dev, neigh); | 729 | ipoib_neigh_free(dev, neigh); |
730 | spin_unlock_irqrestore(&priv->lock, flags); | 730 | spin_unlock_irqrestore(&priv->lock, flags); |
731 | ipoib_path_lookup(skb, dev); | 731 | ipoib_path_lookup(skb, dev); |
732 | return NETDEV_TX_OK; | 732 | return NETDEV_TX_OK; |
733 | } | 733 | } |
734 | 734 | ||
735 | if (ipoib_cm_get(neigh)) { | 735 | if (ipoib_cm_get(neigh)) { |
736 | if (ipoib_cm_up(neigh)) { | 736 | if (ipoib_cm_up(neigh)) { |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index a2eb3b9789eb..59d02e0b8df1 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -529,6 +529,9 @@ void ipoib_mcast_join_task(struct work_struct *work) | |||
529 | if (!priv->broadcast) { | 529 | if (!priv->broadcast) { |
530 | struct ipoib_mcast *broadcast; | 530 | struct ipoib_mcast *broadcast; |
531 | 531 | ||
532 | if (!test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) | ||
533 | return; | ||
534 | |||
532 | broadcast = ipoib_mcast_alloc(dev, 1); | 535 | broadcast = ipoib_mcast_alloc(dev, 1); |
533 | if (!broadcast) { | 536 | if (!broadcast) { |
534 | ipoib_warn(priv, "failed to allocate broadcast group\n"); | 537 | ipoib_warn(priv, "failed to allocate broadcast group\n"); |
diff --git a/drivers/infiniband/ulp/iser/Kconfig b/drivers/infiniband/ulp/iser/Kconfig index 77dedba829e6..b411c51842da 100644 --- a/drivers/infiniband/ulp/iser/Kconfig +++ b/drivers/infiniband/ulp/iser/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config INFINIBAND_ISER | 1 | config INFINIBAND_ISER |
2 | tristate "iSCSI Extensions for RDMA (iSER)" | 2 | tristate "iSCSI Extensions for RDMA (iSER)" |
3 | depends on SCSI && INET | 3 | depends on SCSI && INET && INFINIBAND_ADDR_TRANS |
4 | select SCSI_ISCSI_ATTRS | 4 | select SCSI_ISCSI_ATTRS |
5 | ---help--- | 5 | ---help--- |
6 | Support for the iSCSI Extensions for RDMA (iSER) Protocol | 6 | Support for the iSCSI Extensions for RDMA (iSER) Protocol |
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 710c79e7a2db..6ef2490d5c3e 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
@@ -912,8 +912,8 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) | |||
912 | int i; | 912 | int i; |
913 | 913 | ||
914 | if (msi_x) { | 914 | if (msi_x) { |
915 | nreq = min(dev->caps.num_eqs - dev->caps.reserved_eqs, | 915 | nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, |
916 | num_possible_cpus() + 1); | 916 | num_possible_cpus() + 1); |
917 | entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); | 917 | entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); |
918 | if (!entries) | 918 | if (!entries) |
919 | goto no_msi; | 919 | goto no_msi; |