DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix compilation without VFIO
@ 2018-04-12 13:34 Shahaf Shuler
  2018-04-12 14:13 ` Burakov, Anatoly
  0 siblings, 1 reply; 9+ messages in thread
From: Shahaf Shuler @ 2018-04-12 13:34 UTC (permalink / raw)
  To: thomas; +Cc: dev, anatoly.burakov

a compilation error occurred when compiling with CONFIG_RTE_EAL_VFIO=n

== Build lib/librte_eal/linuxapp/eal
  CC eal_vfio.o
/download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1535:1: error: no
previous prototype for 'rte_vfio_dma_map' [-Werror=missing-prototypes]
 rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t
iova,
 ^
/download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1542:1: error: no
previous prototype for 'rte_vfio_dma_unmap' [-Werror=missing-prototypes]
 rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused
iova,
 ^

As there is no use for those dummy functions without VFIO removing them
completely.

Fixes: 73a639085938 ("vfio: allow to map other memory regions")
Cc: anatoly.burakov@intel.com

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 lib/librte_eal/linuxapp/eal/eal_vfio.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 589d7d4787..4163bd4e08 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -1529,20 +1529,4 @@ rte_vfio_noiommu_is_enabled(void)
 	return c == 'Y';
 }
 
-#else
-
-int __rte_experimental
-rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t iova,
-		  __rte_unused uint64_t len)
-{
-	return -1;
-}
-
-int __rte_experimental
-rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused iova,
-		    __rte_unused uint64_t len)
-{
-	return -1;
-}
-
 #endif
-- 
2.12.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix compilation without VFIO
  2018-04-12 13:34 [dpdk-dev] [PATCH] eal: fix compilation without VFIO Shahaf Shuler
@ 2018-04-12 14:13 ` Burakov, Anatoly
  2018-04-12 23:39   ` Thomas Monjalon
  0 siblings, 1 reply; 9+ messages in thread
From: Burakov, Anatoly @ 2018-04-12 14:13 UTC (permalink / raw)
  To: Shahaf Shuler, thomas; +Cc: dev

On 12-Apr-18 2:34 PM, Shahaf Shuler wrote:
> a compilation error occurred when compiling with CONFIG_RTE_EAL_VFIO=n
> 
> == Build lib/librte_eal/linuxapp/eal
>    CC eal_vfio.o
> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1535:1: error: no
> previous prototype for 'rte_vfio_dma_map' [-Werror=missing-prototypes]
>   rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t
> iova,
>   ^
> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1542:1: error: no
> previous prototype for 'rte_vfio_dma_unmap' [-Werror=missing-prototypes]
>   rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused
> iova,
>   ^
> 
> As there is no use for those dummy functions without VFIO removing them
> completely.
> 
> Fixes: 73a639085938 ("vfio: allow to map other memory regions")
> Cc: anatoly.burakov@intel.com
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>   lib/librte_eal/linuxapp/eal/eal_vfio.c | 16 ----------------
>   1 file changed, 16 deletions(-)
> 
> diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
> index 589d7d4787..4163bd4e08 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
> @@ -1529,20 +1529,4 @@ rte_vfio_noiommu_is_enabled(void)
>   	return c == 'Y';
>   }
>   
> -#else
> -
> -int __rte_experimental
> -rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t iova,
> -		  __rte_unused uint64_t len)
> -{
> -	return -1;
> -}
> -
> -int __rte_experimental
> -rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused iova,
> -		    __rte_unused uint64_t len)
> -{
> -	return -1;
> -}
> -
>   #endif
> 

These functions are part of public API, like rest of functions in this 
header. They're in the map file. Should we perhaps go the BSD way and 
provide EAL with dummy prototypes as well? See bsdapp/eal/eal.c:763 onwards.

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix compilation without VFIO
  2018-04-12 14:13 ` Burakov, Anatoly
@ 2018-04-12 23:39   ` Thomas Monjalon
  2018-04-13  9:11     ` Burakov, Anatoly
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2018-04-12 23:39 UTC (permalink / raw)
  To: Burakov, Anatoly; +Cc: dev, Shahaf Shuler

12/04/2018 16:13, Burakov, Anatoly:
> On 12-Apr-18 2:34 PM, Shahaf Shuler wrote:
> > a compilation error occurred when compiling with CONFIG_RTE_EAL_VFIO=n
> > 
> > == Build lib/librte_eal/linuxapp/eal
> >    CC eal_vfio.o
> > /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1535:1: error: no
> > previous prototype for 'rte_vfio_dma_map' [-Werror=missing-prototypes]
> >   rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t
> > iova,
> >   ^
> > /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1542:1: error: no
> > previous prototype for 'rte_vfio_dma_unmap' [-Werror=missing-prototypes]
> >   rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused
> > iova,
> >   ^
> > 
> > As there is no use for those dummy functions without VFIO removing them
> > completely.
> 
> These functions are part of public API, like rest of functions in this 
> header. They're in the map file. Should we perhaps go the BSD way and 
> provide EAL with dummy prototypes as well? See bsdapp/eal/eal.c:763 onwards.

Why using dummy prototypes?
Because the prototypes in rte_vfio.h are under #ifdef VFIO_PRESENT ?
Is it possible to always define the prototypes in rte_vfio.h ?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix compilation without VFIO
  2018-04-12 23:39   ` Thomas Monjalon
@ 2018-04-13  9:11     ` Burakov, Anatoly
  2018-04-13 13:08       ` Thomas Monjalon
  0 siblings, 1 reply; 9+ messages in thread
From: Burakov, Anatoly @ 2018-04-13  9:11 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Shahaf Shuler

On 13-Apr-18 12:39 AM, Thomas Monjalon wrote:
> 12/04/2018 16:13, Burakov, Anatoly:
>> On 12-Apr-18 2:34 PM, Shahaf Shuler wrote:
>>> a compilation error occurred when compiling with CONFIG_RTE_EAL_VFIO=n
>>>
>>> == Build lib/librte_eal/linuxapp/eal
>>>     CC eal_vfio.o
>>> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1535:1: error: no
>>> previous prototype for 'rte_vfio_dma_map' [-Werror=missing-prototypes]
>>>    rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t
>>> iova,
>>>    ^
>>> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1542:1: error: no
>>> previous prototype for 'rte_vfio_dma_unmap' [-Werror=missing-prototypes]
>>>    rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused
>>> iova,
>>>    ^
>>>
>>> As there is no use for those dummy functions without VFIO removing them
>>> completely.
>>
>> These functions are part of public API, like rest of functions in this
>> header. They're in the map file. Should we perhaps go the BSD way and
>> provide EAL with dummy prototypes as well? See bsdapp/eal/eal.c:763 onwards.
> 
> Why using dummy prototypes?
> Because the prototypes in rte_vfio.h are under #ifdef VFIO_PRESENT ?
> Is it possible to always define the prototypes in rte_vfio.h ?
> 

Well, technically, yes, we could. There is one function that uses a 
VFIO-specific struct definition:

int rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
		int *vfio_dev_fd, struct vfio_device_info *device_info);

I'm sure we can work around that.

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix compilation without VFIO
  2018-04-13  9:11     ` Burakov, Anatoly
@ 2018-04-13 13:08       ` Thomas Monjalon
  2018-04-13 13:37         ` Burakov, Anatoly
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2018-04-13 13:08 UTC (permalink / raw)
  To: Burakov, Anatoly; +Cc: dev, Shahaf Shuler

13/04/2018 11:11, Burakov, Anatoly:
> On 13-Apr-18 12:39 AM, Thomas Monjalon wrote:
> > 12/04/2018 16:13, Burakov, Anatoly:
> >> On 12-Apr-18 2:34 PM, Shahaf Shuler wrote:
> >>> a compilation error occurred when compiling with CONFIG_RTE_EAL_VFIO=n
> >>>
> >>> == Build lib/librte_eal/linuxapp/eal
> >>>     CC eal_vfio.o
> >>> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1535:1: error: no
> >>> previous prototype for 'rte_vfio_dma_map' [-Werror=missing-prototypes]
> >>>    rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t
> >>> iova,
> >>>    ^
> >>> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1542:1: error: no
> >>> previous prototype for 'rte_vfio_dma_unmap' [-Werror=missing-prototypes]
> >>>    rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused
> >>> iova,
> >>>    ^
> >>>
> >>> As there is no use for those dummy functions without VFIO removing them
> >>> completely.
> >>
> >> These functions are part of public API, like rest of functions in this
> >> header. They're in the map file. Should we perhaps go the BSD way and
> >> provide EAL with dummy prototypes as well? See bsdapp/eal/eal.c:763 onwards.
> > 
> > Why using dummy prototypes?
> > Because the prototypes in rte_vfio.h are under #ifdef VFIO_PRESENT ?
> > Is it possible to always define the prototypes in rte_vfio.h ?
> > 
> 
> Well, technically, yes, we could. There is one function that uses a 
> VFIO-specific struct definition:
> 
> int rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
> 		int *vfio_dev_fd, struct vfio_device_info *device_info);
> 
> I'm sure we can work around that.


Removing dummy prototypes need, would be a nicer fix.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix compilation without VFIO
  2018-04-13 13:08       ` Thomas Monjalon
@ 2018-04-13 13:37         ` Burakov, Anatoly
  2018-04-13 13:58           ` Thomas Monjalon
  0 siblings, 1 reply; 9+ messages in thread
From: Burakov, Anatoly @ 2018-04-13 13:37 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Shahaf Shuler

On 13-Apr-18 2:08 PM, Thomas Monjalon wrote:
> 13/04/2018 11:11, Burakov, Anatoly:
>> On 13-Apr-18 12:39 AM, Thomas Monjalon wrote:
>>> 12/04/2018 16:13, Burakov, Anatoly:
>>>> On 12-Apr-18 2:34 PM, Shahaf Shuler wrote:
>>>>> a compilation error occurred when compiling with CONFIG_RTE_EAL_VFIO=n
>>>>>
>>>>> == Build lib/librte_eal/linuxapp/eal
>>>>>      CC eal_vfio.o
>>>>> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1535:1: error: no
>>>>> previous prototype for 'rte_vfio_dma_map' [-Werror=missing-prototypes]
>>>>>     rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t
>>>>> iova,
>>>>>     ^
>>>>> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1542:1: error: no
>>>>> previous prototype for 'rte_vfio_dma_unmap' [-Werror=missing-prototypes]
>>>>>     rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused
>>>>> iova,
>>>>>     ^
>>>>>
>>>>> As there is no use for those dummy functions without VFIO removing them
>>>>> completely.
>>>>
>>>> These functions are part of public API, like rest of functions in this
>>>> header. They're in the map file. Should we perhaps go the BSD way and
>>>> provide EAL with dummy prototypes as well? See bsdapp/eal/eal.c:763 onwards.
>>>
>>> Why using dummy prototypes?
>>> Because the prototypes in rte_vfio.h are under #ifdef VFIO_PRESENT ?
>>> Is it possible to always define the prototypes in rte_vfio.h ?
>>>
>>
>> Well, technically, yes, we could. There is one function that uses a
>> VFIO-specific struct definition:
>>
>> int rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
>> 		int *vfio_dev_fd, struct vfio_device_info *device_info);
>>
>> I'm sure we can work around that.
> 
> 
> Removing dummy prototypes need, would be a nicer fix.
> 

OK. Shahaf, will you submit a v2 with this, or should i do it? I think 
it should be just a matter of #ifndef VFIO_PRESENT //define 
vfio_device_info struct #endif - this should take care of the problem of 
hiding the function definitions.

FreeBSD will also need to be adjusted to remove dummy prototypes.

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix compilation without VFIO
  2018-04-13 13:37         ` Burakov, Anatoly
@ 2018-04-13 13:58           ` Thomas Monjalon
  2018-04-16  5:50             ` Shahaf Shuler
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2018-04-13 13:58 UTC (permalink / raw)
  To: Burakov, Anatoly; +Cc: dev, Shahaf Shuler

13/04/2018 15:37, Burakov, Anatoly:
> On 13-Apr-18 2:08 PM, Thomas Monjalon wrote:
> > 13/04/2018 11:11, Burakov, Anatoly:
> >> On 13-Apr-18 12:39 AM, Thomas Monjalon wrote:
> >>> 12/04/2018 16:13, Burakov, Anatoly:
> >>>> On 12-Apr-18 2:34 PM, Shahaf Shuler wrote:
> >>>>> a compilation error occurred when compiling with CONFIG_RTE_EAL_VFIO=n
> >>>>>
> >>>>> == Build lib/librte_eal/linuxapp/eal
> >>>>>      CC eal_vfio.o
> >>>>> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1535:1: error: no
> >>>>> previous prototype for 'rte_vfio_dma_map' [-Werror=missing-prototypes]
> >>>>>     rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t
> >>>>> iova,
> >>>>>     ^
> >>>>> /download/dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c:1542:1: error: no
> >>>>> previous prototype for 'rte_vfio_dma_unmap' [-Werror=missing-prototypes]
> >>>>>     rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused
> >>>>> iova,
> >>>>>     ^
> >>>>>
> >>>>> As there is no use for those dummy functions without VFIO removing them
> >>>>> completely.
> >>>>
> >>>> These functions are part of public API, like rest of functions in this
> >>>> header. They're in the map file. Should we perhaps go the BSD way and
> >>>> provide EAL with dummy prototypes as well? See bsdapp/eal/eal.c:763 onwards.
> >>>
> >>> Why using dummy prototypes?
> >>> Because the prototypes in rte_vfio.h are under #ifdef VFIO_PRESENT ?
> >>> Is it possible to always define the prototypes in rte_vfio.h ?
> >>>
> >>
> >> Well, technically, yes, we could. There is one function that uses a
> >> VFIO-specific struct definition:
> >>
> >> int rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
> >> 		int *vfio_dev_fd, struct vfio_device_info *device_info);
> >>
> >> I'm sure we can work around that.
> > 
> > 
> > Removing dummy prototypes need, would be a nicer fix.
> > 
> 
> OK. Shahaf, will you submit a v2 with this, or should i do it? I think 
> it should be just a matter of #ifndef VFIO_PRESENT //define 
> vfio_device_info struct #endif - this should take care of the problem of 
> hiding the function definitions.
> 
> FreeBSD will also need to be adjusted to remove dummy prototypes.

I think you are more familiar with VFIO than any of us.
It is better to let you do, think about the implications and do the tests.
Thanks :)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix compilation without VFIO
  2018-04-13 13:58           ` Thomas Monjalon
@ 2018-04-16  5:50             ` Shahaf Shuler
  2018-04-16 10:09               ` Burakov, Anatoly
  0 siblings, 1 reply; 9+ messages in thread
From: Shahaf Shuler @ 2018-04-16  5:50 UTC (permalink / raw)
  To: Thomas Monjalon, Burakov, Anatoly; +Cc: dev

Friday, April 13, 2018 4:59 PM, Thomas Monjalon:
> >
> > OK. Shahaf, will you submit a v2 with this, or should i do it? I think
> > it should be just a matter of #ifndef VFIO_PRESENT //define
> > vfio_device_info struct #endif - this should take care of the problem
> > of hiding the function definitions.
> >
> > FreeBSD will also need to be adjusted to remove dummy prototypes.
> 
> I think you are more familiar with VFIO than any of us.
> It is better to let you do, think about the implications and do the tests.
> Thanks :)
> 

I don't mind whom of us will do it, as long as it will be done quickly. Currently there are some tests which cannot run on our regression due to it. 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix compilation without VFIO
  2018-04-16  5:50             ` Shahaf Shuler
@ 2018-04-16 10:09               ` Burakov, Anatoly
  0 siblings, 0 replies; 9+ messages in thread
From: Burakov, Anatoly @ 2018-04-16 10:09 UTC (permalink / raw)
  To: Shahaf Shuler, Thomas Monjalon; +Cc: dev

On 16-Apr-18 6:50 AM, Shahaf Shuler wrote:
> Friday, April 13, 2018 4:59 PM, Thomas Monjalon:
>>>
>>> OK. Shahaf, will you submit a v2 with this, or should i do it? I think
>>> it should be just a matter of #ifndef VFIO_PRESENT //define
>>> vfio_device_info struct #endif - this should take care of the problem
>>> of hiding the function definitions.
>>>
>>> FreeBSD will also need to be adjusted to remove dummy prototypes.
>>
>> I think you are more familiar with VFIO than any of us.
>> It is better to let you do, think about the implications and do the tests.
>> Thanks :)
>>
> 
> I don't mind whom of us will do it, as long as it will be done quickly. Currently there are some tests which cannot run on our regression due to it.
> 
> 

Yes, i'll be submitting the patch shortly.

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-04-16 10:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-12 13:34 [dpdk-dev] [PATCH] eal: fix compilation without VFIO Shahaf Shuler
2018-04-12 14:13 ` Burakov, Anatoly
2018-04-12 23:39   ` Thomas Monjalon
2018-04-13  9:11     ` Burakov, Anatoly
2018-04-13 13:08       ` Thomas Monjalon
2018-04-13 13:37         ` Burakov, Anatoly
2018-04-13 13:58           ` Thomas Monjalon
2018-04-16  5:50             ` Shahaf Shuler
2018-04-16 10:09               ` Burakov, Anatoly

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).