mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Acc

Threads by month
  • ----- 2026 -----
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
acc@openeuler.org

January 2026

  • 1 participants
  • 2 discussions
[PATCH] uadk: hash agg 8B type of the adaptation chip supports 8 columns
by ZongYu Wu 06 Jan '26

06 Jan '26
From: Zhushuai Yin <yinzhushuai(a)huawei.com> Due to changes in chip specifications, the hash agg 8B and 16B operations have been reduced from 9 columns to 8 columns,requiring the driver to be adapted accordingly. Signed-off-by: Zhushuai Yin <yinzhushuai(a)huawei.com> --- drv/hisi_dae.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drv/hisi_dae.c b/drv/hisi_dae.c index d7b34c2..a6ee368 100644 --- a/drv/hisi_dae.c +++ b/drv/hisi_dae.c @@ -673,7 +673,7 @@ static int agg_get_output_num(enum wd_dae_data_type type, } static int agg_output_num_check(struct wd_agg_col_info *agg_cols, __u32 cols_num, - bool is_count_all, __u16 hw_type) + bool is_count_all) { __u32 size8 = 0, size16 = 0; __u32 i, j, count_num; @@ -691,8 +691,7 @@ static int agg_output_num_check(struct wd_agg_col_info *agg_cols, __u32 cols_num if (is_count_all) size8++; - if (hw_type < HISI_QM_API_VER5_BASE && - (size8 > DAE_MAX_8B_COLS_NUM || size16 > DAE_MAX_16B_COLS_NUM)) { + if (size8 > DAE_MAX_8B_COLS_NUM || size16 > DAE_MAX_16B_COLS_NUM) { WD_ERR("invalid: output col num 8B-16B %u-%u is more than support %d-%d !\n", size8, size16, DAE_MAX_8B_COLS_NUM, DAE_MAX_16B_COLS_NUM); return -WD_EINVAL; @@ -708,7 +707,7 @@ static int agg_output_num_check(struct wd_agg_col_info *agg_cols, __u32 cols_num return WD_SUCCESS; } -static int hashagg_init_param_check(struct wd_agg_sess_setup *setup, __u16 hw_type) +static int hashagg_init_param_check(struct wd_agg_sess_setup *setup) { int ret; @@ -735,7 +734,7 @@ static int hashagg_init_param_check(struct wd_agg_sess_setup *setup, __u16 hw_ty return -WD_EINVAL; return agg_output_num_check(setup->agg_cols_info, setup->agg_cols_num, - setup->is_count_all, hw_type); + setup->is_count_all); } static int transfer_key_col_info(struct wd_key_col_info *key_cols, @@ -1236,7 +1235,7 @@ static int hashagg_sess_priv_init(struct wd_alg_driver *drv, h_qp = (handle_t)wd_ctx_get_priv(config->ctxs[0].ctx); qp = (struct hisi_qp *)h_qp; - ret = hashagg_init_param_check(setup, qp->q_info.hw_type); + ret = hashagg_init_param_check(setup); if (ret) return -WD_EINVAL; -- 2.33.0
1 0
0 0
[PATCH 1/5] uadk: save the algorithm type when algorithm registration
by ZongYu Wu 06 Jan '26

06 Jan '26
From: Weili Qian <qianweili(a)huawei.com> When looking up the corresponding driver by algorithm type, since the driver does not save the algorithm type, it cannot be directly obtained. Therefore, the algorithm type should be saved during algorithm registration. Signed-off-by: Weili Qian <qianweili(a)huawei.com> --- include/wd_alg.h | 2 ++ libwd.map | 1 + wd_alg.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++ wd_util.c | 94 ++++-------------------------------------------- 4 files changed, 102 insertions(+), 87 deletions(-) diff --git a/include/wd_alg.h b/include/wd_alg.h index 5ff73ca..848bdf1 100644 --- a/include/wd_alg.h +++ b/include/wd_alg.h @@ -145,6 +145,7 @@ struct wd_alg_list { struct wd_alg_driver *drv; struct wd_alg_list *next; + char alg_type[ALG_NAME_SIZE]; }; /* @@ -178,6 +179,7 @@ int wd_alg_driver_init(struct wd_alg_driver *drv, void *conf); void wd_alg_driver_exit(struct wd_alg_driver *drv); int wd_alg_driver_send(struct wd_alg_driver *drv, handle_t ctx, void *msg); int wd_alg_driver_recv(struct wd_alg_driver *drv, handle_t ctx, void *msg); +int wd_get_alg_type(const char *alg_name, char *alg_type); struct wd_alg_list *wd_get_alg_head(void); diff --git a/libwd.map b/libwd.map index 90eb5c5..5d732d0 100644 --- a/libwd.map +++ b/libwd.map @@ -53,6 +53,7 @@ global: wd_alg_driver_exit; wd_alg_driver_send; wd_alg_driver_recv; + wd_get_alg_type; wd_find_ctx; wd_get_dev_id; diff --git a/wd_alg.c b/wd_alg.c index 9c7c0fd..919483b 100644 --- a/wd_alg.c +++ b/wd_alg.c @@ -24,6 +24,97 @@ static struct wd_alg_list *alg_list_tail = &alg_list_head; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; +struct acc_alg_item { + const char *name; + const char *algtype; +}; + +static struct acc_alg_item alg_options[] = { + {"zlib", "zlib"}, + {"gzip", "gzip"}, + {"deflate", "deflate"}, + {"lz77_zstd", "lz77_zstd"}, + {"lz4", "lz4"}, + {"lz77_only", "lz77_only"}, + {"hashagg", "hashagg"}, + {"udma", "udma"}, + {"hashjoin", "hashjoin"}, + {"gather", "gather"}, + {"join-gather", "hashjoin"}, + + {"rsa", "rsa"}, + {"dh", "dh"}, + {"ecdh", "ecdh"}, + {"x25519", "x25519"}, + {"x448", "x448"}, + {"ecdsa", "ecdsa"}, + {"sm2", "sm2"}, + + {"ecb(aes)", "cipher"}, + {"cbc(aes)", "cipher"}, + {"xts(aes)", "cipher"}, + {"ofb(aes)", "cipher"}, + {"cfb(aes)", "cipher"}, + {"ctr(aes)", "cipher"}, + {"cbc-cs1(aes)", "cipher"}, + {"cbc-cs2(aes)", "cipher"}, + {"cbc-cs3(aes)", "cipher"}, + {"ecb(sm4)", "cipher"}, + {"xts(sm4)", "cipher"}, + {"cbc(sm4)", "cipher"}, + {"ofb(sm4)", "cipher"}, + {"cfb(sm4)", "cipher"}, + {"ctr(sm4)", "cipher"}, + {"cbc-cs1(sm4)", "cipher"}, + {"cbc-cs2(sm4)", "cipher"}, + {"cbc-cs3(sm4)", "cipher"}, + {"ecb(des)", "cipher"}, + {"cbc(des)", "cipher"}, + {"ecb(des3_ede)", "cipher"}, + {"cbc(des3_ede)", "cipher"}, + + {"ccm(aes)", "aead"}, + {"gcm(aes)", "aead"}, + {"ccm(sm4)", "aead"}, + {"gcm(sm4)", "aead"}, + {"authenc(generic,cbc(aes))", "aead"}, + {"authenc(generic,cbc(sm4))", "aead"}, + + {"sm3", "digest"}, + {"md5", "digest"}, + {"sha1", "digest"}, + {"sha256", "digest"}, + {"sha224", "digest"}, + {"sha384", "digest"}, + {"sha512", "digest"}, + {"sha512-224", "digest"}, + {"sha512-256", "digest"}, + {"cmac(aes)", "digest"}, + {"gmac(aes)", "digest"}, + {"xcbc-mac-96(aes)", "digest"}, + {"xcbc-prf-128(aes)", "digest"}, + {"", ""} +}; + +int wd_get_alg_type(const char *alg_name, char *alg_type) +{ + __u64 i; + + if (!alg_name || !alg_type) { + WD_ERR("invalid: alg_name or alg_type is NULL!\n"); + return -WD_EINVAL; + } + + for (i = 0; i < ARRAY_SIZE(alg_options); i++) { + if (strcmp(alg_name, alg_options[i].name) == 0) { + (void)strcpy(alg_type, alg_options[i].algtype); + return 0; + } + } + + return -WD_EINVAL; +} + static bool wd_check_accel_dev(const char *dev_name) { struct dirent *dev_dir; @@ -182,6 +273,7 @@ int wd_alg_driver_register(struct wd_alg_driver *drv) return -WD_ENOMEM; } + (void)wd_get_alg_type(drv->alg_name, new_alg->alg_type); strncpy(new_alg->alg_name, drv->alg_name, ALG_NAME_SIZE - 1); strncpy(new_alg->drv_name, drv->drv_name, DEV_NAME_LEN - 1); new_alg->priority = drv->priority; diff --git a/wd_util.c b/wd_util.c index 138a078..67a46a6 100644 --- a/wd_util.c +++ b/wd_util.c @@ -98,78 +98,6 @@ struct drv_lib_list { struct drv_lib_list *next; }; -struct acc_alg_item { - const char *name; - const char *algtype; -}; - -static struct acc_alg_item alg_options[] = { - {"zlib", "zlib"}, - {"gzip", "gzip"}, - {"deflate", "deflate"}, - {"lz77_zstd", "lz77_zstd"}, - {"lz4", "lz4"}, - {"lz77_only", "lz77_only"}, - {"hashagg", "hashagg"}, - {"udma", "udma"}, - {"hashjoin", "hashjoin"}, - {"gather", "gather"}, - {"join-gather", "hashjoin"}, - - {"rsa", "rsa"}, - {"dh", "dh"}, - {"ecdh", "ecdh"}, - {"x25519", "x25519"}, - {"x448", "x448"}, - {"ecdsa", "ecdsa"}, - {"sm2", "sm2"}, - - {"ecb(aes)", "cipher"}, - {"cbc(aes)", "cipher"}, - {"xts(aes)", "cipher"}, - {"ofb(aes)", "cipher"}, - {"cfb(aes)", "cipher"}, - {"ctr(aes)", "cipher"}, - {"cbc-cs1(aes)", "cipher"}, - {"cbc-cs2(aes)", "cipher"}, - {"cbc-cs3(aes)", "cipher"}, - {"ecb(sm4)", "cipher"}, - {"xts(sm4)", "cipher"}, - {"cbc(sm4)", "cipher"}, - {"ofb(sm4)", "cipher"}, - {"cfb(sm4)", "cipher"}, - {"ctr(sm4)", "cipher"}, - {"cbc-cs1(sm4)", "cipher"}, - {"cbc-cs2(sm4)", "cipher"}, - {"cbc-cs3(sm4)", "cipher"}, - {"ecb(des)", "cipher"}, - {"cbc(des)", "cipher"}, - {"ecb(des3_ede)", "cipher"}, - {"cbc(des3_ede)", "cipher"}, - - {"ccm(aes)", "aead"}, - {"gcm(aes)", "aead"}, - {"ccm(sm4)", "aead"}, - {"gcm(sm4)", "aead"}, - {"authenc(generic,cbc(aes))", "aead"}, - {"authenc(generic,cbc(sm4))", "aead"}, - - {"sm3", "digest"}, - {"md5", "digest"}, - {"sha1", "digest"}, - {"sha256", "digest"}, - {"sha224", "digest"}, - {"sha384", "digest"}, - {"sha512", "digest"}, - {"sha512-224", "digest"}, - {"sha512-256", "digest"}, - {"cmac(aes)", "digest"}, - {"gmac(aes)", "digest"}, - {"xcbc-mac-96(aes)", "digest"}, - {"xcbc-prf-128(aes)", "digest"}, - {"", ""} -}; - static void *wd_internal_alloc(void *usr, size_t size) { if (size != 0) @@ -2013,18 +1941,6 @@ int wd_init_param_check(struct wd_ctx_config *config, struct wd_sched *sched) return 0; } -static void wd_get_alg_type(const char *alg_name, char *alg_type) -{ - __u64 i; - - for (i = 0; i < ARRAY_SIZE(alg_options); i++) { - if (strcmp(alg_name, alg_options[i].name) == 0) { - (void)strcpy(alg_type, alg_options[i].algtype); - break; - } - } -} - static int wd_alg_init_fallback(struct wd_alg_driver *fb_driver) { if (!fb_driver->init) { @@ -2175,7 +2091,7 @@ static int wd_env_set_ctx_nums(const char *alg_name, const char *name, const cha char *left, *section, *start; struct uacce_dev_list *list; int is_comp; - int ret = 0; + int ret; /* COMP environment variable's format is different, mark it */ is_comp = strncmp(name, "WD_COMP_CTX_NUM", strlen(name)) ? 0 : 1; @@ -2186,7 +2102,10 @@ static int wd_env_set_ctx_nums(const char *alg_name, const char *name, const cha if (!start) return -WD_ENOMEM; - wd_get_alg_type(alg_name, alg_type); + ret = wd_get_alg_type(alg_name, alg_type); + if (ret) + return ret; + list = wd_get_accel_list(alg_type); if (!list) { WD_ERR("failed to get devices!\n"); @@ -3112,7 +3031,8 @@ int wd_alg_attrs_init(struct wd_init_attrs *attrs) } break; case UADK_ALG_HW: - wd_get_alg_type(alg, alg_type); + if (wd_get_alg_type(alg, alg_type)) + return -WD_EINVAL; (void)strcpy(attrs->alg, alg_type); ctx_config = calloc(1, sizeof(*ctx_config)); -- 2.33.0
1 4
0 0

HyperKitty Powered by HyperKitty