[dpdk-dev] eal: fslmc bus need vfio enabled for non PCI case as well

Message ID 1499946530-29581-1-git-send-email-hemant.agrawal@nxp.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Hemant Agrawal July 13, 2017, 11:48 a.m. UTC
  In case no_pci is configured, fslmc bus will still need the
the vfio to be enabled.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 lib/librte_eal/linuxapp/eal/eal.c | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Thomas Monjalon Oct. 5, 2017, 11:41 p.m. UTC | #1
13/07/2017 13:48, Hemant Agrawal:
> In case no_pci is configured, fslmc bus will still need the
> the vfio to be enabled.
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
> --- a/lib/librte_eal/linuxapp/eal/eal.c
> +++ b/lib/librte_eal/linuxapp/eal/eal.c
> +#ifdef RTE_LIBRTE_FSLMC_BUS
> +	if (!vfio_enabled) {
> +		if (!vfio_enable("vfio_fsl_mc"))
> +			vfio_enabled = 1;
> +	}
> +#endif

It seems to be a hack.
VFIO is not only PCI.
Why --no-pci is impacting VFIO?

Anatoly?
  
Hemant Agrawal Oct. 6, 2017, 4:22 p.m. UTC | #2
On 10/6/2017 5:11 AM, Thomas Monjalon wrote:
> 13/07/2017 13:48, Hemant Agrawal:
>> In case no_pci is configured, fslmc bus will still need the
>> the vfio to be enabled.
>>
>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>> ---
>> --- a/lib/librte_eal/linuxapp/eal/eal.c
>> +++ b/lib/librte_eal/linuxapp/eal/eal.c
>> +#ifdef RTE_LIBRTE_FSLMC_BUS
>> +	if (!vfio_enabled) {
>> +		if (!vfio_enable("vfio_fsl_mc"))
>> +			vfio_enabled = 1;
>> +	}
>> +#endif
>
> It seems to be a hack.
> VFIO is not only PCI.
> Why --no-pci is impacting VFIO?
>
> Anatoly?
>

At present there are only 2 users of VFIO. PCI and fsl-mc bus.


One options is that we always enable vfio irrespective of --no-pci flag. 
My believe is that vfio-pci will be present in most system supporting 
any other flavor of vfio (platform, fsl-mc etc).

The other option is what I proposed. i.e. if vfio is not already enabled 
the platform is FSLMC bus, enable it.

regards,
Hemant
  
Thomas Monjalon Oct. 6, 2017, 5:08 p.m. UTC | #3
06/10/2017 18:22, Hemant Agrawal:
> On 10/6/2017 5:11 AM, Thomas Monjalon wrote:
> > 13/07/2017 13:48, Hemant Agrawal:
> >> In case no_pci is configured, fslmc bus will still need the
> >> the vfio to be enabled.
> >>
> >> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> >> ---
> >> --- a/lib/librte_eal/linuxapp/eal/eal.c
> >> +++ b/lib/librte_eal/linuxapp/eal/eal.c
> >> +#ifdef RTE_LIBRTE_FSLMC_BUS
> >> +	if (!vfio_enabled) {
> >> +		if (!vfio_enable("vfio_fsl_mc"))
> >> +			vfio_enabled = 1;
> >> +	}
> >> +#endif
> >
> > It seems to be a hack.
> > VFIO is not only PCI.
> > Why --no-pci is impacting VFIO?
> >
> > Anatoly?
> >
> 
> At present there are only 2 users of VFIO. PCI and fsl-mc bus.
> 
> 
> One options is that we always enable vfio irrespective of --no-pci flag. 
> My believe is that vfio-pci will be present in most system supporting 
> any other flavor of vfio (platform, fsl-mc etc).
> 
> The other option is what I proposed. i.e. if vfio is not already enabled 
> the platform is FSLMC bus, enable it.

Why not always enable it?
  
Hemant Agrawal Oct. 7, 2017, 11:22 a.m. UTC | #4
On 10/6/2017 10:38 PM, Thomas Monjalon wrote:
> 06/10/2017 18:22, Hemant Agrawal:
>> On 10/6/2017 5:11 AM, Thomas Monjalon wrote:
>>> 13/07/2017 13:48, Hemant Agrawal:
>>>> In case no_pci is configured, fslmc bus will still need the
>>>> the vfio to be enabled.
>>>>
>>>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>>>> ---
>>>> --- a/lib/librte_eal/linuxapp/eal/eal.c
>>>> +++ b/lib/librte_eal/linuxapp/eal/eal.c
>>>> +#ifdef RTE_LIBRTE_FSLMC_BUS
>>>> +	if (!vfio_enabled) {
>>>> +		if (!vfio_enable("vfio_fsl_mc"))
>>>> +			vfio_enabled = 1;
>>>> +	}
>>>> +#endif
>>>
>>> It seems to be a hack.
>>> VFIO is not only PCI.
>>> Why --no-pci is impacting VFIO?
>>>
>>> Anatoly?
>>>
>>
>> At present there are only 2 users of VFIO. PCI and fsl-mc bus.
>>
>>
>> One options is that we always enable vfio irrespective of --no-pci flag.
>> My believe is that vfio-pci will be present in most system supporting
>> any other flavor of vfio (platform, fsl-mc etc).
>>
>> The other option is what I proposed. i.e. if vfio is not already enabled
>> the platform is FSLMC bus, enable it.
>
> Why not always enable it?
>
I agree. sent a v2 for this.

Regards,
Hemant
  

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 7c78f2d..0484396 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -722,6 +722,13 @@  static int rte_eal_vfio_setup(void)
 		vfio_enabled |= pci_vfio_is_enabled();
 	}
 
+#ifdef RTE_LIBRTE_FSLMC_BUS
+	if (!vfio_enabled) {
+		if (!vfio_enable("vfio_fsl_mc"))
+			vfio_enabled = 1;
+	}
+#endif
+
 	if (vfio_enabled) {
 
 		/* if we are primary process, create a thread to communicate with