hifn(4) DMA fix for review

Patrick Lamaiziere patfbsd at davenulle.org
Tue May 11 17:11:26 UTC 2010


Le Mon, 10 May 2010 08:26:08 -0700,
Sam Leffler <sam at errno.com> a écrit :

Hello,

> > I noticed several things in hifn, if you want to look:
> > http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/130286
> >
> > IMHO some locks are missing in the use of sc->sc_sessions (the array
> > containing the sessions) : in hifn_newsession(), if there is no
> > space left in sc->sc_sessions, a new array is allocated and the
> > sessions are copied to it. Unfortunaly, sc->sc_sessions is used in
> > hifn_process without any lock and we use some pointers on the array
> > (my patch should
> > addresses this if I remember...).
> 
> Isn't this just the glx locking? (no offense intended)  I've said  
> before I think we to move session management up into the crypto
> layer since it's implemented in many drivers (usually w/ c&p of the
> same code as you noted here sometimes a bit different).

Yes, the code comes mostly from padlock and glxsb.

glxsb and padlock use a TAILQ to store the sessions instead of an array.
It is better when we want to add or remove a session but we have to
search the session each time when processing the operation. In hifn,
the session id (sid) is directly the index so it should be more
efficient. I'm not sure if this is a concern or not.

Regards.


More information about the freebsd-hackers mailing list