Re: [PATCH 11/13] Core Resource Allocation

2006-11-17 Thread Roland Dreier
> 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. I assume based on the algorithm you have now that they don't need to be cryptographically unpredictable. So random32() would prob

Re: [PATCH 11/13] Core Resource Allocation

2006-11-17 Thread Steve Wise
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) & 0x; > > + y = (y & 0x8000) + (ylast & 0x7fff); > > + if ((y & 1)) > > +

Re: [PATCH 11/13] Core Resource Allocation

2006-11-17 Thread Roland Dreier
> +static u32 next_random(u32 rand) > +{ > +u32 y, ylast; > + > +y = rand; > +ylast = y; > +y = (y * 69069) & 0x; > +y = (y & 0x8000) + (ylast & 0x7fff); > +if ((y & 1)) > +y = ylast ^ (y > 1) ^ (2567483615UL); > +else > +

[PATCH 11/13] Core Resource Allocation

2006-11-15 Thread Steve Wise
Core functions to carve up adapter memory, stag, qp, and cq IDs. Signed-off-by: Steve Wise <[EMAIL PROTECTED]> --- drivers/infiniband/hw/cxgb3/core/cxio_resource.c | 357 ++ drivers/infiniband/hw/cxgb3/core/cxio_resource.h | 70 2 files changed, 427 insertions(+), 0