summaryrefslogtreecommitdiff
path: root/sys/dev/softraid_crypto.c
AgeCommit message (Collapse)Author
2014-01-22Remove a pesky free that was supposed to be removed in an earlier commit.Joel Sing
2014-01-21Remove unused variable.Joel Sing
2014-01-21Do not bother calling splvm around crypto_invoke(), as crypto_invoke()Joel Sing
already calls splvm as necessary. ok mikeb@
2014-01-21Remove sr_crypto_finish_io - we can just call sr_scsi_done instead now.Joel Sing
ok krw@
2014-01-21Instead of maintaining a completely separate list of crypto work units,Joel Sing
simply allocate larger work units and include the normal work unit struct in the top of the crypto work unit struct. This greatly simplifies the code and removes possible failure cases. Discussed with dlg@ ok krw@
2014-01-21Allow for variable sized work units.Joel Sing
ok krw@
2014-01-21Remove pointless validation - these cases cannot be hit as they haveJoel Sing
already been checked in sr_crypto_alloc_resources and sr_validate_io. Also document the known issue with per-block key selection. ok krw@
2014-01-20Return a user friendly error if we ever encounter an unknown cryptoJoel Sing
algorithm.
2014-01-20Store the algorithm and key length in the discipline data structure,Joel Sing
instead of having multiple switch statements in various places. ok mikeb@
2014-01-20Remove unused variable.Joel Sing
2014-01-20Do not bother setting crp_desc to NULL, since it does not really gain usJoel Sing
anything. ok mikeb@
2013-12-21Don't assign a literal number to a variable that otherwise holds an errno.Philip Guenther
ok jsing@
2013-11-19Print daddr_t's with %lld, size_t's with %zu, int's with %d andKenneth R Westerback
u_int32_t's with %u. Translate DL_GETPSIZE() results to 512-byte-block values with DL_SECTOBLK(). ok jsing@
2013-11-04substantial namespace cleanup. Might go a little bit too far, but weTheo de Raadt
can expose some of the kernel structures with split .h files if need be. Discussed with various, including jsing.
2013-06-11final removal of daddr64_t. daddr_t has been 64 bit for a long enoughTheo de Raadt
test period; i think 3 years ago the last bugs fell out. ok otto beck others
2013-05-21Provide a function that handles the scheduling of work units. ThisJoel Sing
simplifies the discipline code, avoids code duplication and moves the scheduling logic into a single location. ok krw@
2013-04-01Rename sr_crypto_rw2() to sr_crypto_dev_rw(), which actually reflects theJoel Sing
fact that it is used to generate I/O to the underlying device. Input from/ok krw@
2013-04-01Validate the I/O request when it is first received, rather than waitingJoel Sing
until disk I/O is performed. This avoids doing encryption for a write that has an invalid I/O request. Additionally sr_crypto_wu_get() can get the block number from the work unit, instead of decoding the SCSI command (and failing to handle the invalid case). ok krw@
2013-03-31Use consistent error handling when validating the number of chunksJoel Sing
provided.
2013-03-31The return value of sd_free_resources() is never checked and all of theJoel Sing
implementations only ever returned zero. Change the return value from int to void instead of pretending it might mean something.
2013-03-30Provide a default discipline interrupt handling function and migrate all ofJoel Sing
the disciplines that now have the same interrupt code. ok krw@
2013-03-29sd_wu_pending is only decremented when scsi_done() or scsi_io_put() areJoel Sing
called. As a result, factor out the the sd_sync check/wakeup code and move it to after the scsi_done() call in sr_scsi_done(). Perform the same sd_sync check/wakeup after scsi_io_put() calls (including the addition of some that were previously missed). ok krw@
2013-03-02sr_alloc_resources() and sr_free_resources() can never be called withoutJoel Sing
a valid struct sr_discipline. Remove redundant NULL pointer checks.
2013-01-18Convert softraid crypto to the new ccb and workunit completion functions.Joel Sing
2013-01-16Set resid to zero if the scsi transfer completed without error.Joel Sing
ok krw@
2013-01-15Always initialise the discipline name, not just when we are doing a create.Joel Sing
2013-01-15Keep a function pointer to the per-discipline I/O interrupt handler in theJoel Sing
discipline data structure. To be used with an upcoming diff.
2012-10-09Provide a mechanism for the kernel to directly pass a mask key through toJoel Sing
a crypto volume when it is assembling it.
2012-10-08Provide a mechanism for the kernel to pass data through to the disciplineJoel Sing
during volume assembly.
2012-01-30Prevent softraid from being used with devices that do not have a sectorJoel Sing
size of 512 bytes - any other size is not currently supported. ok krw@
2012-01-22Convert softraid(4) to new bio(4) status interface. This allows bioctl(8)Joel Sing
to provide useful feedback, rather than reporting an ioctl failure and leaving the user to consult dmesg. For now we continue to print most things to the console, even if the message is a result of an ioctl.
2012-01-22Move list initialisation to the start of the function - this prevents usJoel Sing
from walking an uninitialised list if we fail to read the key disk.
2011-12-26Provide default set chunk state and set volume state functions whichJoel Sing
cover the no redundancy/no rebuild case. Use these for the AOE, crypto and RAID 0 disciplines.
2011-12-25Initialise discipline function pointers with defaults and only overrideJoel Sing
those that are needed by a specific discipline.
2011-09-20Mark softraid crypto volumes as being capable of auto assembly, since theyJoel Sing
are if used with a key disk.
2011-09-20Simplify the crypto descriptor handling by changing the list head, insteadJoel Sing
of splitting and rejoining the list.
2011-09-18Add support for variable length optional metadata in softraid(4). ThisJoel Sing
will allow new optional metadata types to be added without needing to change the softraid metadata version. Note that this commit changes the softraid metadata version, however an upgrade from older metadata is handled automatically. A full backup prior to upgrading is still strongly recommended. With feedback from stsp@ and marco.
2011-09-18Rename the optional metadata handler function and factor out the optionalJoel Sing
metadata handling code. This will simplify upcoming changes.
2011-07-07only allocate and copyin the length of kdfinfo data.Ted Unangst
ok deraadt matthew
2011-07-05ENOMEM causing EIO errors is bad juju. Softraid crypto did this.Owain Ainsworth
Instead of allocating a crypto op and the optional dma buffer on each and every io, preallocate a list of softraid crypto wus that contain a buffer of the max size we will use (MAXPHYS). since we know the number of openings we have in advance this means that on each io we just pick one, shorten the list of crypto descs, init any values then do the io. ok jsing (who provided many useful comments. he also provided a smarter way of handling the cryptop lists which is not in this diff but will be implemented soonish), marco@. dlg@ pointed out that this should probably use iopools but letting disciplines allocate their own iopool involves more softraid rejigging that will have to be done first. For now this is sufficient.
2011-06-18Change sizeof(&kdfinfo2) to sizeof(kdfinfo2).Matthew Dempsky
ok deraadt@
2011-06-17M_WAITOK cleanup of two cases:Michael Knudsen
1) Allocating with M_WAITOK, checking for NULL, and calling panic() is pointless (malloc() will panic if it can't allocate) so remove the check and the call. 2) Allocating with M_WAITOK, checking for NULL, and then gracefully handling failure to allocate is pointless. Instead also pass M_CANFAIL so malloc() doesn't panic so we can actually handle it gracefully. 1) was done using Coccinelle. Input from oga. ok miod.
2011-06-05Fix function names in debug printfs and use a more user-friendly errorStefan Sperling
message if the key disk cannot be opened. ok marco (some time ago)
2011-05-20sr_scsi_cmd copes with failed i/o just fine so there's no needMike Belopuhov
to panic if we couldn't allocate memory for crypto descriptors; tested by dcoppa, ok marco
2011-04-06make crypto work with bigmemMarco Peereboom
2011-04-05Iopoolification. Testing by marco@.Kenneth R Westerback
ok dlg@ marco@
2011-03-06fix function name in error/debug messages; ok marcoStefan Sperling
2011-01-12stray tabMarco Peereboom
2011-01-12explicit zeroing of key information in the softraid ioctl codeTheo de Raadt
ok marco
2011-01-12more explicit_bzero to delete keys.Marco Peereboom
prodded and ok deraadt