From patchwork Wed Dec 16 02:55:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 68287 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 nBI4ixk2005715 for ; Fri, 18 Dec 2009 04:45:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756224AbZLPC6h (ORCPT ); Tue, 15 Dec 2009 21:58:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756230AbZLPC6h (ORCPT ); Tue, 15 Dec 2009 21:58:37 -0500 Received: from nspiron-2.llnl.gov ([128.115.41.82]:8616 "EHLO nspiron-2.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756224AbZLPC6h (ORCPT ); Tue, 15 Dec 2009 21:58:37 -0500 X-Attachments: None Received: from mail-2.llnl.gov ([128.115.41.181]) by nspiron-2.llnl.gov with ESMTP; 15 Dec 2009 18:58:36 -0800 Received: from jeepcj7.llnl.gov (jeepcj7.llnl.gov [134.9.93.67]) by mail-2.llnl.gov (8.13.1/8.12.3/LLNL evision: 1.7 $) with SMTP id nBG2wPsp012509; Tue, 15 Dec 2009 18:58:25 -0800 Date: Tue, 15 Dec 2009 18:55:11 -0800 From: Ira Weiny To: Hal Rosenstock Cc: Jason Gunthorpe , Sasha Khapyorsky , "linux-rdma@vger.kernel.org" Subject: [RFC PATCH] Set HopLimit based on off subnet Re: SRP issues with OpenSM 3.3.3 Message-Id: <20091215185511.3ae458cc.weiny2@llnl.gov> In-Reply-To: References: <20091214164334.064102f0.weiny2@llnl.gov> <20091215170317.GV5262@me> <20091215171532.GA8288@obsidianresearch.com> <20091215091819.c217cf36.weiny2@llnl.gov> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.10.4; x86_64-unknown-linux-gnu) Mime-Version: 1.0 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 be0cd71..1fa83a1 100644 --- a/opensm/opensm/osm_sa_path_record.c +++ b/opensm/opensm/osm_sa_path_record.c @@ -757,6 +757,14 @@ Exit: return (status); } +static int gid_is_off_subnet(IN osm_sa_t * sa, IN const ib_gid_t * p_dgid) +{ + return (!ib_gid_is_link_local(p_dgid) && + !ib_gid_is_multicast(p_dgid) && + ib_gid_get_subnet_prefix(p_dgid) != + sa->p_subn->opt.subnet_prefix); +} + /********************************************************************** **********************************************************************/ static void pr_rcv_build_pr(IN osm_sa_t * sa, IN const osm_port_t * p_src_port, @@ -770,16 +778,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; @@ -799,7 +803,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 (gid_is_off_subnet(sa, &p_pr->dgid)) p_pr->hop_flow_raw |= cl_hton32(IB_HOPLIMIT_MAX); p_pr->pkey = p_parms->pkey; @@ -1248,10 +1252,7 @@ static ib_net16_t pr_rcv_get_end_points(IN osm_sa_t * sa, 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) && - ib_gid_get_subnet_prefix(&p_pr->dgid) != - sa->p_subn->opt.subnet_prefix) { + if (gid_is_off_subnet(sa, &p_pr->dgid)) { dest_guid = find_router(sa, p_pr->dgid.unicast.prefix); if (!dest_guid) { char gid_str[INET6_ADDRSTRLEN];