[PATCH v4 05/12] app/mldev: add ordered inference test case

Thomas Monjalon thomas at monjalon.net
Thu Mar 9 21:06:57 CET 2023


07/02/2023 16:49, Srikanth Yalavarthi:
>  static struct option lgopts[] = {
> -	{ML_TEST, 1, 0, 0},  {ML_DEVICE_ID, 1, 0, 0}, {ML_SOCKET_ID, 1, 0, 0}, {ML_MODELS, 1, 0, 0},
> -	{ML_DEBUG, 0, 0, 0}, {ML_HELP, 0, 0, 0},      {NULL, 0, 0, 0}};
> +	{ML_TEST, 1, 0, 0},   {ML_DEVICE_ID, 1, 0, 0}, {ML_SOCKET_ID, 1, 0, 0},
> +	{ML_MODELS, 1, 0, 0}, {ML_FILELIST, 1, 0, 0},  {ML_REPETITIONS, 1, 0, 0},
> +	{ML_DEBUG, 0, 0, 0},  {ML_HELP, 0, 0, 0},      {NULL, 0, 0, 0}};
>  
>  static int
>  ml_opts_parse_long(int opt_idx, struct ml_options *opt)
> @@ -133,10 +195,9 @@ ml_opts_parse_long(int opt_idx, struct ml_options *opt)
>  	unsigned int i;
>  
>  	struct long_opt_parser parsermap[] = {
> -		{ML_TEST, ml_parse_test_name},
> -		{ML_DEVICE_ID, ml_parse_dev_id},
> -		{ML_SOCKET_ID, ml_parse_socket_id},
> -		{ML_MODELS, ml_parse_models},
> +		{ML_TEST, ml_parse_test_name},	    {ML_DEVICE_ID, ml_parse_dev_id},
> +		{ML_SOCKET_ID, ml_parse_socket_id}, {ML_MODELS, ml_parse_models},
> +		{ML_FILELIST, ml_parse_filelist},   {ML_REPETITIONS, ml_parse_repetitions},
[...]
>  /* Options names */
> -#define ML_TEST	     ("test")
> -#define ML_DEVICE_ID ("dev_id")
> -#define ML_SOCKET_ID ("socket_id")
> -#define ML_MODELS    ("models")
> -#define ML_DEBUG     ("debug")
> -#define ML_HELP	     ("help")
> +#define ML_TEST	       ("test")
> +#define ML_DEVICE_ID   ("dev_id")
> +#define ML_SOCKET_ID   ("socket_id")
> +#define ML_MODELS      ("models")
> +#define ML_FILELIST    ("filelist")
> +#define ML_REPETITIONS ("repetitions")
> +#define ML_DEBUG       ("debug")
> +#define ML_HELP	       ("help")

It seems you have issues with alignment.
Please try to do the right alignment in the initial patch, using only spaces.

> +			ml_err("error_code = 0x%016lx, error_message = %s\n", error.errcode,
> +			       error.message);

errcode is 64-bit, you cannot use %lx with 32-bit compiler.
PRIx64 is OK

[...]
> +	req->output = RTE_PTR_ADD(req->input, RTE_ALIGN_CEIL(t->model[t->fid].inp_qsize,
> +							     t->cmn.dev_info.min_align_size));
[...]
> +	t->model[fid].output = RTE_PTR_ADD(t->model[fid].input, t->model[fid].inp_dsize);

inp_qsize and inp_dsize are defined as 64-bit fields.
Is it really necessary to have such big sizes?
It cannot compile on 32-bit systems.
The workaround is to cast to uint32_t or uintptr_t.





More information about the dev mailing list