> 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
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))
> > +
> +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
> +
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