All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] skip virtio fs cache section to enable NIC pass through
@ 2021-04-26 20:24 Dev Audsin
  2021-04-26 20:27 ` Dev Audsin
  0 siblings, 1 reply; 3+ messages in thread
From: Dev Audsin @ 2021-04-26 20:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, alex.williamson, dgilbert

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

 Signed-off-by: Dev Audsin <dev.devaqemu@gmail.com>
---
 hw/vfio/common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 6ff1daa763..3af70238bd 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -541,7 +541,8 @@ static int vfio_host_win_del(VFIOContainer *container,
hwaddr min_iova,

 static bool vfio_listener_skipped_section(MemoryRegionSection *section)
 {
-    return (!memory_region_is_ram(section->mr) &&
+    return (!strcmp(memory_region_name(section->mr), "virtio-fs-cache")) ||
+          (!memory_region_is_ram(section->mr) &&
             !memory_region_is_iommu(section->mr)) ||
            /*
             * Sizing an enabled 64-bit BAR can cause spurious mappings to
-- 
2.25.1

[-- Attachment #2: Type: text/html, Size: 1057 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] skip virtio fs cache section to enable NIC pass through
  2021-04-26 20:24 [PATCH] skip virtio fs cache section to enable NIC pass through Dev Audsin
@ 2021-04-26 20:27 ` Dev Audsin
  2021-04-26 20:54   ` Alex Williamson
  0 siblings, 1 reply; 3+ messages in thread
From: Dev Audsin @ 2021-04-26 20:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, alex.williamson, dgilbert

[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]

 virtio-fs with DAX is currently not compatible with NIC Pass through. VM
fails to boot when DAX  cache is enabled and SR-IOV VF is being attached.
This patch solves the problem. Hencem DAX cache and SR-IOV VF are be
attached together.

When a SR-IOV VF attaches to a qemu process, vfio will try to pin the
entire DAX Window but it is empty when the guest boots and will fail.
A method to make VFIO and DAX to work together is to make vfio skip DAX
cache.
Currently DAX cache need to be set to 0, for the SR-IOV VF to be attached
to Kata containers.
Enabling both SR-IOV VF and DAX work together will potentially improve
performance for workloads which are I/O and network intensive

On Mon, Apr 26, 2021 at 9:24 PM Dev Audsin <dev.devaqemu@gmail.com> wrote:

> Signed-off-by: Dev Audsin <dev.devaqemu@gmail.com>
> ---
>  hw/vfio/common.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 6ff1daa763..3af70238bd 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -541,7 +541,8 @@ static int vfio_host_win_del(VFIOContainer *container,
> hwaddr min_iova,
>
>  static bool vfio_listener_skipped_section(MemoryRegionSection *section)
>  {
> -    return (!memory_region_is_ram(section->mr) &&
> +    return (!strcmp(memory_region_name(section->mr), "virtio-fs-cache"))
> ||
> +          (!memory_region_is_ram(section->mr) &&
>              !memory_region_is_iommu(section->mr)) ||
>             /*
>              * Sizing an enabled 64-bit BAR can cause spurious mappings to
> --
> 2.25.1
>

[-- Attachment #2: Type: text/html, Size: 2155 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] skip virtio fs cache section to enable NIC pass through
  2021-04-26 20:27 ` Dev Audsin
@ 2021-04-26 20:54   ` Alex Williamson
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2021-04-26 20:54 UTC (permalink / raw)
  To: Dev Audsin; +Cc: qemu-trivial, qemu-devel, dgilbert

On Mon, 26 Apr 2021 21:27:52 +0100
Dev Audsin <dev.devaqemu@gmail.com> wrote:

>  virtio-fs with DAX is currently not compatible with NIC Pass through. VM
> fails to boot when DAX  cache is enabled and SR-IOV VF is being attached.
> This patch solves the problem. Hencem DAX cache and SR-IOV VF are be
> attached together.
> 
> When a SR-IOV VF attaches to a qemu process, vfio will try to pin the
> entire DAX Window but it is empty when the guest boots and will fail.
> A method to make VFIO and DAX to work together is to make vfio skip DAX
> cache.
> Currently DAX cache need to be set to 0, for the SR-IOV VF to be attached
> to Kata containers.
> Enabling both SR-IOV VF and DAX work together will potentially improve
> performance for workloads which are I/O and network intensive

Please work on your patch email tooling, this is not how to provide a
commit log.

Also, this is not a qemu-trivial candidate imo.  A qemu-trivial patch
should be obviously correct, not just simple in mechanics.  It's not
obvious to me that simply skipping a region by name to avoid an
incompatibility is correct.


> On Mon, Apr 26, 2021 at 9:24 PM Dev Audsin <dev.devaqemu@gmail.com> wrote:
> 
> > Signed-off-by: Dev Audsin <dev.devaqemu@gmail.com>
> > ---
> >  hw/vfio/common.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> > index 6ff1daa763..3af70238bd 100644
> > --- a/hw/vfio/common.c
> > +++ b/hw/vfio/common.c
> > @@ -541,7 +541,8 @@ static int vfio_host_win_del(VFIOContainer *container,
> > hwaddr min_iova,
> >
> >  static bool vfio_listener_skipped_section(MemoryRegionSection *section)
> >  {
> > -    return (!memory_region_is_ram(section->mr) &&
> > +    return (!strcmp(memory_region_name(section->mr), "virtio-fs-cache"))
> > ||
> > +          (!memory_region_is_ram(section->mr) &&
> >              !memory_region_is_iommu(section->mr)) ||
> >             /*
> >              * Sizing an enabled 64-bit BAR can cause spurious mappings to
> > --
> > 2.25.1
> >  

Dave Gilbert already commented that a hard coded name comparison is not
a good solution here.  There needs to be more analysis of the issue
beyond simply making the VM with this combination boot.  If there's a
valid reason this particular region cannot be a device DMA target, then
advertise that reason and make vfio skip all regions with that
property.  It's clear that we already skip non-ram and non-iommu
sections, why is this region considered both "ram" and not a DMA
target?  The fact that it's not populated at guest boot does not
provide any support that it couldn't later be populated and become a DMA
target for the assigned device.  Thanks,

Alex



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-27  0:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 20:24 [PATCH] skip virtio fs cache section to enable NIC pass through Dev Audsin
2021-04-26 20:27 ` Dev Audsin
2021-04-26 20:54   ` Alex Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.