DPDK patches and discussions
 help / color / mirror / Atom feed
From: "wuchangsheng (C)" <wuchangsheng2@huawei.com>
To: Akhil Goyal <gakhil@marvell.com>,
	"fiona.trahe@intel.com" <fiona.trahe@intel.com>,
	Ashish Gupta <ashishg@marvell.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Chenxiang (EulerOS)" <rose.chen@huawei.com>
Subject: Re: [EXT] [dpdk-dev] [v2] [PATCH] test_compressdev:fix test case skipping due to missing device init
Date: Thu, 11 Nov 2021 11:54:37 +0000	[thread overview]
Message-ID: <aad618beec8b4bfd85287d717e28e591@huawei.com> (raw)

>
>> The testsuite_setup function in the compressdev_autotest test case, 
>> the rte_compressdev_count() return 0 due to the lack of device init.
>> It is considered that there is no equitment to skip execution.
>> So add rte_vdev_init init compress_zlib device.
>
>Why? Devices can be added as command line argument.
>* Use ``--vdev="compress_isal"`` in the EAL options, which will call ``rte_vdev_init()`` internally.
>See documentation of compressdevs.
>
>And if at all it is required, why only the zlib, there are other devices as well.
>

When ut test in this steps, will not call rte_vdev_init()
1. meson build
2. cd build
3. meson test compressdev_autotest

This use case tests the framework code and doesn't care about the specific device, so zlib device is randomly selected.
According to what you said, it may affect the command-line test. I need to think it again.

>> Signed-off-by: Changsheng Wu <wuchangsheng2@huawei.com>
>> ---
>>  app/test/test_compressdev.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/app/test/test_compressdev.c b/app/test/test_compressdev.c 
>> index a1b9f06250..f15fbe7f2d 100644
>> --- a/app/test/test_compressdev.c
>> +++ b/app/test/test_compressdev.c
>> @@ -14,6 +14,7 @@
>>  #include <rte_mbuf.h>
>>  #include <rte_compressdev.h>
>>  #include <rte_string_fns.h>
>> +#include <rte_bus_vdev.h>
>> 
>>  #include "test_compressdev_test_buffer.h"
>>  #include "test.h"
>> @@ -197,6 +198,11 @@ testsuite_setup(void)
>>  	uint32_t max_buf_size = 0;
>>  	unsigned int i;
>> 
>> +	if (rte_vdev_init("compress_zlib", NULL) != 0) {
>> +		RTE_LOG(WARNING, USER1, "not find compress_zlib
>> device\n");
>> +		return TEST_SKIPPED;
>> +	}
>> +
>>  	if (rte_compressdev_count() == 0) {
>>  		RTE_LOG(WARNING, USER1, "Need at least one compress device\n");
>>  		return TEST_SKIPPED;
>> --
>> 2.27.0


             reply	other threads:[~2021-11-11 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 11:54 wuchangsheng (C) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-08 12:35 Changsheng Wu
2021-11-11 11:32 ` [EXT] " Akhil Goyal
2021-11-11 11:42   ` Akhil Goyal

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=aad618beec8b4bfd85287d717e28e591@huawei.com \
    --to=wuchangsheng2@huawei.com \
    --cc=ashishg@marvell.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=gakhil@marvell.com \
    --cc=rose.chen@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).