aboutsummaryrefslogtreecommitdiffstats
path: root/engines/afalg/e_afalg.h
diff options
context:
space:
mode:
authorclucey <catriona.lucey@intel.com>2016-02-23 08:01:01 +0000
committerMatt Caswell <matt@openssl.org>2016-03-07 13:36:17 +0000
commit6cba4a66619dfb2c5cb784fe5aa5677cafbf9a33 (patch)
tree9757390141c45251e2127482dbff5b06f183d538 /engines/afalg/e_afalg.h
parent7f458a48ff3a231d5841466525d2aacbcd4f6b77 (diff)
downloadopenssl-6cba4a66619dfb2c5cb784fe5aa5677cafbf9a33.tar.gz
Rework based on feedback:
1. Cleaned up eventfd handling 2. Reworked socket setup code to allow other algorithms to be added in future 3. Fixed compile errors for static build 4. Added error to error stack in all cases of ALG_PERR/ALG_ERR 5. Called afalg_aes_128_cbc() from bind() to avoid race conditions 6. Used MAX_INFLIGHT define in io_getevents system call 7. Coding style fixes Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'engines/afalg/e_afalg.h')
-rw-r--r--engines/afalg/e_afalg.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/engines/afalg/e_afalg.h b/engines/afalg/e_afalg.h
index 6c92485f3f..8b589e4b4b 100644
--- a/engines/afalg/e_afalg.h
+++ b/engines/afalg/e_afalg.h
@@ -71,6 +71,11 @@
fprintf(stderr, "ALG_PERR: " x, __VA_ARGS__); \
perror(NULL); \
} while(0)
+# define ALG_PWARN(x, ...) \
+ do { \
+ fprintf(stderr, "ALG_PERR: " x, __VA_ARGS__); \
+ perror(NULL); \
+ } while(0)
# ifndef AES_BLOCK_SIZE
# define AES_BLOCK_SIZE 16
@@ -80,11 +85,15 @@
# define MAX_INFLIGHTS 1
+typedef enum {
+ MODE_UNINIT = 0,
+ MODE_SYNC,
+ MODE_ASYNC
+} op_mode;
+
struct afalg_aio_st {
- int efd_sync; /* event fd when sync mode is used */
- int efd_async; /* event fd when async mode is used */
- int efd; /* event fd that is currently in use equal
- to either efd_sync or efd_async */
+ int efd;
+ op_mode mode;
aio_context_t aio_ctx;
struct io_event events[MAX_INFLIGHTS];
struct iocb cbt[MAX_INFLIGHTS];