DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: "Chaitanya Babu, TalluriX" <tallurix.chaitanya.babu@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Pattan, Reshma" <reshma.pattan@intel.com>,
	"Parthasarathy, JananeeX M" <jananeex.m.parthasarathy@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 3/3] app/test: add unit tests for eal vfio
Date: Fri, 23 Aug 2019 10:12:11 +0100	[thread overview]
Message-ID: <bd08b2a3-d6e3-5dde-daa2-4f094c67d55f@intel.com> (raw)
In-Reply-To: <761FB0F2AB727F4FA9CE98D18810B0155B55F4A5@BGSMSX102.gar.corp.intel.com>

On 23-Aug-19 8:57 AM, Chaitanya Babu, TalluriX wrote:
> Hi Anatoly,
> 
>> -----Original Message-----
>> From: Burakov, Anatoly
>> Sent: Thursday, August 22, 2019 5:45 PM
>> To: Chaitanya Babu, TalluriX <tallurix.chaitanya.babu@intel.com>;
>> dev@dpdk.org
>> Cc: Pattan, Reshma <reshma.pattan@intel.com>; Parthasarathy, JananeeX M
>> <jananeex.m.parthasarathy@intel.com>
>> Subject: Re: [PATCH v2 3/3] app/test: add unit tests for eal vfio
>>
>> On 22-Aug-19 12:53 PM, Chaitanya Babu Talluri wrote:
>>> Unit test cases are added for eal vfio library.
>>> eal_vfio_autotest added to meson build file.
>>>
>>> Signed-off-by: Chaitanya Babu Talluri
>>> <tallurix.chaitanya.babu@intel.com>
>>> ---
>>
>> I think the suggestion to check if VFIO is enabled was a good one. There is an
>> API to do that - i think you can do
>>
>> rte_vfio_is_enabled("vfio_pci")
>>
>> and if returns 0, you can return TEST_SKIPPED straight away.
> 
> rte_vfio_is_enabled() checks whether vfio module is loaded  and container fd is created.
> 
> The below error occurs even when the iommu type of vfio_cfg is not set.
> Ideally iommu _type is set only during device probe.
> Since device is not binded, iommu type is not set.
> 
> In order to skip the test in such scenario (vfio module is loaded but device not binded),
> we need to check the device count/groups of the default container.
> 
> Currently there is no RTE APIs to fetch the default vfio_cfg structure in order to check the active vfio_cfgs.vfio_active_groups / vfio_cfgs.vfio_iommu_type of the default container.
> 
> Please let us know whether we can enhance any API in this regard.

I don't quite like the idea of adding a new API just to enable pass/skip 
of unit tests. However, i don't think we have a choice here - i can't 
see any other way than to check if IOMMU type is set. So perhaps

int rte_vfio_iommu_type_is_set()

API could be added to enable graceful skipping for this test.

>>
>>>    app/test/Makefile        |   1 +
>>>    app/test/meson.build     |   2 +
>>>    app/test/test_eal_vfio.c | 728
>> +++++++++++++++++++++++++++++++++++++++
>>>    3 files changed, 731 insertions(+)
>>>    create mode 100644 app/test/test_eal_vfio.c
>>>
>>> diff --git a/app/test/Makefile b/app/test/Makefile
>>
>> <snip>
>>
>>> +static int
>>> +test_eal_vfio(void)
>>> +{
>>> +	printf("VFIO not supported, skipping test\n");
>>> +	return TEST_SKIPPED;
>>> +}
>>> +
>>> +#else
>>> +
>>> +#define PAGESIZE sysconf(_SC_PAGESIZE) #define
>> INVALID_CONTAINER_FD
>>> +-5 #define THREE_PAGES 3 #define UNMAPPED_ADDR 0x1500
>>
>> UNMAPPED_ADDR is not 4K-aligned and will probably trigger other errors
>> regarding page alignment checks. I suggest making it either 4K-aligned (e.g.
>> 0x2000), or explicitly align it (e.g. RTE_ALIGN(0x1500, PAGESIZE)).
> 
> Tests were added to check page un-aligned address.
> The IOCTL fails as expected.
> 
> Please let us know whether we need to remove this.

Ah, so it's *intentionally* unaligned! In that case, maybe 
"UNALIGNED_ADDR" is a better name?

>>
>>
>> --
>> Thanks,
>> Anatoly


-- 
Thanks,
Anatoly

      reply	other threads:[~2019-08-23  9:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-21 13:02 [dpdk-dev] [PATCH 0/3] add unit tests for eal vfio library Chaitanya Babu Talluri
2019-08-21 13:02 ` [dpdk-dev] [PATCH 1/3] lib/eal: fix vfio unmap that fails unexpectedly Chaitanya Babu Talluri
2019-08-21 13:20   ` Burakov, Anatoly
2019-08-21 13:02 ` [dpdk-dev] [PATCH 2/3] lib/eal: fix vfio unmap that succeeds unexpectedly Chaitanya Babu Talluri
2019-08-21 13:24   ` Burakov, Anatoly
2019-08-21 13:02 ` [dpdk-dev] [PATCH 3/3] app/test: add unit tests for eal vfio Chaitanya Babu Talluri
2019-08-21 15:44   ` Aaron Conole
2019-08-22  7:18     ` Chaitanya Babu, TalluriX
2019-08-22 10:57       ` Burakov, Anatoly
2019-08-22 14:40         ` Aaron Conole
2019-08-22 11:53 ` [dpdk-dev] [PATCH v2 0/3] add unit tests for eal vfio library Chaitanya Babu Talluri
2019-08-27 11:57   ` [dpdk-dev] [PATCH v3 0/4] " Chaitanya Babu Talluri
2019-09-04 12:04     ` [dpdk-dev] [PATCH v4 " Chaitanya Babu Talluri
2019-09-23 15:56       ` Burakov, Anatoly
2023-06-14 19:37       ` Stephen Hemminger
2019-09-04 12:04     ` [dpdk-dev] [PATCH v4 1/4] lib/eal: fix vfio unmap that fails unexpectedly Chaitanya Babu Talluri
2019-09-04 12:04     ` [dpdk-dev] [PATCH v4 2/4] lib/eal: fix vfio unmap that succeeds unexpectedly Chaitanya Babu Talluri
2019-09-04 12:04     ` [dpdk-dev] [PATCH v4 3/4] lib/eal: add API to check iommu type is set Chaitanya Babu Talluri
2019-09-04 12:04     ` [dpdk-dev] [PATCH v4 4/4] app/test: add unit tests for eal vfio Chaitanya Babu Talluri
2019-08-27 11:57   ` [dpdk-dev] [PATCH v3 1/4] lib/eal: fix vfio unmap that fails unexpectedly Chaitanya Babu Talluri
2019-08-27 11:57   ` [dpdk-dev] [PATCH v3 2/4] lib/eal: fix vfio unmap that succeeds unexpectedly Chaitanya Babu Talluri
2019-08-27 11:57   ` [dpdk-dev] [PATCH v3 3/4] lib/eal: add API to check iommu type is set Chaitanya Babu Talluri
2019-08-27 11:57   ` [dpdk-dev] [PATCH v3 4/4] app/test: add unit tests for eal vfio Chaitanya Babu Talluri
2019-08-22 11:53 ` [dpdk-dev] [PATCH v2 1/3] lib/eal: fix vfio unmap that fails unexpectedly Chaitanya Babu Talluri
2019-08-22 11:53 ` [dpdk-dev] [PATCH v2 2/3] lib/eal: fix vfio unmap that succeeds unexpectedly Chaitanya Babu Talluri
2019-08-22 11:53 ` [dpdk-dev] [PATCH v2 3/3] app/test: add unit tests for eal vfio Chaitanya Babu Talluri
2019-08-22 12:15   ` Burakov, Anatoly
2019-08-23  7:57     ` Chaitanya Babu, TalluriX
2019-08-23  9:12       ` Burakov, Anatoly [this message]

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=bd08b2a3-d6e3-5dde-daa2-4f094c67d55f@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=jananeex.m.parthasarathy@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=tallurix.chaitanya.babu@intel.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).