Mercurial > illumos > illumos-gate
changeset 10017:d778b606e96c
6846615 Enlarge data buffer in encrypt/decrypt to boost T2 HW accelerator performance
author | Krishna Yenduri <Bhargava.Yenduri@Sun.COM> |
---|---|
date | Wed, 01 Jul 2009 17:31:33 -0700 |
parents | f517d06e1c5e |
children | e84d215463a7 |
files | usr/src/cmd/cmd-crypto/decrypt/decrypt.c |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/cmd-crypto/decrypt/decrypt.c Wed Jul 01 17:10:10 2009 -0700 +++ b/usr/src/cmd/cmd-crypto/decrypt/decrypt.c Wed Jul 01 17:31:33 2009 -0700 @@ -75,9 +75,13 @@ #include <cryptoutil.h> #include <kmfapi.h> -#define BUFFERSIZE (2048) /* Buffer size for reading file */ +/* + * Buffer size for reading file. This is given a rather high value + * to get better performance when a hardware provider is present. + */ +#define BUFFERSIZE (1024 * 64) #define BLOCKSIZE (128) /* Largest guess for block size */ -#define PROGRESSSIZE (BUFFERSIZE*20) /* stdin progress indicator size */ +#define PROGRESSSIZE (1024 * 40) /* stdin progress indicator size */ #define SUNW_ENCRYPT_FILE_VERSION 1 @@ -1130,10 +1134,10 @@ status_pos = 1; } - if ((status_index - status_last) > + while ((status_index - status_last) > (PROGRESSSIZE)) { (void) fprintf(stderr, gettext(".")); - status_last = status_index; + status_last += PROGRESSSIZE; } continue; }