All of lore.kernel.org
 help / color / mirror / Atom feed
* [Accel-config] Re: [PATCH v2 4/4] accel-config/test: Convert the key word IAX to IAA
@ 2022-04-29 22:09 Dave Jiang
  0 siblings, 0 replies; only message in thread
From: Dave Jiang @ 2022-04-29 22:09 UTC (permalink / raw)
  To: accel-config

[-- Attachment #1: Type: text/plain, Size: 29838 bytes --]


On 4/28/2022 8:13 PM, Li Zhang wrote:
> In names of function, variable, enum and macro, convert all
> the IAX to IAA.
>
> Signed-off-by: Li Zhang <li4.zhang(a)intel.com>
> Reviewed-by: Dave Jiang <dave.jiang(a)intel.com>
> ---
>   accfg/config.c               |   2 +-
>   accfg/idxd.h                 | 144 +++++++++++++++++------------------
>   accfg/lib/libaccfg.c         |   4 +-
>   accfg/libaccel_config.h      |   2 +-
>   accfg/list.c                 |   2 +-
>   test/accel_test.h            |  18 ++---
>   test/algorithms/iaa_crc64.c  |   2 +-
>   test/algorithms/iaa_crc64.h  |   8 +-
>   test/common                  |   6 +-
>   test/dsa.c                   |   2 +-
>   test/iaa.c                   |  40 +++++-----
>   test/iaa.h                   |  16 ++--
>   test/iaa_prep.c              |   8 +-
>   test/iaa_test.c              |  42 +++++-----
>   test/iaa_user_test_runner.sh |  34 ++++-----
>   util/json.c                  |   4 +-
>   16 files changed, 167 insertions(+), 167 deletions(-)
>
> diff --git a/accfg/config.c b/accfg/config.c
> index 3e7d48b..7e8dea3 100644
> --- a/accfg/config.c
> +++ b/accfg/config.c
> @@ -351,7 +351,7 @@ static int group_json_set_val(struct accfg_group *group,
>   						|| (val < 0))
>   					return -EINVAL;
>   
> -				if ((accfg_device_get_type(dev) == ACCFG_DEVICE_IAX)
> +				if ((accfg_device_get_type(dev) == ACCFG_DEVICE_IAA)
>   						&& ((!strcmp(group_table[i].name,
>   								"tokens_reserved"))
>   						|| (!strcmp(group_table[i].name,
> diff --git a/accfg/idxd.h b/accfg/idxd.h
> index 718fdad..08e6378 100644
> --- a/accfg/idxd.h
> +++ b/accfg/idxd.h
I would leave this file alone. This is the copy from the kernel source. 
Should not be changed. Otherwise you'll run into issues later on when we 
copy over a new copy
> @@ -49,7 +49,7 @@ enum idxd_scmd_stat {
>   #define IDXD_OP_FLAG_DRDBK	0x4000
>   #define IDXD_OP_FLAG_DSTS	0x8000
>   
> -/* IAX */
> +/* IAA */
>   #define IDXD_OP_FLAG_RD_SRC2_AECS	0x010000
>   
>   /* Opcode */
> @@ -73,24 +73,24 @@ enum dsa_opcode {
>   	DSA_OPCODE_CFLUSH = 0x20,
>   };
>   
> -enum iax_opcode {
> -	IAX_OPCODE_NOOP = 0,
> -	IAX_OPCODE_DRAIN = 2,
> -	IAX_OPCODE_MEMMOVE,
> -	IAX_OPCODE_DECOMPRESS = 0x42,
> -	IAX_OPCODE_COMPRESS,
> -	IAX_OPCODE_CRC64 = 0x44,
> -	IAX_OPCODE_ZDECOMPRESS32 = 0x48,
> -	IAX_OPCODE_ZDECOMPRESS16,
> -	IAX_OPCODE_ZCOMPRESS32 = 0x4c,
> -	IAX_OPCODE_ZCOMPRESS16,
> -	IAX_OPCODE_SCAN = 0x50,
> -	IAX_OPCODE_SET_MEMBERSHIP,
> -	IAX_OPCODE_EXTRACT,
> -	IAX_OPCODE_SELECT,
> -	IAX_OPCODE_RLE_BURST,
> -	IAX_OPCODE_FIND_UNIQUE,
> -	IAX_OPCODE_EXPAND,
> +enum iaa_opcode {
> +	IAA_OPCODE_NOOP = 0,
> +	IAA_OPCODE_DRAIN = 2,
> +	IAA_OPCODE_MEMMOVE,
> +	IAA_OPCODE_DECOMPRESS = 0x42,
> +	IAA_OPCODE_COMPRESS,
> +	IAA_OPCODE_CRC64 = 0x44,
> +	IAA_OPCODE_ZDECOMPRESS32 = 0x48,
> +	IAA_OPCODE_ZDECOMPRESS16,
> +	IAA_OPCODE_ZCOMPRESS32 = 0x4c,
> +	IAA_OPCODE_ZCOMPRESS16,
> +	IAA_OPCODE_SCAN = 0x50,
> +	IAA_OPCODE_SET_MEMBERSHIP,
> +	IAA_OPCODE_EXTRACT,
> +	IAA_OPCODE_SELECT,
> +	IAA_OPCODE_RLE_BURST,
> +	IAA_OPCODE_FIND_UNIQUE,
> +	IAA_OPCODE_EXPAND,
>   };
>   
>   /* Completion record status */
> @@ -126,31 +126,31 @@ enum dsa_completion_status {
>   	DSA_COMP_TRANSLATION_FAIL,
>   };
>   
> -enum iax_completion_status {
> -	IAX_COMP_NONE = 0,
> -	IAX_COMP_SUCCESS,
> -	IAX_COMP_PAGE_FAULT_IR = 0x04,
> -	IAX_COMP_OUTBUF_OVERFLOW,
> -	IAX_COMP_BAD_OPCODE = 0x10,
> -	IAX_COMP_INVALID_FLAGS,
> -	IAX_COMP_NOZERO_RESERVE,
> -	IAX_COMP_INVALID_SIZE,
> -	IAX_COMP_OVERLAP_BUFFERS = 0x16,
> -	IAX_COMP_INT_HANDLE_INVAL = 0x19,
> -	IAX_COMP_CRA_XLAT,
> -	IAX_COMP_CRA_ALIGN,
> -	IAX_COMP_ADDR_ALIGN,
> -	IAX_COMP_PRIV_BAD,
> -	IAX_COMP_TRAFFIC_CLASS_CONF,
> -	IAX_COMP_PFAULT_RDBA,
> -	IAX_COMP_HW_ERR1,
> -	IAX_COMP_HW_ERR_DRB,
> -	IAX_COMP_TRANSLATION_FAIL,
> -	IAX_COMP_PRS_TIMEOUT,
> -	IAX_COMP_WATCHDOG,
> -	IAX_COMP_INVALID_COMP_FLAG = 0x30,
> -	IAX_COMP_INVALID_FILTER_FLAG,
> -	IAX_COMP_INVALID_NUM_ELEMS = 0x33,
> +enum iaa_completion_status {
> +	IAA_COMP_NONE = 0,
> +	IAA_COMP_SUCCESS,
> +	IAA_COMP_PAGE_FAULT_IR = 0x04,
> +	IAA_COMP_OUTBUF_OVERFLOW,
> +	IAA_COMP_BAD_OPCODE = 0x10,
> +	IAA_COMP_INVALID_FLAGS,
> +	IAA_COMP_NOZERO_RESERVE,
> +	IAA_COMP_INVALID_SIZE,
> +	IAA_COMP_OVERLAP_BUFFERS = 0x16,
> +	IAA_COMP_INT_HANDLE_INVAL = 0x19,
> +	IAA_COMP_CRA_XLAT,
> +	IAA_COMP_CRA_ALIGN,
> +	IAA_COMP_ADDR_ALIGN,
> +	IAA_COMP_PRIV_BAD,
> +	IAA_COMP_TRAFFIC_CLASS_CONF,
> +	IAA_COMP_PFAULT_RDBA,
> +	IAA_COMP_HW_ERR1,
> +	IAA_COMP_HW_ERR_DRB,
> +	IAA_COMP_TRANSLATION_FAIL,
> +	IAA_COMP_PRS_TIMEOUT,
> +	IAA_COMP_WATCHDOG,
> +	IAA_COMP_INVALID_COMP_FLAG = 0x30,
> +	IAA_COMP_INVALID_FILTER_FLAG,
> +	IAA_COMP_INVALID_NUM_ELEMS = 0x33,
>   };
>   
>   #define DSA_COMP_STATUS_MASK		0x7f
> @@ -182,9 +182,9 @@ struct hw_desc {
>   	uint16_t	int_handle;
>   	union {
>   		uint16_t	rsvd1;
> -		uint16_t        iax_compr_flags;
> -		uint16_t        iax_decompr_flags;
> -		uint16_t        iax_crc64_flags;
> +		uint16_t        iaa_compr_flags;
> +		uint16_t        iaa_decompr_flags;
> +		uint16_t        iaa_crc64_flags;
>   	};
>   	union {
>   		uint8_t		expected_res;
> @@ -236,19 +236,19 @@ struct hw_desc {
>   			uint16_t	dest_app_tag_mask;
>   			uint16_t	dest_app_tag_seed;
>   		};
> -		/* IAX common */
> +		/* IAA common */
>   		struct {
> -			uint64_t        iax_src2_addr;
> -			uint32_t        iax_max_dst_size;
> -			uint32_t        iax_src2_xfer_size;
> -			uint32_t	iax_filter_flags;
> -			uint32_t	iax_num_inputs;
> +			uint64_t        iaa_src2_addr;
> +			uint32_t        iaa_max_dst_size;
> +			uint32_t        iaa_src2_xfer_size;
> +			uint32_t	iaa_filter_flags;
> +			uint32_t	iaa_num_inputs;
>   		};
>   		/* CRC64 */
>   		struct {
> -			uint64_t        iax_crc64_rsvd;
> -			uint64_t        iax_crc64_rsvd2;
> -			uint64_t        iax_crc64_poly;
> +			uint64_t        iaa_crc64_rsvd;
> +			uint64_t        iaa_crc64_rsvd2;
> +			uint64_t        iaa_crc64_poly;
>   		};
>   
>   		uint8_t		op_specific[24];
> @@ -307,26 +307,26 @@ struct completion_record {
>   			uint16_t	dif_upd_dest_app_tag;
>   		};
>   
> -		/* IAX common */
> +		/* IAA common */
>   		struct {
> -			uint32_t	iax_invalid_flags;
> -			uint32_t	iax_rsvd;
> -			uint32_t	iax_output_size;
> -			uint8_t		iax_output_bits;
> -			uint8_t		iax_rsvd2;
> -			uint16_t	iax_xor_chksum;
> -			uint32_t	iax_crc;
> +			uint32_t	iaa_invalid_flags;
> +			uint32_t	iaa_rsvd;
> +			uint32_t	iaa_output_size;
> +			uint8_t		iaa_output_bits;
> +			uint8_t		iaa_rsvd2;
> +			uint16_t	iaa_xor_chksum;
> +			uint32_t	iaa_crc;
>   			union {
> -				uint32_t	iax_min;
> -				uint32_t	iax_first;
> +				uint32_t	iaa_min;
> +				uint32_t	iaa_first;
>   			};
>   			union {
> -				uint32_t	iax_max;
> -				uint32_t	iax_last;
> +				uint32_t	iaa_max;
> +				uint32_t	iaa_last;
>   			};
>   			union {
> -				uint32_t	iax_sum;
> -				uint32_t	iax_population_cnt;
> +				uint32_t	iaa_sum;
> +				uint32_t	iaa_population_cnt;
>   			};
>   		};
>   
> @@ -339,13 +339,13 @@ struct completion_record {
>   			uint64_t	crc64_result;
>   		};
>   
> -		/* To be compatible with IAX, alloc 64 bytes*/
> +		/* To be compatible with IAA, alloc 64 bytes*/
>   		uint8_t		op_specific[48];
>   	};
>   } __attribute__((packed));
>   
>   struct raw_completion_record {
> -	/* To be compatible with IAX, alloc 64 bytes*/
> +	/* To be compatible with IAA, alloc 64 bytes*/
>   	uint64_t	field[8];
>   } __attribute__((packed));
>   
> diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
> index be3be69..573bba4 100644
> --- a/accfg/lib/libaccfg.c
> +++ b/accfg/lib/libaccfg.c
> @@ -59,13 +59,13 @@ static int filename_prefix_len;
>   
>   ACCFG_EXPORT char *accfg_basenames[] = {
>           [ACCFG_DEVICE_DSA]      = "dsa",
> -	[ACCFG_DEVICE_IAX]      = "iax",
> +	[ACCFG_DEVICE_IAA]      = "iax",
>   	NULL
>   };
>   
>   static unsigned int accfg_device_compl_size[] = {
>   	[ACCFG_DEVICE_DSA] = 32,
> -	[ACCFG_DEVICE_IAX] = 64,
> +	[ACCFG_DEVICE_IAA] = 64,
>   };
>   
>   ACCFG_EXPORT char *accfg_mdev_basenames[] = {
> diff --git a/accfg/libaccel_config.h b/accfg/libaccel_config.h
> index fcfcf31..12869e2 100644
> --- a/accfg/libaccel_config.h
> +++ b/accfg/libaccel_config.h
> @@ -35,7 +35,7 @@ enum accfg_device_version {
>   /* no need to save device state */
>   enum accfg_device_type {
>   	ACCFG_DEVICE_DSA = 0,
> -	ACCFG_DEVICE_IAX = 1,
> +	ACCFG_DEVICE_IAA = 1,
>   	ACCFG_DEVICE_TYPE_UNKNOWN = -1,
>   };
>   
> diff --git a/accfg/list.c b/accfg/list.c
> index c2c6798..9aa7b3f 100644
> --- a/accfg/list.c
> +++ b/accfg/list.c
> @@ -67,7 +67,7 @@ static struct json_object *group_to_json(struct accfg_group *group,
>   
>   	json_object_object_add(jgroup, "dev", jobj);
>   
> -	if (accfg_device_get_type(dev) != ACCFG_DEVICE_IAX) {
> +	if (accfg_device_get_type(dev) != ACCFG_DEVICE_IAA) {
>   		jobj = json_object_new_int(accfg_group_get_read_buffers_reserved(group));
>   		if (!jobj)
>   			goto err;
> diff --git a/test/accel_test.h b/test/accel_test.h
> index d05176c..dc9f56b 100644
> --- a/test/accel_test.h
> +++ b/test/accel_test.h
> @@ -67,18 +67,18 @@ struct task {
>   
>   	/* Dedicate for IAA test */
>   	union {
> -		uint16_t iax_compr_flags;
> -		uint16_t iax_decompr_flags;
> -		uint16_t iax_crc64_flags;
> +		uint16_t iaa_compr_flags;
> +		uint16_t iaa_decompr_flags;
> +		uint16_t iaa_crc64_flags;
>   	};
> -	uint32_t iax_max_dst_size;
> -	uint32_t iax_src2_xfer_size;
> +	uint32_t iaa_max_dst_size;
> +	uint32_t iaa_src2_xfer_size;
>   	union {
>   		struct {
> -			uint32_t iax_filter_flags;
> -			uint32_t iax_num_inputs;
> +			uint32_t iaa_filter_flags;
> +			uint32_t iaa_num_inputs;
>   		};
> -		uint64_t iax_crc64_poly;
> +		uint64_t iaa_crc64_poly;
>   	};
>   };
>   
> @@ -201,7 +201,7 @@ static inline void dump_compl_rec(struct completion_record *compl, int compl_siz
>   
>   	dbg("completion record addr: %p\n", compl);
>   
> -	/* To be compatible with IAX, completion record was allocated 64 bytes*/
> +	/* To be compatible with IAA, completion record was allocated 64 bytes*/
>   	for (i = 0; i < num_qword; i++)
>   		dbg("compl[%d]: 0x%016lx\n", i, rcompl->field[i]);
>   }
> diff --git a/test/algorithms/iaa_crc64.c b/test/algorithms/iaa_crc64.c
> index f4c0bec..13980cd 100644
> --- a/test/algorithms/iaa_crc64.c
> +++ b/test/algorithms/iaa_crc64.c
> @@ -119,7 +119,7 @@ static uint64_t read_qword(uint8_t *in, uint32_t len)
>   	return qword;
>   }
>   
> -uint64_t iax_calculate_crc64(uint64_t poly, uint8_t *buf, uint32_t len,
> +uint64_t iaa_calculate_crc64(uint64_t poly, uint8_t *buf, uint32_t len,
>   			     uint8_t msb, uint8_t invcrc)
>   {
>   	uint64_t data;
> diff --git a/test/algorithms/iaa_crc64.h b/test/algorithms/iaa_crc64.h
> index d0bc5f9..848d964 100644
> --- a/test/algorithms/iaa_crc64.h
> +++ b/test/algorithms/iaa_crc64.h
> @@ -6,13 +6,13 @@
>   #include <stdint.h>
>   #include <stdbool.h>
>   
> -#define IAX_CRC64_EXTRA_FLAGS_BIT_ORDER 0x8000
> -#define IAX_CRC64_EXTRA_FLAGS_INVERT_CRC 0x4000
> +#define IAA_CRC64_EXTRA_FLAGS_BIT_ORDER 0x8000
> +#define IAA_CRC64_EXTRA_FLAGS_INVERT_CRC 0x4000
>   
>   /* crc64-ecma-182 */
> -#define IAX_CRC64_POLYNOMIAL 0x42F0E1EBA9EA3693
> +#define IAA_CRC64_POLYNOMIAL 0x42F0E1EBA9EA3693
>   
> -uint64_t iax_calculate_crc64(uint64_t poly, uint8_t *buf, uint32_t len,
> +uint64_t iaa_calculate_crc64(uint64_t poly, uint8_t *buf, uint32_t len,
>   			     uint8_t msb, uint8_t invcrc);
>   
>   #endif
> diff --git a/test/common b/test/common
> index bab4cc4..2f0d1bb 100644
> --- a/test/common
> +++ b/test/common
> @@ -39,12 +39,12 @@ else
>   	exit "$EXIT_FAILURE"
>   fi
>   
> -# IAXTEST
> +# IAATEST
>   #
>   if [ -f "./iaa_test" ] && [ -x "./iaa_test" ]; then
> -	export IAXTEST=./iaa_test
> +	export IAATEST=./iaa_test
>   elif [ -f "$TESTDIR/iaa_test" ] && [ -x "$TESTDIR/iaa_test" ]; then
> -	export IAXTEST="$TESTDIR"/iaa_test
> +	export IAATEST="$TESTDIR"/iaa_test
>   else
>   	echo "Couldn't find an iaa_test binary"
>   	exit "$EXIT_FAILURE"
> diff --git a/test/dsa.c b/test/dsa.c
> index 3d982d0..b553434 100644
> --- a/test/dsa.c
> +++ b/test/dsa.c
> @@ -568,7 +568,7 @@ int alloc_batch_task(struct acctest_context *ctx, unsigned int task_num, int num
>   			return -ENOMEM;
>   		memset(btsk->sub_descs, 0, task_num * sizeof(struct hw_desc));
>   
> -		/* To be compatible with IAX, completion record need to be 64-byte aligned */
> +		/* To be compatible with IAA, completion record need to be 64-byte aligned */
>   		btsk->sub_comps =
>   			aligned_alloc(64, task_num * sizeof(struct completion_record));
>   		if (!btsk->sub_comps)
> diff --git a/test/iaa.c b/test/iaa.c
> index f5c2f71..3b07464 100644
> --- a/test/iaa.c
> +++ b/test/iaa.c
> @@ -29,7 +29,7 @@ static int init_crc64(struct task *tsk, int tflags, int opcode, unsigned long sr
>   	if (!tsk->src1)
>   		return -ENOMEM;
>   	memset_pattern(tsk->src1, tsk->pattern, src1_xfer_size);
> -	tsk->iax_crc64_poly = IAX_CRC64_POLYNOMIAL;
> +	tsk->iaa_crc64_poly = IAA_CRC64_POLYNOMIAL;
>   
>   	return ACCTEST_STATUS_OK;
>   }
> @@ -43,7 +43,7 @@ int init_task(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_
>   
>   	/* allocate memory: src1*/
>   	switch (opcode) {
> -	case IAX_OPCODE_CRC64: /* intentionally empty */
> +	case IAA_OPCODE_CRC64: /* intentionally empty */
>   		rc = init_crc64(tsk, tflags, opcode, src1_xfer_size);
>   		break;
>   	}
> @@ -59,7 +59,7 @@ int init_task(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_
>   	return ACCTEST_STATUS_OK;
>   }
>   
> -static int iax_wait_noop(struct acctest_context *ctx, struct task *tsk)
> +static int iaa_wait_noop(struct acctest_context *ctx, struct task *tsk)
>   {
>   	struct completion_record *comp = tsk->comp;
>   	int rc;
> @@ -73,7 +73,7 @@ static int iax_wait_noop(struct acctest_context *ctx, struct task *tsk)
>   	return ACCTEST_STATUS_OK;
>   }
>   
> -int iax_noop_multi_task_nodes(struct acctest_context *ctx)
> +int iaa_noop_multi_task_nodes(struct acctest_context *ctx)
>   {
>   	struct task_node *tsk_node = ctx->multi_task_node;
>   	int ret = ACCTEST_STATUS_OK;
> @@ -81,7 +81,7 @@ int iax_noop_multi_task_nodes(struct acctest_context *ctx)
>   	while (tsk_node) {
>   		tsk_node->tsk->dflags |= (IDXD_OP_FLAG_CRAV | IDXD_OP_FLAG_RCR);
>   
> -		iax_prep_noop(tsk_node->tsk);
> +		iaa_prep_noop(tsk_node->tsk);
>   		tsk_node = tsk_node->next;
>   	}
>   
> @@ -94,7 +94,7 @@ int iax_noop_multi_task_nodes(struct acctest_context *ctx)
>   	info("Submitted all noop jobs\n");
>   
>   	while (tsk_node) {
> -		ret = iax_wait_noop(ctx, tsk_node->tsk);
> +		ret = iaa_wait_noop(ctx, tsk_node->tsk);
>   		if (ret != ACCTEST_STATUS_OK)
>   			info("Desc: %p failed with ret: %d\n",
>   			     tsk_node->tsk->desc, tsk_node->tsk->comp->status);
> @@ -103,7 +103,7 @@ int iax_noop_multi_task_nodes(struct acctest_context *ctx)
>   	return ret;
>   }
>   
> -static int iax_wait_crc64(struct acctest_context *ctx, struct task *tsk)
> +static int iaa_wait_crc64(struct acctest_context *ctx, struct task *tsk)
>   {
>   	struct completion_record *comp = tsk->comp;
>   	int rc;
> @@ -117,7 +117,7 @@ static int iax_wait_crc64(struct acctest_context *ctx, struct task *tsk)
>   	return ACCTEST_STATUS_OK;
>   }
>   
> -int iax_crc64_multi_task_nodes(struct acctest_context *ctx)
> +int iaa_crc64_multi_task_nodes(struct acctest_context *ctx)
>   {
>   	struct task_node *tsk_node = ctx->multi_task_node;
>   	int ret = ACCTEST_STATUS_OK;
> @@ -127,7 +127,7 @@ int iax_crc64_multi_task_nodes(struct acctest_context *ctx)
>   		if ((tsk_node->tsk->test_flags & TEST_FLAGS_BOF) && ctx->bof)
>   			tsk_node->tsk->dflags |= IDXD_OP_FLAG_BOF;
>   
> -		iax_prep_crc64(tsk_node->tsk);
> +		iaa_prep_crc64(tsk_node->tsk);
>   		tsk_node = tsk_node->next;
>   	}
>   
> @@ -140,7 +140,7 @@ int iax_crc64_multi_task_nodes(struct acctest_context *ctx)
>   
>   	tsk_node = ctx->multi_task_node;
>   	while (tsk_node) {
> -		ret = iax_wait_crc64(ctx, tsk_node->tsk);
> +		ret = iaa_wait_crc64(ctx, tsk_node->tsk);
>   		if (ret != ACCTEST_STATUS_OK)
>   			info("Desc: %p failed with ret: %d\n",
>   			     tsk_node->tsk->desc, tsk_node->tsk->comp->status);
> @@ -151,17 +151,17 @@ int iax_crc64_multi_task_nodes(struct acctest_context *ctx)
>   }
>   
>   /* mismatch_expected: expect mismatched buffer with success status 0x1 */
> -int iax_task_result_verify(struct task *tsk, int mismatch_expected)
> +int iaa_task_result_verify(struct task *tsk, int mismatch_expected)
>   {
>   	int ret = ACCTEST_STATUS_OK;
>   
>   	info("verifying task result for %#lx\n", tsk);
>   
> -	if (tsk->comp->status != IAX_COMP_SUCCESS)
> +	if (tsk->comp->status != IAA_COMP_SUCCESS)
>   		return tsk->comp->status;
>   
>   	switch (tsk->opcode) {
> -	case IAX_OPCODE_CRC64:
> +	case IAA_OPCODE_CRC64:
>   		ret = task_result_verify_crc64(tsk, mismatch_expected);
>   	}
>   
> @@ -171,13 +171,13 @@ int iax_task_result_verify(struct task *tsk, int mismatch_expected)
>   	return ret;
>   }
>   
> -int iax_task_result_verify_task_nodes(struct acctest_context *ctx, int mismatch_expected)
> +int iaa_task_result_verify_task_nodes(struct acctest_context *ctx, int mismatch_expected)
>   {
>   	struct task_node *tsk_node = ctx->multi_task_node;
>   	int ret = ACCTEST_STATUS_OK;
>   
>   	while (tsk_node) {
> -		ret = iax_task_result_verify(tsk_node->tsk, mismatch_expected);
> +		ret = iaa_task_result_verify(tsk_node->tsk, mismatch_expected);
>   		if (ret != ACCTEST_STATUS_OK) {
>   			err("memory result verify failed %d\n", ret);
>   			return ret;
> @@ -196,14 +196,14 @@ int task_result_verify_crc64(struct task *tsk, int mismatch_expected)
>   	if (mismatch_expected)
>   		warn("invalid arg mismatch_expected for %d\n", tsk->opcode);
>   
> -	if (tsk->iax_crc64_flags == IAX_CRC64_EXTRA_FLAGS_BIT_ORDER) {
> -		crc = iax_calculate_crc64(tsk->iax_crc64_poly, tsk->src1,
> +	if (tsk->iaa_crc64_flags == IAA_CRC64_EXTRA_FLAGS_BIT_ORDER) {
> +		crc = iaa_calculate_crc64(tsk->iaa_crc64_poly, tsk->src1,
>   					  tsk->xfer_size, 1, 0);
> -	} else if (tsk->iax_crc64_flags == IAX_CRC64_EXTRA_FLAGS_INVERT_CRC) {
> -		crc = iax_calculate_crc64(tsk->iax_crc64_poly, tsk->src1,
> +	} else if (tsk->iaa_crc64_flags == IAA_CRC64_EXTRA_FLAGS_INVERT_CRC) {
> +		crc = iaa_calculate_crc64(tsk->iaa_crc64_poly, tsk->src1,
>   					  tsk->xfer_size, 0, 1);
>   	} else {
> -		err("Unsupported extra flags %#x\n", tsk->iax_crc64_flags);
> +		err("Unsupported extra flags %#x\n", tsk->iaa_crc64_flags);
>   		return -EINVAL;
>   	}
>   
> diff --git a/test/iaa.h b/test/iaa.h
> index e0bbad2..40e1e29 100644
> --- a/test/iaa.h
> +++ b/test/iaa.h
> @@ -1,7 +1,7 @@
>   /* SPDX-License-Identifier: GPL-2.0 */
>   /* Copyright(c) 2019 Intel Corporation. All rights reserved. */
> -#ifndef __TEST_IAX_H__
> -#define __TEST_IAX_H__
> +#ifndef __TEST_IAA_H__
> +#define __TEST_IAA_H__
>   #include <accfg/libaccel_config.h>
>   #include <accfg/idxd.h>
>   #include "accel_test.h"
> @@ -9,13 +9,13 @@
>   
>   int init_task(struct task *tsk, int tflags, int opcode, unsigned long src1_xfer_size);
>   
> -int iax_noop_multi_task_nodes(struct acctest_context *ctx);
> -int iax_crc64_multi_task_nodes(struct acctest_context *ctx);
> -void iax_prep_noop(struct task *tsk);
> -void iax_prep_crc64(struct task *tsk);
> +int iaa_noop_multi_task_nodes(struct acctest_context *ctx);
> +int iaa_crc64_multi_task_nodes(struct acctest_context *ctx);
> +void iaa_prep_noop(struct task *tsk);
> +void iaa_prep_crc64(struct task *tsk);
>   
> -int iax_task_result_verify(struct task *tsk, int mismatch_expected);
> -int iax_task_result_verify_task_nodes(struct acctest_context *ctx, int mismatch_expected);
> +int iaa_task_result_verify(struct task *tsk, int mismatch_expected);
> +int iaa_task_result_verify_task_nodes(struct acctest_context *ctx, int mismatch_expected);
>   int task_result_verify_crc64(struct task *tsk, int mismatch_expected);
>   
>   #endif
> diff --git a/test/iaa_prep.c b/test/iaa_prep.c
> index 8522353..d6d46ca 100644
> --- a/test/iaa_prep.c
> +++ b/test/iaa_prep.c
> @@ -9,7 +9,7 @@
>   #include "accel_test.h"
>   #include "iaa.h"
>   
> -void iax_prep_noop(struct task *tsk)
> +void iaa_prep_noop(struct task *tsk)
>   {
>   	info("preparing descriptor for noop\n");
>   
> @@ -20,14 +20,14 @@ void iax_prep_noop(struct task *tsk)
>   	tsk->comp->status = 0;
>   }
>   
> -void iax_prep_crc64(struct task *tsk)
> +void iaa_prep_crc64(struct task *tsk)
>   {
>   	info("preparing descriptor for memcpy\n");
>   
>   	acctest_prep_desc_common(tsk->desc, tsk->opcode, 0,
>   				 (uint64_t)(tsk->src1), tsk->xfer_size, tsk->dflags);
>   	tsk->desc->completion_addr = (uint64_t)(tsk->comp);
> -	tsk->desc->iax_crc64_flags = tsk->iax_crc64_flags;
> -	tsk->desc->iax_crc64_poly = tsk->iax_crc64_poly;
> +	tsk->desc->iaa_crc64_flags = tsk->iaa_crc64_flags;
> +	tsk->desc->iaa_crc64_poly = tsk->iaa_crc64_poly;
>   	tsk->comp->status = 0;
>   }
> diff --git a/test/iaa_test.c b/test/iaa_test.c
> index cd16949..509498a 100644
> --- a/test/iaa_test.c
> +++ b/test/iaa_test.c
> @@ -8,7 +8,7 @@
>   #include "accel_test.h"
>   #include "iaa.h"
>   
> -#define IAX_TEST_SIZE 20000
> +#define IAA_TEST_SIZE 20000
>   
>   static void usage(void)
>   {
> @@ -19,7 +19,7 @@ static void usage(void)
>   	"                ; 0x4: reserved\n"
>   	"                ; 0x8: prefault buffers\n"
>   	"-e <extra_flags> ; specified by each opcpde\n"
> -	"-o <opcode>     ; opcode, same value as in IAX spec\n"
> +	"-o <opcode>     ; opcode, same value as in IAA spec\n"
>   	"-d              ; wq device such as iax1/wq1.0\n"
>   	"-n <number of descriptors> ;descriptor count to submit\n"
>   	"-t <ms timeout> ; ms to wait for descs to complete\n"
> @@ -52,19 +52,19 @@ static int test_noop(struct acctest_context *ctx, int tflags, int num_desc)
>   		/* allocate memory to src and dest buffers and fill in the desc for all the nodes*/
>   		tsk_node = ctx->multi_task_node;
>   		while (tsk_node) {
> -			tsk_node->tsk->opcode = IAX_OPCODE_NOOP;
> +			tsk_node->tsk->opcode = IAA_OPCODE_NOOP;
>   			tsk_node->tsk->test_flags = tflags;
>   			tsk_node = tsk_node->next;
>   		}
>   
> -		rc = iax_noop_multi_task_nodes(ctx);
> +		rc = iaa_noop_multi_task_nodes(ctx);
>   		if (rc != ACCTEST_STATUS_OK)
>   			return rc;
>   
>   		/* Verification of all the nodes*/
>   		tsk_node = ctx->multi_task_node;
>   		while (tsk_node) {
> -			rc = iax_task_result_verify(tsk_node->tsk, 0);
> +			rc = iaa_task_result_verify(tsk_node->tsk, 0);
>   			tsk_node = tsk_node->next;
>   		}
>   
> @@ -102,7 +102,7 @@ static int test_crc64(struct acctest_context *ctx, size_t buf_size, int tflags,
>   		/* allocate memory to src and dest buffers and fill in the desc for all the nodes*/
>   		tsk_node = ctx->multi_task_node;
>   		while (tsk_node) {
> -			tsk_node->tsk->iax_crc64_flags = extra_flags;
> +			tsk_node->tsk->iaa_crc64_flags = extra_flags;
>   
>   			rc = init_task(tsk_node->tsk, tflags, opcode, buf_size);
>   			if (rc != ACCTEST_STATUS_OK)
> @@ -112,13 +112,13 @@ static int test_crc64(struct acctest_context *ctx, size_t buf_size, int tflags,
>   		}
>   
>   		switch (opcode) {
> -		case IAX_OPCODE_CRC64:
> -			rc = iax_crc64_multi_task_nodes(ctx);
> +		case IAA_OPCODE_CRC64:
> +			rc = iaa_crc64_multi_task_nodes(ctx);
>   			if (rc != ACCTEST_STATUS_OK)
>   				return rc;
>   
>   			/* Verification of all the nodes*/
> -			rc = iax_task_result_verify_task_nodes(ctx, 0);
> +			rc = iaa_task_result_verify_task_nodes(ctx, 0);
>   			if (rc != ACCTEST_STATUS_OK)
>   				return rc;
>   			break;
> @@ -136,13 +136,13 @@ static int test_crc64(struct acctest_context *ctx, size_t buf_size, int tflags,
>   
>   int main(int argc, char *argv[])
>   {
> -	struct acctest_context *iax;
> +	struct acctest_context *iaa;
>   	int rc = 0;
>   	int wq_type = SHARED;
> -	unsigned long buf_size = IAX_TEST_SIZE;
> +	unsigned long buf_size = IAA_TEST_SIZE;
>   	int tflags = TEST_FLAGS_BOF;
>   	int extra_flags = 0;
> -	int opcode = IAX_OPCODE_NOOP;
> +	int opcode = IAA_OPCODE_NOOP;
>   	int opt;
>   	char dev_type[MAX_DEV_LEN];
>   	int wq_id = ACCTEST_DEVICE_ID_NO_INPUT;
> @@ -192,29 +192,29 @@ int main(int argc, char *argv[])
>   		}
>   	}
>   
> -	iax = acctest_init(tflags);
> +	iaa = acctest_init(tflags);
>   
> -	if (!iax)
> +	if (!iaa)
>   		return -ENOMEM;
>   
> -	rc = acctest_alloc(iax, wq_type, dev_id, wq_id);
> +	rc = acctest_alloc(iaa, wq_type, dev_id, wq_id);
>   	if (rc < 0)
>   		return -ENOMEM;
>   
> -	if (buf_size > iax->max_xfer_size) {
> +	if (buf_size > iaa->max_xfer_size) {
>   		err("invalid transfer size: %lu\n", buf_size);
>   		return -EINVAL;
>   	}
>   
>   	switch (opcode) {
> -	case IAX_OPCODE_NOOP:
> -		rc = test_noop(iax, tflags, num_desc);
> +	case IAA_OPCODE_NOOP:
> +		rc = test_noop(iaa, tflags, num_desc);
>   		if (rc != ACCTEST_STATUS_OK)
>   			goto error;
>   		break;
>   
> -	case IAX_OPCODE_CRC64:
> -		rc = test_crc64(iax, buf_size, tflags, extra_flags, opcode, num_desc);
> +	case IAA_OPCODE_CRC64:
> +		rc = test_crc64(iaa, buf_size, tflags, extra_flags, opcode, num_desc);
>   		if (rc != ACCTEST_STATUS_OK)
>   			goto error;
>   		break;
> @@ -225,6 +225,6 @@ int main(int argc, char *argv[])
>   	}
>   
>    error:
> -	acctest_free(iax);
> +	acctest_free(iaa);
>   	return rc;
>   }
> diff --git a/test/iaa_user_test_runner.sh b/test/iaa_user_test_runner.sh
> index 4d229c6..532939e 100755
> --- a/test/iaa_user_test_runner.sh
> +++ b/test/iaa_user_test_runner.sh
> @@ -6,48 +6,48 @@
>   
>   rc="$EXIT_SKIP"
>   
> -IAX=iax1
> +IAA=iax1
>   WQ0=wq1.4
>   WQ1=wq1.1
>   
>   trap 'err $LINENO' ERR
>   
> -[ ! -f "$IAXTEST" ] && echo "fail: $LINENO" && exit 1
> +[ ! -f "$IAATEST" ] && echo "fail: $LINENO" && exit 1
>   
>   check_min_kver "5.6" || do_skip "kernel does not support idxd"
>   
>   # skip if no pasid support as iaa_test does not support operation w/o pasid yet.
> -[ ! -f "/sys/bus/dsa/devices/$IAX/pasid_enabled" ] && echo "No SVM support" && exit "$EXIT_SKIP"
> +[ ! -f "/sys/bus/dsa/devices/$IAA/pasid_enabled" ] && echo "No SVM support" && exit "$EXIT_SKIP"
>   
> -pasid_en=$(cat /sys/bus/dsa/devices/$IAX/pasid_enabled)
> +pasid_en=$(cat /sys/bus/dsa/devices/$IAA/pasid_enabled)
>   if [ "$pasid_en" -ne 1 ]; then
>   	exit "$EXIT_SKIP"
>   fi
>   
> -start_iax()
> +start_iaa()
>   {
> -	configurable=$(cat /sys/bus/dsa/devices/$IAX/configurable)
> +	configurable=$(cat /sys/bus/dsa/devices/$IAA/configurable)
>   	if [ "$configurable" ]; then
>   		"$ACCFG" load-config -c "$CONFIG2"
>   	fi
> -	"$ACCFG" enable-device "$IAX"
> +	"$ACCFG" enable-device "$IAA"
>   }
>   
> -stop_iax()
> +stop_iaa()
>   {
> -	"$ACCFG" disable-device "$IAX"
> +	"$ACCFG" disable-device "$IAA"
>   }
>   
>   enable_wqs()
>   {
> -	"$ACCFG" enable-wq "$IAX"/"$WQ0"
> -	"$ACCFG" enable-wq "$IAX"/"$WQ1"
> +	"$ACCFG" enable-wq "$IAA"/"$WQ0"
> +	"$ACCFG" enable-wq "$IAA"/"$WQ1"
>   }
>   
>   disable_wqs()
>   {
> -	"$ACCFG" disable-wq "$IAX"/"$WQ0"
> -	"$ACCFG" disable-wq "$IAX"/"$WQ1"
> +	"$ACCFG" disable-wq "$IAA"/"$WQ0"
> +	"$ACCFG" disable-wq "$IAA"/"$WQ1"
>   }
>   
>   # Test operation with a given opcode
> @@ -71,10 +71,10 @@ test_op()
>   			echo "Testing $xfer_size bytes"
>   			if [ "$extra_flag" != "" ]
>   			then
> -				"$IAXTEST" -w "$wq_mode_code" -l "$xfer_size" -o "$opcode" \
> +				"$IAATEST" -w "$wq_mode_code" -l "$xfer_size" -o "$opcode" \
>   					-f "$flag" -e "$extra_flag" -t 5000 -v
>   			else
> -				"$IAXTEST" -w "$wq_mode_code" -l "$xfer_size" -o "$opcode" \
> +				"$IAATEST" -w "$wq_mode_code" -l "$xfer_size" -o "$opcode" \
>   					-f "$flag" -t 5000 -v
>   			fi
>   		done
> @@ -82,7 +82,7 @@ test_op()
>   }
>   
>   _cleanup
> -start_iax
> +start_iaa
>   enable_wqs
>   # shellcheck disable=SC2034
>   rc="$EXIT_FAILURE"
> @@ -114,6 +114,6 @@ for opcode in "0x44"; do
>   done
>   
>   disable_wqs
> -stop_iax
> +stop_iaa
>   _cleanup
>   exit 0
> diff --git a/util/json.c b/util/json.c
> index e99ca31..3d2c8a4 100644
> --- a/util/json.c
> +++ b/util/json.c
> @@ -168,7 +168,7 @@ struct json_object *util_device_to_json(struct accfg_device *device,
>   	jobj = json_object_new_int(accfg_device_get_read_buffer_limit(device));
>   	if (!jobj)
>   		goto err;
> -	if (accfg_device_get_type(device) != ACCFG_DEVICE_IAX)
> +	if (accfg_device_get_type(device) != ACCFG_DEVICE_IAA)
>   		json_object_object_add(jdevice, "read_buffer_limit", jobj);
>   
>   	if (flags & UTIL_JSON_SAVE) {
> @@ -273,7 +273,7 @@ struct json_object *util_device_to_json(struct accfg_device *device,
>   	jobj = json_object_new_int(accfg_device_get_max_read_buffers(device));
>   	if (!jobj)
>   		goto err;
> -	if (accfg_device_get_type(device) != ACCFG_DEVICE_IAX)
> +	if (accfg_device_get_type(device) != ACCFG_DEVICE_IAA)
>   		json_object_object_add(jdevice, "max_read_buffers", jobj);
>   
>   	ulong_val = accfg_device_get_max_batch_size(device);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-29 22:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 22:09 [Accel-config] Re: [PATCH v2 4/4] accel-config/test: Convert the key word IAX to IAA Dave Jiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.