DPDK patches and discussions
 help / color / mirror / Atom feed
From: Danylo Vodopianov <dvo-plv@napatech.com>
To: thomas@monjalon.net, aman.deep.singh@intel.com,
	yuying.zhang@intel.com, orika@nvidia.com, mcoqueli@redhat.com,
	ckm@napatech.com, matan@mellanox.com, david.marchand@redhat.com,
	mko-plv@napatech.com, sil-plv@napatech.com
Cc: stephen@networkplumber.org, dev@dpdk.org
Subject: [PATCH v1 0/1] Memory hotplug fix
Date: Thu, 29 May 2025 14:32:25 +0200	[thread overview]
Message-ID: <20250529123226.1875075-1-dvo-plv@napatech.com> (raw)

Hi everyone.
We detected an issue with the memory hotplug feature and virtio devices while working with vitrio
in DPDK.In general, the issue is around the user request VHOST_USER_SET_MEM_TABLE and
locking queues for this request
(https://git.dpdk.org/dpdk-stable/tree/lib/vhost/vhost_user.c#n1512)
When the vhost_user receives the request VHOST_USER_SET_MEM_TABLE, it locks queues only
when the flag lock_all_qps is true(it is always true), AND the flag
VIRTIO_DEV_VDPA_CONFIGURED is not set.
https://git.dpdk.org/dpdk-stable/tree/lib/vhost/vhost_user.c#n3181
In the case of a memory hot plug, the flag VIRTIO_DEV_VDPA_CONFIGURED is always set,
and due to this, the queues are never locked while they are expected to be locked.
https://git.dpdk.org/dpdk-stable/tree/lib/vhost/vhost_user.c#n1512.
The quick solution is to add the check for request type and do lock queues always
if we have request VHOST_USER_SET_MEM_TABLE. Something like this, in general
https://git.dpdk.org/dpdk-stable/tree/lib/vhost/vhost_user.c#n3179

 if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED) ||
 request == VHOST_USER_SET_MEM_TABLE) {
 ...

Danylo Vodopianov (1):
  vhost: handle virtqueue locking for memory hotplug

 lib/vhost/vhost_user.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

-- 
2.43.5


             reply	other threads:[~2025-05-29 12:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-29 12:32 Danylo Vodopianov [this message]
2025-05-29 12:32 ` [PATCH v1 1/1] vhost: handle virtqueue locking for memory hotplug Danylo Vodopianov
2025-06-02  8:19   ` [PATCH v2 " Danylo Vodopianov
2025-06-02  8:40     ` [PATCH v3 0/1] Memory hotplug fix Danylo Vodopianov
2025-06-02  8:40       ` [PATCH v3 1/1] vhost: handle virtqueue locking for memory hotplug Danylo Vodopianov
2025-06-02  8:50         ` [PATCH v4 0/1] Memory hotplug fix Danylo Vodopianov
2025-06-02  8:50           ` [PATCH v4 1/1] vhost: handle virtqueue locking for memory hotplug Danylo Vodopianov
  -- strict thread matches above, loose matches on Subject: below --
2025-05-29 12:31 [PATCH v1 0/1] Memory hotplug fix Danylo Vodopianov

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=20250529123226.1875075-1-dvo-plv@napatech.com \
    --to=dvo-plv@napatech.com \
    --cc=aman.deep.singh@intel.com \
    --cc=ckm@napatech.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=mcoqueli@redhat.com \
    --cc=mko-plv@napatech.com \
    --cc=orika@nvidia.com \
    --cc=sil-plv@napatech.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=yuying.zhang@intel.com \
    /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).