diff options
author | Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com> | 2016-08-25 12:14:15 +0300 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-12-14 18:33:38 +0300 |
commit | 34a15167739412750846d4f1a5540d9e592fd815 (patch) | |
tree | 6436d8097ae4f2e3d0d70e13c7983ea714167448 /drivers/s390/crypto/zcrypt_api.h | |
parent | 9af3e04ee41e6841b2accb9dc96562bcf4e59916 (diff) | |
download | linux-34a15167739412750846d4f1a5540d9e592fd815.tar.xz |
s390/zcrypt: Introduce workload balancing
Crypto requests are very different in complexity and thus runtime.
Also various crypto adapters are differ with regard to the execution
time. Crypto requests can be balanced much better when the request
type and eligible crypto adapters are rated in a more precise
granularity. Therefore, request weights and adapter speed rates for
dedicated requests will be introduced.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/zcrypt_api.h')
-rw-r--r-- | drivers/s390/crypto/zcrypt_api.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/s390/crypto/zcrypt_api.h b/drivers/s390/crypto/zcrypt_api.h index 326ecdc0417f..3d0d1e25d751 100644 --- a/drivers/s390/crypto/zcrypt_api.h +++ b/drivers/s390/crypto/zcrypt_api.h @@ -84,15 +84,32 @@ struct ica_z90_status { */ #define ZCRYPT_RNG_BUFFER_SIZE 4096 +/* + * Identifier for Crypto Request Performance Index + */ +enum crypto_ops { + MEX_1K = 0, + MEX_2K, + MEX_4K, + CRT_1K, + CRT_2K, + CRT_4K, + HWRNG, + SECKEY, + NUM_OPS +}; + struct zcrypt_device; struct zcrypt_ops { long (*rsa_modexpo)(struct zcrypt_device *, struct ica_rsa_modexpo *); long (*rsa_modexpo_crt)(struct zcrypt_device *, struct ica_rsa_modexpo_crt *); - long (*send_cprb)(struct zcrypt_device *, struct ica_xcRB *); - long (*send_ep11_cprb)(struct zcrypt_device *, struct ep11_urb *); - long (*rng)(struct zcrypt_device *, char *); + long (*send_cprb)(struct zcrypt_device *, struct ica_xcRB *, + struct ap_message *); + long (*send_ep11_cprb)(struct zcrypt_device *, struct ep11_urb *, + struct ap_message *); + long (*rng)(struct zcrypt_device *, char *, struct ap_message *); struct list_head list; /* zcrypt ops list. */ struct module *owner; int variant; @@ -112,7 +129,8 @@ struct zcrypt_device { int min_mod_size; /* Min number of bits. */ int max_mod_size; /* Max number of bits. */ int short_crt; /* Card has crt length restriction. */ - int speed_rating; /* Speed of the crypto device. */ + int speed_rating[NUM_OPS]; /* Speed idx of crypto ops. */ + int load; /* Utilization of the crypto device */ int request_count; /* # current requests. */ |