From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Alex Netes <alexne-smomgflXvOZWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH/opensm] Decode the SAPKeyTableRecord block number properly, and don't segv
Date: Wed, 23 Feb 2011 11:13:37 -0700 [thread overview]
Message-ID: <20110223181337.GA31715@obsidianresearch.com> (raw)
In-Reply-To: <20110223172019.GA8537-iQai9MGU/dyyaiaB+Ve85laTQe2KTcn/@public.gmane.org>
On Wed, Feb 23, 2011 at 07:20:19PM +0200, Alex Netes wrote:
> I guess reserved2 could also be changed to ib_net16_t, right?
Sure, but unrelated, might be lots more too?
> > diff --git a/opensm/opensm/osm_sa_pkey_record.c b/opensm/opensm/osm_sa_pkey_record.c
> > index e4930d0..cf50430 100644
> > +++ b/opensm/opensm/osm_sa_pkey_record.c
> > @@ -71,6 +71,7 @@ static void sa_pkey_create(IN osm_sa_t * sa, IN osm_physp_t * p_physp,
> > osm_pkey_item_t *p_rec_item;
> > uint16_t lid;
> > ib_api_status_t status = IB_SUCCESS;
> > + ib_pkey_table_t *tbl;
> >
> > OSM_LOG_ENTER(sa->p_log);
> >
> > @@ -98,8 +99,15 @@ static void sa_pkey_create(IN osm_sa_t * sa, IN osm_physp_t * p_physp,
> > p_rec_item->rec.lid = lid;
> > p_rec_item->rec.block_num = block;
> > p_rec_item->rec.port_num = osm_physp_get_port_num(p_physp);
> > - p_rec_item->rec.pkey_tbl =
> > - *(osm_pkey_tbl_block_get(osm_physp_get_pkey_tbl(p_physp), block));
> > + /* FIXME: There are ninf.PartitionCap or swinf.PartitionEnforcementCap
> > + pkey entries so everything in that range is a valid block number
> > + even if opensm is not using it. Return 0. However things outside
> > + that range should return no entries.. Not sure how to figure that
> > + here? The range of pkey_tbl can be less than the cap, so
> > + this falsely triggers. */
> > + tbl = osm_pkey_tbl_block_get(osm_physp_get_pkey_tbl(p_physp), block);
> > + if (tbl)
> > + p_rec_item->rec.pkey_tbl = *tbl;
> >
> > cl_qlist_insert_tail(p_ctxt->p_list, &p_rec_item->list_item);
>
> What is the expected behaviour when IB PKey table block is empty?
IBA is unclear in this case. In my view, direct queries for SA records
should return the same result as a direct SMP for the same data, so
returning a wack of 0 is appropriate. Another view would be that the
SA data is 'empty' so ERR_NO_RECORDS is OK, which matches what
GetTable would return.
> rec.pkey_tbl might be uninitialized here.
All of p_rec_item is memset to 0.
Jason
--
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
next prev parent reply other threads:[~2011-02-23 18:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-11 22:12 [PATCH/opensm] Decode the SAPKeyTableRecord block number properly, and don't segv Jason Gunthorpe
[not found] ` <20110211221206.GA8532-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-02-23 17:20 ` Alex Netes
[not found] ` <20110223172019.GA8537-iQai9MGU/dyyaiaB+Ve85laTQe2KTcn/@public.gmane.org>
2011-02-23 18:13 ` Jason Gunthorpe [this message]
2011-02-23 19:01 ` Hal Rosenstock
[not found] ` <AANLkTinm5Uh-9h+WMh6O8dLsPr8wpdt0BJmOu3+Dt8vj-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-23 20:21 ` Hal Rosenstock
2011-02-25 11:25 ` Alex Netes
[not found] ` <20110225112514.GC8537-iQai9MGU/dyyaiaB+Ve85laTQe2KTcn/@public.gmane.org>
2011-02-25 19:35 ` Jason Gunthorpe
[not found] ` <20110225193509.GA9157-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-02-25 22:02 ` Alex Netes
2011-02-25 22:12 ` Alex Netes
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=20110223181337.GA31715@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=alexne-smomgflXvOZWk0Htik3J/w@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