Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src



Thor Lancelot Simon <tls%rek.tjls.com@localhost> wrote:
> > - Why crypto_mtx is not set to IPL_SOFTNET, but IPL_NET?
> 
> It replaced calls to "splcrypto()", which was splnet().  The actual
> hardware drivers currently in the tree all use splnet() for mutual
> exclusion and there are a couple of cases where driver done routines
> can need the crypto_mtx -- so I think it probably has to be at IPL_NET,
> no?

The current code uses software interrupt, and IPL_SOFT* levels are used to
block them. Why blocking of hard interrupts (at IPL_NET) is needed?

> > - It is not good to allocate the memory, while lock (especially spin-lock)
> >   is held (eg. in csecreate).
> 
> I thought it was acceptable to use pool with PR_NOWAIT with a lock held,
> since it allocates or immediately returns.  The code has been this way
> for months -- it's not OK?
> 
> Calling the cse functions without the mutex held would mean a fairly
> extensive restructuring of some of the code, or a lot of taking and
> dropping of the mutex, which as I understand it is expensive.  I can try to
> do that, though, if the consensus is that I should.

Acceptable, but not recommended. OK if avoiding that is very problematic, but
in this case, I think it is a matter of code re-organisation.

-- 
Best regards,
Mindaugas
www.NetBSD.org


Home | Main Index | Thread Index | Old Index