74 lines
2.3 KiB
Diff
74 lines
2.3 KiB
Diff
From 01580bb856fe7a2206990954b38d8213efd06098 Mon Sep 17 00:00:00 2001
|
|
From: Longfang Liu <liulongfang@huawei.com>
|
|
Date: Sat, 22 Oct 2022 15:31:24 +0800
|
|
Subject: uadk/engine: update the numa parameter of the scheduler
|
|
|
|
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 c6878c3..8e8c5f3 100644
|
|
--- a/src/uadk_cipher.c
|
|
+++ b/src/uadk_cipher.c
|
|
@@ -469,7 +469,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;
|
|
@@ -881,7 +880,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 63887e7..8370490 100644
|
|
--- a/src/uadk_digest.c
|
|
+++ b/src/uadk_digest.c
|
|
@@ -523,7 +523,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 ef1739d..74852e7 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;
|
|
|
|
--
|
|
1.8.3.1
|
|
|