<div dir="ltr">Hi,<br>Attaching the logs of EAL when trying to run a configuration with virtio_user port when IOMMU is <br>disabled and enable_unsafe_iommu is enabled. As you can see it forces IOVA as PA but the viritui_user needs IOVA as VA.<br>I am also attaching the output of dmesg. I am not sure which kernel logs you wanted... if there is anything else please let me know..<br>Regarding the ESXI logs, they are HUGE so I will send to you on a separate email.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 21, 2023 at 1:14 PM Ferruh Yigit <<a href="mailto:ferruh.yigit@amd.com">ferruh.yigit@amd.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 7/21/2023 12:39 PM, Igor de Paula wrote:<br>
> I am trying to use virtio_user for an interface with the<br>
> kernel: <a href="https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html" rel="noreferrer" target="_blank">https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html</a> <<a href="https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html" rel="noreferrer" target="_blank">https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html</a>><br>
> I think this requires IOVA as va.<br>
><br>
<br>
I am not sure if virtio-user has IOVA as VA requirement, cc'ed Chenbo,<br>
he may know better.<br>
<br>
Meanwhile can you give a try to 'enable_unsafe_noiommu_mode' and<br>
'--iova-mode=pa'?<br>
<br>
<br>
> It does work with Intel host and IOMMU<br>
> enabled. Part of the negotiation when setting it up is getting the IOMMU<br>
> number so I thought it has to have IOMMU.<br>
><br>
<br>
Yes, issue looks like related to the IOMMU, and it may be either related<br>
to HW support, or ESXi iommu driver support, we will check using below<br>
information you provided.<br>
<br>
> I tried disabling IOMMU and enabling enable_unsafe_noiommu flag but<br>
> again, that didn't work.<br>
> ESXI version - VMware ESXi, 7.0.0, 16324942<br>
> AMD: AMD EPYC 7452 32-Core Processo<br>
> <br>
> On an Intel host which worked: Intel(R) Xeon(R) CPU E5-2697A v4 @ 2.60GHz<br>
> Regarding the logs I will try and attach it soon.<br>
> <br>
<br>
Thanks for info, waiting for logs.<br>
<br>
> <br>
> On Fri, Jul 21, 2023 at 12:21 PM Ferruh Yigit <<a href="mailto:ferruh.yigit@amd.com" target="_blank">ferruh.yigit@amd.com</a><br>
> <mailto:<a href="mailto:ferruh.yigit@amd.com" target="_blank">ferruh.yigit@amd.com</a>>> wrote:<br>
> <br>
> Hi Igor,<br>
> <br>
> VM doesn't have IOMMU, and vmxnet3 requires PA mode, for this can you<br>
> please try with:<br>
> - enable 'enable_unsafe_noiommu_mode' flag<br>
> - Force PA mode via '--iova-mode=pa' eal parameter<br>
> <br>
> <br>
> Also to be able to figure out AMD IOMMU support level, can you please<br>
> provide:<br>
> - AMD part number<br>
> - ESXi/hypervisor version<br>
> - ESXi & VM kernel logs<br>
> <br>
> <br>
> Thanks,<br>
> Ferruh<br>
> <br>
> On 7/20/2023 5:21 PM, Jochen Behrens wrote:<br>
> > +Ronak from the ESX team<br>
> ><br>
> > <br>
> ><br>
> > <br>
> ><br>
> > In our usage, we do set amd_iommu=off in the boot command line from<br>
> > grub. (Or intel_iommu=off for Intel processors.)<br>
> ><br>
> > <br>
> ><br>
> > Jochen<br>
> ><br>
> > <br>
> ><br>
> > *From: *Thomas Monjalon <<a href="mailto:thomas@monjalon.net" target="_blank">thomas@monjalon.net</a><br>
> <mailto:<a href="mailto:thomas@monjalon.net" target="_blank">thomas@monjalon.net</a>>><br>
> > *Date: *Thursday, July 20, 2023 at 6:00 AM<br>
> > *To: *Igor de Paula <<a href="mailto:igordptx@gmail.com" target="_blank">igordptx@gmail.com</a> <mailto:<a href="mailto:igordptx@gmail.com" target="_blank">igordptx@gmail.com</a>>><br>
> > *Cc: *<a href="mailto:users@dpdk.org" target="_blank">users@dpdk.org</a> <mailto:<a href="mailto:users@dpdk.org" target="_blank">users@dpdk.org</a>> <<a href="mailto:users@dpdk.org" target="_blank">users@dpdk.org</a><br>
> <mailto:<a href="mailto:users@dpdk.org" target="_blank">users@dpdk.org</a>>>, Jochen Behrens<br>
> > <<a href="mailto:jbehrens@vmware.com" target="_blank">jbehrens@vmware.com</a> <mailto:<a href="mailto:jbehrens@vmware.com" target="_blank">jbehrens@vmware.com</a>>>, Nipun Gupta<br>
> <<a href="mailto:nipun.gupta@amd.com" target="_blank">nipun.gupta@amd.com</a> <mailto:<a href="mailto:nipun.gupta@amd.com" target="_blank">nipun.gupta@amd.com</a>>>, Nikhil Agarwal<br>
> > <<a href="mailto:nikhil.agarwal@amd.com" target="_blank">nikhil.agarwal@amd.com</a> <mailto:<a href="mailto:nikhil.agarwal@amd.com" target="_blank">nikhil.agarwal@amd.com</a>>>, Ferruh<br>
> Yigit <<a href="mailto:ferruh.yigit@amd.com" target="_blank">ferruh.yigit@amd.com</a> <mailto:<a href="mailto:ferruh.yigit@amd.com" target="_blank">ferruh.yigit@amd.com</a>>><br>
> > *Subject: *Re: help<br>
> ><br>
> > !! External Email<br>
> ><br>
> > +Cc some AMD maintainers, they can have an idea about IOMMU settings.<br>
> ><br>
> ><br>
> > 20/07/2023 14:44, Igor de Paula:<br>
> >> I have enabled it in the host and in the BIOS for AMD...<br>
> >> In the Bios I changed to amd_iommu=on and in the host it's the<br>
> same for<br>
> >> either.<br>
> >><br>
> >> On Thu, Jul 20, 2023 at 1:31 PM Thomas Monjalon<br>
> <<a href="mailto:thomas@monjalon.net" target="_blank">thomas@monjalon.net</a> <mailto:<a href="mailto:thomas@monjalon.net" target="_blank">thomas@monjalon.net</a>>> wrote:<br>
> >><br>
> >> > 20/07/2023 11:35, Igor de Paula:<br>
> >> > > The weird thing is that it only happens when I am using a<br>
> host with an<br>
> >> > AMD<br>
> >> > > processor. It doesn't happen when I use a host with an Intel<br>
> processor.<br>
> >> ><br>
> >> > So it's probably a matter of BIOS settings for the IOMMU?<br>
> >> ><br>
> >> ><br>
> >> > > On Thu, Jul 20, 2023 at 10:32 AM Thomas Monjalon<br>
> <<a href="mailto:thomas@monjalon.net" target="_blank">thomas@monjalon.net</a> <mailto:<a href="mailto:thomas@monjalon.net" target="_blank">thomas@monjalon.net</a>>><br>
> >> > > wrote:<br>
> >> > ><br>
> >> > > > +Cc the vmxnet3 maintainer.<br>
> >> > > ><br>
> >> > > > Please Jochen, do you have an idea what's wrong below?<br>
> >> > > ><br>
> >> > > ><br>
> >> > > > 20/07/2023 11:25, Igor de Paula:<br>
> >> > > > > This is because it can't negotiate the IOMMU type with<br>
> any port.<br>
> >> > > > ><br>
> >> > > > > On Thu, Jul 20, 2023 at 5:08 AM Thomas Monjalon<br>
> <<a href="mailto:thomas@monjalon.net" target="_blank">thomas@monjalon.net</a> <mailto:<a href="mailto:thomas@monjalon.net" target="_blank">thomas@monjalon.net</a>><br>
> >> > ><br>
> >> > > > wrote:<br>
> >> > > > ><br>
> >> > > > > > Hello,<br>
> >> > > > > ><br>
> >> > > > > > The first error is "Cause: Error: number of ports must<br>
> be even"<br>
> >> > > > > ><br>
> >> > > > > ><br>
> >> > > > > > 03/05/2023 18:13, Igor de Paula:<br>
> >> > > > > > > I am running a VM inside a VMWARE server (vSphere).<br>
> >> > > > > > > My goal it to set up DPDK with two HW ports, and set up a<br>
> >> > > > virtio_user to<br>
> >> > > > > > > interact with the kernel stack.<br>
> >> > > > > > > In another app I have it working but instead of<br>
> virtio_user I am<br>
> >> > > > running<br>
> >> > > > > > > KNI, it works in IOVA-PA mode.<br>
> >> > > > > > > I am looking to replace the KNI.<br>
> >> > > > > > ><br>
> >> > > > > > > When I try to set up virtio_user port as in the doc:<br>
> >> > > > > > ><br>
> >> > > > > ><br>
> >> > > ><br>
> >> ><br>
> <a href="https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html#virtio-user-as-exception-path" rel="noreferrer" target="_blank">https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html#virtio-user-as-exception-path</a> <<a href="https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html#virtio-user-as-exception-path" rel="noreferrer" target="_blank">https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html#virtio-user-as-exception-path</a>> <<a href="https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html#virtio-user-as-exception-path" rel="noreferrer" target="_blank">https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html#virtio-user-as-exception-path</a> <<a href="https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html#virtio-user-as-exception-path" rel="noreferrer" target="_blank">https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html#virtio-user-as-exception-path</a>>><br>
> >> > > > > > > I get a error it can't run in PA mode.<br>
> >> > > > > > ><br>
> >> > > > > > ><br>
> >> > > > > > > When I try to run as VA mode from a parameter, I get the<br>
> >> > following<br>
> >> > > > > > errors:<br>
> >> > > > > > > EAL: lib.eal log level changed from info to debug<br>
> >> > > > > > > EAL: Detected lcore 0 as core 0 on socket 0<br>
> >> > > > > > > EAL: Detected lcore 1 as core 0 on socket 0<br>
> >> > > > > > > EAL: Support maximum 128 logical core(s) by<br>
> configuration.<br>
> >> > > > > > > EAL: Detected 2 lcore(s)<br>
> >> > > > > > > EAL: Detected 1 NUMA nodes<br>
> >> > > > > > > EAL: Checking presence of .so 'librte_eal.so.21.3'<br>
> >> > > > > > > EAL: Checking presence of .so 'librte_eal.so.21'<br>
> >> > > > > > > EAL: Checking presence of .so 'librte_eal.so'<br>
> >> > > > > > > EAL: Detected static linkage of DPDK<br>
> >> > > > > > > EAL: Ask a virtual area of 0x7000 bytes<br>
> >> > > > > > > EAL: Virtual area found at 0x100000000 (size = 0x7000)<br>
> >> > > > > > > EAL: Multi-process socket /var/run/dpdk/rte/mp_socket<br>
> >> > > > > > > EAL: DPAA Bus not present. Skipping.<br>
> >> > > > > > > EAL: VFIO PCI modules not loaded<br>
> >> > > > > > > EAL: Selected IOVA mode 'VA'<br>
> >> > > > > > > EAL: Probing VFIO support...<br>
> >> > > > > > > EAL: IOMMU type 1 (Type 1) is supported<br>
> >> > > > > > > EAL: IOMMU type 7 (sPAPR) is not supported<br>
> >> > > > > > > EAL: IOMMU type 8 (No-IOMMU) is supported<br>
> >> > > > > > > EAL: VFIO support initialized<br>
> >> > > > > > > EAL: Ask a virtual area of 0x5b000 bytes<br>
> >> > > > > > > EAL: Virtual area found at 0x100007000 (size = 0x5b000)<br>
> >> > > > > > > EAL: Setting up physically contiguous memory...<br>
> >> > > > > > > EAL: Setting maximum number of open files to 1048576<br>
> >> > > > > > > EAL: Detected memory type: socket_id:0<br>
> hugepage_sz:1073741824<br>
> >> > > > > > > EAL: Creating 2 segment lists: n_segs:128 socket_id:0<br>
> >> > > > > > hugepage_sz:1073741824<br>
> >> > > > > > > EAL: Ask a virtual area of 0x2000 bytes<br>
> >> > > > > > > EAL: Virtual area found at 0x100062000 (size = 0x2000)<br>
> >> > > > > > > EAL: Memseg list allocated at socket 0, page size<br>
> 0x100000kB<br>
> >> > > > > > > EAL: Ask a virtual area of 0x2000000000 bytes<br>
> >> > > > > > > EAL: Virtual area found at 0x140000000 (size =<br>
> 0x2000000000)<br>
> >> > > > > > > EAL: VA reserved for memseg list at 0x140000000, size<br>
> 2000000000<br>
> >> > > > > > > EAL: Ask a virtual area of 0x2000 bytes<br>
> >> > > > > > > EAL: Virtual area found at 0x2140000000 (size = 0x2000)<br>
> >> > > > > > > EAL: Memseg list allocated at socket 0, page size<br>
> 0x100000kB<br>
> >> > > > > > > EAL: Ask a virtual area of 0x2000000000 bytes<br>
> >> > > > > > > EAL: Virtual area found at 0x2180000000 (size =<br>
> 0x2000000000)<br>
> >> > > > > > > EAL: VA reserved for memseg list at 0x2180000000,<br>
> size 2000000000<br>
> >> > > > > > > EAL: TSC frequency is ~2350000 KHz<br>
> >> > > > > > > EAL: Main lcore 0 is ready (tid=7f8ad790ec00;cpuset=[0])<br>
> >> > > > > > > EAL: lcore 1 is ready (tid=7f8ad6907400;cpuset=[1])<br>
> >> > > > > > > EAL: Trying to obtain current memory policy.<br>
> >> > > > > > > EAL: Setting policy MPOL_PREFERRED for socket 0<br>
> >> > > > > > > EAL: Restoring previous memory policy: 0<br>
> >> > > > > > > EAL: request: mp_malloc_sync<br>
> >> > > > > > > EAL: Heap on socket 0 was expanded by 1024MB<br>
> >> > > > > > > EAL: PCI device 0000:0b:00.0 on NUMA socket -1<br>
> >> > > > > > > EAL: probe driver: 15ad:7b0 net_vmxnet3<br>
> >> > > > > > > EAL: Expecting 'PA' IOVA mode but current mode is<br>
> 'VA', not<br>
> >> > > > > > initializing<br>
> >> > > > > > > EAL: Requested device 0000:0b:00.0 cannot be used<br>
> >> > > > > > > EAL: PCI device 0000:13:00.0 on NUMA socket -1<br>
> >> > > > > > > EAL: probe driver: 15ad:7b0 net_vmxnet3<br>
> >> > > > > > > EAL: Expecting 'PA' IOVA mode but current mode is<br>
> 'VA', not<br>
> >> > > > > > initializing<br>
> >> > > > > > > EAL: Requested device 0000:13:00.0 cannot be used<br>
> >> > > > > > > EAL: Bus (pci) probe failed.<br>
> >> > > > > > > EAL: lib.telemetry log level changed from disabled to<br>
> warning<br>
> >> > > > > > > EAL: Error - exiting with code: 1<br>
> >> > > > > > > Cause: Error: number of ports must be even<br>
> >> > > > > > > EAL: request: mp_malloc_sync<br>
> >> > > > > > > EAL: Heap on socket 0 was shrunk by 1024MB<br>
> >> > > > > > ><br>
> >> > > > > > ><br>
> >> > > > > > ><br>
> >> > > > > > > For some reason the HW ports won't setup. From what I<br>
> understand<br>
> >> > > > > > > net_vmxnet3 should work with VA mode.<br>
> >> > > > > > > I enabled I/OMUU for the VM.<br>
> >> > > > > > > The weird thing even when enabled, I still have the<br>
> >> > > > > > > enable_unsafe_noiommu_mode flag on.<br>
> >> > > > > > > And because it's on the this:<br>
> >> > > > > > ><br>
> >> > > > > > > dev_iova_mode = pci_device_iova_mode(dr, dev);<br>
> >> > > > > > ><br>
> >> > > > > > > return PA mode, and it fails.<br>
> >> > > > > > ><br>
> >> > > > > > > When I disable it by modifying<br>
> >> > > > > > ><br>
> /sys/module/vfio/parameters/enable_unsafe_noiommu_mode, I get<br>
> >> > another<br>
> >> > > > > > error.<br>
> >> > > > > > > The error is that it doesn't find a suitable IOMMU type:<br>
> >> > > > > > > Just putting the relevant message:<br>
> >> > > > > > ><br>
> >> > > > > > ><br>
> >> > > > > > > EAL: Heap on socket 0 was expanded by 1024MB<br>
> >> > > > > > > EAL: PCI device 0000:0b:00.0 on NUMA socket -1<br>
> >> > > > > > > EAL: probe driver: 15ad:7b0 net_vmxnet3<br>
> >> > > > > > > EAL: Set IOMMU type 1 (Type 1) failed, error 19 (No<br>
> such device)<br>
> >> > > > > > > EAL: Set IOMMU type 7 (sPAPR) failed, error 19 (No<br>
> such device)<br>
> >> > > > > > > EAL: Set IOMMU type 8 (No-IOMMU) failed, error 19 (No<br>
> such<br>
> >> > device)<br>
> >> > > > > > > EAL: 0000:0b:00.0 failed to select IOMMU type<br>
> >> > > > > > > EAL: Requested device 0000:0b:00.0 cannot be used<br>
> >> > > > > > > EAL: PCI device 0000:13:00.0 on NUMA socket -1<br>
> >> > > > > > > EAL: probe driver: 15ad:7b0 net_vmxnet3<br>
> >> > > > > > > EAL: Set IOMMU type 1 (Type 1) failed, error 19 (No<br>
> such device)<br>
> >> > > > > > > EAL: Set IOMMU type 7 (sPAPR) failed, error 19 (No<br>
> such device)<br>
> >> > > > > > > EAL: Set IOMMU type 8 (No-IOMMU) failed, error 19 (No<br>
> such<br>
> >> > device)<br>
> >> > > > > > > EAL: 0000:13:00.0 failed to select IOMMU type<br>
> >> > > > > > > EAL: Requested device 0000:13:00.0 cannot be used<br>
> >> > > > > > ><br>
> >> > > > > > ><br>
> >> > > > > > > I can see where it fails:<br>
> >> > > > > > ><br>
> >> > > > > > ><br>
> >> > > > > > > const struct vfio_iommu_type *<br>
> >> > > > > > > vfio_set_iommu_type(int vfio_container_fd)<br>
> >> > > > > > > {<br>
> >> > > > > > > unsigned idx;<br>
> >> > > > > > > for (idx = 0; idx < RTE_DIM(iommu_types); idx++) {<br>
> >> > > > > > > const struct vfio_iommu_type *t = &iommu_types[idx];<br>
> >> > > > > > ><br>
> >> > > > > > > int ret = ioctl(vfio_container_fd, VFIO_SET_IOMMU,<br>
> >> > > > > > > t->type_id);<br>
> >> > > > > > > if (!ret) {<br>
> >> > > > > > > RTE_LOG(INFO, EAL, "Using IOMMU type %d (%s)\n",<br>
> >> > > > > > > t->type_id, t->name);<br>
> >> > > > > > > return t;<br>
> >> > > > > > > }<br>
> >> > > > > > > /* not an error, there may be more supported IOMMU<br>
> types */<br>
> >> > > > > > > RTE_LOG(DEBUG, EAL, "Set IOMMU type %d (%s) failed,<br>
> error "<br>
> >> > > > > > > "%i (%s)\n", t->type_id, t->name, errno,<br>
> >> > > > > > > strerror(errno));<br>
> >> > > > > > > }<br>
> >> > > > > > > /* if we didn't find a suitable IOMMU type, fail */<br>
> >> > > > > > > return NULL;<br>
> >> > > > > > > }<br>
> >> > > > > > ><br>
> >> > > > > > ><br>
> >> > > > > > > The ioctl returns -1.<br>
> >> > > > > > ><br>
> >> > > > > > ><br>
> >> > > > > > ><br>
> >> > > > > > > I tried many things.<br>
> >> > > > > > > Enabling/disabling IOMMU.<br>
> >> > > > > > > Modifying the enable_unsafe_noiommu_mode flag.<br>
> >> > > > > > > Running in PA mode.<br>
> >> > > > > > > Any help will be much appreciated.<br>
> >> ><br>
> >> ><br>
> >> ><br>
> >> ><br>
> >> ><br>
> >> ><br>
> >><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > !! External Email: This email originated from outside of the<br>
> > organization. Do not click links or open attachments unless you<br>
> > recognize the sender.<br>
> ><br>
> <br>
<br>
</blockquote></div>