DPDK patches and discussions
 help / color / mirror / Atom feed
From: Moses Young <mosesyyoung@gmail.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2] eal/linux: skip vfio for non-privileged container
Date: Fri, 16 May 2025 19:08:17 +0800	[thread overview]
Message-ID: <8910af08-3784-4030-bee8-5e0b1031ae78@gmail.com> (raw)
In-Reply-To: <CAJFAV8xGa0y2v_ejaVF8CumzFxK7C5n1=0d4=iQH2ucmLQkiow@mail.gmail.com>

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

On 5/16/2025 2:46 PM, David Marchand wrote:
> On Thu, Mar 27, 2025 at 8:57 AM Yang Ming<ming.1.yang@nokia-sbell.com> wrote:
>> DPDK detect vfio container according the existence of vfio
>> module. But for container with non-privileged mode, there is
>> possibility that no VFIO_DIR(/dev/vfio) mapping from host to
>> container when host have both Intel NIC and Mellanox NIC but
>> this conntainer only allocate VFs from Mellanox NIC.
>> In this case, vfio kernel module has already been loaded from
>> the host.
>> This scenario will cause the error log occurs in DPDK primary
>> process as below:
>> 'EAL:   cannot open VFIO container, error 2 (No such file or
>> directory)'
>> 'EAL: VFIO support could not be initialized'
>> Because `rte_vfio_enable()` call `rte_vfio_get_container_fd()`
>> to execute `vfio_container_fd = open(VFIO_CONTAINER_PATH,
>> O_RDWR);` but VFIO_CONTAINER_PATH(/dev/vfio/vfio) doesn't exist
>> in this container.
>> This scenario will also lead to the delay of DPDK secondary
>> process because `default_vfio_cfg->vfio_enabled = 0` and
>> `default_vfio_cfg->vfio_container_fd = -1`, socket error will
>> be set in DPDK primary process when it sync this info to
>> the secondary process.
>> This patch use to skip this kind of useless detection for this
>> scenario.
>>
>> Signed-off-by: Yang Ming<ming.1.yang@nokia-sbell.com>
> With such a change, is the check on the passed kernel module still needed?

Hi David,

Thanks for your comment.

Yes. We still need this checks:
1. Module check (rte_eal_check_module(modname)) ensures the host has the 
VFIO driver loaded.
2. Directory check (opendir("/dev/vfio")) skips the open call in 
unprivileged containers without /dev/vfio, avoiding a noisy error.
This patch adds the second check. Please let me know if you'd like any 
more details!

Best regards,
Yang Ming

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

  reply	other threads:[~2025-05-16 11:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-17  7:28 [PATCH] Skip vfio in the scenario of non-privileged mode Yang Ming
2025-01-17 16:47 ` Stephen Hemminger
2025-01-22  8:15   ` Yang Ming
2025-02-26  3:10     ` Yang Ming
2025-02-26 13:45     ` Stephen Hemminger
2025-02-28  5:23       ` Yang Ming
2025-03-27  7:57 ` [PATCH v2] eal/linux: skip vfio for non-privileged container Yang Ming
2025-05-16  6:46   ` David Marchand
2025-05-16 11:08     ` Moses Young [this message]
2025-05-16 13:30   ` Burakov, Anatoly

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=8910af08-3784-4030-bee8-5e0b1031ae78@gmail.com \
    --to=mosesyyoung@gmail.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    /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).