aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorMaciej Sosnowski <maciej.sosnowski@intel.com>2010-11-24 12:29:30 -0500
committerRoland Dreier <rolandd@cisco.com>2011-01-16 16:23:33 -0500
commit2a4c97ead4b375a64063523210939b87ad225b85 (patch)
treebe408f5b7e31d24e0fe3dc98612c2a1afec4e260 /drivers/infiniband/hw
parent4162cf64973df51fc885825bc9ca4d055891c49f (diff)
RDMA/nes: Fix bonding on iw_nes
Enable configuring bonds on nes devices by adding missing support for master net_device to the driver. Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/nes/nes.c24
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c8
2 files changed, 26 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index 0c9f0aa5d4ea..e17f52c21947 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -144,6 +144,7 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
144 struct nes_device *nesdev; 144 struct nes_device *nesdev;
145 struct net_device *netdev; 145 struct net_device *netdev;
146 struct nes_vnic *nesvnic; 146 struct nes_vnic *nesvnic;
147 unsigned int is_bonded;
147 148
148 nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address %pI4, netmask %pI4.\n", 149 nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address %pI4, netmask %pI4.\n",
149 &ifa->ifa_address, &ifa->ifa_mask); 150 &ifa->ifa_address, &ifa->ifa_mask);
@@ -152,7 +153,8 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
152 nesdev, nesdev->netdev[0]->name); 153 nesdev, nesdev->netdev[0]->name);
153 netdev = nesdev->netdev[0]; 154 netdev = nesdev->netdev[0];
154 nesvnic = netdev_priv(netdev); 155 nesvnic = netdev_priv(netdev);
155 if (netdev == event_netdev) { 156 is_bonded = (netdev->master == event_netdev);
157 if ((netdev == event_netdev) || is_bonded) {
156 if (nesvnic->rdma_enabled == 0) { 158 if (nesvnic->rdma_enabled == 0) {
157 nes_debug(NES_DBG_NETDEV, "Returning without processing event for %s since" 159 nes_debug(NES_DBG_NETDEV, "Returning without processing event for %s since"
158 " RDMA is not enabled.\n", 160 " RDMA is not enabled.\n",
@@ -169,7 +171,10 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
169 nes_manage_arp_cache(netdev, netdev->dev_addr, 171 nes_manage_arp_cache(netdev, netdev->dev_addr,
170 ntohl(nesvnic->local_ipaddr), NES_ARP_DELETE); 172 ntohl(nesvnic->local_ipaddr), NES_ARP_DELETE);
171 nesvnic->local_ipaddr = 0; 173 nesvnic->local_ipaddr = 0;
172 return NOTIFY_OK; 174 if (is_bonded)
175 continue;
176 else
177 return NOTIFY_OK;
173 break; 178 break;
174 case NETDEV_UP: 179 case NETDEV_UP:
175 nes_debug(NES_DBG_NETDEV, "event:UP\n"); 180 nes_debug(NES_DBG_NETDEV, "event:UP\n");
@@ -178,15 +183,24 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
178 nes_debug(NES_DBG_NETDEV, "Interface already has local_ipaddr\n"); 183 nes_debug(NES_DBG_NETDEV, "Interface already has local_ipaddr\n");
179 return NOTIFY_OK; 184 return NOTIFY_OK;
180 } 185 }
186 /* fall through */
187 case NETDEV_CHANGEADDR:
181 /* Add the address to the IP table */ 188 /* Add the address to the IP table */
182 nesvnic->local_ipaddr = ifa->ifa_address; 189 if (netdev->master)
190 nesvnic->local_ipaddr =
191 ((struct in_device *)netdev->master->ip_ptr)->ifa_list->ifa_address;
192 else
193 nesvnic->local_ipaddr = ifa->ifa_address;
183 194
184 nes_write_indexed(nesdev, 195 nes_write_indexed(nesdev,
185 NES_IDX_DST_IP_ADDR+(0x10*PCI_FUNC(nesdev->pcidev->devfn)), 196 NES_IDX_DST_IP_ADDR+(0x10*PCI_FUNC(nesdev->pcidev->devfn)),
186 ntohl(ifa->ifa_address)); 197 ntohl(nesvnic->local_ipaddr));
187 nes_manage_arp_cache(netdev, netdev->dev_addr, 198 nes_manage_arp_cache(netdev, netdev->dev_addr,
188 ntohl(nesvnic->local_ipaddr), NES_ARP_ADD); 199 ntohl(nesvnic->local_ipaddr), NES_ARP_ADD);
189 return NOTIFY_OK; 200 if (is_bonded)
201 continue;
202 else
203 return NOTIFY_OK;
190 break; 204 break;
191 default: 205 default:
192 break; 206 break;
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 25ad0f9944c0..009ec814d517 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1107,6 +1107,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
1107 struct flowi fl; 1107 struct flowi fl;
1108 struct neighbour *neigh; 1108 struct neighbour *neigh;
1109 int rc = arpindex; 1109 int rc = arpindex;
1110 struct net_device *netdev;
1110 struct nes_adapter *nesadapter = nesvnic->nesdev->nesadapter; 1111 struct nes_adapter *nesadapter = nesvnic->nesdev->nesadapter;
1111 1112
1112 memset(&fl, 0, sizeof fl); 1113 memset(&fl, 0, sizeof fl);
@@ -1117,7 +1118,12 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
1117 return rc; 1118 return rc;
1118 } 1119 }
1119 1120
1120 neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, nesvnic->netdev); 1121 if (nesvnic->netdev->master)
1122 netdev = nesvnic->netdev->master;
1123 else
1124 netdev = nesvnic->netdev;
1125
1126 neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, netdev);
1121 if (neigh) { 1127 if (neigh) {
1122 if (neigh->nud_state & NUD_VALID) { 1128 if (neigh->nud_state & NUD_VALID) {
1123 nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X" 1129 nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"