aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/amso1100/c2_provider.c8
-rw-r--r--drivers/infiniband/hw/mthca/mthca_mcg.c23
-rw-r--r--drivers/infiniband/hw/nes/nes.c17
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c31
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c2
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c13
-rw-r--r--drivers/infiniband/hw/nes/nes_utils.c5
7 files changed, 32 insertions, 67 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2_provider.c b/drivers/infiniband/hw/amso1100/c2_provider.c
index 69580e282af0..5119d6508181 100644
--- a/drivers/infiniband/hw/amso1100/c2_provider.c
+++ b/drivers/infiniband/hw/amso1100/c2_provider.c
@@ -653,7 +653,7 @@ static int c2_service_destroy(struct iw_cm_id *cm_id)
653static int c2_pseudo_up(struct net_device *netdev) 653static int c2_pseudo_up(struct net_device *netdev)
654{ 654{
655 struct in_device *ind; 655 struct in_device *ind;
656 struct c2_dev *c2dev = netdev->priv; 656 struct c2_dev *c2dev = netdev->ml_priv;
657 657
658 ind = in_dev_get(netdev); 658 ind = in_dev_get(netdev);
659 if (!ind) 659 if (!ind)
@@ -678,7 +678,7 @@ static int c2_pseudo_up(struct net_device *netdev)
678static int c2_pseudo_down(struct net_device *netdev) 678static int c2_pseudo_down(struct net_device *netdev)
679{ 679{
680 struct in_device *ind; 680 struct in_device *ind;
681 struct c2_dev *c2dev = netdev->priv; 681 struct c2_dev *c2dev = netdev->ml_priv;
682 682
683 ind = in_dev_get(netdev); 683 ind = in_dev_get(netdev);
684 if (!ind) 684 if (!ind)
@@ -746,14 +746,14 @@ static struct net_device *c2_pseudo_netdev_init(struct c2_dev *c2dev)
746 /* change ethxxx to iwxxx */ 746 /* change ethxxx to iwxxx */
747 strcpy(name, "iw"); 747 strcpy(name, "iw");
748 strcat(name, &c2dev->netdev->name[3]); 748 strcat(name, &c2dev->netdev->name[3]);
749 netdev = alloc_netdev(sizeof(*netdev), name, setup); 749 netdev = alloc_netdev(0, name, setup);
750 if (!netdev) { 750 if (!netdev) {
751 printk(KERN_ERR PFX "%s - etherdev alloc failed", 751 printk(KERN_ERR PFX "%s - etherdev alloc failed",
752 __func__); 752 __func__);
753 return NULL; 753 return NULL;
754 } 754 }
755 755
756 netdev->priv = c2dev; 756 netdev->ml_priv = c2dev;
757 757
758 SET_NETDEV_DEV(netdev, &c2dev->pcidev->dev); 758 SET_NETDEV_DEV(netdev, &c2dev->pcidev->dev);
759 759
diff --git a/drivers/infiniband/hw/mthca/mthca_mcg.c b/drivers/infiniband/hw/mthca/mthca_mcg.c
index 3f5f94879208..d4c81053e439 100644
--- a/drivers/infiniband/hw/mthca/mthca_mcg.c
+++ b/drivers/infiniband/hw/mthca/mthca_mcg.c
@@ -87,17 +87,7 @@ static int find_mgm(struct mthca_dev *dev,
87 } 87 }
88 88
89 if (0) 89 if (0)
90 mthca_dbg(dev, "Hash for %04x:%04x:%04x:%04x:" 90 mthca_dbg(dev, "Hash for %pI6 is %04x\n", gid, *hash);
91 "%04x:%04x:%04x:%04x is %04x\n",
92 be16_to_cpu(((__be16 *) gid)[0]),
93 be16_to_cpu(((__be16 *) gid)[1]),
94 be16_to_cpu(((__be16 *) gid)[2]),
95 be16_to_cpu(((__be16 *) gid)[3]),
96 be16_to_cpu(((__be16 *) gid)[4]),
97 be16_to_cpu(((__be16 *) gid)[5]),
98 be16_to_cpu(((__be16 *) gid)[6]),
99 be16_to_cpu(((__be16 *) gid)[7]),
100 *hash);
101 91
102 *index = *hash; 92 *index = *hash;
103 *prev = -1; 93 *prev = -1;
@@ -264,16 +254,7 @@ int mthca_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
264 goto out; 254 goto out;
265 255
266 if (index == -1) { 256 if (index == -1) {
267 mthca_err(dev, "MGID %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x " 257 mthca_err(dev, "MGID %pI6 not found\n", gid->raw);
268 "not found\n",
269 be16_to_cpu(((__be16 *) gid->raw)[0]),
270 be16_to_cpu(((__be16 *) gid->raw)[1]),
271 be16_to_cpu(((__be16 *) gid->raw)[2]),
272 be16_to_cpu(((__be16 *) gid->raw)[3]),
273 be16_to_cpu(((__be16 *) gid->raw)[4]),
274 be16_to_cpu(((__be16 *) gid->raw)[5]),
275 be16_to_cpu(((__be16 *) gid->raw)[6]),
276 be16_to_cpu(((__be16 *) gid->raw)[7]));
277 err = -EINVAL; 258 err = -EINVAL;
278 goto out; 259 goto out;
279 } 260 }
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index aa1dc41f04c8..b9611ade9eab 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -142,14 +142,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
142 struct nes_device *nesdev; 142 struct nes_device *nesdev;
143 struct net_device *netdev; 143 struct net_device *netdev;
144 struct nes_vnic *nesvnic; 144 struct nes_vnic *nesvnic;
145 unsigned int addr; 145
146 unsigned int mask; 146 nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address %pI4, netmask %pI4.\n",
147 147 &ifa->ifa_address, &ifa->ifa_mask);
148 addr = ntohl(ifa->ifa_address);
149 mask = ntohl(ifa->ifa_mask);
150 nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address " NIPQUAD_FMT
151 ", netmask " NIPQUAD_FMT ".\n",
152 HIPQUAD(addr), HIPQUAD(mask));
153 list_for_each_entry(nesdev, &nes_dev_list, list) { 148 list_for_each_entry(nesdev, &nes_dev_list, list) {
154 nes_debug(NES_DBG_NETDEV, "Nesdev list entry = 0x%p. (%s)\n", 149 nes_debug(NES_DBG_NETDEV, "Nesdev list entry = 0x%p. (%s)\n",
155 nesdev, nesdev->netdev[0]->name); 150 nesdev, nesdev->netdev[0]->name);
@@ -360,10 +355,8 @@ struct ib_qp *nes_get_qp(struct ib_device *device, int qpn)
360 */ 355 */
361static void nes_print_macaddr(struct net_device *netdev) 356static void nes_print_macaddr(struct net_device *netdev)
362{ 357{
363 DECLARE_MAC_BUF(mac); 358 nes_debug(NES_DBG_INIT, "%s: %pM, IRQ %u\n",
364 359 netdev->name, netdev->dev_addr, netdev->irq);
365 nes_debug(NES_DBG_INIT, "%s: %s, IRQ %u\n",
366 netdev->name, print_mac(mac, netdev->dev_addr), netdev->irq);
367} 360}
368 361
369/** 362/**
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index cb48041bed69..a812db243477 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -782,8 +782,8 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core,
782 /* get a handle on the hte */ 782 /* get a handle on the hte */
783 hte = &cm_core->connected_nodes; 783 hte = &cm_core->connected_nodes;
784 784
785 nes_debug(NES_DBG_CM, "Searching for an owner node: " NIPQUAD_FMT ":%x from core %p->%p\n", 785 nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n",
786 HIPQUAD(loc_addr), loc_port, cm_core, hte); 786 &loc_addr, loc_port, cm_core, hte);
787 787
788 /* walk list and find cm_node associated with this session ID */ 788 /* walk list and find cm_node associated with this session ID */
789 spin_lock_irqsave(&cm_core->ht_lock, flags); 789 spin_lock_irqsave(&cm_core->ht_lock, flags);
@@ -832,8 +832,8 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core,
832 } 832 }
833 spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); 833 spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
834 834
835 nes_debug(NES_DBG_CM, "Unable to find listener for " NIPQUAD_FMT ":%x\n", 835 nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n",
836 HIPQUAD(dst_addr), dst_port); 836 &dst_addr, dst_port);
837 837
838 /* no listener */ 838 /* no listener */
839 return NULL; 839 return NULL;
@@ -988,7 +988,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip)
988 struct flowi fl; 988 struct flowi fl;
989 struct neighbour *neigh; 989 struct neighbour *neigh;
990 int rc = -1; 990 int rc = -1;
991 DECLARE_MAC_BUF(mac);
992 991
993 memset(&fl, 0, sizeof fl); 992 memset(&fl, 0, sizeof fl);
994 fl.nl_u.ip4_u.daddr = htonl(dst_ip); 993 fl.nl_u.ip4_u.daddr = htonl(dst_ip);
@@ -1002,8 +1001,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip)
1002 if (neigh) { 1001 if (neigh) {
1003 if (neigh->nud_state & NUD_VALID) { 1002 if (neigh->nud_state & NUD_VALID) {
1004 nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X" 1003 nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"
1005 " is %s, Gateway is 0x%08X \n", dst_ip, 1004 " is %pM, Gateway is 0x%08X \n", dst_ip,
1006 print_mac(mac, neigh->ha), ntohl(rt->rt_gateway)); 1005 neigh->ha, ntohl(rt->rt_gateway));
1007 nes_manage_arp_cache(nesvnic->netdev, neigh->ha, 1006 nes_manage_arp_cache(nesvnic->netdev, neigh->ha,
1008 dst_ip, NES_ARP_ADD); 1007 dst_ip, NES_ARP_ADD);
1009 rc = nes_arp_table(nesvnic->nesdev, dst_ip, NULL, 1008 rc = nes_arp_table(nesvnic->nesdev, dst_ip, NULL,
@@ -1032,7 +1031,6 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
1032 int arpindex = 0; 1031 int arpindex = 0;
1033 struct nes_device *nesdev; 1032 struct nes_device *nesdev;
1034 struct nes_adapter *nesadapter; 1033 struct nes_adapter *nesadapter;
1035 DECLARE_MAC_BUF(mac);
1036 1034
1037 /* create an hte and cm_node for this instance */ 1035 /* create an hte and cm_node for this instance */
1038 cm_node = kzalloc(sizeof(*cm_node), GFP_ATOMIC); 1036 cm_node = kzalloc(sizeof(*cm_node), GFP_ATOMIC);
@@ -1045,10 +1043,9 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
1045 cm_node->loc_port = cm_info->loc_port; 1043 cm_node->loc_port = cm_info->loc_port;
1046 cm_node->rem_port = cm_info->rem_port; 1044 cm_node->rem_port = cm_info->rem_port;
1047 cm_node->send_write0 = send_first; 1045 cm_node->send_write0 = send_first;
1048 nes_debug(NES_DBG_CM, "Make node addresses : loc = " NIPQUAD_FMT 1046 nes_debug(NES_DBG_CM, "Make node addresses : loc = %pI4:%x, rem = %pI4:%x\n",
1049 ":%x, rem = " NIPQUAD_FMT ":%x\n", 1047 &cm_node->loc_addr, cm_node->loc_port,
1050 HIPQUAD(cm_node->loc_addr), cm_node->loc_port, 1048 &cm_node->rem_addr, cm_node->rem_port);
1051 HIPQUAD(cm_node->rem_addr), cm_node->rem_port);
1052 cm_node->listener = listener; 1049 cm_node->listener = listener;
1053 cm_node->netdev = nesvnic->netdev; 1050 cm_node->netdev = nesvnic->netdev;
1054 cm_node->cm_id = cm_info->cm_id; 1051 cm_node->cm_id = cm_info->cm_id;
@@ -1101,8 +1098,8 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
1101 1098
1102 /* copy the mac addr to node context */ 1099 /* copy the mac addr to node context */
1103 memcpy(cm_node->rem_mac, nesadapter->arp_table[arpindex].mac_addr, ETH_ALEN); 1100 memcpy(cm_node->rem_mac, nesadapter->arp_table[arpindex].mac_addr, ETH_ALEN);
1104 nes_debug(NES_DBG_CM, "Remote mac addr from arp table: %s\n", 1101 nes_debug(NES_DBG_CM, "Remote mac addr from arp table: %pM\n",
1105 print_mac(mac, cm_node->rem_mac)); 1102 cm_node->rem_mac);
1106 1103
1107 add_hte_node(cm_core, cm_node); 1104 add_hte_node(cm_core, cm_node);
1108 atomic_inc(&cm_nodes_created); 1105 atomic_inc(&cm_nodes_created);
@@ -2077,10 +2074,8 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core,
2077 nfo.rem_addr = ntohl(iph->saddr); 2074 nfo.rem_addr = ntohl(iph->saddr);
2078 nfo.rem_port = ntohs(tcph->source); 2075 nfo.rem_port = ntohs(tcph->source);
2079 2076
2080 nes_debug(NES_DBG_CM, "Received packet: dest=" NIPQUAD_FMT 2077 nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n",
2081 ":0x%04X src=" NIPQUAD_FMT ":0x%04X\n", 2078 &iph->daddr, tcph->dest, &iph->saddr, tcph->source);
2082 NIPQUAD(iph->daddr), tcph->dest,
2083 NIPQUAD(iph->saddr), tcph->source);
2084 2079
2085 do { 2080 do {
2086 cm_node = find_node(cm_core, 2081 cm_node = find_node(cm_core,
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index 8f70ff2dcc58..5d139db1b771 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -2541,7 +2541,7 @@ static void nes_nic_napi_ce_handler(struct nes_device *nesdev, struct nes_hw_nic
2541{ 2541{
2542 struct nes_vnic *nesvnic = container_of(cq, struct nes_vnic, nic_cq); 2542 struct nes_vnic *nesvnic = container_of(cq, struct nes_vnic, nic_cq);
2543 2543
2544 netif_rx_schedule(nesdev->netdev[nesvnic->netdev_index], &nesvnic->napi); 2544 netif_rx_schedule(&nesvnic->napi);
2545} 2545}
2546 2546
2547 2547
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 730358637bb6..57a47cf7e513 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -99,7 +99,6 @@ static int nics_per_function = 1;
99static int nes_netdev_poll(struct napi_struct *napi, int budget) 99static int nes_netdev_poll(struct napi_struct *napi, int budget)
100{ 100{
101 struct nes_vnic *nesvnic = container_of(napi, struct nes_vnic, napi); 101 struct nes_vnic *nesvnic = container_of(napi, struct nes_vnic, napi);
102 struct net_device *netdev = nesvnic->netdev;
103 struct nes_device *nesdev = nesvnic->nesdev; 102 struct nes_device *nesdev = nesvnic->nesdev;
104 struct nes_hw_nic_cq *nescq = &nesvnic->nic_cq; 103 struct nes_hw_nic_cq *nescq = &nesvnic->nic_cq;
105 104
@@ -112,7 +111,7 @@ static int nes_netdev_poll(struct napi_struct *napi, int budget)
112 nes_nic_ce_handler(nesdev, nescq); 111 nes_nic_ce_handler(nesdev, nescq);
113 112
114 if (nescq->cqes_pending == 0) { 113 if (nescq->cqes_pending == 0) {
115 netif_rx_complete(netdev, napi); 114 netif_rx_complete(napi);
116 /* clear out completed cqes and arm */ 115 /* clear out completed cqes and arm */
117 nes_write32(nesdev->regs+NES_CQE_ALLOC, NES_CQE_ALLOC_NOTIFY_NEXT | 116 nes_write32(nesdev->regs+NES_CQE_ALLOC, NES_CQE_ALLOC_NOTIFY_NEXT |
118 nescq->cq_number | (nescq->cqe_allocs_pending << 16)); 117 nescq->cq_number | (nescq->cqe_allocs_pending << 16));
@@ -797,14 +796,13 @@ static int nes_netdev_set_mac_address(struct net_device *netdev, void *p)
797 int i; 796 int i;
798 u32 macaddr_low; 797 u32 macaddr_low;
799 u16 macaddr_high; 798 u16 macaddr_high;
800 DECLARE_MAC_BUF(mac);
801 799
802 if (!is_valid_ether_addr(mac_addr->sa_data)) 800 if (!is_valid_ether_addr(mac_addr->sa_data))
803 return -EADDRNOTAVAIL; 801 return -EADDRNOTAVAIL;
804 802
805 memcpy(netdev->dev_addr, mac_addr->sa_data, netdev->addr_len); 803 memcpy(netdev->dev_addr, mac_addr->sa_data, netdev->addr_len);
806 printk(PFX "%s: Address length = %d, Address = %s\n", 804 printk(PFX "%s: Address length = %d, Address = %pM\n",
807 __func__, netdev->addr_len, print_mac(mac, mac_addr->sa_data)); 805 __func__, netdev->addr_len, mac_addr->sa_data);
808 macaddr_high = ((u16)netdev->dev_addr[0]) << 8; 806 macaddr_high = ((u16)netdev->dev_addr[0]) << 8;
809 macaddr_high += (u16)netdev->dev_addr[1]; 807 macaddr_high += (u16)netdev->dev_addr[1];
810 macaddr_low = ((u32)netdev->dev_addr[2]) << 24; 808 macaddr_low = ((u32)netdev->dev_addr[2]) << 24;
@@ -909,9 +907,8 @@ static void nes_netdev_set_multicast_list(struct net_device *netdev)
909 if (mc_index >= max_pft_entries_avaiable) 907 if (mc_index >= max_pft_entries_avaiable)
910 break; 908 break;
911 if (multicast_addr) { 909 if (multicast_addr) {
912 DECLARE_MAC_BUF(mac); 910 nes_debug(NES_DBG_NIC_RX, "Assigning MC Address %pM to register 0x%04X nic_idx=%d\n",
913 nes_debug(NES_DBG_NIC_RX, "Assigning MC Address %s to register 0x%04X nic_idx=%d\n", 911 multicast_addr->dmi_addr,
914 print_mac(mac, multicast_addr->dmi_addr),
915 perfect_filter_register_address+(mc_index * 8), 912 perfect_filter_register_address+(mc_index * 8),
916 mc_nic_index); 913 mc_nic_index);
917 macaddr_high = ((u16)multicast_addr->dmi_addr[0]) << 8; 914 macaddr_high = ((u16)multicast_addr->dmi_addr[0]) << 8;
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
index 5611a73d5831..aa9b7348c728 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -682,9 +682,8 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti
682 682
683 /* DELETE or RESOLVE */ 683 /* DELETE or RESOLVE */
684 if (arp_index == nesadapter->arp_table_size) { 684 if (arp_index == nesadapter->arp_table_size) {
685 nes_debug(NES_DBG_NETDEV, "MAC for " NIPQUAD_FMT " not in ARP table - cannot %s\n", 685 nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n",
686 HIPQUAD(ip_addr), 686 &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete");
687 action == NES_ARP_RESOLVE ? "resolve" : "delete");
688 return -1; 687 return -1;
689 } 688 }
690 689