From patchwork Fri Apr 1 23:55:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 682781 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p31NtUJt013024 for ; Fri, 1 Apr 2011 23:55:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753910Ab1DAXza (ORCPT ); Fri, 1 Apr 2011 19:55:30 -0400 Received: from mga14.intel.com ([143.182.124.37]:62091 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753702Ab1DAXz3 convert rfc822-to-8bit (ORCPT ); Fri, 1 Apr 2011 19:55:29 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 01 Apr 2011 16:55:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.63,285,1299484800"; d="scan'208";a="412611100" Received: from orsmsx602.amr.corp.intel.com ([10.22.226.211]) by azsmga001.ch.intel.com with ESMTP; 01 Apr 2011 16:55:21 -0700 Received: from orsmsx501.amr.corp.intel.com ([10.22.226.209]) by orsmsx602.amr.corp.intel.com ([10.22.226.211]) with mapi; Fri, 1 Apr 2011 16:55:20 -0700 From: "Hefty, Sean" To: linux-rdma CC: "Hefty, Sean" Date: Fri, 1 Apr 2011 16:55:20 -0700 Subject: [PATCH 1/3] ibacm: Reduce overhead on multicast groups not used Thread-Topic: [PATCH 1/3] ibacm: Reduce overhead on multicast groups not used Thread-Index: AcvwyEIChnqntkeTRSa7K71KdbTx/Q== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Apr 2011 23:55:35 +0000 (UTC) diff --git a/src/acm.c b/src/acm.c index 15f2631..3df996b 100644 --- a/src/acm.c +++ b/src/acm.c @@ -724,22 +724,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); }