eal: force IOVA mode to physical
PATCH 1/1 eal: force IOVA mode to physical
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
--- lib/librte_eal/linuxapp/eal/eal.c | 7 +++++++ 1 file changed, 7 insertions(+)
lib/librte_eal/linuxapp/eal/eal.c +7 -0
@@ -805,6 +805,7 @@ static void rte_eal_init_alert(const char *msg)return -1 ; } +#ifndef RTE_EAL_IOVA_MODE_PA /* autodetect the iova mapping mode (default is iova_pa) */ rte_eal_get_configuration ()->iova_mode =rte_bus_get_iommu_class ();
@@ -816,6 +817,12 @@ static void rte_eal_init_alert(const char *msg)"Some devices want IOVA as VA but PA will be used because.. " "KNI module inserted\n"); } +#else +/* Force iova mapping mode to be physical address */ +rte_eal_get_configuration ()->iova_mode =RTE_IOVA_PA ; +RTE_LOG (WARNING ,EAL , +"Force the iova mapping mode to be physical address\n" ); +#endif if (internal_config.no_hugetlbfs == 0 && internal_config.process_type != RTE_PROC_SECONDARY &&
Signature · 1 line
1.8.3.1
Quoted 10 lines · eric zhang
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>--- lib/librte_eal/linuxapp/eal/eal.c | 7 +++++++
you will also need the same in bsdapp/eal
lib/librte_eal/linuxapp/eal/eal.c static void rte_eal_init_alert(const char *msg) · line 808
Quoted 11 lines
1 file changed, 7 insertions(+)lib/librte_eal/linuxapp/eal/eal.c +1
-0@@ -805,6 +805,7 @@ static void rte_eal_init_alert(const char *msg)return -1 ; } +#ifndef RTE_EAL_IOVA_MODE_PA
Add the default option as 'n' in config/common_base
Quoted 16 lines
lib/librte_eal/linuxapp/eal/eal.c +6
-0/* autodetect the iova mapping mode (default is iova_pa) */ rte_eal_get_configuration ()->iova_mode =rte_bus_get_iommu_class ();@@ -816,6 +817,12 @@ static void rte_eal_init_alert(const char *msg)"Some devices want IOVA as VA but PA will be used because.. " "KNI module inserted\n"); } +#else +/* Force iova mapping mode to be physical address */ +rte_eal_get_configuration ()->iova_mode =RTE_IOVA_PA ; +RTE_LOG (WARNING ,EAL , +"Force the iova mapping mode to be physical address\n" ); +#endif if (internal_config.no_hugetlbfs == 0 && internal_config.process_type != RTE_PROC_SECONDARY &&
Quoted 9 lines · eric zhang
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
Signature · 2 lines
Thanks, Anatoly
Hi,
Quoted 8 lines · Anatoly
Quoted 7 lines · eric zhang
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Quoted 10 lines
Quoted 2 lines
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
Signature · 2 lines
Thanks, Anatoly
What is the bus of these devices and why not implement get_iommu_class in it?
Signature · 2 lines
Gaëtan Rivet 6WIND
Hi,
Quoted 16 lines · Gaëtan Rivet
Hi,
Quoted 13 lines · Anatoly
Quoted 9 lines · eric zhang
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
That is a good suggestion.
Quoted 5 lines
Quoted 3 lines
Signature · 2 lines
Thanks, AnatolyWhat is the bus of these devices and why not implement
get_iommu_classin it?
There are cases, where you are using dpdk libraries with external libraries and you need to change the default behavior DPDK lib to use physical address instead of virtual address. Providing an option to user will help.
Quoted 25 lines · Hemant
External Email
Hi,
Quoted 16 lines · Gaëtan Rivet
Hi,
Quoted 13 lines · Anatoly
Quoted 9 lines · eric zhang
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
That is a good suggestion.
Quoted 3 lines
Quoted 3 lines
Signature · 2 lines
Thanks, Anatoly
Quoted 8 lines
Quoted 2 lines
What is the bus of these devices and why not implement
get_iommu_classin it?There are cases, where you are using dpdk libraries with external libraries and you need to change the default behavior DPDK lib to use physical address instead of virtual address.
Providing an option to user will help.
More appropriate solution could be:
* Either fix it at bus layer .. i.e.. get_iommu_class()..
* Or introduce something like [1] --iova-mode=<pa/va> param.
Former is better solution than latter if autodetection is a key criteria. Thanks.
Quoted 11 lines
-----Original Message-----
From: santosh [mailto:[email protected]]
Sent: Thursday, August 30, 2018 8:59 AM
To: [email protected]; Gaëtan Rivet; Burakov, Anatoly
Cc: Zhang, Qing Long (Eric); [email protected]; [email protected]; Legacy, Allain; Peters, Matt
Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physicalQuoted 1 line · Hemant
External Email
<...>
Quoted 2 lines
Is there a reason this was abandoned?
Quoted 11 lines · Allain
External Email
Quoted 9 lines
-----Original Message-----
From: santosh [mailto:[email protected]]
Sent: Thursday, August 30, 2018 8:59 AM
To: [email protected]; Gaëtan Rivet; Burakov, Anatoly
Cc: Zhang, Qing Long (Eric); [email protected]; [email protected]; Legacy, Allain; Peters, Matt
Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physical
Quoted 5 lines
Quoted 2 lines · Hemant
Quoted 1 line
External Email
<...>
Quoted 1 line
Is there a reason this was abandoned?
Wasn't abandoned exactly, in-fact we had better solution which is to introduce autodetection notion at bus layer.
Quoted 34 lines · santosh
Quoted 25 lines · Hemant
External Email
Hi,
Quoted 16 lines · Gaëtan Rivet
Hi,
Quoted 13 lines · Anatoly
Quoted 9 lines · eric zhang
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
That is a good suggestion.
Quoted 3 lines
Quoted 3 lines
Signature · 2 lines
Thanks, AnatolyQuoted 8 lines
Quoted 2 lines
What is the bus of these devices and why not implement
get_iommu_classin it?There are cases, where you are using dpdk libraries with external libraries and you need to change the default behavior DPDK lib to use physical address instead of virtual address.
Providing an option to user will help.
Quoted 9 lines
More appropriate solution could be:
* Either fix it at bus layer .. i.e..get_iommu_class()..
* Or introduce something like [1] --iova-mode=<pa/va> param.Former is better solution than latter if autodetection is a key criteria. Thanks.
It's not generic which couldn't be fixed at bus layer.
So what's the preference of EAL option or compile time solution?
Adding --iova-mode as patch [1] will overrivde auto-detection rte_bus_get_iommu_class() make it no use; compile time solution will align with upstream and keep new atuodetection solution in #ifndef.
Thanks
Eric
-----Original Message-----
Quoted 55 lines
Date: Tue, 4 Sep 2018 23:40:36 -0400
From: Eric Zhang <[email protected]>
To: santosh <[email protected]>, [email protected],
Gaëtan Rivet <[email protected]>, "Burakov, Anatoly" <[email protected]>
CC: [email protected], [email protected], [email protected],
[email protected]
Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physical
User-Agent: Mozilla/5.0 (X11; Linuxx86_64; rv:52.0) Gecko/20100101
Thunderbird/52.9.1Quoted 34 lines · santosh
Quoted 25 lines · Hemant
External Email
Hi,
Quoted 16 lines · Gaëtan Rivet
Hi,
Quoted 13 lines · Anatoly
Quoted 9 lines · eric zhang
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
That is a good suggestion.
Quoted 3 lines
Quoted 3 lines
--
Thanks,
AnatolyQuoted 8 lines
Quoted 2 lines
What is the bus of these devices and why not implement
get_iommu_classin it?There are cases, where you are using dpdk libraries with external libraries and you need to change the default behavior DPDK lib to use physical address instead of virtual address.
Providing an option to user will help.Quoted 9 lines
More appropriate solution could be:
* Either fix it at bus layer .. i.e..get_iommu_class()..
* Or introduce something like [1] --iova-mode=<pa/va> param.Former is better solution than latter if autodetection is a key criteria. Thanks.
Quoted 7 lines
It's not generic which couldn't be fixed at bus layer.
So what's the preference of EAL option or compile time solution? Adding --iova-mode as patch [1] will overrivde auto-detectionrte_bus_get_iommu_class()
make it no use; compile time solution will align with upstream and keep new atuodetection
solution in #ifndef.
If it is for vdev devices, why not introduce something like RTE_PCI_DRV_IOVA_AS_VA and let vdev device describe its personality. And based on the devices(flags) on vdev bus, rte_bus_get_iommu_class() of vdev can decide the mode just like PCI bus.
Quoted 4 lines
Thanks
Eric
Quoted 64 lines · Jerin Jacob
-----Original Message-----
Quoted 55 lines
Date: Tue, 4 Sep 2018 23:40:36 -0400
From: Eric Zhang <[email protected]>
To: santosh <[email protected]>, [email protected],
Gaëtan Rivet <[email protected]>, "Burakov, Anatoly" <[email protected]>
CC: [email protected], [email protected], [email protected],
[email protected]
Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physical
User-Agent: Mozilla/5.0 (X11; Linuxx86_64; rv:52.0) Gecko/20100101
Thunderbird/52.9.1Quoted 34 lines · santosh
Quoted 25 lines · Hemant
External Email
Hi,
Quoted 16 lines · Gaëtan Rivet
Hi,
Quoted 13 lines · Anatoly
Quoted 9 lines · eric zhang
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
That is a good suggestion.
Quoted 3 lines
Quoted 3 lines
--
Thanks,
AnatolyQuoted 8 lines
Quoted 2 lines
What is the bus of these devices and why not implement
get_iommu_classin it?There are cases, where you are using dpdk libraries with external libraries and you need to change the default behavior DPDK lib to use physical address instead of virtual address.
Providing an option to user will help.Quoted 9 lines
More appropriate solution could be:
* Either fix it at bus layer .. i.e..get_iommu_class()..
* Or introduce something like [1] --iova-mode=<pa/va> param.Former is better solution than latter if autodetection is a key criteria. Thanks.
Quoted 7 lines
It's not generic which couldn't be fixed at bus layer.
So what's the preference of EAL option or compile time solution? Adding --iova-mode as patch [1] will overrivde auto-detectionrte_bus_get_iommu_class()
make it no use; compile time solution will align with upstream and keep new atuodetection
solution in #ifndef.
Quoted 5 lines
If it is for vdev devices, why not introduce something like
RTE_PCI_DRV_IOVA_AS_VAand let vdev device describe its personality. And based on the devices(flags) on vdev bus,rte_bus_get_iommu_class()of vdev can decide the mode just like PCI bus.
That seems like a better option to me, +1. As far as i know, at the moment if there are no devices attached at all, or if there are only vdev devices attached, DPDK will default to IOVA as PA mode for no good reason; such a change would certainly fix this.
Quoted 6 lines
Quoted 5 lines
Thanks
Eric
Signature · 2 lines
Thanks, Anatoly
Quoted 65 lines · Anatoly
Quoted 64 lines · Jerin Jacob
-----Original Message-----
Quoted 62 lines
Date: Tue, 4 Sep 2018 23:40:36 -0400
From: Eric Zhang <[email protected]>
To: santosh <[email protected]>, [email protected], Gaëtan Rivet <[email protected]>, "Burakov, Anatoly" <[email protected]>
CC: [email protected], [email protected], [email protected], [email protected]
Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physical
User-Agent: Mozilla/5.0 (X11; Linuxx86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1Quoted 34 lines · santosh
Quoted 25 lines · Hemant
External Email
Hi,
Quoted 16 lines · Gaëtan Rivet
Hi,
Quoted 13 lines · Anatoly
Quoted 9 lines · eric zhang
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
That is a good suggestion.
Quoted 3 lines
Quoted 3 lines
Signature · 2 lines
Thanks, AnatolyQuoted 8 lines
Quoted 2 lines
What is the bus of these devices and why not implement
get_iommu_classin it?There are cases, where you are using dpdk libraries with external libraries and you need to change the default behavior DPDK lib to use physical address instead of virtual address.
Providing an option to user will help.Quoted 9 lines
More appropriate solution could be:
* Either fix it at bus layer .. i.e..get_iommu_class()..
* Or introduce something like [1] --iova-mode=<pa/va> param.Former is better solution than latter if autodetection is a key criteria. Thanks.
It's not generic which couldn't be fixed at bus layer.
So what's the preference of EAL option or compile time solution? Adding --iova-mode as patch [1] will overrivde auto-detectionrte_bus_get_iommu_class()
make it no use; compile time solution will align with upstream and keep new atuodetection
solution in #ifndef.
Quoted 7 lines
Quoted 5 lines
If it is for vdev devices, why not introduce something like
RTE_PCI_DRV_IOVA_AS_VAand let vdev device describe its personality. And based on the devices(flags) on vdev bus,rte_bus_get_iommu_class()of vdev can decide the mode just like PCI bus.That seems like a better option to me, +1. As far as i know, at the moment if there are no devices attached at all, or if there are only vdev devices attached, DPDK will default to IOVA as PA mode for no good reason; such a change would certainly fix this.
Thanks for the suggestions however our virtual device doesn't run dpdk vdev code so we can't use the flag.
Notice that in eal.c there is one workaround that force iova to be PA per virtual device is not directly attached to pci. That case is checking kni module. Ours is a similar case that virtual device not attach pci directly. So we have to turn to force iova to PA either 1. compilation option 2. eal option. Which one should be the preference by taking into consideration that align with upstream?
Thanks
Quoted 9 lines
Quoted 7 lines
Quoted 6 lines
Thanks
Eric
Quoted 74 lines · Eric Zhang
Quoted 71 lines · Anatoly
Quoted 69 lines · Jerin Jacob
-----Original Message-----
Quoted 55 lines
Date: Tue, 4 Sep 2018 23:40:36 -0400
From: Eric Zhang <[email protected]>
To: santosh <[email protected]>, [email protected], Gaëtan Rivet <[email protected]>, "Burakov, Anatoly" <[email protected]>
CC: [email protected], [email protected], [email protected], [email protected]
Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physical
User-Agent: Mozilla/5.0 (X11; Linuxx86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1Quoted 34 lines · santosh
Quoted 25 lines · Hemant
External Email
Hi,
Quoted 16 lines · Gaëtan Rivet
Hi,
Quoted 13 lines · Anatoly
Quoted 9 lines · eric zhang
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required addressing mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
That is a good suggestion.
Quoted 3 lines
Quoted 3 lines
Signature · 2 lines
Thanks, AnatolyQuoted 8 lines
Quoted 2 lines
What is the bus of these devices and why not implement
get_iommu_classin it?There are cases, where you are using dpdk libraries with external libraries and you need to change the default behavior DPDK lib to use physical address instead of virtual address.
Providing an option to user will help.Quoted 9 lines
More appropriate solution could be:
* Either fix it at bus layer .. i.e..get_iommu_class()..
* Or introduce something like [1] --iova-mode=<pa/va> param.Former is better solution than latter if autodetection is a key criteria. Thanks.
Quoted 7 lines
It's not generic which couldn't be fixed at bus layer.
So what's the preference of EAL option or compile time solution? Adding --iova-mode as patch [1] will overrivde auto-detectionrte_bus_get_iommu_class()
make it no use; compile time solution will align with upstream and keep new atuodetection
solution in #ifndef.If it is for vdev devices, why not introduce something like
RTE_PCI_DRV_IOVA_AS_VAand let vdev device describe its personality. And based on the devices(flags) on vdev bus,rte_bus_get_iommu_class()of vdev can decide the mode just like PCI bus.
Quoted 7 lines
Quoted 1 line
That seems like a better option to me, +1. As far as i know, at the moment if there are no devices attached at all, or if there are only vdev devices attached, DPDK will default to IOVA as PA mode for no good reason; such a change would certainly fix this.
Thanks for the suggestions however our virtual device doesn't run dpdk vdev code so we can't use the flag.
Notice that ineal.cthere is one workaround that force iova to be PA per virtual device is not directly attached to pci. That case is checking kni module. Ours is a similar case that virtual device not attach pci directly. So we have to turn to force iova to PA either 1. compilation option 2. eal option. Which one should be the preference by taking into consideration that align with upstream?Thanks
Any comments?
Quoted 10 lines
Quoted 9 lines
Quoted 7 lines
Quoted 6 lines
Thanks
Eric
Hi,
A little bit of self-advertising:
I recently pushed patches that will make DPDK default to RTE_IOVA_VA when physical addresses were not explicitly requested and are not available, e.g. when running as a non-privileged user. It shouldn't cause any conflicts with the changes you're proposing here, but any review is welcome.
pci/linux: use RTE_IOVA_VA whenever possible http://patches.dpdk.org/patch/44392/
[v2] eal/bus: use RTE_IOVA_PA only if phys addresses are available http://patches.dpdk.org/patch/44420/
As for the --iova-mode=<pa/va>, I agree it could help DPDK use cases where most drivers or devices are hotplugged/hotattached at runtime - e.g. SPDK, it could certainly make use of such param.
D.
Quoted 120 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Eric Zhang
Sent: Tuesday, September 11, 2018 7:22 PM
To: Burakov, Anatoly <[email protected]>; Jerin Jacob <[email protected]>
Cc: santosh <[email protected]>; [email protected]; Gaëtan Rivet <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physicalQuoted 27 lines · Eric Zhang
Quoted 24 lines · Anatoly
Quoted 23 lines · Jerin Jacob
-----Original Message-----
Quoted 22 lines
Date: Tue, 4 Sep 2018 23:40:36 -0400
From: Eric Zhang <[email protected]>
To: santosh <[email protected]>, [email protected],
Gaëtan Rivet <[email protected]>, "Burakov, Anatoly" <[email protected]>
CC: [email protected], [email protected], [email protected],
[email protected]
Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physical
User-Agent: Mozilla/5.0 (X11; Linuxx86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1Quoted 8 lines · santosh
Quoted 7 lines · Hemant
External Email
Hi,
Quoted 2 lines · Gaëtan Rivet
Hi,
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines · Anatoly
Quoted 6 lines · eric zhang
Quoted 5 lines
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required
addressing
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 36 lines
Quoted 24 lines
Quoted 12 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
That is a good suggestion.
Quoted 3 lines
Quoted 3 lines
--
Thanks,
AnatolyQuoted 8 lines
Quoted 2 lines
What is the bus of these devices and why not implement
get_iommu_classin it?There are cases, where you are using dpdk libraries with external libraries and you need to change the default behavior DPDK lib to use physical address instead of virtual address. Providing an option to user will help.
More appropriate solution could be:
* Either fix it at bus layer .. i.e..get_iommu_class()..
* Or introduce something like [1] --iova-mode=<pa/va> param.Quoted 6 lines
Former is better solution than latter if autodetection is a key criteria.
Thanks.It's not generic which couldn't be fixed at bus layer. So what's the preference of EAL option or compile time solution? Adding --iova-mode as patch [1] will overrivde auto-detection
rte_bus_get_iommu_class()
make it no use; compile time solution will align with upstream and keep new atuodetection solution in #ifndef.Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
If it is for vdev devices, why not introduce something like
RTE_PCI_DRV_IOVA_AS_VAand let vdev device describe its personality. And based on the devices(flags) on vdev bus,rte_bus_get_iommu_class()of vdev can decide the mode just like PCIbus.
Quoted 16 lines
Quoted 6 lines
Quoted 1 line
That seems like a better option to me, +1. As far as i know, at the moment if there are no devices attached at all, or if there are only vdev devices attached, DPDK will default to IOVA as PA mode for no good reason; such a change would certainly fix this.
Thanks for the suggestions however our virtual device doesn't run dpdk vdev code so we can't use the flag.
Notice that ineal.cthere is one workaround that force iova to be PA per virtual device is not directly attached to pci. That case is checking kni module. Ours is a similar case that virtual device not attach pci directly.
So we have to turn to force iova to PA either 1. compilation option 2. eal option. Which one should be the preference by taking into consideration that align with upstream?Quoted 2 lines
Thanks
Any comments?
Quoted 10 lines
Quoted 9 lines
Quoted 7 lines
Quoted 6 lines
Thanks
Eric
Hi All,
Considered that most people commented that eal option "--iova-mode" is a better solution that gives user a chance not to use bus iova auto detection scheme and want to override for some reason, I will generate 2nd version patch which will use eal option instead of compilation configuration.
Eric
Quoted 122 lines · Dariusz
Hi,
A little bit of self-advertising:
I recently pushed patches that will make DPDK default toRTE_IOVA_VAwhen physical addresses were not explicitly requested and are not available, e.g. when running as a non-privileged user. It shouldn't cause any conflicts with the changes you're proposing here, but any review is welcome.pci/linux: use
RTE_IOVA_VAwhenever possible http://patches.dpdk.org/patch/44392/
[v2] eal/bus: useRTE_IOVA_PAonly if phys addresses are available http://patches.dpdk.org/patch/44420/As for the --iova-mode=<pa/va>, I agree it could help DPDK use cases where most drivers or devices are hotplugged/hotattached at runtime - e.g. SPDK, it could certainly make use of such param.
D.
Quoted 110 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Eric Zhang
Sent: Tuesday, September 11, 2018 7:22 PM
To: Burakov, Anatoly <[email protected]>; Jerin Jacob <[email protected]>
Cc: santosh <[email protected]>; [email protected]; Gaëtan Rivet <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physicalQuoted 26 lines · Eric Zhang
Quoted 24 lines · Anatoly
Quoted 23 lines · Jerin Jacob
-----Original Message-----
Quoted 22 lines
Date: Tue, 4 Sep 2018 23:40:36 -0400
From: Eric Zhang <[email protected]>
To: santosh <[email protected]>, [email protected],
Gaëtan Rivet <[email protected]>, "Burakov, Anatoly" <[email protected]>
CC: [email protected], [email protected], [email protected],
[email protected]
Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physical
User-Agent: Mozilla/5.0 (X11; Linuxx86_64; rv:52.0) Gecko/20100101
Thunderbird/52.9.1Quoted 8 lines · santosh
Quoted 7 lines · Hemant
External Email
Hi,
Quoted 2 lines · Gaëtan Rivet
Hi,
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines · Anatoly
Quoted 6 lines · eric zhang
Quoted 5 lines
This patch adds a configuration option to force the IOVA mode to physical address (PA). There exists virtual devices that are not directly attached to the PCI bus, and therefore the auto detection of the IOVA mode based on probing the PCI bus and IOMMU configuration may not report the required
addressing
Quoted 36 lines
Quoted 36 lines
Quoted 36 lines
Quoted 36 lines
Quoted 24 lines
Quoted 12 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
mode. Having the configuration option permits the mode to be explicitly configured in this scenario.
Signed-off-by eric zhang <[email protected]>---
Defining this at compile-time seems like an overkill. Wouldn't it be better to just add an EAL command-line option to force IOVA mode to a particular value?
That is a good suggestion.
Quoted 3 lines
Quoted 3 lines
--
Thanks,
AnatolyQuoted 8 lines
Quoted 2 lines
What is the bus of these devices and why not implement
get_iommu_classin it?There are cases, where you are using dpdk libraries with external libraries and you need to change the default behavior DPDK lib to use physical address instead of virtual address. Providing an option to user will help.
More appropriate solution could be:
* Either fix it at bus layer .. i.e..get_iommu_class()..
* Or introduce something like [1] --iova-mode=<pa/va> param.Quoted 6 lines
Former is better solution than latter if autodetection is a key criteria.
Thanks.It's not generic which couldn't be fixed at bus layer. So what's the preference of EAL option or compile time solution? Adding --iova-mode as patch [1] will overrivde auto-detection
rte_bus_get_iommu_class()
make it no use; compile time solution will align with upstream and keep new atuodetection solution in #ifndef.Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
If it is for vdev devices, why not introduce something like
RTE_PCI_DRV_IOVA_AS_VAand let vdev device describe its personality. And based on the devices(flags) on vdev bus,rte_bus_get_iommu_class()of vdev can decide the mode just like PCIbus.
Quoted 14 lines
Quoted 4 lines
That seems like a better option to me, +1. As far as i know, at the moment if there are no devices attached at all, or if there are only vdev devices attached, DPDK will default to IOVA as PA mode for no good reason; such a change would certainly fix this.
Thanks for the suggestions however our virtual device doesn't run dpdk vdev code so we can't use the flag.
Notice that ineal.cthere is one workaround that force iova to be PA per virtual device is not directly attached to pci. That case is checking kni module. Ours is a similar case that virtual device not attach pci directly.
So we have to turn to force iova to PA either 1. compilation option 2. eal option. Which one should be the preference by taking into consideration that align with upstream?Quoted 2 lines
Thanks
Any comments?
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Thanks
Eric