Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
IB: Fix RCU lockdep splats
IB/ipoib: Prevent hung task or softlockup processing multicast response
IB/qib: Fix over-scheduling of QSFP work
RDMA/cxgb4: Fix retry with MPAv1 logic for MPAv2
RDMA/cxgb4: Fix iw_cxgb4 count_rcqes() logic
IB/qib: Don't use schedule_work()

+62 -45
+6 -3
drivers/infiniband/core/addr.c
··· 216 216 217 217 neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->dst.dev); 218 218 if (!neigh || !(neigh->nud_state & NUD_VALID)) { 219 + rcu_read_lock(); 219 220 neigh_event_send(dst_get_neighbour(&rt->dst), NULL); 221 + rcu_read_unlock(); 220 222 ret = -ENODATA; 221 223 if (neigh) 222 224 goto release; ··· 276 274 goto put; 277 275 } 278 276 277 + rcu_read_lock(); 279 278 neigh = dst_get_neighbour(dst); 280 279 if (!neigh || !(neigh->nud_state & NUD_VALID)) { 281 280 if (neigh) 282 281 neigh_event_send(neigh, NULL); 283 282 ret = -ENODATA; 284 - goto put; 283 + } else { 284 + ret = rdma_copy_addr(addr, dst->dev, neigh->ha); 285 285 } 286 - 287 - ret = rdma_copy_addr(addr, dst->dev, neigh->ha); 286 + rcu_read_unlock(); 288 287 put: 289 288 dst_release(dst); 290 289 return ret;
+4
drivers/infiniband/hw/cxgb3/iwch_cm.c
··· 1375 1375 goto reject; 1376 1376 } 1377 1377 dst = &rt->dst; 1378 + rcu_read_lock(); 1378 1379 neigh = dst_get_neighbour(dst); 1379 1380 l2t = t3_l2t_get(tdev, neigh, neigh->dev); 1381 + rcu_read_unlock(); 1380 1382 if (!l2t) { 1381 1383 printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n", 1382 1384 __func__); ··· 1948 1946 } 1949 1947 ep->dst = &rt->dst; 1950 1948 1949 + rcu_read_lock(); 1951 1950 neigh = dst_get_neighbour(ep->dst); 1952 1951 1953 1952 /* get a l2t entry */ 1954 1953 ep->l2t = t3_l2t_get(ep->com.tdev, neigh, neigh->dev); 1954 + rcu_read_unlock(); 1955 1955 if (!ep->l2t) { 1956 1956 printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__); 1957 1957 err = -ENOMEM;
+9 -1
drivers/infiniband/hw/cxgb4/cm.c
··· 542 542 (mpa_rev_to_use == 2 ? MPA_ENHANCED_RDMA_CONN : 0); 543 543 mpa->private_data_size = htons(ep->plen); 544 544 mpa->revision = mpa_rev_to_use; 545 - if (mpa_rev_to_use == 1) 545 + if (mpa_rev_to_use == 1) { 546 546 ep->tried_with_mpa_v1 = 1; 547 + ep->retry_with_mpa_v1 = 0; 548 + } 547 549 548 550 if (mpa_rev_to_use == 2) { 549 551 mpa->private_data_size += ··· 1596 1594 goto reject; 1597 1595 } 1598 1596 dst = &rt->dst; 1597 + rcu_read_lock(); 1599 1598 neigh = dst_get_neighbour(dst); 1600 1599 if (neigh->dev->flags & IFF_LOOPBACK) { 1601 1600 pdev = ip_dev_find(&init_net, peer_ip); ··· 1623 1620 rss_qid = dev->rdev.lldi.rxq_ids[ 1624 1621 cxgb4_port_idx(neigh->dev) * step]; 1625 1622 } 1623 + rcu_read_unlock(); 1626 1624 if (!l2t) { 1627 1625 printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n", 1628 1626 __func__); ··· 1824 1820 } 1825 1821 ep->dst = &rt->dst; 1826 1822 1823 + rcu_read_lock(); 1827 1824 neigh = dst_get_neighbour(ep->dst); 1828 1825 1829 1826 /* get a l2t entry */ ··· 1861 1856 ep->rss_qid = ep->com.dev->rdev.lldi.rxq_ids[ 1862 1857 cxgb4_port_idx(neigh->dev) * step]; 1863 1858 } 1859 + rcu_read_unlock(); 1864 1860 if (!ep->l2t) { 1865 1861 printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__); 1866 1862 err = -ENOMEM; ··· 2307 2301 } 2308 2302 ep->dst = &rt->dst; 2309 2303 2304 + rcu_read_lock(); 2310 2305 neigh = dst_get_neighbour(ep->dst); 2311 2306 2312 2307 /* get a l2t entry */ ··· 2346 2339 ep->retry_with_mpa_v1 = 0; 2347 2340 ep->tried_with_mpa_v1 = 0; 2348 2341 } 2342 + rcu_read_unlock(); 2349 2343 if (!ep->l2t) { 2350 2344 printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__); 2351 2345 err = -ENOMEM;
+1 -1
drivers/infiniband/hw/cxgb4/cq.c
··· 311 311 while (ptr != cq->sw_pidx) { 312 312 cqe = &cq->sw_queue[ptr]; 313 313 if (RQ_TYPE(cqe) && (CQE_OPCODE(cqe) != FW_RI_READ_RESP) && 314 - (CQE_QPID(cqe) == wq->rq.qid) && cqe_completes_wr(cqe, wq)) 314 + (CQE_QPID(cqe) == wq->sq.qid) && cqe_completes_wr(cqe, wq)) 315 315 (*count)++; 316 316 if (++ptr == cq->size) 317 317 ptr = 0;
+4 -2
drivers/infiniband/hw/nes/nes_cm.c
··· 1377 1377 neigh_release(neigh); 1378 1378 } 1379 1379 1380 - if ((neigh == NULL) || (!(neigh->nud_state & NUD_VALID))) 1380 + if ((neigh == NULL) || (!(neigh->nud_state & NUD_VALID))) { 1381 + rcu_read_lock(); 1381 1382 neigh_event_send(dst_get_neighbour(&rt->dst), NULL); 1382 - 1383 + rcu_read_unlock(); 1384 + } 1383 1385 ip_rt_put(rt); 1384 1386 return rc; 1385 1387 }
+9 -9
drivers/infiniband/hw/qib/qib_iba7322.c
··· 2307 2307 SYM_LSB(IBCCtrlA_0, MaxPktLen); 2308 2308 ppd->cpspec->ibcctrl_a = ibc; /* without linkcmd or linkinitcmd! */ 2309 2309 2310 - /* initially come up waiting for TS1, without sending anything. */ 2311 - val = ppd->cpspec->ibcctrl_a | (QLOGIC_IB_IBCC_LINKINITCMD_DISABLE << 2312 - QLOGIC_IB_IBCC_LINKINITCMD_SHIFT); 2313 - 2314 - ppd->cpspec->ibcctrl_a = val; 2315 2310 /* 2316 2311 * Reset the PCS interface to the serdes (and also ibc, which is still 2317 2312 * in reset from above). Writes new value of ibcctrl_a as last step. 2318 2313 */ 2319 2314 qib_7322_mini_pcs_reset(ppd); 2320 - qib_write_kreg(dd, kr_scratch, 0ULL); 2321 - /* clear the linkinit cmds */ 2322 - ppd->cpspec->ibcctrl_a &= ~SYM_MASK(IBCCtrlA_0, LinkInitCmd); 2323 2315 2324 2316 if (!ppd->cpspec->ibcctrl_b) { 2325 2317 unsigned lse = ppd->link_speed_enabled; ··· 2376 2384 /* Enable port */ 2377 2385 ppd->cpspec->ibcctrl_a |= SYM_MASK(IBCCtrlA_0, IBLinkEn); 2378 2386 set_vls(ppd); 2387 + 2388 + /* initially come up DISABLED, without sending anything. */ 2389 + val = ppd->cpspec->ibcctrl_a | (QLOGIC_IB_IBCC_LINKINITCMD_DISABLE << 2390 + QLOGIC_IB_IBCC_LINKINITCMD_SHIFT); 2391 + qib_write_kreg_port(ppd, krp_ibcctrl_a, val); 2392 + qib_write_kreg(dd, kr_scratch, 0ULL); 2393 + /* clear the linkinit cmds */ 2394 + ppd->cpspec->ibcctrl_a = val & ~SYM_MASK(IBCCtrlA_0, LinkInitCmd); 2379 2395 2380 2396 /* be paranoid against later code motion, etc. */ 2381 2397 spin_lock_irqsave(&dd->cspec->rcvmod_lock, flags); ··· 5241 5241 off */ 5242 5242 if (ppd->dd->flags & QIB_HAS_QSFP) { 5243 5243 qd->t_insert = get_jiffies_64(); 5244 - schedule_work(&qd->work); 5244 + queue_work(ib_wq, &qd->work); 5245 5245 } 5246 5246 spin_lock_irqsave(&ppd->sdma_lock, flags); 5247 5247 if (__qib_sdma_running(ppd))
-12
drivers/infiniband/hw/qib/qib_qsfp.c
··· 480 480 udelay(20); /* Generous RST dwell */ 481 481 482 482 dd->f_gpio_mod(dd, mask, mask, mask); 483 - /* Spec says module can take up to two seconds! */ 484 - mask = QSFP_GPIO_MOD_PRS_N; 485 - if (qd->ppd->hw_pidx) 486 - mask <<= QSFP_GPIO_PORT2_SHIFT; 487 - 488 - /* Do not try to wait here. Better to let event handle it */ 489 - if (!qib_qsfp_mod_present(qd->ppd)) 490 - goto bail; 491 - /* We see a module, but it may be unwise to look yet. Just schedule */ 492 - qd->t_insert = get_jiffies_64(); 493 - queue_work(ib_wq, &qd->work); 494 - bail: 495 483 return; 496 484 } 497 485
+8 -5
drivers/infiniband/ulp/ipoib/ipoib_ib.c
··· 57 57 struct ib_pd *pd, struct ib_ah_attr *attr) 58 58 { 59 59 struct ipoib_ah *ah; 60 + struct ib_ah *vah; 60 61 61 62 ah = kmalloc(sizeof *ah, GFP_KERNEL); 62 63 if (!ah) 63 - return NULL; 64 + return ERR_PTR(-ENOMEM); 64 65 65 66 ah->dev = dev; 66 67 ah->last_send = 0; 67 68 kref_init(&ah->ref); 68 69 69 - ah->ah = ib_create_ah(pd, attr); 70 - if (IS_ERR(ah->ah)) { 70 + vah = ib_create_ah(pd, attr); 71 + if (IS_ERR(vah)) { 71 72 kfree(ah); 72 - ah = NULL; 73 - } else 73 + ah = (struct ipoib_ah *)vah; 74 + } else { 75 + ah->ah = vah; 74 76 ipoib_dbg(netdev_priv(dev), "Created ah %p\n", ah->ah); 77 + } 75 78 76 79 return ah; 77 80 }
+12 -8
drivers/infiniband/ulp/ipoib/ipoib_main.c
··· 432 432 433 433 spin_lock_irqsave(&priv->lock, flags); 434 434 435 - if (ah) { 435 + if (!IS_ERR_OR_NULL(ah)) { 436 436 path->pathrec = *pathrec; 437 437 438 438 old_ah = path->ah; ··· 555 555 return 0; 556 556 } 557 557 558 + /* called with rcu_read_lock */ 558 559 static void neigh_add_path(struct sk_buff *skb, struct net_device *dev) 559 560 { 560 561 struct ipoib_dev_priv *priv = netdev_priv(dev); ··· 637 636 spin_unlock_irqrestore(&priv->lock, flags); 638 637 } 639 638 639 + /* called with rcu_read_lock */ 640 640 static void ipoib_path_lookup(struct sk_buff *skb, struct net_device *dev) 641 641 { 642 642 struct ipoib_dev_priv *priv = netdev_priv(skb->dev); ··· 722 720 struct neighbour *n = NULL; 723 721 unsigned long flags; 724 722 723 + rcu_read_lock(); 725 724 if (likely(skb_dst(skb))) 726 725 n = dst_get_neighbour(skb_dst(skb)); 727 726 728 727 if (likely(n)) { 729 728 if (unlikely(!*to_ipoib_neigh(n))) { 730 729 ipoib_path_lookup(skb, dev); 731 - return NETDEV_TX_OK; 730 + goto unlock; 732 731 } 733 732 734 733 neigh = *to_ipoib_neigh(n); ··· 752 749 ipoib_neigh_free(dev, neigh); 753 750 spin_unlock_irqrestore(&priv->lock, flags); 754 751 ipoib_path_lookup(skb, dev); 755 - return NETDEV_TX_OK; 752 + goto unlock; 756 753 } 757 754 758 755 if (ipoib_cm_get(neigh)) { 759 756 if (ipoib_cm_up(neigh)) { 760 757 ipoib_cm_send(dev, skb, ipoib_cm_get(neigh)); 761 - return NETDEV_TX_OK; 758 + goto unlock; 762 759 } 763 760 } else if (neigh->ah) { 764 761 ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(n->ha)); 765 - return NETDEV_TX_OK; 762 + goto unlock; 766 763 } 767 764 768 765 if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE) { ··· 796 793 phdr->hwaddr + 4); 797 794 dev_kfree_skb_any(skb); 798 795 ++dev->stats.tx_dropped; 799 - return NETDEV_TX_OK; 796 + goto unlock; 800 797 } 801 798 802 799 unicast_arp_send(skb, dev, phdr); 803 800 } 804 801 } 805 - 802 + unlock: 803 + rcu_read_unlock(); 806 804 return NETDEV_TX_OK; 807 805 } 808 806 ··· 841 837 dst = skb_dst(skb); 842 838 n = NULL; 843 839 if (dst) 844 - n = dst_get_neighbour(dst); 840 + n = dst_get_neighbour_raw(dst); 845 841 if ((!dst || !n) && daddr) { 846 842 struct ipoib_pseudoheader *phdr = 847 843 (struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr);
+9 -4
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
··· 240 240 av.grh.dgid = mcast->mcmember.mgid; 241 241 242 242 ah = ipoib_create_ah(dev, priv->pd, &av); 243 - if (!ah) { 244 - ipoib_warn(priv, "ib_address_create failed\n"); 243 + if (IS_ERR(ah)) { 244 + ipoib_warn(priv, "ib_address_create failed %ld\n", 245 + -PTR_ERR(ah)); 246 + /* use original error */ 247 + return PTR_ERR(ah); 245 248 } else { 246 249 spin_lock_irq(&priv->lock); 247 250 mcast->ah = ah; ··· 269 266 270 267 skb->dev = dev; 271 268 if (dst) 272 - n = dst_get_neighbour(dst); 269 + n = dst_get_neighbour_raw(dst); 273 270 if (!dst || !n) { 274 271 /* put pseudoheader back on for next time */ 275 272 skb_push(skb, sizeof (struct ipoib_pseudoheader)); ··· 725 722 if (mcast && mcast->ah) { 726 723 struct dst_entry *dst = skb_dst(skb); 727 724 struct neighbour *n = NULL; 725 + 726 + rcu_read_lock(); 728 727 if (dst) 729 728 n = dst_get_neighbour(dst); 730 729 if (n && !*to_ipoib_neigh(n)) { ··· 739 734 list_add_tail(&neigh->list, &mcast->neigh_list); 740 735 } 741 736 } 742 - 737 + rcu_read_unlock(); 743 738 spin_unlock_irqrestore(&priv->lock, flags); 744 739 ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN); 745 740 return;