diff options
-rw-r--r-- | drivers/infiniband/core/mad.c | 10 | ||||
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_cmd.c | 38 | ||||
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_dev.h | 4 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib.h | 1 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 28 |
5 files changed, 55 insertions, 26 deletions
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index d393b504bf26..c82f47a66e48 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c | |||
@@ -665,7 +665,15 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, | |||
665 | struct ib_wc mad_wc; | 665 | struct ib_wc mad_wc; |
666 | struct ib_send_wr *send_wr = &mad_send_wr->send_wr; | 666 | struct ib_send_wr *send_wr = &mad_send_wr->send_wr; |
667 | 667 | ||
668 | if (!smi_handle_dr_smp_send(smp, device->node_type, port_num)) { | 668 | /* |
669 | * Directed route handling starts if the initial LID routed part of | ||
670 | * a request or the ending LID routed part of a response is empty. | ||
671 | * If we are at the start of the LID routed part, don't update the | ||
672 | * hop_ptr or hop_cnt. See section 14.2.2, Vol 1 IB spec. | ||
673 | */ | ||
674 | if ((ib_get_smp_direction(smp) ? smp->dr_dlid : smp->dr_slid) == | ||
675 | IB_LID_PERMISSIVE && | ||
676 | !smi_handle_dr_smp_send(smp, device->node_type, port_num)) { | ||
669 | ret = -EINVAL; | 677 | ret = -EINVAL; |
670 | printk(KERN_ERR PFX "Invalid directed route\n"); | 678 | printk(KERN_ERR PFX "Invalid directed route\n"); |
671 | goto out; | 679 | goto out; |
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c index f9b9b93dc501..2825615ce81c 100644 --- a/drivers/infiniband/hw/mthca/mthca_cmd.c +++ b/drivers/infiniband/hw/mthca/mthca_cmd.c | |||
@@ -1029,25 +1029,6 @@ int mthca_QUERY_DEV_LIM(struct mthca_dev *dev, | |||
1029 | MTHCA_GET(size, outbox, QUERY_DEV_LIM_UAR_ENTRY_SZ_OFFSET); | 1029 | MTHCA_GET(size, outbox, QUERY_DEV_LIM_UAR_ENTRY_SZ_OFFSET); |
1030 | dev_lim->uar_scratch_entry_sz = size; | 1030 | dev_lim->uar_scratch_entry_sz = size; |
1031 | 1031 | ||
1032 | mthca_dbg(dev, "Max QPs: %d, reserved QPs: %d, entry size: %d\n", | ||
1033 | dev_lim->max_qps, dev_lim->reserved_qps, dev_lim->qpc_entry_sz); | ||
1034 | mthca_dbg(dev, "Max SRQs: %d, reserved SRQs: %d, entry size: %d\n", | ||
1035 | dev_lim->max_srqs, dev_lim->reserved_srqs, dev_lim->srq_entry_sz); | ||
1036 | mthca_dbg(dev, "Max CQs: %d, reserved CQs: %d, entry size: %d\n", | ||
1037 | dev_lim->max_cqs, dev_lim->reserved_cqs, dev_lim->cqc_entry_sz); | ||
1038 | mthca_dbg(dev, "Max EQs: %d, reserved EQs: %d, entry size: %d\n", | ||
1039 | dev_lim->max_eqs, dev_lim->reserved_eqs, dev_lim->eqc_entry_sz); | ||
1040 | mthca_dbg(dev, "reserved MPTs: %d, reserved MTTs: %d\n", | ||
1041 | dev_lim->reserved_mrws, dev_lim->reserved_mtts); | ||
1042 | mthca_dbg(dev, "Max PDs: %d, reserved PDs: %d, reserved UARs: %d\n", | ||
1043 | dev_lim->max_pds, dev_lim->reserved_pds, dev_lim->reserved_uars); | ||
1044 | mthca_dbg(dev, "Max QP/MCG: %d, reserved MGMs: %d\n", | ||
1045 | dev_lim->max_pds, dev_lim->reserved_mgms); | ||
1046 | mthca_dbg(dev, "Max CQEs: %d, max WQEs: %d, max SRQ WQEs: %d\n", | ||
1047 | dev_lim->max_cq_sz, dev_lim->max_qp_sz, dev_lim->max_srq_sz); | ||
1048 | |||
1049 | mthca_dbg(dev, "Flags: %08x\n", dev_lim->flags); | ||
1050 | |||
1051 | if (mthca_is_memfree(dev)) { | 1032 | if (mthca_is_memfree(dev)) { |
1052 | MTHCA_GET(field, outbox, QUERY_DEV_LIM_MAX_SRQ_SZ_OFFSET); | 1033 | MTHCA_GET(field, outbox, QUERY_DEV_LIM_MAX_SRQ_SZ_OFFSET); |
1053 | dev_lim->max_srq_sz = 1 << field; | 1034 | dev_lim->max_srq_sz = 1 << field; |
@@ -1093,6 +1074,25 @@ int mthca_QUERY_DEV_LIM(struct mthca_dev *dev, | |||
1093 | dev_lim->mpt_entry_sz = MTHCA_MPT_ENTRY_SIZE; | 1074 | dev_lim->mpt_entry_sz = MTHCA_MPT_ENTRY_SIZE; |
1094 | } | 1075 | } |
1095 | 1076 | ||
1077 | mthca_dbg(dev, "Max QPs: %d, reserved QPs: %d, entry size: %d\n", | ||
1078 | dev_lim->max_qps, dev_lim->reserved_qps, dev_lim->qpc_entry_sz); | ||
1079 | mthca_dbg(dev, "Max SRQs: %d, reserved SRQs: %d, entry size: %d\n", | ||
1080 | dev_lim->max_srqs, dev_lim->reserved_srqs, dev_lim->srq_entry_sz); | ||
1081 | mthca_dbg(dev, "Max CQs: %d, reserved CQs: %d, entry size: %d\n", | ||
1082 | dev_lim->max_cqs, dev_lim->reserved_cqs, dev_lim->cqc_entry_sz); | ||
1083 | mthca_dbg(dev, "Max EQs: %d, reserved EQs: %d, entry size: %d\n", | ||
1084 | dev_lim->max_eqs, dev_lim->reserved_eqs, dev_lim->eqc_entry_sz); | ||
1085 | mthca_dbg(dev, "reserved MPTs: %d, reserved MTTs: %d\n", | ||
1086 | dev_lim->reserved_mrws, dev_lim->reserved_mtts); | ||
1087 | mthca_dbg(dev, "Max PDs: %d, reserved PDs: %d, reserved UARs: %d\n", | ||
1088 | dev_lim->max_pds, dev_lim->reserved_pds, dev_lim->reserved_uars); | ||
1089 | mthca_dbg(dev, "Max QP/MCG: %d, reserved MGMs: %d\n", | ||
1090 | dev_lim->max_pds, dev_lim->reserved_mgms); | ||
1091 | mthca_dbg(dev, "Max CQEs: %d, max WQEs: %d, max SRQ WQEs: %d\n", | ||
1092 | dev_lim->max_cq_sz, dev_lim->max_qp_sz, dev_lim->max_srq_sz); | ||
1093 | |||
1094 | mthca_dbg(dev, "Flags: %08x\n", dev_lim->flags); | ||
1095 | |||
1096 | out: | 1096 | out: |
1097 | mthca_free_mailbox(dev, mailbox); | 1097 | mthca_free_mailbox(dev, mailbox); |
1098 | return err; | 1098 | return err; |
diff --git a/drivers/infiniband/hw/mthca/mthca_dev.h b/drivers/infiniband/hw/mthca/mthca_dev.h index 2a165fd06e57..e481037288d6 100644 --- a/drivers/infiniband/hw/mthca/mthca_dev.h +++ b/drivers/infiniband/hw/mthca/mthca_dev.h | |||
@@ -53,8 +53,8 @@ | |||
53 | 53 | ||
54 | #define DRV_NAME "ib_mthca" | 54 | #define DRV_NAME "ib_mthca" |
55 | #define PFX DRV_NAME ": " | 55 | #define PFX DRV_NAME ": " |
56 | #define DRV_VERSION "0.06" | 56 | #define DRV_VERSION "0.07" |
57 | #define DRV_RELDATE "June 23, 2005" | 57 | #define DRV_RELDATE "February 13, 2006" |
58 | 58 | ||
59 | enum { | 59 | enum { |
60 | MTHCA_FLAG_DDR_HIDDEN = 1 << 1, | 60 | MTHCA_FLAG_DDR_HIDDEN = 1 << 1, |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index e0a5412b7e68..2f85a9a831b1 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
@@ -78,6 +78,7 @@ enum { | |||
78 | IPOIB_FLAG_SUBINTERFACE = 4, | 78 | IPOIB_FLAG_SUBINTERFACE = 4, |
79 | IPOIB_MCAST_RUN = 5, | 79 | IPOIB_MCAST_RUN = 5, |
80 | IPOIB_STOP_REAPER = 6, | 80 | IPOIB_STOP_REAPER = 6, |
81 | IPOIB_MCAST_STARTED = 7, | ||
81 | 82 | ||
82 | IPOIB_MAX_BACKOFF_SECONDS = 16, | 83 | IPOIB_MAX_BACKOFF_SECONDS = 16, |
83 | 84 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index ccaa0c387076..a2408d7ec598 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -533,8 +533,10 @@ void ipoib_mcast_join_task(void *dev_ptr) | |||
533 | } | 533 | } |
534 | 534 | ||
535 | if (!priv->broadcast) { | 535 | if (!priv->broadcast) { |
536 | priv->broadcast = ipoib_mcast_alloc(dev, 1); | 536 | struct ipoib_mcast *broadcast; |
537 | if (!priv->broadcast) { | 537 | |
538 | broadcast = ipoib_mcast_alloc(dev, 1); | ||
539 | if (!broadcast) { | ||
538 | ipoib_warn(priv, "failed to allocate broadcast group\n"); | 540 | ipoib_warn(priv, "failed to allocate broadcast group\n"); |
539 | mutex_lock(&mcast_mutex); | 541 | mutex_lock(&mcast_mutex); |
540 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) | 542 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) |
@@ -544,10 +546,11 @@ void ipoib_mcast_join_task(void *dev_ptr) | |||
544 | return; | 546 | return; |
545 | } | 547 | } |
546 | 548 | ||
547 | memcpy(priv->broadcast->mcmember.mgid.raw, priv->dev->broadcast + 4, | 549 | spin_lock_irq(&priv->lock); |
550 | memcpy(broadcast->mcmember.mgid.raw, priv->dev->broadcast + 4, | ||
548 | sizeof (union ib_gid)); | 551 | sizeof (union ib_gid)); |
552 | priv->broadcast = broadcast; | ||
549 | 553 | ||
550 | spin_lock_irq(&priv->lock); | ||
551 | __ipoib_mcast_add(dev, priv->broadcast); | 554 | __ipoib_mcast_add(dev, priv->broadcast); |
552 | spin_unlock_irq(&priv->lock); | 555 | spin_unlock_irq(&priv->lock); |
553 | } | 556 | } |
@@ -601,6 +604,10 @@ int ipoib_mcast_start_thread(struct net_device *dev) | |||
601 | queue_work(ipoib_workqueue, &priv->mcast_task); | 604 | queue_work(ipoib_workqueue, &priv->mcast_task); |
602 | mutex_unlock(&mcast_mutex); | 605 | mutex_unlock(&mcast_mutex); |
603 | 606 | ||
607 | spin_lock_irq(&priv->lock); | ||
608 | set_bit(IPOIB_MCAST_STARTED, &priv->flags); | ||
609 | spin_unlock_irq(&priv->lock); | ||
610 | |||
604 | return 0; | 611 | return 0; |
605 | } | 612 | } |
606 | 613 | ||
@@ -611,6 +618,10 @@ int ipoib_mcast_stop_thread(struct net_device *dev, int flush) | |||
611 | 618 | ||
612 | ipoib_dbg_mcast(priv, "stopping multicast thread\n"); | 619 | ipoib_dbg_mcast(priv, "stopping multicast thread\n"); |
613 | 620 | ||
621 | spin_lock_irq(&priv->lock); | ||
622 | clear_bit(IPOIB_MCAST_STARTED, &priv->flags); | ||
623 | spin_unlock_irq(&priv->lock); | ||
624 | |||
614 | mutex_lock(&mcast_mutex); | 625 | mutex_lock(&mcast_mutex); |
615 | clear_bit(IPOIB_MCAST_RUN, &priv->flags); | 626 | clear_bit(IPOIB_MCAST_RUN, &priv->flags); |
616 | cancel_delayed_work(&priv->mcast_task); | 627 | cancel_delayed_work(&priv->mcast_task); |
@@ -693,6 +704,14 @@ void ipoib_mcast_send(struct net_device *dev, union ib_gid *mgid, | |||
693 | */ | 704 | */ |
694 | spin_lock(&priv->lock); | 705 | spin_lock(&priv->lock); |
695 | 706 | ||
707 | if (!test_bit(IPOIB_MCAST_STARTED, &priv->flags) || | ||
708 | !priv->broadcast || | ||
709 | !test_bit(IPOIB_MCAST_FLAG_ATTACHED, &priv->broadcast->flags)) { | ||
710 | ++priv->stats.tx_dropped; | ||
711 | dev_kfree_skb_any(skb); | ||
712 | goto unlock; | ||
713 | } | ||
714 | |||
696 | mcast = __ipoib_mcast_find(dev, mgid); | 715 | mcast = __ipoib_mcast_find(dev, mgid); |
697 | if (!mcast) { | 716 | if (!mcast) { |
698 | /* Let's create a new send only group now */ | 717 | /* Let's create a new send only group now */ |
@@ -754,6 +773,7 @@ out: | |||
754 | ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN); | 773 | ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN); |
755 | } | 774 | } |
756 | 775 | ||
776 | unlock: | ||
757 | spin_unlock(&priv->lock); | 777 | spin_unlock(&priv->lock); |
758 | } | 778 | } |
759 | 779 | ||