<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">+Ronak from the ESX team<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">In our usage, we do set amd_iommu=off in the boot command line from grub. (Or intel_iommu=off for Intel processors.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">                Jochen<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Thomas Monjalon <thomas@monjalon.net><br>
<b>Date: </b>Thursday, July 20, 2023 at 6:00 AM<br>
<b>To: </b>Igor de Paula <igordptx@gmail.com><br>
<b>Cc: </b>users@dpdk.org <users@dpdk.org>, Jochen Behrens <jbehrens@vmware.com>, Nipun Gupta <nipun.gupta@amd.com>, Nikhil Agarwal <nikhil.agarwal@amd.com>, Ferruh Yigit <ferruh.yigit@amd.com><br>
<b>Subject: </b>Re: help<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">!! 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 same for<br>
> either.<br>
><br>
> On Thu, Jul 20, 2023 at 1:31 PM Thomas Monjalon <thomas@monjalon.net> 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 host with an<br>
> > AMD<br>
> > > processor. It doesn't happen when I use a host with an Intel 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 <thomas@monjalon.net><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 any port.<br>
> > > > ><br>
> > > > > On Thu, Jul 20, 2023 at 5:08 AM Thomas Monjalon <thomas@monjalon.net<br>
> > ><br>
> > > > wrote:<br>
> > > > ><br>
> > > > > > Hello,<br>
> > > > > ><br>
> > > > > > The first error is "Cause: Error: number of ports must 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 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>
> > </span><a href="https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html#virtio-user-as-exception-path"><span style="font-size:11.0pt">https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoc.dpdk.org%2Fguides%2Fhowto%2Fvirtio_user_as_exception_path.html%23virtio-user-as-exception-path&data=05%7C01%7Cjbehrens%40vmware.com%7Cfbb1f6df362e4537d62608db8921432f%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638254548229277606%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3NuWkbtQx2q8NJ2CzArNfuDjP%2FYIVv1kMc%2Bo4IiHlmM%3D&reserved=0</span></a><span style="font-size:11.0pt"><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 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 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 0x100000kB<br>
> > > > > > > EAL: Ask a virtual area of 0x2000000000 bytes<br>
> > > > > > > EAL: Virtual area found at 0x140000000 (size = 0x2000000000)<br>
> > > > > > > EAL: VA reserved for memseg list at 0x140000000, size 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 0x100000kB<br>
> > > > > > > EAL: Ask a virtual area of 0x2000000000 bytes<br>
> > > > > > > EAL: Virtual area found at 0x2180000000 (size = 0x2000000000)<br>
> > > > > > > EAL: VA reserved for memseg list at 0x2180000000, 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 '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 '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 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 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>
> > > > > > > /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 such device)<br>
> > > > > > > EAL: Set IOMMU type 7 (sPAPR) failed, error 19 (No such device)<br>
> > > > > > > EAL: Set IOMMU type 8 (No-IOMMU) failed, error 19 (No 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 such device)<br>
> > > > > > > EAL: Set IOMMU type 7 (sPAPR) failed, error 19 (No such device)<br>
> > > > > > > EAL: Set IOMMU type 8 (No-IOMMU) failed, error 19 (No 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 types */<br>
> > > > > > > RTE_LOG(DEBUG, EAL, "Set IOMMU type %d (%s) failed, 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 organization. Do not click links or open attachments unless you recognize the sender.<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>