patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev@dpdk.org, Tyler Retzlaff <roretzla@linux.microsoft.com>,
	 Xiao Wang <xiao.w.wang@intel.com>,
	Ferruh Yigit <ferruh.yigit@amd.com>,
	 Junjie Chen <junjie.j.chen@intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	stable@dpdk.org
Subject: Re: [PATCH v2 1/1] vfio: fix custom containers in multiprocess
Date: Thu, 6 Nov 2025 08:28:37 +0100	[thread overview]
Message-ID: <CAJFAV8zSLEayfO2NPFmTs3Ljq1du1o0f6iuFvcaTM9BT1Ge-nQ@mail.gmail.com> (raw)
In-Reply-To: <7e195ed0245a80a7f3302ae5d3c08a66c206ca9b.1761052774.git.anatoly.burakov@intel.com>

Hello Anatoly,

On Tue, 21 Oct 2025 at 15:20, Anatoly Burakov <anatoly.burakov@intel.com> wrote:
>
> Currently, the API regarding handling custom (non-default) containers has
> a problem with how it behaves in secondary process. The expected flow for
> using custom containers is to:
>
> 1) create a new container using rte_vfio_container_create()
> 2) look up IOMMU group with rte_vfio_get_group_num()
> 3) bind group to that container using rte_vfio_group_bind()
> 4) setup device with rte_vfio_setup_device()
>
> When called from secondary process, rte_vfio_container_create() will check
> if there's space in local VFIO config, and if there is, it will call
> rte_vfio_get_container_fd() which, in secondary process, will call into a
> multiprocess code to request primary process to open container fd, and then
> pass it back to the requester. Primary process does not store this fd
> anywhere, in fact it closes it immediately after responding to the request.
>
> Following that, when we call rte_vfio_group_bind(), we check if the group
> is open locally, and if not, we will call into multiprocess code again, to
> request primary process to open the group fd for us, but since primary did
> not store any information about the new container in step 1, it will store
> the group in local config for default container, and return it to the
> secondary, who will add it to its own config for a different container.
>
> To address these issues, the following changes are made:
>
> 1) Clarify meaning of rte_vfio_get_container_fd() to only return the
>    default container, and always pick it up from process-local config
>
> 2) Avoid calling into multiprocess on rte_vfio_container_create()
>
> 3) Avoid calling into multiprocess in group-related code, except when
>    dealing with groups associated with default container
>
> As a consequence, SOCKET_REQ_DEFAULT_CONTAINER can be removed and
> consolidated with SOCKET_REQ_CONTAINER, which now only handles the
> default container.
>
> Fixes: ea2dc1066870 ("vfio: add multi container support")
> Cc: stable@dpdk.org
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

The patch looks fine to me.

I am not clear of the implications of this change in the API and I am
a bit hesitant on marking for backport.

On the other hand, it seems this was not working in multiprocess context only.
Plus, this is about programming an iommu, and the (intended) consumers
of this API are drivers.
I found no trace of use in opensource projects using DPDK.
So the chance of breaking an application is low.

Applied, thanks.


-- 
David Marchand


      reply	other threads:[~2025-11-06  7:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 10:09 [PATCH v1 " Anatoly Burakov
2025-10-21 13:19 ` [PATCH v2 " Anatoly Burakov
2025-11-06  7:28   ` David Marchand [this message]

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=CAJFAV8zSLEayfO2NPFmTs3Ljq1du1o0f6iuFvcaTM9BT1Ge-nQ@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=junjie.j.chen@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=stable@dpdk.org \
    --cc=xiao.w.wang@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).