All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yevgeny Kliteynik <kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
Cc: Linux RDMA <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] opensm/osm_mcast_mgr.c: fix osm_mcast_mgr_compute_max_hops for managed switch
Date: Wed, 23 Dec 2009 16:29:45 +0200	[thread overview]
Message-ID: <4B322959.10500@dev.mellanox.co.il> (raw)
In-Reply-To: <20091222212348.GF26940@me>

Hi Sasha,

On 22/Dec/09 23:23, Sasha Khapyorsky wrote:
> Hi Yevgeny,
>
> On 11:46 Mon 21 Dec     , Yevgeny Kliteynik wrote:
>> If a certain mcast group has only one member, and this
>> member is a switch, OSM fails to select this switch
>> when trying to create spanning tree for this mcast group:
>>
>> ERR 0A08: Unable to locate a suitable switch for group 0xC000
>> ERR 0A17: Unable to create spanning tree (IB_ERROR) for mlid 0xc000
>>
>> Signed-off-by: Yevgeny Kliteynik<kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
>> ---
>>   opensm/opensm/osm_mcast_mgr.c |   16 ++++++++++------
>>   1 files changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c
>> index 697fb58..16f578b 100644
>> --- a/opensm/opensm/osm_mcast_mgr.c
>> +++ b/opensm/opensm/osm_mcast_mgr.c
>> @@ -204,6 +204,12 @@ static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qlist_t * l,
>>
>>   	OSM_LOG_ENTER(sm->p_log);
>>
>> +	if (cl_qlist_count(l) == 0) {
>> +		/*  We should be here if there aren't any ports in the group */
>> +		max_hops = 10001; /* see later - we use it to realize no hops */
>> +		goto Exit;
>> +	}
>> +
>
> Could we reach this condition?
>
>> From the caller code:
>
> 	num_ports = cl_qlist_count(&port_list);
> 	if (num_ports == 0) {
> 		OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
> 			"MLID 0x%X has no members - nothing to do\n",
> 			mbox->mlid);
> 		goto Exit;
> 	}

You're fight, we can't reach this condition anyway.
So the fix should be just removing the special treatment
of the problematic case. Patch shortly.

-- Yevgeny
  
> Sasha
>
>>   	/*
>>   	   For each member of the multicast group, compute the
>>   	   number of hops to its base LID.
>> @@ -215,12 +221,10 @@ static float osm_mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qlist_t * l,
>>   			max_hops = hops;
>>   	}
>>
>> -	if (max_hops == 0)
>> -		/*
>> -		   We should be here if there aren't any ports in the group.
>> -		 */
>> -		max_hops = 10001;	/* see later - we use it to realize no hops */
>> -
>> +	/* Note that at this point we might get (max_hops == 0),
>> +	   which means that there's only one member in the mcast
>> +	   group, and it's the current switch */
>> +Exit:
>>   	OSM_LOG_EXIT(sm->p_log);
>>   	return (float)max_hops;
>>   }
>> --
>> 1.5.1.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2009-12-23 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21  9:46 [PATCH] opensm/osm_mcast_mgr.c: fix osm_mcast_mgr_compute_max_hops for managed switch Yevgeny Kliteynik
     [not found] ` <4B2F4405.9000300-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2009-12-22 21:23   ` Sasha Khapyorsky
2009-12-23 14:29     ` Yevgeny Kliteynik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B322959.10500@dev.mellanox.co.il \
    --to=kliteyn-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.