From: Longfang Liu liulongfang@huawei.com
In the scenario where multiple devices are enabled at the same time through environment variables, fixing a numa id will make other devices unusable. When using the default numa parameter, the scheduler will automatically allocate device resources according to the CPU id of the thread, so as to realize all devices.
Signed-off-by: Longfang Liu liulongfang@huawei.com --- src/uadk_cipher.c | 4 ++-- src/uadk_digest.c | 3 ++- src/uadk_rsa.c | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/uadk_cipher.c b/src/uadk_cipher.c index cf7f4bb..e56cf01 100644 --- a/src/uadk_cipher.c +++ b/src/uadk_cipher.c @@ -468,7 +468,6 @@ static handle_t sched_single_init(handle_t h_sched_ctx, void *sched_param) return (handle_t)0; }
- skey->numa_id = param->numa_id; skey->type = param->type;
return (handle_t)skey; @@ -877,7 +876,8 @@ static void uadk_e_ctx_init(EVP_CIPHER_CTX *ctx, struct cipher_priv_ctx *priv) if (ret) params.type = 0;
- params.numa_id = engine.numa_id; + /* Use the default numa parameters */ + params.numa_id = -1; priv->setup.sched_param = ¶ms; if (!priv->sess) { priv->sess = wd_cipher_alloc_sess(&priv->setup); diff --git a/src/uadk_digest.c b/src/uadk_digest.c index fff0a75..51d67be 100644 --- a/src/uadk_digest.c +++ b/src/uadk_digest.c @@ -522,7 +522,8 @@ static int uadk_e_digest_init(EVP_MD_CTX *ctx) return 0; }
- params.numa_id = engine.numa_id; + /* Use the default numa parameters */ + params.numa_id = -1; priv->setup.sched_param = ¶ms; priv->sess = wd_digest_alloc_sess(&priv->setup); if (unlikely(!priv->sess)) diff --git a/src/uadk_rsa.c b/src/uadk_rsa.c index 493c4b1..4618d6b 100644 --- a/src/uadk_rsa.c +++ b/src/uadk_rsa.c @@ -881,7 +881,9 @@ static struct uadk_rsa_sess *rsa_get_eng_session(RSA *rsa, unsigned int bits,
rsa_sess->key_size = key_size; rsa_sess->setup.key_bits = key_size << BIT_BYTES_SHIFT; - params.numa_id = g_rsa_res.numa_id; + + /* Use the default numa parameters */ + params.numa_id = -1; rsa_sess->setup.sched_param = ¶ms; rsa_sess->setup.is_crt = is_crt;