From: Jianfeng Tan <hidden> Date: 2017-10-11 10:32:22
With the introduction of IOVA mode, the only blocker to run
with 4KB pages for NICs binding to vfio-pci, is that
RTE_BAD_PHYS_ADDR is not a valid IOVA address.
We can refine this by using VA as IOVA if it's IOVA mode.
Signed-off-by: Jianfeng Tan <redacted>
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
If we want to enable IOVA mode, introduced by
commit 93878cf0255e ("eal: introduce helper API for IOVA mode"),
we need PMDs (for PCI devices) to expose this flag.
Signed-off-by: Jianfeng Tan <redacted>
---
Is this the complete list of drivers which need this flag? Do other
devices (e.g. cryptodev?) need this flag?
--
Thanks,
Anatoly
If we want to enable IOVA mode, introduced by
commit 93878cf0255e ("eal: introduce helper API for IOVA mode"),
we need PMDs (for PCI devices) to expose this flag.
Signed-off-by: Jianfeng Tan <redacted>
---
Is this the complete list of drivers which need this flag? Do other
devices (e.g. cryptodev?) need this flag?
No, these are just NICs from Intel (as an example). If other NICs want
to enable this, I'm more than happy to cover it in v2.
Thanks,
Jianfeng
With the introduction of IOVA mode, the only blocker to run
with 4KB pages for NICs binding to vfio-pci, is that
RTE_BAD_PHYS_ADDR is not a valid IOVA address.
We can refine this by using VA as IOVA if it's IOVA mode.
Signed-off-by: Jianfeng Tan <redacted>
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
If we want to enable IOVA mode, introduced by
commit 93878cf0255e ("eal: introduce helper API for IOVA mode"),
we need PMDs (for PCI devices) to expose this flag.
Signed-off-by: Jianfeng Tan <redacted>
---
On Wednesday 11 October 2017 04:03 PM, Jianfeng Tan wrote:
With the introduction of IOVA mode, the only blocker to run
with 4KB pages for NICs binding to vfio-pci, is that
RTE_BAD_PHYS_ADDR is not a valid IOVA address.
We can refine this by using VA as IOVA if it's IOVA mode.
Signed-off-by: Jianfeng Tan <redacted>
---
On Wednesday 11 October 2017 04:03 PM, Jianfeng Tan wrote:
If we want to enable IOVA mode, introduced by
commit 93878cf0255e ("eal: introduce helper API for IOVA mode"),
we need PMDs (for PCI devices) to expose this flag.
Signed-off-by: Jianfeng Tan <redacted>
---
Patch 1: Use VA as IOVA if IOVA mode is enabled.
Patch 2: Enable IOVA mode for the PMDs for Intel NICs.
How to test:
$ (bind nic to vfio-pci)
$ testpmd -c 0x3 -n 4 -m 2048 --no-huge -- -i --no-numa
Jianfeng Tan (2):
eal: honor IOVA mode for no-huge case
net: enable IOVA mode for PMDs
With the introduction of IOVA mode, the only blocker to run
with 4KB pages for NICs binding to vfio-pci, is that
RTE_BAD_PHYS_ADDR is not a valid IOVA address.
We can refine this by using VA as IOVA if it's IOVA mode.
Signed-off-by: Jianfeng Tan <redacted>
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
With the introduction of IOVA mode, the only blocker to run
with 4KB pages for NICs binding to vfio-pci, is that
RTE_BAD_PHYS_ADDR is not a valid IOVA address.
We can refine this by using VA as IOVA if it's IOVA mode.
Signed-off-by: Jianfeng Tan <redacted>
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
My bad, this patch is for no_hugetlbfs case.
Issue seen starting from next patch in the set [1], which enables IOVA mode for
Intel PMDs.
With IOVA mode enabled, KNI fails.
Does it make sense to add an API to set iova mode explicitly by application?
Application can set iova to PA and allocate memzones it requires.
[1]
http://dpdk.org/commit/f37dfab2
Any idea how to disable RTE_IOVA_VA when KNI used?
With the introduction of IOVA mode, the only blocker to run
with 4KB pages for NICs binding to vfio-pci, is that
RTE_BAD_PHYS_ADDR is not a valid IOVA address.
We can refine this by using VA as IOVA if it's IOVA mode.
Signed-off-by: Jianfeng Tan <redacted>
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
My bad, this patch is for no_hugetlbfs case.
Issue seen starting from next patch in the set [1], which enables IOVA mode for
Intel PMDs.
With IOVA mode enabled, KNI fails.
Does it make sense to add an API to set iova mode explicitly by application?
Application can set iova to PA and allocate memzones it requires.
Added config option to disable IOVA mode detection:
http://dpdk.org/dev/patchwork/patch/31071/
Still concerned if this may hit someone, since the result for KNI is a kernel
crash it would be nice to have more solid protection here.
And suggestion welcome.
Thanks,
ferruh
From: Maxime Coquelin <hidden> Date: 2018-01-05 10:32:48
Hi Jianfeng,
On 10/11/2017 12:33 PM, Jianfeng Tan wrote:
If we want to enable IOVA mode, introduced by
commit 93878cf0255e ("eal: introduce helper API for IOVA mode"),
we need PMDs (for PCI devices) to expose this flag.
Signed-off-by: Jianfeng Tan<redacted>
---
drivers/net/e1000/em_ethdev.c | 3 ++-
drivers/net/e1000/igb_ethdev.c | 5 +++--
drivers/net/fm10k/fm10k_ethdev.c | 3 ++-
drivers/net/i40e/i40e_ethdev.c | 3 ++-
drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++--
6 files changed, 13 insertions(+), 8 deletions(-)
This patch introduces a regression when doing device assignment in
guest, because current VT-d emulation only supports 39bits guest address
width [0].
In the Bz, Peter suggest we could have an IOVA allocator algorithm,
which could start to allocate IOVAs from 0. I think it could solve the
--no-huge case your series address, do you agree?
But it would be a long term solution, we need to fix this in stable.
Is the --no-huge option used in production, or is it only for testing?
If the latter do you think we could revert your patch while we find a
solution that makes all cases to work?
Ferruh, I see you also faced problems with KNI, how did you solved it?
Thanks,
Maxime
[0]: https://bugzilla.redhat.com/show_bug.cgi?id=1530957#c3
From: Maxime Coquelin <hidden> Date: 2018-01-05 12:04:12
On 01/05/2018 11:32 AM, Maxime Coquelin wrote:
Hi Jianfeng,
On 10/11/2017 12:33 PM, Jianfeng Tan wrote:
quoted
If we want to enable IOVA mode, introduced by
commit 93878cf0255e ("eal: introduce helper API for IOVA mode"),
we need PMDs (for PCI devices) to expose this flag.
Signed-off-by: Jianfeng Tan<redacted>
---
drivers/net/e1000/em_ethdev.c | 3 ++-
drivers/net/e1000/igb_ethdev.c | 5 +++--
drivers/net/fm10k/fm10k_ethdev.c | 3 ++-
drivers/net/i40e/i40e_ethdev.c | 3 ++-
drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++--
6 files changed, 13 insertions(+), 8 deletions(-)
This patch introduces a regression when doing device assignment in
guest, because current VT-d emulation only supports 39bits guest address
width [0].
In the Bz, Peter suggest we could have an IOVA allocator algorithm,
which could start to allocate IOVAs from 0. I think it could solve the
--no-huge case your series address, do you agree?
But it would be a long term solution, we need to fix this in stable.
Is the --no-huge option used in production, or is it only for testing?
If the latter do you think we could revert your patch while we find a
solution that makes all cases to work?
It seems that we can get Intel IOMMU's Guest Address Width from the
sysfs, as the CAP register is exposed.
So we can get the SAGAW value (see [1], page 217):
On Bare Metal:
# echo $(((0x`cat /sys/class/iommu/dmar0/intel-iommu/cap` >> 8) & 0x1f))
4
=> 48bits
In guest:
# echo $(((0x`cat /sys/class/iommu/dmar0/intel-iommu/cap` >> 8) & 0x1f))
2
=> 39bits
Using this, we could or not allow the VA mode when using Intel IOMMU.
Any thoughts?
Regards,
Maxime
[1]:
https://software.intel.com/sites/default/files/managed/c5/15/vt-directed-io-spec.pdf
Hi Maxim,
On Friday 05 January 2018 04:02 PM, Maxime Coquelin wrote:
Hi Jianfeng,
On 10/11/2017 12:33 PM, Jianfeng Tan wrote:
quoted
If we want to enable IOVA mode, introduced by
commit 93878cf0255e ("eal: introduce helper API for IOVA mode"),
we need PMDs (for PCI devices) to expose this flag.
Signed-off-by: Jianfeng Tan<redacted>
---
[...]
Ferruh, I see you also faced problems with KNI, how did you solved it?
By checking lsmod for rte_kni module and if found then set .iova_mode = _pa, refer [1].
You may follow similar approach.. meaning detect emulation mode Or if not then
other-way to introduce --iova-mode=<> eal arg.
[1] http://dpdk.org/browse/dpdk/tree/lib/librte_eal/linuxapp/eal/eal.c#n810
Thanks.
From: Maxime Coquelin <hidden> Date: 2018-01-05 12:58:03
Hi Santosh
On 01/05/2018 01:10 PM, santosh wrote:
Hi Maxim,
On Friday 05 January 2018 04:02 PM, Maxime Coquelin wrote:
quoted
Hi Jianfeng,
On 10/11/2017 12:33 PM, Jianfeng Tan wrote:
quoted
If we want to enable IOVA mode, introduced by
commit 93878cf0255e ("eal: introduce helper API for IOVA mode"),
we need PMDs (for PCI devices) to expose this flag.
Signed-off-by: Jianfeng Tan<redacted>
---
[...]
quoted
Ferruh, I see you also faced problems with KNI, how did you solved it?
By checking lsmod for rte_kni module and if found then set .iova_mode = _pa, refer [1].
You may follow similar approach.. meaning detect emulation mode Or if not then
other-way to introduce --iova-mode=<> eal arg.
Thanks for the information
Detecting whether we are in host or guest is not that trivial, and as
Peter pointed me out, the VT-d specifies the 39bits guest address width
so there are certainly some processors in the wild using it.
And I don't think introducing a new EAL arg in -stable is a good idea.
If this is the only solution, then we should keep PA by default.
When using intel IOMMU, I think the best solution is to forbid VA mode
if GAW is 39 bits.
Regards,
Maxime