From: Wenkai Lin <linwenkai6@hisilicon.com> Adjusted the rehash descriptors counta_vld, agg_col_bit_map, Agg_Oid, Agg_Out_Type, Col_Data_Type, and Col_Data_Info. These descriptors are consistent with those generated by the hash aggregation task. In addition, an extra 4 bytes are added when calculating the row size to ensure that each hash table contains 4 bytes of empty information. Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com> --- drv/hisi_dae.c | 12 ++++++++---- drv/hisi_dae_join_gather.c | 7 +++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drv/hisi_dae.c b/drv/hisi_dae.c index a6ee368..8fe6092 100644 --- a/drv/hisi_dae.c +++ b/drv/hisi_dae.c @@ -33,7 +33,6 @@ /* hash table */ #define HASH_TABLE_HEAD_TAIL_SIZE 8 -#define HASH_TABLE_EMPTY_SIZE 4 /* hash agg operations col max num */ #define DAE_AGG_COL_ALG_MAX_NUM 2 @@ -160,13 +159,18 @@ static void fill_hashagg_merge_output_order(struct dae_sqe *sqe, struct dae_ext_ { struct hashagg_ctx *agg_ctx = msg->priv; struct hashagg_col_data *cols_data = &agg_ctx->cols_data; + __u32 out_cols_num = cols_data->output_num; struct hashagg_output_src *output_src; __u32 offset = 0; __u32 i; - output_src = cols_data->rehash_output; + output_src = cols_data->normal_output; + if (cols_data->is_count_all) { + sqe->counta_vld = DAE_HASH_COUNT_ALL; + out_cols_num--; + } - for (i = 0; i < cols_data->output_num; i++) { + for (i = 0; i < out_cols_num; i++) { ext_sqe->out_from_in_idx |= (__u64)output_src[i].out_from_in_idx << offset; ext_sqe->out_optype |= (__u64)output_src[i].out_optype << offset; offset += DAE_COL_BIT_NUM; @@ -370,7 +374,7 @@ static void fill_hashagg_merge_input_data(struct dae_sqe *sqe, struct dae_ext_sq struct hashagg_ctx *agg_ctx = msg->priv; struct hashagg_col_data *cols_data = &agg_ctx->cols_data; - fill_hashagg_data_info(sqe, ext_sqe, cols_data->output_data, msg->agg_cols_num); + fill_hashagg_data_info(sqe, ext_sqe, cols_data->input_data, msg->agg_cols_num); } static void fill_hashagg_ext_addr(struct dae_sqe *sqe, struct dae_ext_sqe *ext_sqe, diff --git a/drv/hisi_dae_join_gather.c b/drv/hisi_dae_join_gather.c index 92fae1a..8c45f57 100644 --- a/drv/hisi_dae_join_gather.c +++ b/drv/hisi_dae_join_gather.c @@ -19,7 +19,7 @@ #define PROBE_INDEX_ROW_SIZE 4 /* align size */ -#define DAE_KEY_ALIGN_SIZE 8 +#define DAE_KEY_ALIGN_SIZE 4 #define DAE_BREAKPOINT_SIZE 81920 #define DAE_ADDR_INDEX_SHIFT 1 @@ -28,7 +28,6 @@ #define HASH_TABLE_INDEX_NUM 1 #define HASH_TABLE_MAX_INDEX_NUM 15 #define HASH_TABLE_INDEX_SIZE 12 -#define HASH_TABLE_EMPTY_SIZE 4 #define GATHER_ROW_BATCH_EMPTY_SIZE 4 /* DAE hardware protocol data */ @@ -173,6 +172,9 @@ static void fill_join_table_data(struct dae_sqe *sqe, struct dae_addr_list *addr } sqe->table_row_size = ctx->hash_table_row_size; + /* Initialize these fields for hardware check*/ + sqe->src_table_width = ctx->table_data.table_width; + sqe->dst_table_width = ctx->table_data.table_width; if (table_data_src) { sqe->src_table_width = table_data_src->table_width; @@ -814,6 +816,7 @@ static int join_get_table_rowsize(struct join_gather_col_data *cols_data, for (i = 0; i < key_num; i++) row_count_size += get_data_type_size(key_data[i].hw_type, 0); + row_count_size += HASH_TABLE_EMPTY_SIZE; row_count_size = ALIGN(row_count_size, DAE_KEY_ALIGN_SIZE); row_count_size += HASH_TABLE_HEAD_TAIL_SIZE + cols_data->index_num * HASH_TABLE_INDEX_SIZE; -- 2.33.0