All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang at intel.com>
To: accel-config@lists.01.org
Subject: [Accel-config] Re: [PATCH] accel-config: Fix a bug in unit test
Date: Tue, 06 Jul 2021 08:33:30 -0700	[thread overview]
Message-ID: <7af561cb-c9cd-e488-744b-e0e77441ebb9@intel.com> (raw)
In-Reply-To: 20210702025026.1046344-1-ramesh.thomas@intel.com

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


On 7/1/2021 7:50 PM, ramesh.thomas(a)intel.com wrote:
> From: Ramesh Thomas <ramesh.thomas(a)intel.com>
>
> Configuring wq as "mdev" type when mdev support is not present fails at
> configuration tests. Set the wq type as "user" in the template configs
> and set type as "mdev" only in the mdev tests.
>
> Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
Reviewed-by: Dave Jiang <dave.jiang(a)intel.com>
> ---
>   test/libaccfg.c | 25 ++++++++++++++++++++++---
>   1 file changed, 22 insertions(+), 3 deletions(-)
>
> diff --git a/test/libaccfg.c b/test/libaccfg.c
> index 93229c6..e5676eb 100644
> --- a/test/libaccfg.c
> +++ b/test/libaccfg.c
> @@ -94,7 +94,7 @@ static struct wq_parameters wq02_param = {
>   	.max_batch_size = (1 << 8),
>   	.max_transfer_size = (1l << 30),
>   	.mode = "shared",
> -	.type = "mdev",
> +	.type = "user",
>   	.name = "guest1"
>   };
>   
> @@ -106,7 +106,7 @@ static struct wq_parameters wq03_param = {
>   	.max_batch_size = (1 << 9),
>   	.max_transfer_size = (1l << 31),
>   	.mode = "dedicated",
> -	.type = "mdev",
> +	.type = "user",
>   	.name = "guest2"
>   };
>   
> @@ -246,7 +246,7 @@ static int config_wq(struct accfg_ctx *ctx, struct accfg_device *device,
>   	if (wq_param->threshold)
>   		SET_ERR(rc, accfg_wq_set_threshold(wq, wq_param->threshold));
>   
> -	return 0;
> +	return rc;
>   }
>   
>   static int check_wq(struct accfg_ctx *ctx, struct accfg_device *device,
> @@ -744,6 +744,17 @@ static int mdev_test(struct accfg_ctx *ctx, struct accfg_device *device,
>   	return 0;
>   }
>   
> +static int set_mdev_type(struct accfg_ctx *ctx, struct accfg_wq *wq)
> +{
> +	int rc;
> +
> +	rc = accfg_wq_set_str_type(wq, "mdev");
> +	if (rc)
> +		fprintf(stderr, "Error setting mdev type\n");
> +
> +	return rc;
> +}
> +
>   static int enable_wq(struct accfg_ctx *ctx, struct accfg_device *device,
>   		struct accfg_wq *wq)
>   {
> @@ -779,6 +790,10 @@ static int test_mdev_1swq(struct accfg_ctx *ctx)
>   	if (rc)
>   		return rc;
>   
> +	rc = set_mdev_type(ctx, test_ctx.wq[2]);
> +	if (rc)
> +		return rc;
> +
>   	rc = enable_wq(ctx, test_ctx.device, test_ctx.wq[2]);
>   	if (rc)
>   		return rc;
> @@ -808,6 +823,10 @@ static int test_mdev_1dwq(struct accfg_ctx *ctx)
>   	if (rc)
>   		return rc;
>   
> +	rc = set_mdev_type(ctx, test_ctx.wq[3]);
> +	if (rc)
> +		return rc;
> +
>   	rc = enable_wq(ctx, test_ctx.device, test_ctx.wq[3]);
>   	if (rc)
>   		return rc;

                 reply	other threads:[~2021-07-06 15:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7af561cb-c9cd-e488-744b-e0e77441ebb9@intel.com \
    --to=accel-config@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.