summaryrefslogtreecommitdiff
path: root/sys/opencrypto/crypto.c
Commit message (Collapse)AuthorAgeFilesLines
* consolidate callback optimization check in one location by adding a flagSam Leffler2003-06-301-1/+10
| | | | | | | | | | for crypto operations that indicates the crypto code should do the check in crypto_done MFC after: 1 day Notes: svn path=/head/; revision=117058
* Add support to eliminate a context switch per crypto op when using theSam Leffler2003-06-271-19/+17
| | | | | | | | | | | | | | software crypto device: o record crypto device capabilities in each session id o add a capability that indicates if the crypto driver operates synchronously o tag the software crypto driver as operating synchronously This commit also introduces crypto session id macros that cleanup their construction and querying. Notes: svn path=/head/; revision=116924
* Use __FBSDID().David E. O'Brien2003-06-111-1/+4
| | | | Notes: svn path=/head/; revision=116191
* Flush my local cache of cryto subsystem fixes:Sam Leffler2003-06-021-12/+16
| | | | | | | | | | | | | | | | | | | | | | | o add a ``done'' flag for crypto operations; this is set when the operation completes and is intended for callers to check operations that may complete ``prematurely'' because of direct callbacks o close a race for operations where the crypto driver returns ERESTART: we need to hold the q lock to insure the blocked state for the driver and any driver-private state is consistent; otherwise drivers may take an interrupt and notify the crypto subsystem that it can unblock the driver but operations will be left queued and never be processed o close a race in /dev/crypto where operations can complete before the caller can sleep waiting for the callback: use a per-session mutex and the new done flag to handle this o correct crypto_dispatch's handling of operations where the driver returns ERESTART: the return value must be zero and not ERESTART, otherwise the caller may free the crypto request despite it being queued for later handling (this typically results in a later panic) o change crypto mutex ``names'' so witness printouts and the like are more meaningful Notes: svn path=/head/; revision=115746
* o add a CRYPTO_F_CBIMM flag to symmetric ops to indicate the callbackSam Leffler2003-02-231-26/+72
| | | | | | | | | | | | | | | | | | | | | should be done in crypto_done rather than in the callback thread o use this flag to mark operations from /dev/crypto since the callback routine just does a wakeup; this eliminates the last unneeded ctx switch o change CRYPTO_F_NODELAY to CRYPTO_F_BATCH with an inverted meaning so "0" becomes the default/desired setting (needed for user-mode compatibility with openbsd) o change crypto_dispatch to honor CRYPTO_F_BATCH instead of always dispatching immediately o remove uses of CRYPTO_F_NODELAY o define COP_F_BATCH for ops submitted through /dev/crypto and pass this on to the op that is submitted Similar changes and more eventually coming for asymmetric ops. MFC if re gives approval. Notes: svn path=/head/; revision=111297
* Invoke the driver directly when a request is submitted via crypto_dispatchSam Leffler2003-01-091-21/+52
| | | | | | | | | | | | | | | | | | or crypto_kdispatch unless the driver is currently blocked. This eliminates the context switch to the dispatch thread for virtually all requests. Note that this change means that for software crypto drivers the caller will now block until the request is completed and the callback is dispatched to the callback thread (h/w drivers will typically just dispatch the op to the device and return quickly). If this is an issue we can either implement a non-blocking interface in the s/w crypto driver or use either the "no delay" flag in the crypto request or the "software driver" capability flag to control what to do. Sponsored by: Vernier Networks Notes: svn path=/head/; revision=108990
* correct flags passed when allocation crypto request structures so weSam Leffler2003-01-061-2/+2
| | | | | | | don't block and the returned data is zero'd Notes: svn path=/head/; revision=108813
* manage kernel threads properly; especially shutting them down on module unloadSam Leffler2003-01-031-52/+133
| | | | | | | Reviewed by: jhb Notes: svn path=/head/; revision=108588
* MFS: crypto timing support; purge usercrypto sysctl (just don't configSam Leffler2003-01-031-6/+78
| | | | | | | | | | | cryptodev or kldunload cryptodev module); crypto statistcs; remove unused alloctype field from crypto op to offset addition of the performance time stamp Supported by: Vernier Networks Notes: svn path=/head/; revision=108587
* change load order so module is present before crypto driversSam Leffler2002-11-081-1/+1
| | | | | | | Submitted by: Doug Ambrisko" <ambrisko@verniernetworks.com> Notes: svn path=/head/; revision=106676
* Module-ize the 'core' crypto stuff. This may still need to be compiledMark Murray2002-10-161-3/+30
| | | | | | | | | | | | into the kernel by default (if required), but other modules can now depend() on this. Fix inter-module dependancy. Earlier version OK'ed by: sam Notes: svn path=/head/; revision=105251
* o split crypto_proc into two threads: one for processing requests and oneSam Leffler2002-10-071-52/+92
| | | | | | | | | for processing callbacks. This closes race conditions caused by locking too many things with a single mutex. o reclaim crypto requests under certain (impossible) failure conditions Notes: svn path=/head/; revision=104628
* In-kernel crypto framework derived from openbsd. This facility providesSam Leffler2002-10-041-0/+936
a consistent interface to h/w and s/w crypto algorithms for use by the kernel and (for h/w at least) by user-mode apps. Access for user-level code is through a /dev/crypto device that'll eventually be used by openssl to (potentially) accelerate many applications. Coming soon is an IPsec that makes use of this service to accelerate ESP, AH, and IPCOMP protocols. Included here is the "core" crypto support, /dev/crypto driver, various crypto algorithms that are not already present in the KAME crypto area, and support routines used by crypto device drivers. Obtained from: openbsd Notes: svn path=/head/; revision=104476