aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/addr.c7
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_cm.c12
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c42
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c2
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c41
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c20
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c8
-rw-r--r--drivers/s390/net/qeth_l3_main.c25
-rw-r--r--drivers/scsi/cxgbi/cxgb3i/cxgb3i.c2
-rw-r--r--drivers/scsi/cxgbi/cxgb4i/cxgb4i.c2
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.c4
11 files changed, 100 insertions, 65 deletions
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index 8e21d457b899..236ad9a89c0a 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -215,7 +215,7 @@ static int addr4_resolve(struct sockaddr_in *src_in,
215 215
216 neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->dst.dev); 216 neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->dst.dev);
217 if (!neigh || !(neigh->nud_state & NUD_VALID)) { 217 if (!neigh || !(neigh->nud_state & NUD_VALID)) {
218 neigh_event_send(rt->dst.neighbour, NULL); 218 neigh_event_send(dst_get_neighbour(&rt->dst), NULL);
219 ret = -ENODATA; 219 ret = -ENODATA;
220 if (neigh) 220 if (neigh)
221 goto release; 221 goto release;
@@ -273,9 +273,10 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
273 goto put; 273 goto put;
274 } 274 }
275 275
276 neigh = dst->neighbour; 276 neigh = dst_get_neighbour(dst);
277 if (!neigh || !(neigh->nud_state & NUD_VALID)) { 277 if (!neigh || !(neigh->nud_state & NUD_VALID)) {
278 neigh_event_send(dst->neighbour, NULL); 278 if (neigh)
279 neigh_event_send(neigh, NULL);
279 ret = -ENODATA; 280 ret = -ENODATA;
280 goto put; 281 goto put;
281 } 282 }
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index 0a5008fbebac..17bf9d95463c 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -1328,6 +1328,7 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
1328 struct iwch_ep *child_ep, *parent_ep = ctx; 1328 struct iwch_ep *child_ep, *parent_ep = ctx;
1329 struct cpl_pass_accept_req *req = cplhdr(skb); 1329 struct cpl_pass_accept_req *req = cplhdr(skb);
1330 unsigned int hwtid = GET_TID(req); 1330 unsigned int hwtid = GET_TID(req);
1331 struct neighbour *neigh;
1331 struct dst_entry *dst; 1332 struct dst_entry *dst;
1332 struct l2t_entry *l2t; 1333 struct l2t_entry *l2t;
1333 struct rtable *rt; 1334 struct rtable *rt;
@@ -1364,7 +1365,8 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
1364 goto reject; 1365 goto reject;
1365 } 1366 }
1366 dst = &rt->dst; 1367 dst = &rt->dst;
1367 l2t = t3_l2t_get(tdev, dst->neighbour, dst->neighbour->dev); 1368 neigh = dst_get_neighbour(dst);
1369 l2t = t3_l2t_get(tdev, neigh, neigh->dev);
1368 if (!l2t) { 1370 if (!l2t) {
1369 printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n", 1371 printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n",
1370 __func__); 1372 __func__);
@@ -1874,10 +1876,11 @@ static int is_loopback_dst(struct iw_cm_id *cm_id)
1874 1876
1875int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) 1877int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
1876{ 1878{
1877 int err = 0;
1878 struct iwch_dev *h = to_iwch_dev(cm_id->device); 1879 struct iwch_dev *h = to_iwch_dev(cm_id->device);
1880 struct neighbour *neigh;
1879 struct iwch_ep *ep; 1881 struct iwch_ep *ep;
1880 struct rtable *rt; 1882 struct rtable *rt;
1883 int err = 0;
1881 1884
1882 if (is_loopback_dst(cm_id)) { 1885 if (is_loopback_dst(cm_id)) {
1883 err = -ENOSYS; 1886 err = -ENOSYS;
@@ -1933,9 +1936,10 @@ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
1933 } 1936 }
1934 ep->dst = &rt->dst; 1937 ep->dst = &rt->dst;
1935 1938
1939 neigh = dst_get_neighbour(ep->dst);
1940
1936 /* get a l2t entry */ 1941 /* get a l2t entry */
1937 ep->l2t = t3_l2t_get(ep->com.tdev, ep->dst->neighbour, 1942 ep->l2t = t3_l2t_get(ep->com.tdev, neigh, neigh->dev);
1938 ep->dst->neighbour->dev);
1939 if (!ep->l2t) { 1943 if (!ep->l2t) {
1940 printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__); 1944 printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__);
1941 err = -ENOMEM; 1945 err = -ENOMEM;
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 31fb44085c9b..77f769d9227d 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -1325,6 +1325,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
1325 unsigned int stid = GET_POPEN_TID(ntohl(req->tos_stid)); 1325 unsigned int stid = GET_POPEN_TID(ntohl(req->tos_stid));
1326 struct tid_info *t = dev->rdev.lldi.tids; 1326 struct tid_info *t = dev->rdev.lldi.tids;
1327 unsigned int hwtid = GET_TID(req); 1327 unsigned int hwtid = GET_TID(req);
1328 struct neighbour *neigh;
1328 struct dst_entry *dst; 1329 struct dst_entry *dst;
1329 struct l2t_entry *l2t; 1330 struct l2t_entry *l2t;
1330 struct rtable *rt; 1331 struct rtable *rt;
@@ -1357,11 +1358,11 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
1357 goto reject; 1358 goto reject;
1358 } 1359 }
1359 dst = &rt->dst; 1360 dst = &rt->dst;
1360 if (dst->neighbour->dev->flags & IFF_LOOPBACK) { 1361 neigh = dst_get_neighbour(dst);
1362 if (neigh->dev->flags & IFF_LOOPBACK) {
1361 pdev = ip_dev_find(&init_net, peer_ip); 1363 pdev = ip_dev_find(&init_net, peer_ip);
1362 BUG_ON(!pdev); 1364 BUG_ON(!pdev);
1363 l2t = cxgb4_l2t_get(dev->rdev.lldi.l2t, dst->neighbour, 1365 l2t = cxgb4_l2t_get(dev->rdev.lldi.l2t, neigh, pdev, 0);
1364 pdev, 0);
1365 mtu = pdev->mtu; 1366 mtu = pdev->mtu;
1366 tx_chan = cxgb4_port_chan(pdev); 1367 tx_chan = cxgb4_port_chan(pdev);
1367 smac_idx = (cxgb4_port_viid(pdev) & 0x7F) << 1; 1368 smac_idx = (cxgb4_port_viid(pdev) & 0x7F) << 1;
@@ -1372,17 +1373,16 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
1372 rss_qid = dev->rdev.lldi.rxq_ids[cxgb4_port_idx(pdev) * step]; 1373 rss_qid = dev->rdev.lldi.rxq_ids[cxgb4_port_idx(pdev) * step];
1373 dev_put(pdev); 1374 dev_put(pdev);
1374 } else { 1375 } else {
1375 l2t = cxgb4_l2t_get(dev->rdev.lldi.l2t, dst->neighbour, 1376 l2t = cxgb4_l2t_get(dev->rdev.lldi.l2t, neigh, neigh->dev, 0);
1376 dst->neighbour->dev, 0);
1377 mtu = dst_mtu(dst); 1377 mtu = dst_mtu(dst);
1378 tx_chan = cxgb4_port_chan(dst->neighbour->dev); 1378 tx_chan = cxgb4_port_chan(neigh->dev);
1379 smac_idx = (cxgb4_port_viid(dst->neighbour->dev) & 0x7F) << 1; 1379 smac_idx = (cxgb4_port_viid(neigh->dev) & 0x7F) << 1;
1380 step = dev->rdev.lldi.ntxq / dev->rdev.lldi.nchan; 1380 step = dev->rdev.lldi.ntxq / dev->rdev.lldi.nchan;
1381 txq_idx = cxgb4_port_idx(dst->neighbour->dev) * step; 1381 txq_idx = cxgb4_port_idx(neigh->dev) * step;
1382 ctrlq_idx = cxgb4_port_idx(dst->neighbour->dev); 1382 ctrlq_idx = cxgb4_port_idx(neigh->dev);
1383 step = dev->rdev.lldi.nrxq / dev->rdev.lldi.nchan; 1383 step = dev->rdev.lldi.nrxq / dev->rdev.lldi.nchan;
1384 rss_qid = dev->rdev.lldi.rxq_ids[ 1384 rss_qid = dev->rdev.lldi.rxq_ids[
1385 cxgb4_port_idx(dst->neighbour->dev) * step]; 1385 cxgb4_port_idx(neigh->dev) * step];
1386 } 1386 }
1387 if (!l2t) { 1387 if (!l2t) {
1388 printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n", 1388 printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n",
@@ -1847,6 +1847,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
1847 struct c4iw_ep *ep; 1847 struct c4iw_ep *ep;
1848 struct rtable *rt; 1848 struct rtable *rt;
1849 struct net_device *pdev; 1849 struct net_device *pdev;
1850 struct neighbour *neigh;
1850 int step; 1851 int step;
1851 1852
1852 if ((conn_param->ord > c4iw_max_read_depth) || 1853 if ((conn_param->ord > c4iw_max_read_depth) ||
@@ -1908,14 +1909,15 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
1908 } 1909 }
1909 ep->dst = &rt->dst; 1910 ep->dst = &rt->dst;
1910 1911
1912 neigh = dst_get_neighbour(ep->dst);
1913
1911 /* get a l2t entry */ 1914 /* get a l2t entry */
1912 if (ep->dst->neighbour->dev->flags & IFF_LOOPBACK) { 1915 if (neigh->dev->flags & IFF_LOOPBACK) {
1913 PDBG("%s LOOPBACK\n", __func__); 1916 PDBG("%s LOOPBACK\n", __func__);
1914 pdev = ip_dev_find(&init_net, 1917 pdev = ip_dev_find(&init_net,
1915 cm_id->remote_addr.sin_addr.s_addr); 1918 cm_id->remote_addr.sin_addr.s_addr);
1916 ep->l2t = cxgb4_l2t_get(ep->com.dev->rdev.lldi.l2t, 1919 ep->l2t = cxgb4_l2t_get(ep->com.dev->rdev.lldi.l2t,
1917 ep->dst->neighbour, 1920 neigh, pdev, 0);
1918 pdev, 0);
1919 ep->mtu = pdev->mtu; 1921 ep->mtu = pdev->mtu;
1920 ep->tx_chan = cxgb4_port_chan(pdev); 1922 ep->tx_chan = cxgb4_port_chan(pdev);
1921 ep->smac_idx = (cxgb4_port_viid(pdev) & 0x7F) << 1; 1923 ep->smac_idx = (cxgb4_port_viid(pdev) & 0x7F) << 1;
@@ -1930,20 +1932,18 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
1930 dev_put(pdev); 1932 dev_put(pdev);
1931 } else { 1933 } else {
1932 ep->l2t = cxgb4_l2t_get(ep->com.dev->rdev.lldi.l2t, 1934 ep->l2t = cxgb4_l2t_get(ep->com.dev->rdev.lldi.l2t,
1933 ep->dst->neighbour, 1935 neigh, neigh->dev, 0);
1934 ep->dst->neighbour->dev, 0);
1935 ep->mtu = dst_mtu(ep->dst); 1936 ep->mtu = dst_mtu(ep->dst);
1936 ep->tx_chan = cxgb4_port_chan(ep->dst->neighbour->dev); 1937 ep->tx_chan = cxgb4_port_chan(neigh->dev);
1937 ep->smac_idx = (cxgb4_port_viid(ep->dst->neighbour->dev) & 1938 ep->smac_idx = (cxgb4_port_viid(neigh->dev) & 0x7F) << 1;
1938 0x7F) << 1;
1939 step = ep->com.dev->rdev.lldi.ntxq / 1939 step = ep->com.dev->rdev.lldi.ntxq /
1940 ep->com.dev->rdev.lldi.nchan; 1940 ep->com.dev->rdev.lldi.nchan;
1941 ep->txq_idx = cxgb4_port_idx(ep->dst->neighbour->dev) * step; 1941 ep->txq_idx = cxgb4_port_idx(neigh->dev) * step;
1942 ep->ctrlq_idx = cxgb4_port_idx(ep->dst->neighbour->dev); 1942 ep->ctrlq_idx = cxgb4_port_idx(neigh->dev);
1943 step = ep->com.dev->rdev.lldi.nrxq / 1943 step = ep->com.dev->rdev.lldi.nrxq /
1944 ep->com.dev->rdev.lldi.nchan; 1944 ep->com.dev->rdev.lldi.nchan;
1945 ep->rss_qid = ep->com.dev->rdev.lldi.rxq_ids[ 1945 ep->rss_qid = ep->com.dev->rdev.lldi.rxq_ids[
1946 cxgb4_port_idx(ep->dst->neighbour->dev) * step]; 1946 cxgb4_port_idx(neigh->dev) * step];
1947 } 1947 }
1948 if (!ep->l2t) { 1948 if (!ep->l2t) {
1949 printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__); 1949 printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__);
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index e74cdf9ef471..73bc18465c9c 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1151,7 +1151,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
1151 } 1151 }
1152 1152
1153 if ((neigh == NULL) || (!(neigh->nud_state & NUD_VALID))) 1153 if ((neigh == NULL) || (!(neigh->nud_state & NUD_VALID)))
1154 neigh_event_send(rt->dst.neighbour, NULL); 1154 neigh_event_send(dst_get_neighbour(&rt->dst), NULL);
1155 1155
1156 ip_rt_put(rt); 1156 ip_rt_put(rt);
1157 return rc; 1157 return rc;
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 86addca9ddf6..43f89ba0a908 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -560,9 +560,11 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
560 struct ipoib_dev_priv *priv = netdev_priv(dev); 560 struct ipoib_dev_priv *priv = netdev_priv(dev);
561 struct ipoib_path *path; 561 struct ipoib_path *path;
562 struct ipoib_neigh *neigh; 562 struct ipoib_neigh *neigh;
563 struct neighbour *n;
563 unsigned long flags; 564 unsigned long flags;
564 565
565 neigh = ipoib_neigh_alloc(skb_dst(skb)->neighbour, skb->dev); 566 n = dst_get_neighbour(skb_dst(skb));
567 neigh = ipoib_neigh_alloc(n, skb->dev);
566 if (!neigh) { 568 if (!neigh) {
567 ++dev->stats.tx_dropped; 569 ++dev->stats.tx_dropped;
568 dev_kfree_skb_any(skb); 570 dev_kfree_skb_any(skb);
@@ -571,9 +573,9 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
571 573
572 spin_lock_irqsave(&priv->lock, flags); 574 spin_lock_irqsave(&priv->lock, flags);
573 575
574 path = __path_find(dev, skb_dst(skb)->neighbour->ha + 4); 576 path = __path_find(dev, n->ha + 4);
575 if (!path) { 577 if (!path) {
576 path = path_rec_create(dev, skb_dst(skb)->neighbour->ha + 4); 578 path = path_rec_create(dev, n->ha + 4);
577 if (!path) 579 if (!path)
578 goto err_path; 580 goto err_path;
579 581
@@ -607,7 +609,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
607 } 609 }
608 } else { 610 } else {
609 spin_unlock_irqrestore(&priv->lock, flags); 611 spin_unlock_irqrestore(&priv->lock, flags);
610 ipoib_send(dev, skb, path->ah, IPOIB_QPN(skb_dst(skb)->neighbour->ha)); 612 ipoib_send(dev, skb, path->ah, IPOIB_QPN(n->ha));
611 return; 613 return;
612 } 614 }
613 } else { 615 } else {
@@ -637,17 +639,20 @@ err_drop:
637static void ipoib_path_lookup(struct sk_buff *skb, struct net_device *dev) 639static void ipoib_path_lookup(struct sk_buff *skb, struct net_device *dev)
638{ 640{
639 struct ipoib_dev_priv *priv = netdev_priv(skb->dev); 641 struct ipoib_dev_priv *priv = netdev_priv(skb->dev);
642 struct dst_entry *dst = skb_dst(skb);
643 struct neighbour *n;
640 644
641 /* Look up path record for unicasts */ 645 /* Look up path record for unicasts */
642 if (skb_dst(skb)->neighbour->ha[4] != 0xff) { 646 n = dst_get_neighbour(dst);
647 if (n->ha[4] != 0xff) {
643 neigh_add_path(skb, dev); 648 neigh_add_path(skb, dev);
644 return; 649 return;
645 } 650 }
646 651
647 /* Add in the P_Key for multicasts */ 652 /* Add in the P_Key for multicasts */
648 skb_dst(skb)->neighbour->ha[8] = (priv->pkey >> 8) & 0xff; 653 n->ha[8] = (priv->pkey >> 8) & 0xff;
649 skb_dst(skb)->neighbour->ha[9] = priv->pkey & 0xff; 654 n->ha[9] = priv->pkey & 0xff;
650 ipoib_mcast_send(dev, skb_dst(skb)->neighbour->ha + 4, skb); 655 ipoib_mcast_send(dev, n->ha + 4, skb);
651} 656}
652 657
653static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, 658static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
@@ -712,18 +717,20 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
712{ 717{
713 struct ipoib_dev_priv *priv = netdev_priv(dev); 718 struct ipoib_dev_priv *priv = netdev_priv(dev);
714 struct ipoib_neigh *neigh; 719 struct ipoib_neigh *neigh;
720 struct neighbour *n;
715 unsigned long flags; 721 unsigned long flags;
716 722
717 if (likely(skb_dst(skb) && skb_dst(skb)->neighbour)) { 723 n = dst_get_neighbour(skb_dst(skb));
718 if (unlikely(!*to_ipoib_neigh(skb_dst(skb)->neighbour))) { 724 if (likely(skb_dst(skb) && n)) {
725 if (unlikely(!*to_ipoib_neigh(n))) {
719 ipoib_path_lookup(skb, dev); 726 ipoib_path_lookup(skb, dev);
720 return NETDEV_TX_OK; 727 return NETDEV_TX_OK;
721 } 728 }
722 729
723 neigh = *to_ipoib_neigh(skb_dst(skb)->neighbour); 730 neigh = *to_ipoib_neigh(n);
724 731
725 if (unlikely((memcmp(&neigh->dgid.raw, 732 if (unlikely((memcmp(&neigh->dgid.raw,
726 skb_dst(skb)->neighbour->ha + 4, 733 n->ha + 4,
727 sizeof(union ib_gid))) || 734 sizeof(union ib_gid))) ||
728 (neigh->dev != dev))) { 735 (neigh->dev != dev))) {
729 spin_lock_irqsave(&priv->lock, flags); 736 spin_lock_irqsave(&priv->lock, flags);
@@ -749,7 +756,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
749 return NETDEV_TX_OK; 756 return NETDEV_TX_OK;
750 } 757 }
751 } else if (neigh->ah) { 758 } else if (neigh->ah) {
752 ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(skb_dst(skb)->neighbour->ha)); 759 ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(n->ha));
753 return NETDEV_TX_OK; 760 return NETDEV_TX_OK;
754 } 761 }
755 762
@@ -812,6 +819,8 @@ static int ipoib_hard_header(struct sk_buff *skb,
812 const void *daddr, const void *saddr, unsigned len) 819 const void *daddr, const void *saddr, unsigned len)
813{ 820{
814 struct ipoib_header *header; 821 struct ipoib_header *header;
822 struct dst_entry *dst;
823 struct neighbour *n;
815 824
816 header = (struct ipoib_header *) skb_push(skb, sizeof *header); 825 header = (struct ipoib_header *) skb_push(skb, sizeof *header);
817 826
@@ -823,7 +832,11 @@ static int ipoib_hard_header(struct sk_buff *skb,
823 * destination address onto the front of the skb so we can 832 * destination address onto the front of the skb so we can
824 * figure out where to send the packet later. 833 * figure out where to send the packet later.
825 */ 834 */
826 if ((!skb_dst(skb) || !skb_dst(skb)->neighbour) && daddr) { 835 dst = skb_dst(skb);
836 n = NULL;
837 if (dst)
838 n = dst_get_neighbour(dst);
839 if ((!dst || !n) && daddr) {
827 struct ipoib_pseudoheader *phdr = 840 struct ipoib_pseudoheader *phdr =
828 (struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr); 841 (struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr);
829 memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN); 842 memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 3871ac663554..ecea4fe1ed00 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -258,11 +258,15 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
258 netif_tx_lock_bh(dev); 258 netif_tx_lock_bh(dev);
259 while (!skb_queue_empty(&mcast->pkt_queue)) { 259 while (!skb_queue_empty(&mcast->pkt_queue)) {
260 struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue); 260 struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue);
261 struct dst_entry *dst = skb_dst(skb);
262 struct neighbour *n = NULL;
263
261 netif_tx_unlock_bh(dev); 264 netif_tx_unlock_bh(dev);
262 265
263 skb->dev = dev; 266 skb->dev = dev;
264 267 if (dst)
265 if (!skb_dst(skb) || !skb_dst(skb)->neighbour) { 268 n = dst_get_neighbour(dst);
269 if (!dst || !n) {
266 /* put pseudoheader back on for next time */ 270 /* put pseudoheader back on for next time */
267 skb_push(skb, sizeof (struct ipoib_pseudoheader)); 271 skb_push(skb, sizeof (struct ipoib_pseudoheader));
268 } 272 }
@@ -715,11 +719,13 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb)
715 719
716out: 720out:
717 if (mcast && mcast->ah) { 721 if (mcast && mcast->ah) {
718 if (skb_dst(skb) && 722 struct dst_entry *dst = skb_dst(skb);
719 skb_dst(skb)->neighbour && 723 struct neighbour *n = NULL;
720 !*to_ipoib_neigh(skb_dst(skb)->neighbour)) { 724 if (dst)
721 struct ipoib_neigh *neigh = ipoib_neigh_alloc(skb_dst(skb)->neighbour, 725 n = dst_get_neighbour(dst);
722 skb->dev); 726 if (n && !*to_ipoib_neigh(n)) {
727 struct ipoib_neigh *neigh = ipoib_neigh_alloc(n,
728 skb->dev);
723 729
724 if (neigh) { 730 if (neigh) {
725 kref_get(&mcast->ah->ref); 731 kref_get(&mcast->ah->ref);
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index 9db9068d29d2..fa1b450af825 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -971,7 +971,7 @@ static int nb_callback(struct notifier_block *self, unsigned long event,
971 case (NETEVENT_REDIRECT):{ 971 case (NETEVENT_REDIRECT):{
972 struct netevent_redirect *nr = ctx; 972 struct netevent_redirect *nr = ctx;
973 cxgb_redirect(nr->old, nr->new); 973 cxgb_redirect(nr->old, nr->new);
974 cxgb_neigh_update(nr->new->neighbour); 974 cxgb_neigh_update(dst_get_neighbour(nr->new));
975 break; 975 break;
976 } 976 }
977 default: 977 default:
@@ -1116,8 +1116,8 @@ static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
1116 struct l2t_entry *e; 1116 struct l2t_entry *e;
1117 struct t3c_tid_entry *te; 1117 struct t3c_tid_entry *te;
1118 1118
1119 olddev = old->neighbour->dev; 1119 olddev = dst_get_neighbour(old)->dev;
1120 newdev = new->neighbour->dev; 1120 newdev = dst_get_neighbour(new)->dev;
1121 if (!is_offloading(olddev)) 1121 if (!is_offloading(olddev))
1122 return; 1122 return;
1123 if (!is_offloading(newdev)) { 1123 if (!is_offloading(newdev)) {
@@ -1134,7 +1134,7 @@ static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
1134 } 1134 }
1135 1135
1136 /* Add new L2T entry */ 1136 /* Add new L2T entry */
1137 e = t3_l2t_get(tdev, new->neighbour, newdev); 1137 e = t3_l2t_get(tdev, dst_get_neighbour(new), newdev);
1138 if (!e) { 1138 if (!e) {
1139 printk(KERN_ERR "%s: couldn't allocate new l2t entry!\n", 1139 printk(KERN_ERR "%s: couldn't allocate new l2t entry!\n",
1140 __func__); 1140 __func__);
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index fd69da3fa6b4..e2c9ac5fcb36 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -2742,9 +2742,14 @@ static int qeth_l3_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2742int inline qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb) 2742int inline qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
2743{ 2743{
2744 int cast_type = RTN_UNSPEC; 2744 int cast_type = RTN_UNSPEC;
2745 2745 struct neighbour *n = NULL;
2746 if (skb_dst(skb) && skb_dst(skb)->neighbour) { 2746 struct dst_entry *dst;
2747 cast_type = skb_dst(skb)->neighbour->type; 2747
2748 dst = skb_dst(skb);
2749 if (dst)
2750 n = dst_get_neighbour(dst);
2751 if (n) {
2752 cast_type = n->type;
2748 if ((cast_type == RTN_BROADCAST) || 2753 if ((cast_type == RTN_BROADCAST) ||
2749 (cast_type == RTN_MULTICAST) || 2754 (cast_type == RTN_MULTICAST) ||
2750 (cast_type == RTN_ANYCAST)) 2755 (cast_type == RTN_ANYCAST))
@@ -2787,6 +2792,9 @@ int inline qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
2787static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, 2792static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
2788 struct sk_buff *skb, int ipv, int cast_type) 2793 struct sk_buff *skb, int ipv, int cast_type)
2789{ 2794{
2795 struct neighbour *n = NULL;
2796 struct dst_entry *dst;
2797
2790 memset(hdr, 0, sizeof(struct qeth_hdr)); 2798 memset(hdr, 0, sizeof(struct qeth_hdr));
2791 hdr->hdr.l3.id = QETH_HEADER_TYPE_LAYER3; 2799 hdr->hdr.l3.id = QETH_HEADER_TYPE_LAYER3;
2792 hdr->hdr.l3.ext_flags = 0; 2800 hdr->hdr.l3.ext_flags = 0;
@@ -2804,13 +2812,16 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
2804 } 2812 }
2805 2813
2806 hdr->hdr.l3.length = skb->len - sizeof(struct qeth_hdr); 2814 hdr->hdr.l3.length = skb->len - sizeof(struct qeth_hdr);
2815 dst = skb_dst(skb);
2816 if (dst)
2817 n = dst_get_neighbour(dst);
2807 if (ipv == 4) { 2818 if (ipv == 4) {
2808 /* IPv4 */ 2819 /* IPv4 */
2809 hdr->hdr.l3.flags = qeth_l3_get_qeth_hdr_flags4(cast_type); 2820 hdr->hdr.l3.flags = qeth_l3_get_qeth_hdr_flags4(cast_type);
2810 memset(hdr->hdr.l3.dest_addr, 0, 12); 2821 memset(hdr->hdr.l3.dest_addr, 0, 12);
2811 if ((skb_dst(skb)) && (skb_dst(skb)->neighbour)) { 2822 if (n) {
2812 *((u32 *) (&hdr->hdr.l3.dest_addr[12])) = 2823 *((u32 *) (&hdr->hdr.l3.dest_addr[12])) =
2813 *((u32 *) skb_dst(skb)->neighbour->primary_key); 2824 *((u32 *) n->primary_key);
2814 } else { 2825 } else {
2815 /* fill in destination address used in ip header */ 2826 /* fill in destination address used in ip header */
2816 *((u32 *) (&hdr->hdr.l3.dest_addr[12])) = 2827 *((u32 *) (&hdr->hdr.l3.dest_addr[12])) =
@@ -2821,9 +2832,9 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
2821 hdr->hdr.l3.flags = qeth_l3_get_qeth_hdr_flags6(cast_type); 2832 hdr->hdr.l3.flags = qeth_l3_get_qeth_hdr_flags6(cast_type);
2822 if (card->info.type == QETH_CARD_TYPE_IQD) 2833 if (card->info.type == QETH_CARD_TYPE_IQD)
2823 hdr->hdr.l3.flags &= ~QETH_HDR_PASSTHRU; 2834 hdr->hdr.l3.flags &= ~QETH_HDR_PASSTHRU;
2824 if ((skb_dst(skb)) && (skb_dst(skb)->neighbour)) { 2835 if (n) {
2825 memcpy(hdr->hdr.l3.dest_addr, 2836 memcpy(hdr->hdr.l3.dest_addr,
2826 skb_dst(skb)->neighbour->primary_key, 16); 2837 n->primary_key, 16);
2827 } else { 2838 } else {
2828 /* fill in destination address used in ip header */ 2839 /* fill in destination address used in ip header */
2829 memcpy(hdr->hdr.l3.dest_addr, 2840 memcpy(hdr->hdr.l3.dest_addr,
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
index fc2cdb62f53b..abc7b122e050 100644
--- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
+++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
@@ -985,7 +985,7 @@ static int init_act_open(struct cxgbi_sock *csk)
985 csk->saddr.sin_addr.s_addr = chba->ipv4addr; 985 csk->saddr.sin_addr.s_addr = chba->ipv4addr;
986 986
987 csk->rss_qid = 0; 987 csk->rss_qid = 0;
988 csk->l2t = t3_l2t_get(t3dev, dst->neighbour, ndev); 988 csk->l2t = t3_l2t_get(t3dev, dst_get_neighbour(dst), ndev);
989 if (!csk->l2t) { 989 if (!csk->l2t) {
990 pr_err("NO l2t available.\n"); 990 pr_err("NO l2t available.\n");
991 return -EINVAL; 991 return -EINVAL;
diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
index f3a4cd7cf782..ae13c4993aa3 100644
--- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
+++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
@@ -1160,7 +1160,7 @@ static int init_act_open(struct cxgbi_sock *csk)
1160 cxgbi_sock_set_flag(csk, CTPF_HAS_ATID); 1160 cxgbi_sock_set_flag(csk, CTPF_HAS_ATID);
1161 cxgbi_sock_get(csk); 1161 cxgbi_sock_get(csk);
1162 1162
1163 csk->l2t = cxgb4_l2t_get(lldi->l2t, csk->dst->neighbour, ndev, 0); 1163 csk->l2t = cxgb4_l2t_get(lldi->l2t, dst_get_neighbour(csk->dst), ndev, 0);
1164 if (!csk->l2t) { 1164 if (!csk->l2t) {
1165 pr_err("%s, cannot alloc l2t.\n", ndev->name); 1165 pr_err("%s, cannot alloc l2t.\n", ndev->name);
1166 goto rel_resource; 1166 goto rel_resource;
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index a2a9c7c6c643..77ac217ad5ce 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -492,7 +492,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr)
492 goto err_out; 492 goto err_out;
493 } 493 }
494 dst = &rt->dst; 494 dst = &rt->dst;
495 ndev = dst->neighbour->dev; 495 ndev = dst_get_neighbour(dst)->dev;
496 496
497 if (rt->rt_flags & (RTCF_MULTICAST | RTCF_BROADCAST)) { 497 if (rt->rt_flags & (RTCF_MULTICAST | RTCF_BROADCAST)) {
498 pr_info("multi-cast route %pI4, port %u, dev %s.\n", 498 pr_info("multi-cast route %pI4, port %u, dev %s.\n",
@@ -506,7 +506,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr)
506 ndev = ip_dev_find(&init_net, daddr->sin_addr.s_addr); 506 ndev = ip_dev_find(&init_net, daddr->sin_addr.s_addr);
507 mtu = ndev->mtu; 507 mtu = ndev->mtu;
508 pr_info("rt dev %s, loopback -> %s, mtu %u.\n", 508 pr_info("rt dev %s, loopback -> %s, mtu %u.\n",
509 dst->neighbour->dev->name, ndev->name, mtu); 509 dst_get_neighbour(dst)->dev->name, ndev->name, mtu);
510 } 510 }
511 511
512 cdev = cxgbi_device_find_by_netdev(ndev, &port); 512 cdev = cxgbi_device_find_by_netdev(ndev, &port);