From patchwork Tue Dec 22 11:57:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 69266 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBMBsSlf001593 for ; Tue, 22 Dec 2009 11:54:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752557AbZLVLy2 (ORCPT ); Tue, 22 Dec 2009 06:54:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752712AbZLVLy1 (ORCPT ); Tue, 22 Dec 2009 06:54:27 -0500 Received: from mail-fx0-f213.google.com ([209.85.220.213]:41113 "EHLO mail-fx0-f213.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752557AbZLVLy1 (ORCPT ); Tue, 22 Dec 2009 06:54:27 -0500 Received: by fxm5 with SMTP id 5so5779394fxm.28 for ; Tue, 22 Dec 2009 03:54:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:date:from:to :cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=d9WRQ2+Uk7VqbS5Tg0CsE1B7htVE5c1qa6cPlGDzKI8=; b=YbJGeMZRx1XBnnYhx17WmPuNF7v1AL3Tv9fs12Q6fUe7cAaaEDJIroYnf0CDH8ePhV zvTaFnZGEC+EeSSGzsop8LH8qiIPycRCvtFXylP1SLNBK3WDg30bPBbg5R9yUrqXEvNE XWoc8TCRTgUU6id6rQdtqllWMy33WvQpCWKgU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=eAoB1ue128HOh+L6C9rjGV0ri5T0ZQ5etRUKLtAQ9PsnRML28FSwXXt5UsB5zRPzV6 9qvo/wn7bSl3oEor/Vriu/6E6VAbRp+UXQAFkpbTKldYsLqLaigBCYcKPWTI8c0FLLSJ 1z+l/e5kCop2HjYbWnl1DwHJOaclZSZiYHhHQ= Received: by 10.102.210.9 with SMTP id i9mr1170020mug.50.1261482865471; Tue, 22 Dec 2009 03:54:25 -0800 (PST) Received: from me.localdomain (85.64.35.106.dynamic.barak-online.net [85.64.35.106]) by mx.google.com with ESMTPS id 23sm4008079mum.3.2009.12.22.03.54.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Dec 2009 03:54:24 -0800 (PST) Received: by me.localdomain (Postfix, from userid 1000) id 4444E11DF8; Tue, 22 Dec 2009 13:57:20 +0200 (IST) Date: Tue, 22 Dec 2009 13:57:20 +0200 From: Sasha Khapyorsky To: linux-rdma Cc: Hal Rosenstock , Ira Weiny Subject: [PATCH] osm_sa_path_record.c: use PR DGID by reference Message-ID: <20091222115720.GE26940@me> References: <20091215170317.GV5262@me> <20091215171532.GA8288@obsidianresearch.com> <20091215091819.c217cf36.weiny2@llnl.gov> <20091215185511.3ae458cc.weiny2@llnl.gov> <20091217181800.a1ee6b9b.weiny2@llnl.gov> <20091220195710.GA18524@me> <20091222113701.GC26940@me> <20091222113842.GD26940@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091222113842.GD26940@me> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/opensm/osm_sa_path_record.c b/opensm/opensm/osm_sa_path_record.c index b78225e..4614b6d 100644 --- a/opensm/opensm/osm_sa_path_record.c +++ b/opensm/opensm/osm_sa_path_record.c @@ -754,16 +754,12 @@ static void pr_rcv_build_pr(IN osm_sa_t * sa, IN const osm_port_t * p_src_port, { const osm_physp_t *p_src_physp; const osm_physp_t *p_dest_physp; - boolean_t is_nonzero_gid = 0; OSM_LOG_ENTER(sa->p_log); p_src_physp = p_src_port->p_physp; if (p_dgid) - is_nonzero_gid = ib_gid_is_notzero(p_dgid); - - if (is_nonzero_gid) p_pr->dgid = *p_dgid; else { p_dest_physp = p_dest_port->p_physp; @@ -783,7 +779,7 @@ static void pr_rcv_build_pr(IN osm_sa_t * sa, IN const osm_port_t * p_src_port, p_pr->hop_flow_raw &= cl_hton32(1 << 31); /* Only set HopLimit if going through a router */ - if (is_nonzero_gid) + if (p_dgid) p_pr->hop_flow_raw |= cl_hton32(IB_HOPLIMIT_MAX); p_pr->pkey = p_parms->pkey; @@ -1133,7 +1129,7 @@ static ib_net16_t pr_rcv_get_end_points(IN osm_sa_t * sa, IN const osm_madw_t * p_madw, OUT const osm_port_t ** pp_src_port, OUT const osm_port_t ** pp_dest_port, - OUT ib_gid_t * p_dgid) + OUT const ib_gid_t ** pp_dgid) { const ib_path_rec_t *p_pr; const ib_sa_mad_t *p_sa_mad; @@ -1217,9 +1213,6 @@ static ib_net16_t pr_rcv_get_end_points(IN osm_sa_t * sa, } } - if (p_dgid) - memset(p_dgid, 0, sizeof(*p_dgid)); - if (comp_mask & IB_PR_COMPMASK_DGID) { if (!ib_gid_is_link_local(&p_pr->dgid) && !ib_gid_is_multicast(&p_pr->dgid) && @@ -1236,8 +1229,8 @@ static ib_net16_t pr_rcv_get_end_points(IN osm_sa_t * sa, sa_status = IB_SA_MAD_STATUS_INVALID_GID; goto Exit; } - if (p_dgid) - *p_dgid = p_pr->dgid; + if (pp_dgid) + *pp_dgid = &p_pr->dgid; } else dest_guid = p_pr->dgid.unicast.interface_id; @@ -1560,7 +1553,7 @@ void osm_pr_rcv_process(IN void *context, IN void *data) const osm_port_t *p_src_port; const osm_port_t *p_dest_port; cl_qlist_t pr_list; - ib_gid_t dgid; + const ib_gid_t *p_dgid = NULL; ib_net16_t sa_status; osm_port_t *requester_port; @@ -1614,7 +1607,7 @@ void osm_pr_rcv_process(IN void *context, IN void *data) OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Unicast destination requested\n"); sa_status = pr_rcv_get_end_points(sa, p_madw, &p_src_port, &p_dest_port, - &dgid); + &p_dgid); if (sa_status == IB_SA_MAD_STATUS_SUCCESS) { /* What happens next depends on the type of endpoint information @@ -1624,17 +1617,17 @@ void osm_pr_rcv_process(IN void *context, IN void *data) if (p_dest_port) pr_rcv_process_pair(sa, p_madw, requester_port, p_src_port, p_dest_port, - &dgid, p_sa_mad->comp_mask, + p_dgid, p_sa_mad->comp_mask, &pr_list); else pr_rcv_process_half(sa, p_madw, requester_port, - p_src_port, NULL, &dgid, + p_src_port, NULL, p_dgid, p_sa_mad->comp_mask, &pr_list); } else { if (p_dest_port) pr_rcv_process_half(sa, p_madw, requester_port, - NULL, p_dest_port, &dgid, + NULL, p_dest_port, p_dgid, p_sa_mad->comp_mask, &pr_list); else @@ -1642,7 +1635,7 @@ void osm_pr_rcv_process(IN void *context, IN void *data) Katie, bar the door! */ pr_rcv_process_world(sa, p_madw, requester_port, - &dgid, p_sa_mad->comp_mask, + p_dgid, p_sa_mad->comp_mask, &pr_list); } }