On Wed, 16 Dec 2009 08:29:43 -0500 Hal Rosenstock <hal.rosenst...@gmail.com> wrote:
> On Tue, Dec 15, 2009 at 9:55 PM, Ira Weiny <wei...@llnl.gov> wrote: [snip] > > > > 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]; > > > > > > This maintains the p_dgid found in pr_rcv_get_end_points but appropriately > > set's the HopLimit when the DGID is off subnet. > > Yes, this looks right to me. Would it be better to only determine > gid_is_off_subnet once by saving this in a variable and passing it as > a parameter where needed ? > It might be faster but it would mean a bigger change. It looks like having the dgid or p_pr structures in some internal opensm structure to carry that information along would be best but that is a lot of work. Do you think this will adversely affect performance on a big system? I plan to roll this out internally and we will have a chance to test on bigger systems here. But there are larger out there now. Ira -- Ira Weiny Math Programmer/Computer Scientist Lawrence Livermore National Lab 925-423-8008 wei...@llnl.gov -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html