DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hao Chen <chenh@yusur.tech>
To: dev@dpdk.org
Cc: zy@yusur.tech, Maxime Coquelin <maxime.coquelin@redhat.com>,
	Chenbo Xia <chenbo.xia@intel.com>
Subject: [PATCH v4] examples/vdpa: support running in nested virtualization environment
Date: Sun, 13 Nov 2022 22:04:26 -0500	[thread overview]
Message-ID: <20221114030426.1363561-1-chenh@yusur.tech> (raw)
In-Reply-To: <20221025061939.3229676-1-chenh@yusur.tech>

When we run dpdk vdpa in the nested virtual machine vm-L1 and ping
test in vm-L2, the ping is not good. The reason for troubleshooting is
that the virtio net in vm-L2 sends control information to the vring,
and the qemu back-end device in vm-L1 cannot obtain correct data
from the vring. This problem is related to the opening of the vIOMMU.

This patch add flag RTE_VHOST_USER_IOMMU_SUPPORT to use vhost vIOMMU
, VIRTIO_F_IOMMU_PLATFORM feature will be negotiated successfully if
virtio iommu is used in a nested virtualization environment.

The configuration is as follows:
The host starts iommu, and the kernel parameter is added with
'intel_iommu=on iommu=pt'.
VM-L1's xml add viommu and virtio device adds iommu='on' ats='on'.
VM-L2's xml enables viommu, and adds  parameters
'intel_iommu=on iommu=pt' to kernel.

Then the ping test in vm-L2 is OK.

Signed-off-by: Hao Chen <chenh@yusur.tech>
---
v4:
*Simplify the patch. Set the flags RTE_VHOST_USER_IOMMU_SUPPORT default.

v3:
*Modify mail title.

v2:
*fprintf all string including the eal one.
*remove exit(1).

 examples/vdpa/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c
index 4c7e81d7b6..4d3203f3a7 100644
--- a/examples/vdpa/main.c
+++ b/examples/vdpa/main.c
@@ -214,6 +214,8 @@ start_vdpa(struct vdpa_port *vport)
 	if (client_mode)
 		vport->flags |= RTE_VHOST_USER_CLIENT;
 
+	vport->flags |= RTE_VHOST_USER_IOMMU_SUPPORT;
+
 	if (access(socket_path, F_OK) != -1 && !client_mode) {
 		RTE_LOG(ERR, VDPA,
 			"%s exists, please remove it or specify another file and try again.\n",
-- 
2.27.0


  parent reply	other threads:[~2022-11-14  3:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11  2:55 [PATCH] example: vdpa: support run " Hao Chen
2022-10-17  7:23 ` Xia, Chenbo
2022-10-25  6:08 ` [PATCH v2] " Hao Chen
2022-10-25  6:19   ` [PATCH v3] examples/vdpa: support running " Hao Chen
2022-10-26  6:10     ` Maxime Coquelin
2022-10-26  6:48       ` Hao Chen
2022-11-14  3:04     ` Hao Chen [this message]
2023-01-19 10:16       ` [PATCH v4] " Maxime Coquelin
2023-02-03 14:47       ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221114030426.1363561-1-chenh@yusur.tech \
    --to=chenh@yusur.tech \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=zy@yusur.tech \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).