Version: 1
-Previous: 5d369d7f79a018216cd8ebca2741cd0f2a171177
+Previous: 4a6e4250cf20c1c018d37462804569b280c8f360
Head: a26b6e020fd54f16249125ed2fbf94bb93f7828e
Applied:
- dyn_ah: a26b6e020fd54f16249125ed2fbf94bb93f7828e
+ opt_mc_av: a26b6e020fd54f16249125ed2fbf94bb93f7828e
Unapplied:
addr_size: 8de02c47fbf595132105a7050ad6f755f49f9a7a
Hidden:
+++ /dev/null
-Bottom: 4a725c3b21d37e7ff6d4e2430fc69ddf4d72920a
-Top: ff1f0e0cc0c31d7a9b01b551462a6a3a0612e4b9
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2011-04-01 14:46:34 -0700
-
-ibacm: Allocate address handles dynamically when needed
-
-ibacm allocates an address handle for every remote destination
-that it tracks. However, under normal operation, the handle
-is used infrequently - typically only once by the target
-service to send a response and not at all on the initiator
-service. Avoid the overhead of having 1 address handle per
-destination by allocating them dynamically only when they are needed.
-
-The exceptions to this are the address handles allocated to
-communicate with the SA and the primary multicast group.
-
-Signed-off-by: Sean Hefty <sean.hefty@intel.com>
-
-
----
-
-diff --git a/src/acm.c b/src/acm.c
-index 15f2631..0dbc23c 100644
---- a/src/acm.c
-+++ b/src/acm.c
-@@ -164,6 +164,7 @@ struct acm_send_msg
- DLIST_ENTRY entry;
- struct acm_ep *ep;
- struct acm_dest *dest;
-+ struct ibv_ah *ah;
- void *context;
- void (*resp_handler)(struct acm_send_msg *req,
- struct ibv_wc *wc, struct acm_mad *resp);
-@@ -724,22 +725,32 @@ static void acm_process_join_resp(struct acm_ep *ep, struct ib_user_mad *umad)
- mc_rec = (struct ib_mc_member_rec *) mad->data;
- lock_acquire(&ep->lock);
- index = acm_mc_index(ep, &mc_rec->mgid);
-- if (index >= 0) {
-- dest = &ep->mc_dest[index];
-- dest->remote_qpn = IB_MC_QPN;
-- dest->mgid = mc_rec->mgid;
-- acm_record_mc_av(ep->port, mc_rec, dest);
-+ if (index < 0) {
-+ acm_log(0, "ERROR - MGID in join response not found\n");
-+ goto out;
-+ }
-+
-+ dest = &ep->mc_dest[index];
-+ dest->remote_qpn = IB_MC_QPN;
-+ dest->mgid = mc_rec->mgid;
-+ acm_record_mc_av(ep->port, mc_rec, dest);
-+
-+ if (index == 0) {
- dest->ah = ibv_create_ah(ep->port->dev->pd, &dest->av);
-+ if (!dest->ah) {
-+ acm_log(0, "ERROR - unable to create ah\n");
-+ goto out;
-+ }
- ret = ibv_attach_mcast(ep->qp, &mc_rec->mgid, mc_rec->mlid);
- if (ret) {
- acm_log(0, "ERROR - unable to attach QP to multicast group\n");
-- } else {
-- dest->state = ACM_READY;
-- acm_log(1, "join successful\n");
-+ goto out;
- }
-- } else {
-- acm_log(0, "ERROR - MGID in join response not found\n");
- }
-+
-+ dest->state = ACM_READY;
-+ acm_log(1, "join successful\n");
-+out:
- lock_release(&ep->lock);
- }
--- /dev/null
+Bottom: 4a725c3b21d37e7ff6d4e2430fc69ddf4d72920a
+Top: ff1f0e0cc0c31d7a9b01b551462a6a3a0612e4b9
+Author: Sean Hefty <sean.hefty@intel.com>
+Date: 2011-04-01 14:46:34 -0700
+
+ibacm: Allocate address handles dynamically when needed
+
+ibacm allocates an address handle for every remote destination
+that it tracks. However, under normal operation, the handle
+is used infrequently - typically only once by the target
+service to send a response and not at all on the initiator
+service. Avoid the overhead of having 1 address handle per
+destination by allocating them dynamically only when they are needed.
+
+The exceptions to this are the address handles allocated to
+communicate with the SA and the primary multicast group.
+
+Signed-off-by: Sean Hefty <sean.hefty@intel.com>
+
+
+---
+
+diff --git a/src/acm.c b/src/acm.c
+index 15f2631..0dbc23c 100644
+--- a/src/acm.c
++++ b/src/acm.c
+@@ -164,6 +164,7 @@ struct acm_send_msg
+ DLIST_ENTRY entry;
+ struct acm_ep *ep;
+ struct acm_dest *dest;
++ struct ibv_ah *ah;
+ void *context;
+ void (*resp_handler)(struct acm_send_msg *req,
+ struct ibv_wc *wc, struct acm_mad *resp);
+@@ -724,22 +725,32 @@ static void acm_process_join_resp(struct acm_ep *ep, struct ib_user_mad *umad)
+ mc_rec = (struct ib_mc_member_rec *) mad->data;
+ lock_acquire(&ep->lock);
+ index = acm_mc_index(ep, &mc_rec->mgid);
+- if (index >= 0) {
+- dest = &ep->mc_dest[index];
+- dest->remote_qpn = IB_MC_QPN;
+- dest->mgid = mc_rec->mgid;
+- acm_record_mc_av(ep->port, mc_rec, dest);
++ if (index < 0) {
++ acm_log(0, "ERROR - MGID in join response not found\n");
++ goto out;
++ }
++
++ dest = &ep->mc_dest[index];
++ dest->remote_qpn = IB_MC_QPN;
++ dest->mgid = mc_rec->mgid;
++ acm_record_mc_av(ep->port, mc_rec, dest);
++
++ if (index == 0) {
+ dest->ah = ibv_create_ah(ep->port->dev->pd, &dest->av);
++ if (!dest->ah) {
++ acm_log(0, "ERROR - unable to create ah\n");
++ goto out;
++ }
+ ret = ibv_attach_mcast(ep->qp, &mc_rec->mgid, mc_rec->mlid);
+ if (ret) {
+ acm_log(0, "ERROR - unable to attach QP to multicast group\n");
+- } else {
+- dest->state = ACM_READY;
+- acm_log(1, "join successful\n");
++ goto out;
+ }
+- } else {
+- acm_log(0, "ERROR - MGID in join response not found\n");
+ }
++
++ dest->state = ACM_READY;
++ acm_log(1, "join successful\n");
++out:
+ lock_release(&ep->lock);
+ }