Skip to contentSkip to conversation

make vfio and DAX cache work together

PATCH New Edge NFV 3 participants 4 messages Apr 26, 2021

lore
Share & tools
lore

Edge NFV

author
#0 lore raw

PATCH 1/1 make vfio and DAX cache work together

I am using Kata containers and create containers inside the virtual machine. The hypervisor used is QEMU.
My workload is I/O and network intensive. So, I prefer SR-IOV VF (which provides better network isolation) and DAX caching to work together. However, I was unable to create a QEMU based virual machine when the above mentioned featires are enabled together.

Currently DAX cache need to be set to 0, to boot the VM successfully with the SR-IOV VF to be attached. Enabling both SR-IOV VF and DAX work together will potentially improve performance for workloads which are I/O and network intensive. This patch enables SR-IOV VF and DAX to work together.

author
#1 lore raw

PATCH 1/1 make vfio and DAX cache work together by skipping virtio fs cache section during vfio memory region add

---
 hw/vfio/common.c | 9 +++++++++
 1 file changed, 9 insertions(+)
hw/vfio/common.c +9 -0
index ae5654fcdb..83e15bf7a3 100644
@@ -668,6 +668,15 @@ static void vfio_listener_region_add(MemoryListener *listener,
                 int128_get64(int128_sub(section->size, int128_one())));
         return;
     }
+    
+    /* Do not add virtio fs cache section */                  
+    if (!strcmp(memory_region_name(section->mr), "virtio-fs-cache")) {
+        trace_vfio_listener_region_add_skip(
+                section->offset_within_address_space,
+                section->offset_within_address_space +
+                int128_get64(int128_sub(section->size, int128_one())));
+        return;
+    }  
 
     if (unlikely((section->offset_within_address_space &
                   ~qemu_real_host_page_mask) !=
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH] make vfio and DAX cache work together by skipping virtio fs cache section during vfio memory region add

Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Type: series
Message-id: [email protected]
Subject: [PATCH] make vfio and DAX cache work together by skipping virtio fs cache section during vfio memory region add

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
32bddb3 make vfio and DAX cache work together by skipping virtio fs cache section during vfio memory region add

=== OUTPUT BEGIN ===
ERROR: trailing whitespace
#21: FILE: hw/vfio/common.c:671:
+ $

ERROR: trailing whitespace
#22: FILE: hw/vfio/common.c:672:
+ /* Do not add virtio fs cache section */ $

ERROR: trailing whitespace
#29: FILE: hw/vfio/common.c:679:
+ } $

total: 3 errors, 0 warnings, 15 lines checked

Commit 32bddb3c2253 (make vfio and DAX cache work together by skipping virtio fs cache section during vfio memory region add) has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#3 lore raw

Re: [PATCH] make vfio and DAX cache work together by skipping virtio fs cache section during vfio memory region add

In reply to Edge NFV
Quoted 1 line · Edge NFV

You must use your real name for a patch submission:

https://wiki.qemu.org/Contribute/SubmitAPatch#Patch_emails_must_include_a_Signed-off-by:_line

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches?id=f6f94e2ab1b33f0082ac22d71f66385a60d8157f#n297

And CC: maintainer of the file:

$ ./scripts/get_maintainer.pl -f hw/vfio/common.c
Alex Williamson <[email protected]> (supporter:VFIO)
[email protected] (open list:All patches CC here)

If you want to submit it to qemu-trivial, don't send a separate mail, but cc: also qemu-trivial.

Thanks,
Laurent

Quoted 25 lines
---
 hw/vfio/common.c | 9 +++++++++
 1 file changed, 9 insertions(+)
hw/vfio/common.c +9 -0
index ae5654fcdb..83e15bf7a3 100644
@@ -668,6 +668,15 @@ static void vfio_listener_region_add(MemoryListener *listener,
                 int128_get64(int128_sub(section->size, int128_one())));
         return;
     }
+    
+    /* Do not add virtio fs cache section */                  
+    if (!strcmp(memory_region_name(section->mr), "virtio-fs-cache")) {
+        trace_vfio_listener_region_add_skip(
+                section->offset_within_address_space,
+                section->offset_within_address_space +
+                int128_get64(int128_sub(section->size, int128_one())));
+        return;
+    }  
 
     if (unlikely((section->offset_within_address_space &
                   ~qemu_real_host_page_mask) !=