[v3,4/4] test: change external memory test to use system page sz

Message ID 20201201193302.28131-5-ndabilpuram@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series fix issue with partial DMA unmap |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues
ci/iol-testing fail Testing issues
ci/travis-robot warning Travis build: failed

Commit Message

Nithin Dabilpuram Dec. 1, 2020, 7:33 p.m. UTC
  Currently external memory test uses 4K page size.
VFIO DMA mapping works only with system page granularity.

Earlier it was working because all the contiguous mappings
were coalesced and mapped in one-go which ended up becoming
a lot bigger page. Now that VFIO DMA mappings both in IOVA as VA
and IOVA as PA mode, are being done at memseg list granularity,
we need to use system page size.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 app/test/test_external_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

David Christensen Dec. 1, 2020, 11:23 p.m. UTC | #1
> diff --git a/app/test/test_external_mem.c b/app/test/test_external_mem.c
> index 7eb81f6..67690c6 100644
> --- a/app/test/test_external_mem.c
> +++ b/app/test/test_external_mem.c
> @@ -532,8 +532,8 @@ test_extmem_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,
>   static int
>   test_external_mem(void)
>   {
> +	size_t pgsz = rte_mem_page_size();

I'm seeing a build warning with this code.  Looks like you need:

#include <rte_eal_paging.h>

Dave
  
Nithin Dabilpuram Dec. 2, 2020, 5:40 a.m. UTC | #2
On Tue, Dec 01, 2020 at 03:23:39PM -0800, David Christensen wrote:
> > diff --git a/app/test/test_external_mem.c b/app/test/test_external_mem.c
> > index 7eb81f6..67690c6 100644
> > --- a/app/test/test_external_mem.c
> > +++ b/app/test/test_external_mem.c
> > @@ -532,8 +532,8 @@ test_extmem_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,
> >   static int
> >   test_external_mem(void)
> >   {
> > +	size_t pgsz = rte_mem_page_size();
> 
> I'm seeing a build warning with this code.  Looks like you need:
> 
> #include <rte_eal_paging.h>

Ack, will fix it in v4. Missed to test this series with x86 but just tested with
arm64.

Thanks.
> 
> Dave
  

Patch

diff --git a/app/test/test_external_mem.c b/app/test/test_external_mem.c
index 7eb81f6..67690c6 100644
--- a/app/test/test_external_mem.c
+++ b/app/test/test_external_mem.c
@@ -532,8 +532,8 @@  test_extmem_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,
 static int
 test_external_mem(void)
 {
+	size_t pgsz = rte_mem_page_size();
 	size_t len = EXTERNAL_MEM_SZ;
-	size_t pgsz = RTE_PGSIZE_4K;
 	rte_iova_t iova[len / pgsz];
 	void *addr;
 	int ret, n_pages;