diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-19 19:18:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-19 19:18:21 -0400 |
commit | 5a0cd4eb661fea095ff9962060c21c161a9ed43f (patch) | |
tree | 7e1e7a044fc9d04d2da246a58a52bd07c4e5fef0 /drivers | |
parent | b4df9d88a62c6db4cee0d96507a27527bf205dde (diff) | |
parent | 7e2c23285454ecc8c8159b86d6343efe222ca3ae (diff) |
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/mlx4/qp.c | 6 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_cm.c | 11 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib.h | 2 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 1 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 31 | ||||
-rw-r--r-- | drivers/net/mlx4/mr.c | 10 |
6 files changed, 38 insertions, 23 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index f29dbb767e87..9559248f265b 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
@@ -1342,6 +1342,12 @@ static __be32 convert_access(int acc) | |||
1342 | static void set_fmr_seg(struct mlx4_wqe_fmr_seg *fseg, struct ib_send_wr *wr) | 1342 | static void set_fmr_seg(struct mlx4_wqe_fmr_seg *fseg, struct ib_send_wr *wr) |
1343 | { | 1343 | { |
1344 | struct mlx4_ib_fast_reg_page_list *mfrpl = to_mfrpl(wr->wr.fast_reg.page_list); | 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 | fseg->flags = convert_access(wr->wr.fast_reg.access_flags); | 1352 | fseg->flags = convert_access(wr->wr.fast_reg.access_flags); |
1347 | fseg->mem_key = cpu_to_be32(wr->wr.fast_reg.rkey); | 1353 | fseg->mem_key = cpu_to_be32(wr->wr.fast_reg.rkey); |
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 9f0b964b2c99..499d3cf83e1f 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c | |||
@@ -1956,13 +1956,6 @@ static int mini_cm_reject(struct nes_cm_core *cm_core, | |||
1956 | return ret; | 1956 | return ret; |
1957 | cleanup_retrans_entry(cm_node); | 1957 | cleanup_retrans_entry(cm_node); |
1958 | cm_node->state = NES_CM_STATE_CLOSED; | 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 | ret = send_reset(cm_node, NULL); | 1960 | ret = send_reset(cm_node, NULL); |
1968 | return ret; | 1961 | return ret; |
@@ -2383,6 +2376,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp) | |||
2383 | atomic_inc(&cm_disconnects); | 2376 | atomic_inc(&cm_disconnects); |
2384 | cm_event.event = IW_CM_EVENT_DISCONNECT; | 2377 | cm_event.event = IW_CM_EVENT_DISCONNECT; |
2385 | if (last_ae == NES_AEQE_AEID_LLP_CONNECTION_RESET) { | 2378 | if (last_ae == NES_AEQE_AEID_LLP_CONNECTION_RESET) { |
2379 | issued_disconnect_reset = 1; | ||
2386 | cm_event.status = IW_CM_EVENT_STATUS_RESET; | 2380 | cm_event.status = IW_CM_EVENT_STATUS_RESET; |
2387 | nes_debug(NES_DBG_CM, "Generating a CM " | 2381 | nes_debug(NES_DBG_CM, "Generating a CM " |
2388 | "Disconnect Event (status reset) for " | 2382 | "Disconnect Event (status reset) for " |
@@ -2508,7 +2502,6 @@ static int nes_disconnect(struct nes_qp *nesqp, int abrupt) | |||
2508 | nes_debug(NES_DBG_CM, "Call close API\n"); | 2502 | nes_debug(NES_DBG_CM, "Call close API\n"); |
2509 | 2503 | ||
2510 | g_cm_core->api->close(g_cm_core, nesqp->cm_node); | 2504 | g_cm_core->api->close(g_cm_core, nesqp->cm_node); |
2511 | nesqp->cm_node = NULL; | ||
2512 | } | 2505 | } |
2513 | 2506 | ||
2514 | return ret; | 2507 | return ret; |
@@ -2837,6 +2830,7 @@ int nes_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) | |||
2837 | cm_node->apbvt_set = 1; | 2830 | cm_node->apbvt_set = 1; |
2838 | nesqp->cm_node = cm_node; | 2831 | nesqp->cm_node = cm_node; |
2839 | cm_node->nesqp = nesqp; | 2832 | cm_node->nesqp = nesqp; |
2833 | nes_add_ref(&nesqp->ibqp); | ||
2840 | 2834 | ||
2841 | return 0; | 2835 | return 0; |
2842 | } | 2836 | } |
@@ -3167,7 +3161,6 @@ static void cm_event_connect_error(struct nes_cm_event *event) | |||
3167 | if (ret) | 3161 | if (ret) |
3168 | printk(KERN_ERR "%s[%u] OFA CM event_handler returned, " | 3162 | printk(KERN_ERR "%s[%u] OFA CM event_handler returned, " |
3169 | "ret=%d\n", __func__, __LINE__, ret); | 3163 | "ret=%d\n", __func__, __LINE__, ret); |
3170 | nes_rem_ref(&nesqp->ibqp); | ||
3171 | cm_id->rem_ref(cm_id); | 3164 | cm_id->rem_ref(cm_id); |
3172 | 3165 | ||
3173 | rem_ref_cm_node(event->cm_node->cm_core, event->cm_node); | 3166 | rem_ref_cm_node(event->cm_node->cm_core, event->cm_node); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index b0ffc9abe8c0..05eb41b8ab63 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
@@ -293,6 +293,7 @@ struct ipoib_dev_priv { | |||
293 | 293 | ||
294 | struct delayed_work pkey_poll_task; | 294 | struct delayed_work pkey_poll_task; |
295 | struct delayed_work mcast_task; | 295 | struct delayed_work mcast_task; |
296 | struct work_struct carrier_on_task; | ||
296 | struct work_struct flush_light; | 297 | struct work_struct flush_light; |
297 | struct work_struct flush_normal; | 298 | struct work_struct flush_normal; |
298 | struct work_struct flush_heavy; | 299 | struct work_struct flush_heavy; |
@@ -464,6 +465,7 @@ int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port); | |||
464 | void ipoib_dev_cleanup(struct net_device *dev); | 465 | void ipoib_dev_cleanup(struct net_device *dev); |
465 | 466 | ||
466 | void ipoib_mcast_join_task(struct work_struct *work); | 467 | void ipoib_mcast_join_task(struct work_struct *work); |
468 | void ipoib_mcast_carrier_on_task(struct work_struct *work); | ||
467 | void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb); | 469 | void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb); |
468 | 470 | ||
469 | void ipoib_mcast_restart_task(struct work_struct *work); | 471 | void ipoib_mcast_restart_task(struct work_struct *work); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 7e9e218738fa..1b1df5cc4113 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -1075,6 +1075,7 @@ static void ipoib_setup(struct net_device *dev) | |||
1075 | 1075 | ||
1076 | INIT_DELAYED_WORK(&priv->pkey_poll_task, ipoib_pkey_poll); | 1076 | INIT_DELAYED_WORK(&priv->pkey_poll_task, ipoib_pkey_poll); |
1077 | INIT_DELAYED_WORK(&priv->mcast_task, ipoib_mcast_join_task); | 1077 | INIT_DELAYED_WORK(&priv->mcast_task, ipoib_mcast_join_task); |
1078 | INIT_WORK(&priv->carrier_on_task, ipoib_mcast_carrier_on_task); | ||
1078 | INIT_WORK(&priv->flush_light, ipoib_ib_dev_flush_light); | 1079 | INIT_WORK(&priv->flush_light, ipoib_ib_dev_flush_light); |
1079 | INIT_WORK(&priv->flush_normal, ipoib_ib_dev_flush_normal); | 1080 | INIT_WORK(&priv->flush_normal, ipoib_ib_dev_flush_normal); |
1080 | INIT_WORK(&priv->flush_heavy, ipoib_ib_dev_flush_heavy); | 1081 | INIT_WORK(&priv->flush_heavy, ipoib_ib_dev_flush_heavy); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index ac33c8f3ea85..aae28620a6e5 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -366,6 +366,21 @@ static int ipoib_mcast_sendonly_join(struct ipoib_mcast *mcast) | |||
366 | return ret; | 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 | static int ipoib_mcast_join_complete(int status, | 384 | static int ipoib_mcast_join_complete(int status, |
370 | struct ib_sa_multicast *multicast) | 385 | struct ib_sa_multicast *multicast) |
371 | { | 386 | { |
@@ -392,16 +407,12 @@ static int ipoib_mcast_join_complete(int status, | |||
392 | &priv->mcast_task, 0); | 407 | &priv->mcast_task, 0); |
393 | mutex_unlock(&mcast_mutex); | 408 | mutex_unlock(&mcast_mutex); |
394 | 409 | ||
395 | if (mcast == priv->broadcast) { | 410 | /* |
396 | /* | 411 | * Defer carrier on work to ipoib_workqueue to avoid a |
397 | * Take RTNL lock here to avoid racing with | 412 | * deadlock on rtnl_lock here. |
398 | * ipoib_stop() and turning the carrier back | 413 | */ |
399 | * on while a device is being removed. | 414 | if (mcast == priv->broadcast) |
400 | */ | 415 | queue_work(ipoib_workqueue, &priv->carrier_on_task); |
401 | rtnl_lock(); | ||
402 | netif_carrier_on(dev); | ||
403 | rtnl_unlock(); | ||
404 | } | ||
405 | 416 | ||
406 | return 0; | 417 | return 0; |
407 | } | 418 | } |
diff --git a/drivers/net/mlx4/mr.c b/drivers/net/mlx4/mr.c index 62071d9c4a55..d1dd5b48dbd1 100644 --- a/drivers/net/mlx4/mr.c +++ b/drivers/net/mlx4/mr.c | |||
@@ -67,11 +67,10 @@ struct mlx4_mpt_entry { | |||
67 | #define MLX4_MPT_FLAG_PHYSICAL (1 << 9) | 67 | #define MLX4_MPT_FLAG_PHYSICAL (1 << 9) |
68 | #define MLX4_MPT_FLAG_REGION (1 << 8) | 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 | #define MLX4_MPT_PD_FLAG_EN_INV (3 << 24) | 72 | #define MLX4_MPT_PD_FLAG_EN_INV (3 << 24) |
72 | 73 | ||
73 | #define MLX4_MTT_FLAG_PRESENT 1 | ||
74 | |||
75 | #define MLX4_MPT_STATUS_SW 0xF0 | 74 | #define MLX4_MPT_STATUS_SW 0xF0 |
76 | #define MLX4_MPT_STATUS_HW 0x00 | 75 | #define MLX4_MPT_STATUS_HW 0x00 |
77 | 76 | ||
@@ -348,7 +347,10 @@ int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr) | |||
348 | if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) { | 347 | if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) { |
349 | /* fast register MR in free state */ | 348 | /* fast register MR in free state */ |
350 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_FREE); | 349 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_FREE); |
351 | mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG); | 350 | mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG | |
351 | MLX4_MPT_PD_FLAG_RAE); | ||
352 | mpt_entry->mtt_sz = cpu_to_be32((1 << mr->mtt.order) * | ||
353 | MLX4_MTT_ENTRY_PER_SEG); | ||
352 | } else { | 354 | } else { |
353 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_SW_OWNS); | 355 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_SW_OWNS); |
354 | } | 356 | } |