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:
IPoIB: Fix deadlock on RTNL between bcast join comp and ipoib_stop()
RDMA/nes: Fix client side QP destroy
IB/mlx4: Fix up fast register page list format
mlx4_core: Set RAE and init mtt_sz field in FRMR MPT entries

+42 -23
+6
drivers/infiniband/hw/mlx4/qp.c
··· 1342 1342 static void set_fmr_seg(struct mlx4_wqe_fmr_seg *fseg, struct ib_send_wr *wr) 1343 1343 { 1344 1344 struct mlx4_ib_fast_reg_page_list *mfrpl = to_mfrpl(wr->wr.fast_reg.page_list); 1345 + int i; 1346 + 1347 + for (i = 0; i < wr->wr.fast_reg.page_list_len; ++i) 1348 + wr->wr.fast_reg.page_list->page_list[i] = 1349 + cpu_to_be64(wr->wr.fast_reg.page_list->page_list[i] | 1350 + MLX4_MTT_FLAG_PRESENT); 1345 1351 1346 1352 fseg->flags = convert_access(wr->wr.fast_reg.access_flags); 1347 1353 fseg->mem_key = cpu_to_be32(wr->wr.fast_reg.rkey);
+2 -9
drivers/infiniband/hw/nes/nes_cm.c
··· 1956 1956 return ret; 1957 1957 cleanup_retrans_entry(cm_node); 1958 1958 cm_node->state = NES_CM_STATE_CLOSED; 1959 - ret = send_fin(cm_node, NULL); 1960 - 1961 - if (cm_node->accept_pend) { 1962 - BUG_ON(!cm_node->listener); 1963 - atomic_dec(&cm_node->listener->pend_accepts_cnt); 1964 - BUG_ON(atomic_read(&cm_node->listener->pend_accepts_cnt) < 0); 1965 - } 1966 1959 1967 1960 ret = send_reset(cm_node, NULL); 1968 1961 return ret; ··· 2376 2383 atomic_inc(&cm_disconnects); 2377 2384 cm_event.event = IW_CM_EVENT_DISCONNECT; 2378 2385 if (last_ae == NES_AEQE_AEID_LLP_CONNECTION_RESET) { 2386 + issued_disconnect_reset = 1; 2379 2387 cm_event.status = IW_CM_EVENT_STATUS_RESET; 2380 2388 nes_debug(NES_DBG_CM, "Generating a CM " 2381 2389 "Disconnect Event (status reset) for " ··· 2502 2508 nes_debug(NES_DBG_CM, "Call close API\n"); 2503 2509 2504 2510 g_cm_core->api->close(g_cm_core, nesqp->cm_node); 2505 - nesqp->cm_node = NULL; 2506 2511 } 2507 2512 2508 2513 return ret; ··· 2830 2837 cm_node->apbvt_set = 1; 2831 2838 nesqp->cm_node = cm_node; 2832 2839 cm_node->nesqp = nesqp; 2840 + nes_add_ref(&nesqp->ibqp); 2833 2841 2834 2842 return 0; 2835 2843 } ··· 3161 3167 if (ret) 3162 3168 printk(KERN_ERR "%s[%u] OFA CM event_handler returned, " 3163 3169 "ret=%d\n", __func__, __LINE__, ret); 3164 - nes_rem_ref(&nesqp->ibqp); 3165 3170 cm_id->rem_ref(cm_id); 3166 3171 3167 3172 rem_ref_cm_node(event->cm_node->cm_core, event->cm_node);
+2
drivers/infiniband/ulp/ipoib/ipoib.h
··· 293 293 294 294 struct delayed_work pkey_poll_task; 295 295 struct delayed_work mcast_task; 296 + struct work_struct carrier_on_task; 296 297 struct work_struct flush_light; 297 298 struct work_struct flush_normal; 298 299 struct work_struct flush_heavy; ··· 465 464 void ipoib_dev_cleanup(struct net_device *dev); 466 465 467 466 void ipoib_mcast_join_task(struct work_struct *work); 467 + void ipoib_mcast_carrier_on_task(struct work_struct *work); 468 468 void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb); 469 469 470 470 void ipoib_mcast_restart_task(struct work_struct *work);
+1
drivers/infiniband/ulp/ipoib/ipoib_main.c
··· 1075 1075 1076 1076 INIT_DELAYED_WORK(&priv->pkey_poll_task, ipoib_pkey_poll); 1077 1077 INIT_DELAYED_WORK(&priv->mcast_task, ipoib_mcast_join_task); 1078 + INIT_WORK(&priv->carrier_on_task, ipoib_mcast_carrier_on_task); 1078 1079 INIT_WORK(&priv->flush_light, ipoib_ib_dev_flush_light); 1079 1080 INIT_WORK(&priv->flush_normal, ipoib_ib_dev_flush_normal); 1080 1081 INIT_WORK(&priv->flush_heavy, ipoib_ib_dev_flush_heavy);
+21 -10
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
··· 366 366 return ret; 367 367 } 368 368 369 + void ipoib_mcast_carrier_on_task(struct work_struct *work) 370 + { 371 + struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv, 372 + carrier_on_task); 373 + 374 + /* 375 + * Take rtnl_lock to avoid racing with ipoib_stop() and 376 + * turning the carrier back on while a device is being 377 + * removed. 378 + */ 379 + rtnl_lock(); 380 + netif_carrier_on(priv->dev); 381 + rtnl_unlock(); 382 + } 383 + 369 384 static int ipoib_mcast_join_complete(int status, 370 385 struct ib_sa_multicast *multicast) 371 386 { ··· 407 392 &priv->mcast_task, 0); 408 393 mutex_unlock(&mcast_mutex); 409 394 410 - if (mcast == priv->broadcast) { 411 - /* 412 - * Take RTNL lock here to avoid racing with 413 - * ipoib_stop() and turning the carrier back 414 - * on while a device is being removed. 415 - */ 416 - rtnl_lock(); 417 - netif_carrier_on(dev); 418 - rtnl_unlock(); 419 - } 395 + /* 396 + * Defer carrier on work to ipoib_workqueue to avoid a 397 + * deadlock on rtnl_lock here. 398 + */ 399 + if (mcast == priv->broadcast) 400 + queue_work(ipoib_workqueue, &priv->carrier_on_task); 420 401 421 402 return 0; 422 403 }
+6 -4
drivers/net/mlx4/mr.c
··· 67 67 #define MLX4_MPT_FLAG_PHYSICAL (1 << 9) 68 68 #define MLX4_MPT_FLAG_REGION (1 << 8) 69 69 70 - #define MLX4_MPT_PD_FLAG_FAST_REG (1 << 26) 70 + #define MLX4_MPT_PD_FLAG_FAST_REG (1 << 27) 71 + #define MLX4_MPT_PD_FLAG_RAE (1 << 28) 71 72 #define MLX4_MPT_PD_FLAG_EN_INV (3 << 24) 72 - 73 - #define MLX4_MTT_FLAG_PRESENT 1 74 73 75 74 #define MLX4_MPT_STATUS_SW 0xF0 76 75 #define MLX4_MPT_STATUS_HW 0x00 ··· 347 348 if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) { 348 349 /* fast register MR in free state */ 349 350 mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_FREE); 350 - mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG); 351 + mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG | 352 + MLX4_MPT_PD_FLAG_RAE); 353 + mpt_entry->mtt_sz = cpu_to_be32((1 << mr->mtt.order) * 354 + MLX4_MTT_ENTRY_PER_SEG); 351 355 } else { 352 356 mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_SW_OWNS); 353 357 }
+4
include/linux/mlx4/device.h
··· 141 141 MLX4_STAT_RATE_OFFSET = 5 142 142 }; 143 143 144 + enum { 145 + MLX4_MTT_FLAG_PRESENT = 1 146 + }; 147 + 144 148 static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) 145 149 { 146 150 return (major << 32) | (minor << 16) | subminor;