public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
To: Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCHv5] opensm: Reduce heap consumption by multicast routing tables (MFTs)
Date: Fri, 30 Oct 2009 21:55:45 +0200	[thread overview]
Message-ID: <20091030195545.GA5829@me> (raw)
In-Reply-To: <f0e08f230910300647q274e4e76v70c60a978f84309c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Hal,

On 09:47 Fri 30 Oct     , Hal Rosenstock wrote:
> >> @@ -152,10 +166,11 @@ boolean_t osm_mcast_tbl_is_port(IN const osm_mcast_tbl_t * p_tbl,
> >>               CL_ASSERT(port_num <=
> >>                         (p_tbl->max_position + 1) * IB_MCAST_MASK_SIZE);
> >>               CL_ASSERT(mlid_ho >= IB_LID_MCAST_START_HO);
> >> -             CL_ASSERT(mlid_ho <= (uint16_t) (IB_LID_MCAST_START_HO +
> >> -                                              p_tbl->num_entries - 1));
> >> +             CL_ASSERT(mlid_ho <= p_tbl->max_mlid_ho);
> >>
> >>               mlid_offset = mlid_ho - IB_LID_MCAST_START_HO;
> >> +             if (mlid_offset >= p_tbl->mft_depth)
> >> +                     return FALSE;
> >
> > This duplicates CL_ASSERT() above.
> 
> Not quite. There's a difference between max_mlid_ho and mft_depth.

And 'max_mlid_ho <= mft_depth + IB_LID_MCAST_START_HO - 1', isn't it?

> > Looking on how this function is used
> > I don't see why we this check should be introduced. Do you?
> 
> It's needed for group removal to work properly.

Could you elaborate? osm_mcast_tbl_is_port() is called only from
osm_switch_recommend_mcast_path(), how is it related to group removal?

> 
> 
> >>               mask_offset = port_num / IB_MCAST_MASK_SIZE;
> >>               bit_mask = cl_ntoh16((uint16_t)
> >>                                    (1 << (port_num % IB_MCAST_MASK_SIZE)));
> >> @@ -180,10 +195,11 @@ boolean_t osm_mcast_tbl_is_any_port(IN const osm_mcast_tbl_t * p_tbl,
> >>
> >>       if (p_tbl->p_mask_tbl) {
> >>               CL_ASSERT(mlid_ho >= IB_LID_MCAST_START_HO);
> >> -             CL_ASSERT(mlid_ho <= (uint16_t) (IB_LID_MCAST_START_HO +
> >> -                                              p_tbl->num_entries - 1));
> >> +             CL_ASSERT(mlid_ho <= p_tbl->max_mlid_ho);
> >>
> >>               mlid_offset = mlid_ho - IB_LID_MCAST_START_HO;
> >> +             if (mlid_offset >= p_tbl->mft_depth)
> >> +                     return FALSE;
> >
> > Ditto.
> 
> See above.

And this function osm_mcast_tbl_is_any_port() is not called at all. Is
it?

> >> @@ -223,9 +238,6 @@ ib_api_status_t osm_mcast_tbl_set_block(IN osm_mcast_tbl_t * p_tbl,
> >>       if (block_num > p_tbl->max_block_in_use)
> >>               p_tbl->max_block_in_use = (uint16_t) block_num;
> >>
> >> -     if (mlid_start_ho + IB_MCAST_BLOCK_SIZE - 1 > p_tbl->max_mlid_ho)
> >> -             p_tbl->max_mlid_ho = mlid_start_ho + IB_MCAST_BLOCK_SIZE - 1;
> >> -
> >>       return IB_SUCCESS;
> >>  }
> >>
> >> @@ -241,6 +253,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho)
> >>
> >>       if (p_tbl->p_mask_tbl && (mlid_ho <= p_tbl->max_mlid_ho)) {
> >>               mlid_offset = mlid_ho - IB_LID_MCAST_START_HO;
> >> +             if (mlid_offset >= p_tbl->mft_depth)
> >> +                     return;
> >
> > This seems redundant for me after 'mlid_ho <= p_tbl->max_mlid_ho' check
> > above.
> 
> See above.

I see nothing related above. Again:

This is what we will have after your patch:

	if (p_tbl->p_mask_tbl && (mlid_ho <= p_tbl->max_mlid_ho)) {
		mlid_offset = mlid_ho - IB_LID_MCAST_START_HO;
		if (mlid_offset >= p_tbl->mft_depth)
			return;

, and assuming that:

	p_tbl->max_mlid_ho = p_tbl->mft_depth + IB_LID_MCAST_START_HO - 1

, how the second if () condition could be true?

Sasha
--
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

      parent reply	other threads:[~2009-10-30 19:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-23 23:48 [PATCHv5] opensm: Reduce heap consumption by multicast routing tables (MFTs) Hal Rosenstock
     [not found] ` <20091023234856.GA1482-Wuw85uim5zDR7s880joybQ@public.gmane.org>
2009-10-29 19:17   ` Sasha Khapyorsky
2009-10-29 19:18     ` [PATCH] opensm/osm_mcast_mgr: simplify alloc_mfts() Sasha Khapyorsky
2009-10-29 19:19     ` [PATCH] opensm/osm_mcast_tbl: remove redundant checks Sasha Khapyorsky
2009-10-30 13:47       ` Hal Rosenstock
2009-10-29 19:19     ` [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid Sasha Khapyorsky
2009-10-29 22:44       ` Ira Weiny
     [not found]         ` <20091029154431.72fc32bd.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-10-29 23:02           ` Sasha Khapyorsky
2009-10-29 23:09             ` Ira Weiny
     [not found]               ` <20091029160958.d13ed53e.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-10-30  0:32                 ` Sasha Khapyorsky
2009-10-30 13:47     ` [PATCHv5] opensm: Reduce heap consumption by multicast routing tables (MFTs) Hal Rosenstock
     [not found]       ` <f0e08f230910300647q274e4e76v70c60a978f84309c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-10-30 19:55         ` Sasha Khapyorsky [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=20091030195545.GA5829@me \
    --to=sashak-smomgflxvozwk0htik3j/w@public.gmane.org \
    --cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox