From: Steve Wise <swise@opengridcomputing.com>
To: Roland Dreier <rdreier@cisco.com>
Cc: openib-general@openib.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH 11/13] Core Resource Allocation
Date: Fri, 17 Nov 2006 11:25:11 -0600 [thread overview]
Message-ID: <1163784311.8457.44.camel@stevo-desktop> (raw)
In-Reply-To: <adaslgim2tt.fsf@cisco.com>
On Fri, 2006-11-17 at 08:54 -0800, Roland Dreier wrote:
> > +static u32 next_random(u32 rand)
> > +{
> > + u32 y, ylast;
> > +
> > + y = rand;
> > + ylast = y;
> > + y = (y * 69069) & 0xffffffff;
> > + y = (y & 0x80000000) + (ylast & 0x7fffffff);
> > + if ((y & 1))
> > + y = ylast ^ (y > 1) ^ (2567483615UL);
> > + else
> > + y = ylast ^ (y > 1);
> > + y = y ^ (y >> 11);
> > + y = y ^ ((y >> 7) & 2636928640UL);
> > + y = y ^ ((y >> 15) & 4022730752UL);
> > + y = y ^ (y << 18);
> > + return y;
> > +}
>
> How about just using the kernel's random32()?
>
> I haven't read the code really so I don't understand what's being
> randomized here, but random32() should be more than good enough for a
> typical randomized algorithm().
>
> - R.
I think we can use random32() or get_random_bytes(). I need to
re-review how this algorithm works. Its randomizing the stag IDs so
they are not predictable.
Steve.
next prev parent reply other threads:[~2006-11-17 17:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-16 3:58 [PATCH 00/13] Chelsio T3 RDMA Driver Steve Wise
2006-11-16 3:58 ` [PATCH 01/13] Linux RDMA Core Changes Steve Wise
2006-11-16 19:41 ` Roland Dreier
2006-11-16 3:58 ` [PATCH 02/13] Device Discovery and ULLD Linkage Steve Wise
2006-11-17 17:53 ` [openib-general] " Bryan O'Sullivan
2006-11-17 17:59 ` Steve Wise
2006-11-16 3:58 ` [PATCH 03/13] Provider Methods and Data Structures Steve Wise
2006-11-16 3:58 ` [PATCH 04/13] Connection Manager Steve Wise
2006-11-17 18:07 ` [openib-general] " Bryan O'Sullivan
2006-11-17 18:26 ` Steve Wise
2006-11-16 3:58 ` [PATCH 05/13] Queue Pairs Steve Wise
2006-11-16 3:58 ` [PATCH 06/13] Completion Queues Steve Wise
2006-11-16 3:59 ` [PATCH 07/13] Async Event Handler Steve Wise
2006-11-16 3:59 ` [PATCH 08/13] Memory Registration Steve Wise
2006-11-16 3:59 ` [PATCH 09/13] Core WQE/CQE Types Steve Wise
2006-11-17 4:45 ` Roland Dreier
2006-11-17 17:02 ` Steve Wise
2006-11-17 18:19 ` [openib-general] " Bryan O'Sullivan
2006-11-17 18:32 ` Steve Wise
2006-11-17 18:45 ` Bryan O'Sullivan
2006-11-16 3:59 ` [PATCH 10/13] Core HAL Steve Wise
2006-11-16 3:59 ` [PATCH 11/13] Core Resource Allocation Steve Wise
2006-11-17 16:54 ` Roland Dreier
2006-11-17 17:25 ` Steve Wise [this message]
2006-11-17 20:37 ` Roland Dreier
2006-11-16 3:59 ` [PATCH 12/13] Core Debug functions Steve Wise
2006-11-16 3:59 ` [PATCH 13/13] Kconfig/Makefile Steve Wise
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=1163784311.8457.44.camel@stevo-desktop \
--to=swise@opengridcomputing.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=openib-general@openib.org \
--cc=rdreier@cisco.com \
/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;
as well as URLs for NNTP newsgroup(s).